/* ============================================================
   Dan Nicolau Portfolio — Complete Stylesheet
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:       #050b18;
  --bg2:      #090f20;
  --bg3:      #0d1428;
  --card:     #0f1a2e;
  --card2:    #131f35;
  --border:   rgba(99,102,241,.18);
  --accent:   #6366f1;
  --accent2:  #818cf8;
  --accent3:  #a5b4fc;
  --teal:     #06b6d4;
  --green:    #10b981;
  --text:     #e2e8f0;
  --muted:    #94a3b8;
  --dim:      #475569;
  --radius:   14px;
  --radius-sm: 8px;
  --font:     'Inter', system-ui, sans-serif;
  --mono:     'JetBrains Mono', monospace;
}

/* ── Light Mode ── */
body.light {
  --bg:     #f8fafc;
  --bg2:    #f1f5f9;
  --bg3:    #e2e8f0;
  --card:   #ffffff;
  --card2:  #f8fafc;
  --border: rgba(99,102,241,.2);
  --text:   #0f172a;
  --muted:  #475569;
  --dim:    #94a3b8;
}

body.light #neural-bg { opacity: .12; }
body.light .cursor-glow { background: radial-gradient(circle 180px, rgba(99,102,241,.08), transparent); }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
  line-height: 1.6;
  transition: background .3s, color .3s;
}

/* ── Page Loader ── */
.loader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity .5s ease, visibility .5s ease;
}

.loader.hidden { opacity: 0; visibility: hidden; pointer-events: none; }

.loader-inner { text-align: center; }

.loader-logo {
  font-size: 3.5rem;
  font-weight: 800;
  color: var(--accent2);
  letter-spacing: -.03em;
  margin-bottom: 1.5rem;
  display: block;
  animation: loader-pulse 1.2s ease-in-out infinite alternate;
}

.loader-dot { color: var(--teal); }

@keyframes loader-pulse {
  from { opacity: .5; transform: scale(.96); }
  to   { opacity: 1;  transform: scale(1); }
}

.loader-bar {
  width: 200px;
  height: 3px;
  background: rgba(255,255,255,.1);
  border-radius: 10px;
  overflow: hidden;
  margin: 0 auto 1rem;
}

.loader-fill {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--accent), var(--teal));
  border-radius: 10px;
  transition: width .05s linear;
}

.loader-text {
  font-size: .8rem;
  color: var(--dim);
  font-family: var(--mono);
  letter-spacing: .08em;
}

/* ── Scroll Progress Bar ── */
.scroll-progress {
  position: fixed;
  top: 0; left: 0;
  height: 3px;
  width: 0;
  background: linear-gradient(90deg, var(--accent), var(--teal));
  z-index: 200;
  transition: width .1s linear;
  box-shadow: 0 0 10px var(--accent);
}

/* ── Cursor Glow ── */
.cursor-glow {
  position: fixed;
  pointer-events: none;
  z-index: 0;
  width: 1px; height: 1px;
  background: radial-gradient(circle 200px, rgba(99,102,241,.15), transparent);
  transform: translate(-50%, -50%);
  transition: left .08s ease, top .08s ease;
}

/* ── Neural Background Canvas ── */
#neural-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: .45;
}

/* ── Layout ── */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 2rem;
  position: relative;
  z-index: 1;
}

.section { padding: 6rem 0; position: relative; z-index: 1; }

.section-alt {
  background: linear-gradient(135deg, rgba(99,102,241,.04) 0%, rgba(6,182,212,.04) 100%);
}

/* ── Navigation ── */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 1rem 2rem;
  transition: background .3s, backdrop-filter .3s;
}

.nav.scrolled {
  background: rgba(5,11,24,.88);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}

body.light .nav.scrolled { background: rgba(248,250,252,.92); }

.nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 2rem;
}

.nav-logo {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--accent2);
  letter-spacing: -.02em;
  flex-shrink: 0;
}

.dot { color: var(--teal); }

.nav-links {
  display: flex;
  list-style: none;
  gap: 2rem;
  margin-left: auto;
}

.nav-links a {
  color: var(--muted);
  text-decoration: none;
  font-size: .9rem;
  font-weight: 500;
  transition: color .2s;
  position: relative;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -3px; left: 0; right: 0;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transition: transform .2s;
  border-radius: 10px;
}

.nav-links a:hover, .nav-links a.active { color: var(--text); }
.nav-links a.active::after { transform: scaleX(1); }

.nav-actions {
  display: flex;
  align-items: center;
  gap: .75rem;
}

.theme-toggle {
  background: none;
  border: 1px solid var(--border);
  width: 36px; height: 36px;
  border-radius: 8px;
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color .2s, background .2s;
}

.theme-toggle:hover { border-color: var(--accent); background: rgba(99,102,241,.08); }

.nav-cta {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: .5rem 1.2rem;
  border-radius: 8px;
  font-size: .875rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .2s, transform .2s;
  font-family: var(--font);
}

.nav-cta:hover { background: var(--accent2); transform: translateY(-1px); }

/* ── Hamburger ── */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: 1px solid var(--border);
  padding: 8px;
  border-radius: 8px;
  cursor: pointer;
  transition: border-color .2s;
}

.hamburger:hover { border-color: var(--accent); }

.hamburger span {
  display: block;
  width: 18px; height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform .3s, opacity .3s;
}

.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ── Mobile Menu ── */
.mobile-menu {
  display: none;
  flex-direction: column;
  background: var(--card);
  border-top: 1px solid var(--border);
  padding: 1rem 2rem;
  max-width: 1100px;
  margin: 0 auto;
}

.mobile-menu.open { display: flex; }

.mobile-link {
  color: var(--muted);
  text-decoration: none;
  padding: .65rem 0;
  font-weight: 500;
  font-size: .95rem;
  border-bottom: 1px solid rgba(255,255,255,.05);
  transition: color .2s;
}

.mobile-link:hover { color: var(--accent2); }

/* ── Hero ── */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 8rem 2rem 4rem;
  max-width: 1100px;
  margin: 0 auto;
  gap: 4rem;
  position: relative;
  z-index: 1;
}

.hero-content { flex: 1; }

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  background: rgba(16,185,129,.1);
  border: 1px solid rgba(16,185,129,.25);
  color: var(--green);
  padding: .35rem .9rem;
  border-radius: 20px;
  font-size: .8rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
  letter-spacing: .03em;
}

.badge-dot {
  width: 7px; height: 7px;
  background: var(--green);
  border-radius: 50%;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%,100% { opacity: 1; transform: scale(1); }
  50% { opacity: .5; transform: scale(1.4); }
}

.hero-name {
  font-size: clamp(2.8rem, 6vw, 5rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -.03em;
  background: linear-gradient(135deg, var(--text) 0%, var(--accent3) 60%, var(--teal) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: .5rem;
}

.hero-title {
  font-size: clamp(1.1rem, 2.5vw, 1.4rem);
  color: var(--muted);
  margin-bottom: 1.5rem;
  min-height: 2rem;
}

.typed-text { color: var(--accent2); font-weight: 600; }
.typed-cursor { color: var(--accent); animation: blink .8s step-end infinite; }
@keyframes blink { 50% { opacity: 0; } }

.hero-summary {
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.7;
  max-width: 560px;
  margin-bottom: 2rem;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  margin-bottom: 3rem;
  flex-wrap: wrap;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--teal));
  color: #fff;
  padding: .75rem 1.75rem;
  border-radius: 10px;
  font-weight: 600;
  font-size: .95rem;
  text-decoration: none;
  transition: transform .2s, box-shadow .2s;
  box-shadow: 0 4px 20px rgba(99,102,241,.35);
}

.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 30px rgba(99,102,241,.5); }

.btn-ghost {
  border: 1px solid var(--border);
  color: var(--text);
  padding: .75rem 1.75rem;
  border-radius: 10px;
  font-weight: 600;
  font-size: .95rem;
  text-decoration: none;
  transition: border-color .2s, background .2s;
}

.btn-ghost:hover { border-color: var(--accent); background: rgba(99,102,241,.08); }

.btn-download {
  border: 1px solid rgba(6,182,212,.3);
  color: var(--teal);
  padding: .75rem 1.4rem;
  border-radius: 10px;
  font-weight: 600;
  font-size: .9rem;
  text-decoration: none;
  transition: border-color .2s, background .2s, transform .2s;
  background: rgba(6,182,212,.07);
}

.btn-download:hover { border-color: var(--teal); background: rgba(6,182,212,.14); transform: translateY(-2px); }

.hero-meta {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 1.25rem;
}

.meta-item { display: flex; flex-direction: column; align-items: center; }

.meta-num {
  font-size: 2rem;
  font-weight: 800;
  color: var(--accent2);
  line-height: 1;
}

.counter::after { content: '+'; font-size: 1.3rem; }

.meta-label {
  font-size: .75rem;
  color: var(--dim);
  margin-top: .2rem;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.meta-divider { width: 1px; height: 40px; background: var(--border); }

/* ── GitHub Strip ── */
.gh-strip {
  display: flex;
  gap: .75rem;
  flex-wrap: wrap;
}

.gh-chip {
  display: flex;
  align-items: center;
  gap: .4rem;
  background: rgba(255,255,255,.04);
  border: 1px solid var(--border);
  padding: .3rem .75rem;
  border-radius: 20px;
  font-size: .78rem;
  color: var(--muted);
  font-family: var(--mono);
}

.gh-chip a { color: var(--accent2); text-decoration: none; }
.gh-chip a:hover { text-decoration: underline; }
.gh-chip-icon { font-size: .9rem; }

/* ── Hero Visual ── */
.hero-visual {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.avatar-ring { position: relative; width: 280px; height: 280px; }

.avatar-inner {
  position: absolute;
  inset: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--card2), var(--card));
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.avatar-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  position: relative;
  z-index: 1;
  display: block;
}

.avatar-glow {
  position: absolute;
  inset: -20px;
  background: radial-gradient(circle, rgba(99,102,241,.2) 0%, transparent 70%);
  animation: glow 3s ease-in-out infinite alternate;
}

@keyframes glow { from { opacity: .5; } to { opacity: 1; } }

.orbit-ring { position: absolute; inset: 0; animation: orbit-rotate 20s linear infinite; }
@keyframes orbit-rotate { to { transform: rotate(360deg); } }

.orbit-dot {
  position: absolute;
  top: 50%; left: 50%;
  width: 280px; height: 280px;
  margin: -140px 0 0 -140px;
  transform: rotate(var(--angle));
  animation: orbit-rotate 20s linear infinite;
}

.orbit-dot::after {
  content: '';
  position: absolute;
  top: 0; left: 50%;
  width: 8px; height: 8px;
  background: var(--accent);
  border-radius: 50%;
  margin-left: -4px;
  margin-top: -4px;
  box-shadow: 0 0 12px var(--accent);
}

.orbit-tag {
  position: absolute;
  top: -4px; left: 50%;
  transform: translateX(-50%) rotate(calc(-1 * var(--angle))) translateY(-28px);
  background: var(--card2);
  border: 1px solid var(--border);
  padding: .2rem .55rem;
  border-radius: 6px;
  font-size: .65rem;
  font-weight: 600;
  color: var(--accent3);
  white-space: nowrap;
  font-family: var(--mono);
}

/* ── AI Banner ── */
.ai-banner {
  background: linear-gradient(90deg, rgba(99,102,241,.12) 0%, rgba(6,182,212,.12) 100%);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: .9rem 2rem;
  overflow: hidden;
  position: relative;
  z-index: 1;
}

.ai-banner-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  font-size: .875rem;
  color: var(--accent3);
  font-weight: 500;
  letter-spacing: .02em;
}

.ai-icon { color: var(--teal); font-size: 1rem; }

/* ── Section Headers ── */
.section-header { text-align: center; margin-bottom: 4rem; }

.section-tag {
  font-family: var(--mono);
  font-size: .8rem;
  color: var(--accent);
  letter-spacing: .1em;
  display: block;
  margin-bottom: .75rem;
}

.section-header h2 {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 800;
  letter-spacing: -.03em;
  margin-bottom: .75rem;
  background: linear-gradient(135deg, var(--text), var(--accent3));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.section-header p { color: var(--muted); font-size: 1rem; max-width: 480px; margin: 0 auto; }

/* ── Skills Grid ── */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.25rem;
  margin-bottom: 3rem;
}

.skill-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  transition: border-color .3s, transform .3s;
}

.skill-card:hover { border-color: var(--accent); transform: translateY(-3px); }

.skill-card-header { display: flex; align-items: center; gap: .75rem; margin-bottom: 1rem; }
.skill-icon { font-size: 1.4rem; }
.skill-card-header h3 { font-size: 1rem; font-weight: 700; color: var(--text); }
.skill-pills { display: flex; flex-wrap: wrap; gap: .5rem; }

.pill {
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.08);
  color: var(--muted);
  padding: .2rem .65rem;
  border-radius: 20px;
  font-size: .75rem;
  font-weight: 500;
  font-family: var(--mono);
}

.pill.highlight {
  background: rgba(99,102,241,.15);
  border-color: rgba(99,102,241,.3);
  color: var(--accent3);
}

/* ── Radar Chart ── */
.radar-section {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  margin-bottom: 2rem;
  text-align: center;
}

.radar-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 1.5rem;
}

#radar-chart { max-width: 100%; }

/* ── Proficiency Bars ── */
.proficiency {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
}

.prof-title { font-size: 1.1rem; font-weight: 700; margin-bottom: 1.5rem; color: var(--text); }
.bars { display: flex; flex-direction: column; gap: 1rem; }

.bar-row {
  display: grid;
  grid-template-columns: 160px 1fr 40px;
  align-items: center;
  gap: 1rem;
}

.bar-label { font-size: .875rem; color: var(--muted); font-weight: 500; }
.bar-track { height: 6px; background: rgba(255,255,255,.07); border-radius: 10px; overflow: hidden; }

.bar-fill {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--accent), var(--teal));
  border-radius: 10px;
  transition: width 1.5s cubic-bezier(.25,.8,.25,1);
}

.bar-pct { font-size: .75rem; color: var(--accent2); font-family: var(--mono); text-align: right; }

/* ── Timeline Filters ── */
.timeline-filters {
  display: flex;
  gap: .6rem;
  flex-wrap: wrap;
  margin-bottom: 2rem;
}

.filter-btn {
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--muted);
  padding: .4rem 1rem;
  border-radius: 20px;
  font-size: .8rem;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font);
  transition: all .2s;
}

.filter-btn:hover { border-color: var(--accent); color: var(--accent2); }

.filter-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* ── Timeline ── */
.timeline { position: relative; }

.tl-item {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 1.5rem;
  margin-bottom: 2rem;
  transition: opacity .3s, transform .3s;
}

.tl-item.hidden { opacity: 0; height: 0; overflow: hidden; margin: 0; pointer-events: none; }

.tl-marker { display: flex; flex-direction: column; align-items: center; padding-top: .6rem; }

.tl-dot {
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--card2);
  border: 2px solid var(--dim);
  flex-shrink: 0;
  z-index: 1;
  transition: border-color .3s;
}

.tl-item.current .tl-dot {
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 14px rgba(99,102,241,.6);
}

.tl-line {
  width: 2px;
  flex: 1;
  background: linear-gradient(to bottom, var(--accent), transparent);
  margin-top: 4px;
  min-height: 40px;
  opacity: .3;
}

.tl-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  transition: border-color .3s, transform .2s;
}

.tl-card:hover { border-color: var(--accent); transform: translateX(4px); }

.tl-item.current .tl-card {
  border-color: rgba(99,102,241,.4);
  background: linear-gradient(135deg, var(--card2), rgba(99,102,241,.05));
}

.tl-meta { display: flex; align-items: center; gap: .75rem; margin-bottom: .5rem; }

.tl-badge {
  font-size: .7rem; font-weight: 700;
  padding: .2rem .6rem; border-radius: 20px;
  letter-spacing: .05em; text-transform: uppercase;
}

.current-badge {
  background: rgba(99,102,241,.2);
  color: var(--accent3);
  border: 1px solid rgba(99,102,241,.3);
}

.tl-date { font-size: .8rem; color: var(--dim); font-family: var(--mono); }

.tl-role { font-size: 1.1rem; font-weight: 700; color: var(--text); margin-bottom: .25rem; }

.tl-company { font-size: .9rem; font-weight: 500; color: var(--muted); margin-bottom: .75rem; }
.tl-via { color: var(--dim); font-size: .8rem; font-weight: 400; }
.tl-location { color: var(--dim); font-size: .8rem; font-weight: 400; }

.tl-tags { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: 1rem; }

.tag {
  background: rgba(6,182,212,.1);
  border: 1px solid rgba(6,182,212,.2);
  color: var(--teal);
  padding: .15rem .6rem;
  border-radius: 6px;
  font-size: .72rem;
  font-weight: 600;
  font-family: var(--mono);
}

.tl-bullets { list-style: none; display: flex; flex-direction: column; gap: .4rem; }

.tl-bullets li {
  font-size: .875rem;
  color: var(--muted);
  padding-left: 1rem;
  position: relative;
  line-height: 1.5;
}

.tl-bullets li::before {
  content: '▸';
  position: absolute;
  left: 0;
  color: var(--accent);
  font-size: .75rem;
  top: .1rem;
}

/* ── Projects ── */

.project-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  position: relative;
  transition: border-color .3s, box-shadow .3s;
  transform-style: preserve-3d;
  will-change: transform;
}

.project-card:hover { border-color: var(--accent); box-shadow: 0 20px 60px rgba(99,102,241,.15); }

.project-card.featured {
  border-color: rgba(99,102,241,.4);
  background: linear-gradient(135deg, var(--card2), rgba(99,102,241,.07));
}

.project-featured-label {
  position: absolute;
  top: 1rem; right: 1rem;
  background: linear-gradient(135deg, var(--accent), var(--teal));
  color: #fff;
  font-size: .65rem;
  font-weight: 700;
  padding: .2rem .6rem;
  border-radius: 20px;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.project-icon { font-size: 2rem; margin-bottom: 1rem; display: block; }
.project-card h3 { font-size: 1.05rem; font-weight: 700; color: var(--text); margin-bottom: .75rem; }
.project-card p { font-size: .875rem; color: var(--muted); line-height: 1.6; margin-bottom: 1rem; }
.project-tags { display: flex; flex-wrap: wrap; gap: .4rem; }

/* ── Company Logo Links in Timeline ── */
.company-link {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  color: var(--muted);
  text-decoration: none;
  transition: color .2s;
}

.company-link:hover { color: var(--accent2); }

.company-logo {
  width: 18px; height: 18px;
  border-radius: 4px;
  object-fit: contain;
  flex-shrink: 0;
  vertical-align: middle;
  filter: grayscale(20%);
  transition: filter .2s;
}

.company-link:hover .company-logo { filter: grayscale(0%); }

/* ── AI Featured Project ── */
.projects-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.project-card.ai-featured {
  grid-column: 1 / -1;
}

.ai-project-header {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1rem;
}

.ai-project-header .project-icon {
  font-size: 2.2rem;
  margin-bottom: 0;
  flex-shrink: 0;
}

.ai-project-header h3 { font-size: 1.3rem; margin-bottom: .2rem; }

.ai-subtitle {
  font-size: .85rem;
  color: var(--accent2);
  font-family: var(--mono);
  margin: 0;
}

.ai-desc {
  font-size: .9rem;
  color: var(--muted);
  line-height: 1.7;
  margin-bottom: 1.5rem;
}

/* Pipeline architecture */
.ai-arch {
  display: flex;
  align-items: center;
  gap: .5rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
  background: rgba(0,0,0,.2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
}

.arch-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .25rem;
  flex: 1;
  min-width: 100px;
}

.arch-icon { font-size: 1.5rem; }

.arch-label {
  font-size: .8rem;
  font-weight: 700;
  color: var(--text);
  text-align: center;
}

.arch-sub {
  font-size: .68rem;
  color: var(--dim);
  font-family: var(--mono);
  text-align: center;
  line-height: 1.3;
}

.arch-arrow {
  font-size: 1.2rem;
  color: var(--accent);
  flex-shrink: 0;
  font-weight: 700;
}

/* Metrics row */
.ai-metrics {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.ai-metric {
  flex: 1;
  min-width: 120px;
  background: linear-gradient(135deg, rgba(99,102,241,.12), rgba(6,182,212,.08));
  border: 1px solid rgba(99,102,241,.2);
  border-radius: 10px;
  padding: .9rem 1rem;
  text-align: center;
}

.ai-metric-num {
  display: block;
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--accent2);
  line-height: 1;
  margin-bottom: .3rem;
}

.ai-metric-label {
  font-size: .72rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .05em;
}

/* Technical detail table */
.ai-tech-detail {
  display: flex;
  flex-direction: column;
  gap: .5rem;
  margin-bottom: 1.25rem;
  background: rgba(0,0,0,.15);
  border-radius: 10px;
  padding: 1rem;
  border: 1px solid var(--border);
}

.ai-tech-item {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: .75rem;
  align-items: baseline;
  font-size: .8rem;
}

.ai-tech-label {
  color: var(--accent3);
  font-family: var(--mono);
  font-weight: 600;
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  flex-shrink: 0;
}

.ai-tech-val { color: var(--muted); line-height: 1.5; }

/* ── Education ── */
.edu-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; margin-bottom: 3rem; }

.edu-col-title {
  font-size: 1rem; font-weight: 700; color: var(--accent3);
  letter-spacing: .08em; text-transform: uppercase;
  margin-bottom: 1.5rem; font-family: var(--mono);
}

.edu-card {
  display: flex; align-items: flex-start; gap: 1rem;
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.25rem;
  margin-bottom: 1rem; transition: border-color .3s;
}

.edu-card:hover { border-color: var(--accent); }

.edu-logo {
  width: 48px; height: 48px; border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), var(--teal));
  display: flex; align-items: center; justify-content: center;
  font-size: .65rem; font-weight: 800; color: #fff;
  letter-spacing: .04em; flex-shrink: 0;
}

.edu-info { display: flex; flex-direction: column; gap: .15rem; }
.edu-info h4 { font-size: .95rem; font-weight: 700; color: var(--text); }
.edu-school { font-size: .8rem; color: var(--muted); }
.edu-date { font-size: .75rem; color: var(--dim); font-family: var(--mono); }
.edu-note { font-size: .75rem; color: var(--accent); margin-top: .2rem; }

/* ── Certifications ── */
.cert-list { display: flex; flex-direction: column; gap: .75rem; }

.cert-item {
  display: flex; align-items: center; gap: .75rem;
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: .875rem 1rem;
  transition: border-color .3s;
}

.cert-item:hover { border-color: var(--accent); }
.cert-icon { font-size: 1.1rem; flex-shrink: 0; }
.cert-info { flex: 1; display: flex; flex-direction: column; }
.cert-name { font-size: .85rem; font-weight: 600; color: var(--text); }
.cert-year { font-size: .72rem; color: var(--dim); font-family: var(--mono); }

.cert-status {
  font-size: .7rem; font-weight: 700; padding: .2rem .55rem;
  border-radius: 20px; text-transform: uppercase; letter-spacing: .05em; flex-shrink: 0;
}

.cert-status.active { background: rgba(16,185,129,.12); border: 1px solid rgba(16,185,129,.25); color: var(--green); }
.cert-status.progress { background: rgba(251,191,36,.1); border: 1px solid rgba(251,191,36,.25); color: #fbbf24; }

/* ── Languages ── */
.lang-section { text-align: center; }

.lang-grid { display: flex; justify-content: center; gap: 1.5rem; flex-wrap: wrap; }

.lang-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.25rem 2rem;
  display: flex; flex-direction: column; align-items: center; gap: .4rem;
  transition: border-color .3s, transform .3s;
}

.lang-card:hover { border-color: var(--accent); transform: translateY(-3px); }
.lang-flag { font-size: 2rem; }
.lang-name { font-size: .95rem; font-weight: 700; color: var(--text); }
.lang-level { font-size: .75rem; color: var(--dim); font-family: var(--mono); }

/* ── Contact ── */
.contact-grid { display: flex; flex-wrap: wrap; gap: 1rem; justify-content: center; }

.contact-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.5rem 1.75rem;
  display: flex; flex-direction: column; align-items: center; gap: .4rem;
  text-decoration: none; cursor: pointer;
  transition: border-color .3s, transform .3s, background .3s;
  min-width: 180px; position: relative;
}

.contact-card:not(.no-link):hover,
.contact-card.copyable:hover {
  border-color: var(--accent);
  background: rgba(99,102,241,.06);
  transform: translateY(-3px);
}

.contact-icon { font-size: 1.75rem; }
.contact-label { font-size: .7rem; color: var(--dim); text-transform: uppercase; letter-spacing: .08em; font-family: var(--mono); }
.contact-value { font-size: .875rem; color: var(--text); font-weight: 600; text-align: center; }

.copy-hint {
  font-size: .68rem;
  color: var(--accent);
  font-family: var(--mono);
  opacity: 0;
  transition: opacity .2s;
}

.contact-card.copyable:hover .copy-hint { opacity: 1; }

.contact-card.copied { border-color: var(--green) !important; }
.contact-card.copied .copy-hint { opacity: 1; color: var(--green); }

/* ── Recommendations ── */
.rec-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.rec-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  position: relative;
  transition: border-color .3s, transform .3s;
}

.rec-card:hover {
  border-color: var(--accent);
  transform: translateY(-3px);
}

.rec-quote {
  font-size: 4rem;
  line-height: .8;
  color: var(--accent);
  font-family: Georgia, serif;
  margin-bottom: .5rem;
  opacity: .5;
}

.rec-text {
  font-size: .9rem;
  color: var(--muted);
  line-height: 1.75;
  margin-bottom: 1.5rem;
  font-style: italic;
}

.rec-author {
  display: flex;
  align-items: center;
  gap: .75rem;
}

.rec-avatar {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--teal));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .9rem;
  font-weight: 800;
  color: #fff;
  flex-shrink: 0;
}

.rec-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: .15rem;
}

.rec-name {
  font-size: .875rem;
  font-weight: 700;
  color: var(--text);
}

.rec-rel {
  font-size: .72rem;
  color: var(--dim);
  font-family: var(--mono);
}

.rec-li-link {
  color: #0077b5;
  transition: opacity .2s;
  flex-shrink: 0;
}

.rec-li-link:hover { opacity: .7; }

.rec-cta {
  text-align: center;
}

.rec-full-link {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  color: var(--accent2);
  text-decoration: none;
  font-size: .9rem;
  font-weight: 600;
  border: 1px solid var(--border);
  padding: .65rem 1.5rem;
  border-radius: 10px;
  transition: border-color .2s, background .2s;
}

.rec-full-link:hover {
  border-color: var(--accent);
  background: rgba(99,102,241,.07);
}

@media (max-width: 700px) {
  .rec-grid { grid-template-columns: 1fr; }
}

/* ── Footer ── */
.footer {
  border-top: 1px solid var(--border);
  text-align: center;
  padding: 2.5rem 2rem;
  color: var(--dim);
  font-size: .8rem;
  position: relative;
  z-index: 1;
  line-height: 1.8;
}

.footer-ai { color: var(--accent); font-size: .75rem; }

/* ── Back to Top ── */
.back-to-top {
  position: fixed;
  bottom: 2rem; right: 2rem;
  width: 44px; height: 44px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 12px;
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  z-index: 90;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity .3s, transform .3s, background .2s;
  box-shadow: 0 4px 20px rgba(99,102,241,.4);
}

.back-to-top.visible { opacity: 1; transform: translateY(0); }
.back-to-top:hover { background: var(--accent2); transform: translateY(-2px); }

/* ── Chatbot Widget ── */
.chat-widget {
  position: fixed;
  bottom: 5.5rem; right: 2rem;
  z-index: 90;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: .75rem;
}

.chat-toggle {
  display: flex;
  align-items: center;
  gap: .6rem;
  background: linear-gradient(135deg, var(--accent), var(--teal));
  color: #fff;
  border: none;
  padding: .7rem 1.2rem;
  border-radius: 50px;
  font-size: .875rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 6px 24px rgba(99,102,241,.45);
  transition: transform .2s, box-shadow .2s;
  font-family: var(--font);
  position: relative;
}

.chat-toggle:hover { transform: translateY(-2px); box-shadow: 0 10px 30px rgba(99,102,241,.55); }

.chat-toggle-icon { font-size: 1.1rem; }

.chat-unread {
  position: absolute;
  top: -6px; right: -6px;
  background: #ef4444;
  color: #fff;
  width: 18px; height: 18px;
  border-radius: 50%;
  font-size: .65rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: pulse 2s infinite;
}

.chat-unread.hidden { display: none; }

.chat-panel {
  width: 340px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,.4);
  display: none;
  flex-direction: column;
}

.chat-panel.open { display: flex; animation: chat-slide-in .3s ease; }

@keyframes chat-slide-in {
  from { opacity: 0; transform: translateY(16px) scale(.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.chat-header {
  background: linear-gradient(135deg, rgba(99,102,241,.2), rgba(6,182,212,.1));
  border-bottom: 1px solid var(--border);
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.chat-header-info { display: flex; align-items: center; gap: .75rem; }

.chat-avatar-wrap {
  width: 38px; height: 38px;
  background: linear-gradient(135deg, var(--accent), var(--teal));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

.chat-header-name { font-size: .9rem; font-weight: 700; color: var(--text); }

.chat-header-status {
  display: flex;
  align-items: center;
  gap: .35rem;
  font-size: .72rem;
  color: var(--green);
  font-family: var(--mono);
}

.chat-status-dot {
  width: 6px; height: 6px;
  background: var(--green);
  border-radius: 50%;
  animation: pulse 2s infinite;
}

.chat-close {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 1rem;
  cursor: pointer;
  padding: .25rem;
  border-radius: 6px;
  transition: color .2s, background .2s;
}

.chat-close:hover { color: var(--text); background: rgba(255,255,255,.05); }

.chat-messages {
  padding: 1rem;
  height: 280px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: .75rem;
  scroll-behavior: smooth;
}

.chat-messages::-webkit-scrollbar { width: 4px; }
.chat-messages::-webkit-scrollbar-track { background: transparent; }
.chat-messages::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

.chat-msg {
  max-width: 85%;
  padding: .6rem .9rem;
  border-radius: 12px;
  font-size: .85rem;
  line-height: 1.5;
}

.chat-msg.bot {
  background: rgba(99,102,241,.12);
  border: 1px solid rgba(99,102,241,.2);
  color: var(--text);
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}

.chat-msg.user {
  background: var(--accent);
  color: #fff;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}

.chat-msg.typing {
  background: rgba(99,102,241,.08);
  border: 1px solid rgba(99,102,241,.15);
  align-self: flex-start;
}

.typing-dots { display: flex; gap: 4px; padding: 2px 0; }

.typing-dots span {
  width: 6px; height: 6px;
  background: var(--accent2);
  border-radius: 50%;
  animation: typing-bounce .9s infinite;
}

.typing-dots span:nth-child(2) { animation-delay: .15s; }
.typing-dots span:nth-child(3) { animation-delay: .3s; }

@keyframes typing-bounce {
  0%,60%,100% { transform: translateY(0); }
  30% { transform: translateY(-6px); }
}

.chat-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  margin-top: .25rem;
}

.chat-suggestion {
  background: rgba(99,102,241,.08);
  border: 1px solid rgba(99,102,241,.2);
  color: var(--accent3);
  padding: .25rem .65rem;
  border-radius: 20px;
  font-size: .75rem;
  cursor: pointer;
  font-family: var(--font);
  transition: background .2s, border-color .2s;
}

.chat-suggestion:hover { background: rgba(99,102,241,.2); border-color: var(--accent); }

.chat-input-row {
  display: flex;
  gap: .5rem;
  padding: .75rem 1rem;
  border-top: 1px solid var(--border);
  background: var(--card2);
}

#chat-input {
  flex: 1;
  background: rgba(255,255,255,.05);
  border: 1px solid var(--border);
  color: var(--text);
  padding: .5rem .75rem;
  border-radius: 8px;
  font-size: .875rem;
  font-family: var(--font);
  outline: none;
  transition: border-color .2s;
}

#chat-input:focus { border-color: var(--accent); }
#chat-input::placeholder { color: var(--dim); }

.chat-send-btn {
  background: var(--accent);
  color: #fff;
  border: none;
  width: 36px; height: 36px;
  border-radius: 8px;
  font-size: 1rem;
  cursor: pointer;
  transition: background .2s, transform .1s;
  flex-shrink: 0;
}

.chat-send-btn:hover { background: var(--accent2); transform: scale(1.05); }

/* ── Reveal Animation (staggered) ── */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .6s ease calc(var(--i, 0) * 0.08s),
              transform .6s ease calc(var(--i, 0) * 0.08s);
}

.reveal.visible { opacity: 1; transform: translateY(0); }

/* ── Print Styles ── */
@media print {
  #neural-bg, .chat-widget, .back-to-top, .scroll-progress,
  .cursor-glow, .loader, .nav, .ai-banner, .timeline-filters,
  .hero-actions, .hero-visual, .orbit-ring, .orbit-dot { display: none !important; }

  body { background: #fff; color: #000; font-size: 11pt; }
  .hero { min-height: auto; padding: 2rem 0 1rem; }
  .hero-name { font-size: 2.5rem; -webkit-text-fill-color: #000; }
  .section { padding: 2rem 0; page-break-inside: avoid; }
  .tl-card, .skill-card, .edu-card, .cert-item, .project-card {
    border: 1px solid #ddd;
    background: #fff;
    box-shadow: none;
  }
  .hero-meta { gap: 1rem; }
  .gh-strip { display: none; }
  a { color: #000; text-decoration: none; }
}

/* ── Responsive ── */
@media (max-width: 900px) {
  .hero { flex-direction: column; padding-top: 7rem; gap: 2rem; }
  .hero-visual { display: none; }
  .nav-links { display: none; }
  .hamburger { display: flex; }
  .edu-grid { grid-template-columns: 1fr; }
  .bar-row { grid-template-columns: 120px 1fr 36px; }
  .projects-grid { grid-template-columns: 1fr; }
  .project-card.ai-featured { grid-column: 1; }
  .ai-arch { flex-direction: column; align-items: flex-start; gap: .75rem; }
  .arch-arrow { transform: rotate(90deg); align-self: center; }
  .arch-step { flex-direction: row; align-items: center; gap: .75rem; text-align: left; }
  .ai-tech-item { grid-template-columns: 1fr; gap: .2rem; }
}

@media (max-width: 540px) {
  .chat-widget { right: 1rem; bottom: 5rem; }
  .back-to-top { right: 1rem; bottom: 1rem; }
  .chat-panel { width: calc(100vw - 2rem); }
  .hero-meta { gap: 1rem; }
  .hero-actions { flex-direction: column; }
}

/* ── Mobile (≤480px) ── */
@media (max-width: 480px) {
  .container { padding: 0 1rem; }

  /* Hero */
  .hero { padding: 6rem 1rem 3rem; text-align: center; }
  .hero-name { font-size: clamp(2rem, 10vw, 2.8rem); }
  .hero-summary { font-size: .95rem; max-width: 100%; }
  .hero-badge { margin-bottom: 1rem; }
  .hero-actions { flex-direction: column; align-items: stretch; }
  .hero-actions a { text-align: center; }

  /* Meta counters — wrap into 2 rows, hide dividers */
  .hero-meta { flex-wrap: wrap; justify-content: center; gap: .75rem 1.25rem; }
  .meta-divider { display: none; }
  .meta-item { min-width: 70px; }
  .meta-num { font-size: 1.5rem; }

  /* GitHub strip */
  .gh-strip { justify-content: center; }

  /* Skills */
  .skills-grid { grid-template-columns: 1fr; }
  .bar-row { grid-template-columns: 100px 1fr 34px; gap: .5rem; }
  .bar-label { font-size: .8rem; }

  /* Projects — pipeline arrows & steps */
  .ai-arch { gap: .5rem; }
  .arch-step { padding: .5rem .75rem; }
  .arch-icon { font-size: 1.2rem; }
  .arch-label { font-size: .8rem; }
  .arch-sub { font-size: .7rem; }

  /* AI tech detail rows — stack label above value */
  .ai-tech-item { grid-template-columns: 1fr; gap: .15rem; }
  .ai-tech-label { margin-bottom: .1rem; }

  /* AI metrics — 1 per row on very small screens */
  .ai-metrics { flex-direction: column; }
  .ai-metric { min-width: unset; }

  /* Project tags */
  .project-tags { gap: .3rem; }
  .tag { font-size: .72rem; padding: .2rem .55rem; }

  /* Education */
  .edu-grid { grid-template-columns: 1fr; gap: 1.5rem; }

  /* Section headings */
  .section { padding: 4rem 0; }
  .section-header h2 { font-size: clamp(1.6rem, 6vw, 2.2rem); }

  /* Marquee */
  .marquee-item { font-size: .8rem; }

  /* AI project header */
  .ai-project-header { flex-direction: column; gap: .5rem; }
  .project-icon { font-size: 1.8rem; }

  /* Experience timeline */
  .tl-card { padding: 1.25rem; }
  .tl-meta { flex-wrap: wrap; gap: .4rem; }
}

/* ── Extra small (≤360px) ── */
@media (max-width: 360px) {
  .hero-name { font-size: 1.8rem; }
  .bar-row { grid-template-columns: 80px 1fr 30px; }
  .chat-toggle-label { display: none; }
}
