/* =========================================================
   Richard Watson Stephen Amudha — Portfolio
   Design system + animations (vanilla, no framework)
   ========================================================= */

:root {
  --bg: #081120;              /* Midnight Navy */
  --bg-2: #101C2F;            /* Deep Slate */
  --surface: rgba(255, 255, 255, 0.035);
  --surface-2: rgba(255, 255, 255, 0.06);
  --border: rgba(148, 163, 184, 0.14);
  --border-strong: rgba(148, 163, 184, 0.28);
  --text: #F8FAFC;           /* Soft White — body/heading; white on blue buttons */
  --text-dim: #94A3B8;       /* Cool Gray — secondary text */
  --text-faint: #7E8CA8;     /* tertiary TEXT (dates, labels, footer) — AA on navy */

  --blue: #3B82F6;           /* PRIMARY accent: fills, borders, focus ring, data */
  --blue-600: #2563EB;
  --gold: #F2B84B;           /* RESERVED highlight (≤10%): name, key numbers, premium */
  --gold-600: #E0A93C;
  --emerald: #22C55E;        /* STATUS / live only: current dot, live pulses, GPA */
  --cyan: #60A5FA;           /* documented secondary micro-accent — NEVER a button fill */

  /* legacy aliases → remapped to the navy/blue/gold system */
  --indigo: #3B82F6;
  --violet: #2563EB;
  --pink: #F2B84B;

  --grad: linear-gradient(135deg, #3B82F6 0%, #2563EB 100%);         /* DECORATIVE only — never text */
  --grad-btn: linear-gradient(135deg, #2563EB 0%, #1D4ED8 100%);     /* text-bearing blue pills — white passes AA */
  --grad-gold: linear-gradient(135deg, var(--gold) 0%, var(--gold-600) 100%); /* name + key numbers (token-based) */
  --grad-page: linear-gradient(135deg, #081120 0%, #101C2F 60%, #102A56 100%);

  /* shadows / glows */
  --glow: 0 0 60px -14px rgba(59, 130, 246, 0.5);
  --glow-gold: 0 0 48px -14px rgba(242, 184, 75, 0.5);
  --shadow-card: 0 20px 50px -25px rgba(2, 6, 20, .55);
  --shadow-btn: 0 8px 30px -8px rgba(37, 99, 235, .5);

  /* radii */
  --radius-xs: 6px;
  --radius-sm: 10px;
  --radius-md: 12px;
  --radius: 18px;            /* = --radius-lg */
  --radius-lg: 18px;
  --radius-pill: 100px;

  /* type scale */
  --fs-2xs: .72rem;  --fs-xs: .8rem;  --fs-sm: .88rem;  --fs-base: .95rem;
  --fs-md: 1.05rem;  --fs-lg: 1.18rem;

  /* spacing (8px base) */
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 24px;
  --sp-6: 32px; --sp-7: 48px; --sp-8: 64px; --sp-section: 96px;
  --card-pad: 24px; --card-pad-sm: 20px;

  /* motion */
  --dur-fast: .18s; --dur: .28s; --dur-slow: .5s;

  --maxw: 1120px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);

  --font-display: "Space Grotesk", system-ui, sans-serif;
  --font-body: "Inter", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
}

html[data-theme="light"] {
  --bg: #f6f7fb;
  --bg-2: #eef1f8;
  --surface: rgba(15, 23, 42, 0.03);
  --surface-2: rgba(15, 23, 42, 0.05);
  --border: rgba(15, 23, 42, 0.1);
  --border-strong: rgba(15, 23, 42, 0.18);
  --text: #10182b;
  --text-dim: #4a5570;
  --text-faint: #5C6577;     /* ~5.4:1 on #f6f7fb */
  /* accent remaps so gold name / stats / cyan tags stay legible on near-white */
  --blue: #2563EB;           /* ~5:1 */
  --cyan: #2563EB;           /* was #60A5FA (~1.9:1 FAIL) */
  --gold: #8A5A0B;           /* text-legible warm gold, ~4.6:1 */
  --gold-600: #6E4708;
}

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

/* Base gradient lives on the root element (painted to the viewport canvas) rather than
   background-attachment:fixed on <body> — avoids scroll jank / blank-frame compositing. */
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; background: var(--grad-page); }
html[data-theme="light"] { background: var(--bg); }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

body {
  font-family: var(--font-body);
  background: transparent;
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  transition: color .5s var(--ease);
}

a { color: inherit; text-decoration: none; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
img { max-width: 100%; display: block; }

.skip-link {
  position: absolute; left: -999px; top: 8px; z-index: 999;
  background: var(--indigo); color: #fff; padding: 10px 16px; border-radius: 8px;
}
.skip-link:focus { left: 12px; }

/* ---------- Background layers ---------- */
.bg-mesh {
  position: fixed; inset: 0; z-index: -3; pointer-events: none;
  background:
    radial-gradient(50% 45% at 15% 12%, rgba(59, 130, 246, 0.20), transparent 60%),
    radial-gradient(45% 40% at 88% 18%, rgba(37, 99, 235, 0.16), transparent 60%),
    radial-gradient(55% 55% at 72% 92%, rgba(16, 42, 86, 0.55), transparent 62%),
    radial-gradient(36% 36% at 22% 84%, rgba(242, 184, 75, 0.08), transparent 60%);
  filter: saturate(1.05);
  animation: meshFloat 22s ease-in-out infinite alternate;
}
html[data-theme="light"] .bg-mesh { opacity: .5; }
@keyframes meshFloat {
  0% { transform: translate3d(0,0,0) scale(1); }
  100% { transform: translate3d(0,-3%,0) scale(1.08); }
}
body::before {
  content: ""; position: fixed; inset: 0; z-index: -2; pointer-events: none;
  background: radial-gradient(120% 120% at 50% 0%, transparent 55%, var(--bg) 100%);
}
#constellation { position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: .6; }
html[data-theme="light"] #constellation { opacity: .35; }

.scroll-progress {
  position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 60; background: transparent;
}
.scroll-progress span {
  display: block; height: 100%; width: 0%;
  background: var(--grad); box-shadow: 0 0 12px rgba(59,130,246,.7);
}

/* ---------- Buttons ---------- */
.btn {
  --pad: 12px 22px;
  display: inline-flex; align-items: center; gap: 9px;
  padding: var(--pad); border-radius: 100px; font-weight: 600; font-size: .95rem;
  font-family: var(--font-display); cursor: pointer; border: 1px solid transparent;
  transition: transform .25s var(--ease), box-shadow .25s var(--ease), background .25s, border-color .25s;
  white-space: nowrap;
}
.btn .arr { transition: transform .25s var(--ease); }
.btn:hover .arr { transform: translateX(4px); }
.btn-primary { background: var(--grad-btn); color: #fff; box-shadow: 0 8px 30px -8px rgba(37,99,235,.7); }
.btn-primary:hover { transform: translateY(-3px); box-shadow: 0 14px 40px -8px rgba(37,99,235,.9); }
.btn-outline { border-color: color-mix(in srgb, var(--gold) 55%, transparent); color: var(--gold); background: transparent; }
.btn-outline:hover { transform: translateY(-3px); border-color: var(--gold); box-shadow: var(--glow-gold); background: color-mix(in srgb, var(--gold) 8%, transparent); }
.btn-ghost { color: var(--text-dim); padding: 8px 14px; font-size: .88rem; }
.btn-ghost:hover { color: var(--text); }

/* ---------- Navbar ---------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  transition: background .35s var(--ease), border-color .35s, backdrop-filter .35s;
  border-bottom: 1px solid transparent;
}
.nav.scrolled {
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  backdrop-filter: blur(14px) saturate(1.4);
  border-bottom-color: var(--border);
}
.nav-inner {
  max-width: var(--maxw); margin: 0 auto; padding: 16px 24px;
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
}
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 700; }
.brand-mark {
  width: 40px; height: 40px; border-radius: 11px; object-fit: cover; display: block;
  box-shadow: var(--glow); transition: transform .25s var(--ease);
}
.brand:hover .brand-mark { transform: scale(1.06); }
.dot { color: var(--cyan); }
.nav-links { display: flex; gap: 26px; }
.nav-links a {
  font-size: .92rem; color: var(--text-dim); font-weight: 500; position: relative; padding: 4px 0;
  transition: color .2s;
}
.nav-links a::after {
  content: ""; position: absolute; left: 0; bottom: -2px; height: 2px; width: 0;
  background: var(--grad); transition: width .3s var(--ease);
}
.nav-links a:hover { color: var(--text); }
.nav-links a:hover::after, .nav-links a.active::after { width: 100%; }
.nav-links a.active { color: var(--gold); }
.nav-links a.active::after { background: var(--grad-gold); }
.nav-actions { display: flex; align-items: center; gap: 8px; }

.theme-toggle {
  display: grid; place-items: center; width: 44px; height: 44px; border-radius: 10px;
  background: var(--surface); border: 1px solid var(--border); color: var(--text-dim); cursor: pointer;
  transition: color .2s var(--ease), border-color .2s var(--ease), transform .2s var(--ease);
}
.theme-toggle:hover { color: var(--text); border-color: var(--border-strong); transform: rotate(15deg); }
.theme-toggle .i-moon { display: none; }
html[data-theme="light"] .theme-toggle .i-sun { display: none; }
html[data-theme="light"] .theme-toggle .i-moon { display: block; }

.hamburger { display: none; flex-direction: column; align-items: center; justify-content: center; gap: 5px; width: 44px; height: 44px; background: none; border: 0; cursor: pointer; padding: 6px; }
.hamburger span { width: 24px; height: 2px; background: var(--text); border-radius: 2px; transition: .3s var(--ease); }
.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 {
  display: none; flex-direction: column; gap: 4px; padding: 8px 24px 20px;
  background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.mobile-menu.open { display: flex; animation: fadeDown .3s var(--ease); }
.mobile-menu a { padding: 12px 4px; color: var(--text-dim); border-bottom: 1px solid var(--border); font-weight: 500; }
.mobile-menu a:last-child { border-bottom: 0; }
.mm-resume { color: var(--cyan) !important; }
@keyframes fadeDown { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }

/* ---------- Layout ---------- */
main { position: relative; z-index: 1; }
.section { max-width: var(--maxw); margin: 0 auto; padding: 90px 24px; }
.section-head { display: flex; align-items: center; gap: 18px; margin-bottom: 44px; }
.sec-index {
  font-family: var(--font-mono); font-size: .85rem; color: var(--cyan);
  border: 1px solid var(--border); padding: 4px 10px; border-radius: 8px; background: var(--surface);
}
.sec-title { font-family: var(--font-display); font-size: clamp(1.6rem, 4vw, 2.4rem); font-weight: 700; letter-spacing: -.5px; }
.sec-line { flex: 1; height: 1px; background: linear-gradient(90deg, var(--border-strong), transparent); }

/* ---------- Hero ---------- */
.hero {
  min-height: 100vh; max-width: var(--maxw); margin: 0 auto; padding: 120px 24px 60px;
  display: grid; grid-template-columns: 1.15fr .85fr; align-items: center; gap: 40px; position: relative;
}
.hero-eyebrow {
  display: inline-flex; align-items: center; gap: 9px; font-size: .85rem; color: var(--text-dim);
  background: var(--surface); border: 1px solid var(--border); padding: 7px 15px; border-radius: 100px;
  font-family: var(--font-mono); margin-bottom: 22px; width: fit-content;
}
.pulse-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--emerald); box-shadow: 0 0 0 0 rgba(34,197,94,.7); animation: pulse 2s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(34,197,94,.6); } 70% { box-shadow: 0 0 0 10px rgba(34,197,94,0); } 100% { box-shadow: 0 0 0 0 rgba(34,197,94,0); } }
@keyframes pulseBlue { 0% { box-shadow: 0 0 0 0 rgba(59,130,246,.6); } 70% { box-shadow: 0 0 0 10px rgba(59,130,246,0); } 100% { box-shadow: 0 0 0 0 rgba(59,130,246,0); } }

.hero-title {
  font-family: var(--font-display); font-weight: 700; letter-spacing: -1.5px;
  font-size: clamp(2.5rem, 6.5vw, 4.4rem); line-height: 1.02; margin-bottom: 16px;
}
.grad-text {
  background: var(--grad-gold); -webkit-background-clip: text; background-clip: text; color: transparent;
}
/* blue accent for non-reserved highlight text (keeps gold discipline) */
.intake-accent { color: var(--blue); }

.hero-role { font-family: var(--font-mono); font-size: clamp(1rem, 2.6vw, 1.5rem); font-weight: 500; color: var(--text); margin-bottom: 22px; min-height: 1.6em; }
.static-role { color: var(--text-dim); }
.typed { color: var(--cyan); }
.caret { color: var(--cyan); font-weight: 400; animation: blink 1s step-end infinite; }
@keyframes blink { 50% { opacity: 0; } }

.hero-sub { font-size: 1.06rem; color: var(--text-dim); max-width: 560px; margin-bottom: 30px; }
.hero-sub strong { color: var(--text); font-weight: 600; }
.hero-cta { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 26px; }
.hero-socials { display: flex; gap: 12px; }
.hero-socials a {
  display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px;
  background: var(--surface); border: 1px solid var(--border); color: var(--text-dim);
  transition: transform .25s var(--ease), color .25s, border-color .25s, box-shadow .25s;
}
.hero-socials a:hover { transform: translateY(-4px); color: var(--text); border-color: var(--indigo); box-shadow: var(--glow); }

/* Hero — live "AI core" orbital system */
.hero-orbit { justify-self: end; width: 100%; max-width: 440px; display: flex; flex-direction: column; align-items: center; gap: 18px; }
.orbit-stage { position: relative; width: min(380px, 82vw); aspect-ratio: 1; perspective: 900px; transform-style: preserve-3d; transition: transform .5s var(--ease); }
.orbit-glow { position: absolute; inset: 20%; border-radius: 50%; background: radial-gradient(circle, rgba(59,130,246,.30), transparent 66%); filter: blur(14px); animation: glowPulse 5s ease-in-out infinite; }
@keyframes glowPulse { 0%,100% { opacity: .7; transform: scale(1); } 50% { opacity: 1; transform: scale(1.08); } }
.orbit-ring { position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); border: 1px dashed var(--border-strong); border-radius: 50%; pointer-events: none; }
.orbit-ring.r1 { width: 44%; height: 44%; } .orbit-ring.r2 { width: 70%; height: 70%; } .orbit-ring.r3 { width: 96%; height: 96%; opacity: .7; }
.orbit-links { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.orbit-link { stroke: url(#linkgrad); stroke-width: 1.2; stroke-dasharray: 3 7; opacity: .55; animation: linkFlow 3s linear infinite; }
@keyframes linkFlow { to { stroke-dashoffset: -20; } }
.orbit-core { position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); width: 27%; aspect-ratio: 1; display: grid; place-items: center; z-index: 3; }
.orbit-core::before { content: ""; position: absolute; inset: -10%; border-radius: 50%; border: 1px solid color-mix(in srgb, var(--gold) 45%, transparent); animation: corePulse 2.8s ease-out infinite; }
@keyframes corePulse { 0% { transform: scale(.85); opacity: .8; } 100% { transform: scale(1.7); opacity: 0; } }
.core-disc { position: relative; width: 100%; height: 100%; border-radius: 50%; display: grid; place-items: center; background: radial-gradient(circle at 32% 28%, #60A5FA, #2563EB 55%, #1D4ED8); border: 1px solid rgba(255,255,255,.25); box-shadow: 0 0 46px -6px rgba(59,130,246,.85), inset 0 0 22px rgba(255,255,255,.18); }
.core-text { font-family: var(--font-mono); font-size: clamp(.62rem, 1.6vw, .78rem); font-weight: 600; color: #fff; letter-spacing: .02em; text-shadow: 0 1px 6px rgba(0,0,0,.4); }
.orbit-node { position: absolute; top: 50%; left: 50%; z-index: 2; will-change: transform; }
.node-chip { display: inline-flex; align-items: center; gap: 6px; transform: translate(-50%,-50%); font-family: var(--font-mono); font-size: .72rem; color: var(--text); background: color-mix(in srgb, var(--bg) 84%, transparent); border: 1px solid var(--border-strong); padding: 5px 11px; border-radius: 100px; white-space: nowrap; box-shadow: 0 8px 20px -10px rgba(0,0,0,.7); transition: border-color .2s, box-shadow .2s, background .2s; cursor: default; }
.node-chip::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 8px var(--cyan); flex: none; }
.orbit-node:hover .node-chip { border-color: var(--gold); background: color-mix(in srgb, var(--gold) 12%, var(--bg)); box-shadow: 0 0 26px -6px rgba(242,184,75,.65); }
.orbit-node:hover .node-chip::before { background: var(--gold); box-shadow: 0 0 8px var(--gold); }
.orbit-caption { font-family: var(--font-mono); font-size: .82rem; color: var(--text-dim); display: inline-flex; align-items: center; gap: 8px; min-height: 1.4em; }
.oc-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--emerald); box-shadow: 0 0 0 0 rgba(34,197,94,.6); animation: pulse 2s infinite; flex: none; }
.oc-caret { color: var(--cyan); animation: blink 1s step-end infinite; margin-left: -6px; }
@media (prefers-reduced-motion: reduce) { .orbit-glow, .orbit-link, .orbit-core::before, .oc-caret { animation: none; } }

.scroll-hint { position: absolute; bottom: 24px; left: 50%; transform: translateX(-50%); }
.mouse { display: block; width: 24px; height: 38px; border: 2px solid var(--text-faint); border-radius: 14px; position: relative; }
.mouse span { position: absolute; top: 7px; left: 50%; width: 4px; height: 8px; margin-left: -2px; border-radius: 4px; background: var(--cyan); animation: scrollWheel 1.6s infinite; }
@keyframes scrollWheel { 0% { opacity: 0; transform: translateY(0); } 30% { opacity: 1; } 100% { opacity: 0; transform: translateY(12px); } }

/* ---------- Stats ---------- */
.stats {
  max-width: var(--maxw); margin: 0 auto; padding: 0 24px;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px;
}
.stat {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 26px 22px; text-align: center; position: relative; overflow: hidden;
  transition: transform .3s var(--ease), border-color .3s, box-shadow .3s;
}
.stat:hover { transform: translateY(-6px); border-color: var(--border-strong); box-shadow: 0 20px 50px -25px rgba(59,130,246,.6); }
.stat-num { font-family: var(--font-display); font-weight: 700; font-size: clamp(1.8rem, 4vw, 2.6rem); background: var(--grad-gold); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stat-label { color: var(--text-dim); font-size: .9rem; margin-top: 6px; }

/* ---------- About ---------- */
.about-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 40px; align-items: start; }
.about-text p { color: var(--text-dim); margin-bottom: 18px; font-size: 1.02rem; }
.about-text strong { color: var(--text); font-weight: 600; }
.about-highlights { list-style: none; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 24px; }
.about-highlights li { display: flex; align-items: center; gap: 10px; font-size: .92rem; color: var(--text-dim); background: var(--surface); border: 1px solid var(--border); padding: 12px 14px; border-radius: var(--radius-sm); transition: border-color .25s, transform .25s; }
.about-highlights li:hover { border-color: var(--border-strong); transform: translateX(4px); }
.about-highlights span { font-size: 1.15rem; }

.edu-card { background: linear-gradient(160deg, var(--surface-2), var(--surface)); border: 1px solid var(--border); border-radius: var(--radius); padding: 26px; position: relative; }
.edu-badge { display: inline-block; font-size: .8rem; font-family: var(--font-mono); color: var(--cyan); background: var(--surface); border: 1px solid var(--border); padding: 5px 12px; border-radius: 100px; margin-bottom: 20px; }
.edu-item { padding: 16px 0; border-bottom: 1px solid var(--border); }
.edu-item:last-of-type { border-bottom: 0; }
.edu-item h3 { font-family: var(--font-display); font-size: 1.05rem; font-weight: 600; margin-bottom: 4px; }
.edu-deg { font-size: .9rem; color: var(--text-dim); margin-bottom: 6px; }
.edu-meta { font-size: .82rem; color: var(--text-faint); font-family: var(--font-mono); }
.gpa { color: var(--emerald); }
.edu-loc { margin-top: 18px; font-size: .88rem; color: var(--text-dim); }

/* ---------- Skills (interactive bars + radar) ---------- */
.skills-tabs { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 26px; }
.skill-tab { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; font-family: var(--font-display); font-weight: 600; font-size: .9rem;
  color: var(--text-dim); background: var(--surface); border: 1px solid var(--border); padding: 9px 16px; border-radius: 100px; cursor: pointer;
  transition: all .25s var(--ease); }
.skill-tab:hover { color: var(--text); border-color: var(--border-strong); transform: translateY(-1px); }
.skill-tab.active { color: #fff; background: var(--grad-btn); border-color: transparent; box-shadow: 0 10px 26px -12px rgba(37,99,235,.8); }
.skill-tab .st-ico { font-size: 1rem; }

.skills-panel { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; align-items: stretch; }
.skill-bars { display: grid; gap: 16px; align-content: start; }
.skill-row-top { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 8px; }
.skill-name { font-weight: 500; font-size: .95rem; color: var(--text); }
.skill-lvl { font-family: var(--font-mono); font-size: .9rem; font-weight: 600; color: var(--gold); }
.skill-lvl em { color: var(--text-faint); font-style: normal; font-size: .78rem; }
.skill-track { height: 8px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--border); overflow: hidden; }
.skill-fill { display: block; height: 100%; border-radius: 8px; background: var(--grad); box-shadow: 0 0 14px -2px rgba(59,130,246,.6);
  transition: width 1s var(--ease); }

.skill-radar { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; display: flex; flex-direction: column; }
.radar-title { font-family: var(--font-display); font-size: 1.05rem; font-weight: 600; margin-bottom: 8px; }
.radar-wrap { flex: 1; display: grid; place-items: center; }
#radarSvg { width: 100%; max-width: 420px; height: auto; }
.radar-ring { fill: none; stroke: var(--border); stroke-width: 1; }
.radar-axis { stroke: var(--border); stroke-width: 1; }
.radar-label { fill: var(--text-dim); font-family: var(--font-mono); font-size: 11px; }
.radar-data { fill: color-mix(in srgb, var(--blue) 22%, transparent); stroke: var(--blue); stroke-width: 2; stroke-linejoin: round; }
.radar-dot { fill: var(--bg); stroke: var(--blue); stroke-width: 2; }

@media (max-width: 780px) {
  .skills-panel { grid-template-columns: 1fr; }
}

/* ---------- Timeline ---------- */
.timeline { position: relative; padding-left: 34px; }
.timeline::before { content: ""; position: absolute; left: 9px; top: 6px; bottom: 6px; width: 2px; background: linear-gradient(var(--indigo), var(--cyan), transparent); }
.tl-item { position: relative; padding: 0 0 40px 8px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-item::before { content: ""; position: absolute; left: -34px; top: 5px; width: 18px; height: 18px; border-radius: 50%; background: var(--bg); border: 3px solid var(--indigo); box-shadow: 0 0 0 4px color-mix(in srgb, var(--indigo) 20%, transparent); }
.tl-item.current::before { border-color: var(--emerald); box-shadow: 0 0 0 4px color-mix(in srgb, var(--emerald) 22%, transparent); animation: pulse 2s infinite; }
.tl-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 12px; margin-bottom: 4px; }
.tl-role { font-family: var(--font-display); font-size: 1.15rem; font-weight: 600; }
.tl-co { color: var(--cyan); font-weight: 600; }
.tl-meta { font-family: var(--font-mono); font-size: .8rem; color: var(--text-faint); margin-bottom: 14px; }
.tl-meta .badge-now { color: var(--emerald); }
.tl-list { list-style: none; display: grid; gap: 9px; }
.tl-list li { position: relative; padding-left: 20px; color: var(--text-dim); font-size: .95rem; }
.tl-list li::before { content: "▹"; position: absolute; left: 0; color: var(--cyan); }
.tl-list b { color: var(--text); }

/* ---------- Projects ---------- */
.proj-filters { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 30px; }
.filter-btn { display: inline-flex; align-items: center; min-height: 44px; font-family: var(--font-mono); font-size: .82rem; color: var(--text-dim); background: var(--surface); border: 1px solid var(--border); padding: 8px 16px; border-radius: 100px; cursor: pointer; transition: all .25s var(--ease); }
.filter-btn:hover { color: var(--text); border-color: var(--border-strong); }
.filter-btn.active { color: #fff; background: var(--grad-btn); border-color: transparent; }

.projects-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.proj-card {
  display: flex; flex-direction: column; background: linear-gradient(165deg, var(--surface-2), var(--surface));
  border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; position: relative; overflow: hidden;
  transition: transform .35s var(--ease), border-color .35s, box-shadow .35s; min-height: 240px;
}
.proj-card::after { content: ""; position: absolute; inset: 0; border-radius: var(--radius); padding: 1px; background: var(--grad); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; opacity: 0; transition: opacity .35s; pointer-events: none; }
.proj-card:hover { transform: translateY(-8px); box-shadow: 0 30px 70px -30px rgba(59,130,246,.6); }
.proj-card:hover::after { opacity: 1; }
.pc-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.pc-icon { font-size: 1.7rem; }
.pc-links { display: flex; gap: 8px; }
.pc-links a { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 10px; background: var(--surface); border: 1px solid var(--border); color: var(--text-dim); transition: color .2s var(--ease), border-color .2s var(--ease), transform .2s var(--ease); }
.pc-links a:hover { color: var(--text); border-color: var(--indigo); transform: translateY(-2px); }
.pc-title { font-family: var(--font-display); font-size: 1.18rem; font-weight: 600; margin-bottom: 9px; }
.pc-desc { color: var(--text-dim); font-size: .93rem; flex: 1; margin-bottom: 16px; }
.pc-tags { display: flex; flex-wrap: wrap; gap: 7px; }
.pc-tag { font-family: var(--font-mono); font-size: .72rem; color: var(--cyan); background: color-mix(in srgb, var(--cyan) 10%, transparent); border: 1px solid color-mix(in srgb, var(--cyan) 22%, transparent); padding: 3px 9px; border-radius: 6px; }
.projects-more { text-align: center; margin-top: 40px; }
.proj-card.hide { display: none; }

/* ---------- Intake (AI project briefing) ---------- */
.intake-grid { display: grid; grid-template-columns: 1fr 1.05fr; gap: 40px; align-items: start; }
.intake-head { font-family: var(--font-display); font-weight: 700; font-size: clamp(1.7rem, 3.6vw, 2.5rem); line-height: 1.1; letter-spacing: -.5px; margin-bottom: 16px; }
.intake-sub { color: var(--text-dim); font-size: 1.02rem; max-width: 480px; margin-bottom: 22px; }
.intake-checks { list-style: none; display: grid; gap: 12px; margin-bottom: 28px; }
.intake-checks li { position: relative; padding-left: 30px; color: var(--text-dim); font-size: .95rem; }
.intake-checks li::before { content: "✓"; position: absolute; left: 0; top: -1px; width: 20px; height: 20px; display: grid; place-items: center; border-radius: 50%; background: color-mix(in srgb, var(--blue) 16%, transparent); color: var(--blue); font-size: .72rem; font-weight: 700; }

/* Live blueprint card */
.blueprint { background: linear-gradient(165deg, var(--surface-2), var(--surface)); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; }
.bp-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.bp-title { font-family: var(--font-mono); font-size: .78rem; letter-spacing: 1.5px; text-transform: uppercase; color: var(--text-dim); }
.bp-live { font-family: var(--font-mono); font-size: .72rem; letter-spacing: 1px; text-transform: uppercase; color: var(--blue); display: inline-flex; align-items: center; gap: 7px; }
.bp-live i { width: 7px; height: 7px; border-radius: 50%; background: var(--blue); box-shadow: 0 0 0 0 rgba(59,130,246,.6); animation: pulseBlue 2s infinite; }
.bp-rows { display: grid; }
.bp-row { display: grid; grid-template-columns: 130px 1fr; gap: 16px; align-items: baseline; padding: 14px 0; border-bottom: 1px dashed var(--border); }
.bp-row:last-child { border-bottom: 0; }
.bp-row dt { font-family: var(--font-mono); font-size: .72rem; letter-spacing: 1px; text-transform: uppercase; color: var(--text-faint); }
.bp-row dd { color: var(--text); font-size: .95rem; transition: color .3s; }
.bp-row dd.bp-wait { color: var(--text-faint); font-style: italic; }
.bp-row dd.bp-static { color: var(--text-dim); font-size: .88rem; }
.bp-row dd.bp-filled { animation: bpPop .5s var(--ease); }
.bp-row dd .hl { color: var(--gold); font-weight: 600; }
@keyframes bpPop { from { opacity: .2; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.bp-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.bp-chip { font-family: var(--font-mono); font-size: .72rem; color: var(--blue); background: color-mix(in srgb, var(--blue) 12%, transparent); border: 1px solid color-mix(in srgb, var(--blue) 28%, transparent); padding: 3px 9px; border-radius: 6px; animation: bpPop .4s var(--ease); }

/* Chat */
.chat { display: flex; flex-direction: column; height: 520px; background: linear-gradient(165deg, var(--surface-2), var(--surface)); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.chat-head { padding: 16px 20px; border-bottom: 1px solid var(--border); }
.chat-live { font-family: var(--font-mono); font-size: .74rem; letter-spacing: 1px; text-transform: uppercase; color: var(--text-dim); display: inline-flex; align-items: center; gap: 8px; }
.chat-live i { width: 8px; height: 8px; border-radius: 50%; background: var(--emerald); box-shadow: 0 0 0 0 rgba(34,197,94,.6); animation: pulse 2s infinite; }
.chat-body { flex: 1; overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 12px; scroll-behavior: smooth; }
.chat-body::-webkit-scrollbar { width: 6px; }
.chat-body::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 6px; }
.msg { max-width: 82%; padding: 12px 15px; border-radius: 14px; font-size: .95rem; line-height: 1.45; animation: msgIn .35s var(--ease); }
@keyframes msgIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.msg.aj { align-self: flex-start; background: var(--surface-2); border: 1px solid var(--border); border-bottom-left-radius: 4px; color: var(--text); }
.msg.user { align-self: flex-end; background: var(--grad-btn); color: #fff; border-bottom-right-radius: 4px; }
.msg.aj a { color: var(--gold); }
.msg-typing { align-self: flex-start; display: inline-flex; gap: 4px; padding: 14px 16px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 14px; border-bottom-left-radius: 4px; }
.msg-typing span { width: 7px; height: 7px; border-radius: 50%; background: var(--text-faint); animation: blink2 1.2s infinite; }
.msg-typing span:nth-child(2) { animation-delay: .2s; } .msg-typing span:nth-child(3) { animation-delay: .4s; }
@keyframes blink2 { 0%,60%,100% { opacity: .3; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-3px); } }
.chat-cta { align-self: flex-start; max-width: 100%; }
.chat-cta .btn { margin-top: 4px; }
.chat-input { display: flex; align-items: center; gap: 10px; padding: 14px; border-top: 1px solid var(--border); }
.chat-input input { flex: 1; font: inherit; font-size: .95rem; color: var(--text); background: var(--surface); border: 1px solid var(--border-strong); border-radius: 100px; padding: 12px 18px; }
.chat-input input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(59,130,246,.18); }
.chat-send { flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--grad-btn); color: #fff; border: 0; cursor: pointer; transition: transform .2s var(--ease), box-shadow .2s var(--ease), opacity .2s var(--ease); box-shadow: 0 6px 18px -6px rgba(37,99,235,.7); }
.chat-send:hover { transform: translateY(-2px) scale(1.05); }
.chat-send:disabled { opacity: .4; cursor: not-allowed; transform: none; }
.intake-alt { margin-top: 16px; font-family: var(--font-mono); font-size: .82rem; color: var(--text-dim); text-align: center; }
.intake-alt a { color: var(--text-dim); transition: color .2s; }
.intake-alt a:hover { color: var(--blue); }

@media (max-width: 860px) {
  .intake-grid { grid-template-columns: 1fr; gap: 28px; }
  .intake-right { order: -1; }
  .chat { height: 460px; }
}

/* ---------- Footer ---------- */
.footer { text-align: center; padding: 34px 24px; border-top: 1px solid var(--border); color: var(--text-faint); font-size: .85rem; }

/* ---------- Tour button ---------- */
.btn-tour {
  position: relative; color: var(--text); background: var(--surface);
  border: 1px solid var(--border-strong); overflow: hidden;
}
.btn-tour::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px;
  background: var(--grad); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude; opacity: .8;
}
.btn-tour:hover { transform: translateY(-3px); box-shadow: var(--glow); }
.tour-play {
  display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%;
  background: var(--grad-btn); color: #fff; box-shadow: 0 0 0 0 rgba(59,130,246,.6);
  animation: tourPulse 2.2s infinite;
}
@keyframes tourPulse { 0%{box-shadow:0 0 0 0 rgba(59,130,246,.55);} 70%{box-shadow:0 0 0 9px rgba(59,130,246,0);} 100%{box-shadow:0 0 0 0 rgba(59,130,246,0);} }
.tour-hint { font-family: var(--font-mono); font-size: .72rem; color: var(--text-faint); font-weight: 400; }
.btn-tour.playing .tour-play { animation: none; }

/* ---------- Tour control bar ---------- */
.tour-bar {
  position: fixed; left: 50%; bottom: 22px; transform: translate(-50%, 130%);
  z-index: 80; width: min(620px, calc(100vw - 32px));
  display: flex; align-items: center; gap: 14px; padding: 14px 16px;
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  backdrop-filter: blur(18px) saturate(1.4);
  border: 1px solid var(--border-strong); border-radius: 16px;
  box-shadow: 0 24px 70px -20px rgba(0,0,0,.7), var(--glow);
  transition: transform .5s var(--ease), opacity .4s var(--ease); opacity: 0;
}
.tour-bar.show { transform: translate(-50%, 0); opacity: 1; }
.tour-bar[hidden] { display: none; }
.tb-main { flex: 1; min-width: 0; }
.tb-row { display: flex; align-items: baseline; gap: 10px; }
.tb-step { font-family: var(--font-mono); font-size: .72rem; color: var(--cyan); flex: none; }
.tb-title { font-family: var(--font-display); font-weight: 600; font-size: .96rem; color: var(--text); }
.tb-caption {
  font-size: .82rem; color: var(--text-dim); margin: 3px 0 8px; line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.tb-track { height: 4px; border-radius: 4px; background: var(--surface-2); overflow: hidden; }
.tb-track span { display: block; height: 100%; width: 0; background: var(--grad); transition: width .5s var(--ease); }
.tb-btn {
  flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 11px;
  background: var(--surface); border: 1px solid var(--border); color: var(--text); cursor: pointer;
  transition: color .2s var(--ease), border-color .2s var(--ease), background .2s var(--ease), transform .2s var(--ease);
}
.tb-btn:hover { border-color: var(--indigo); transform: translateY(-2px); }
.tb-toggle { background: var(--grad-btn); color: #fff; border-color: transparent; }
.tb-close:hover { border-color: var(--pink); color: var(--pink); }
.tb-btn .ic-play, .tour-bar.paused .tb-toggle .ic-pause { display: none; }
.tour-bar.paused .tb-toggle .ic-play { display: block; }
.tb-btn .ic-muted { display: none; }
.tour-bar.muted #tbMute .ic-vol { display: none; }
.tour-bar.muted #tbMute .ic-muted { display: block; }

/* Section spotlight during tour */
.tour-focus .sec-index {
  background: var(--grad-btn); color: #fff; border-color: transparent; box-shadow: var(--glow);
  transition: all .4s var(--ease);
}
.tour-focus .sec-title { transition: text-shadow .4s; }
@media (max-width: 680px) {
  .tour-bar { bottom: 12px; padding: 12px; gap: 10px; }
  .tb-caption { -webkit-line-clamp: 3; }
}

/* ============================================================
   CREATIVE SPACE — full-screen idea lab takeover
   ============================================================ */

/* Nav trigger button — static blue→gold gradient border (on-palette, no spin) */
.btn-creative {
  position: relative; display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--font-display); font-weight: 600; font-size: .9rem; cursor: pointer;
  color: var(--text); background: var(--surface); border: 1px solid transparent;
  padding: 9px 16px; border-radius: 100px; min-height: 44px;
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.btn-creative::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px; pointer-events: none;
  background: linear-gradient(135deg, var(--blue), var(--gold));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  opacity: .55; transition: opacity var(--dur) var(--ease);
}
.btn-creative:hover { transform: translateY(-2px); box-shadow: 0 10px 30px -10px rgba(59,130,246,.5); }
.btn-creative:hover::before { opacity: 1; }
.cb-spark { color: var(--gold); font-size: 1rem; }
.mm-creative { color: var(--blue) !important; font-weight: 600; }

/* Creative Space attention cue — glow pulse + hand pointer + hint */
.cs-wrap { position: relative; display: inline-flex; }
.nav-creative { animation: csGlow 2.8s ease-in-out infinite; }
@keyframes csGlow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(242,184,75,0); }
  50% { box-shadow: 0 0 24px -4px rgba(242,184,75,.6), 0 0 0 4px rgba(242,184,75,.10); }
}
.nav-creative:hover { animation: none; }
/* animated tapping hand + click ripple ("tap here" cue) */
.cs-tap { position: absolute; top: calc(100% - 2px); right: 16px; z-index: 5; width: 30px; height: 34px; pointer-events: none; }
.cs-finger { position: absolute; inset: 0; width: 100%; height: 100%; transform-origin: 50% 8%;
  filter: drop-shadow(0 3px 5px rgba(0,0,0,.5)); animation: fingerTap 1.5s ease-in-out infinite; }
@keyframes fingerTap {
  0%, 100% { transform: translateY(0) scale(1); }
  32% { transform: translateY(-8px) scale(.93); }
  55% { transform: translateY(0) scale(1); }
}
.cs-ripple { position: absolute; top: -7px; left: 50%; width: 20px; height: 20px; margin-left: -10px;
  border-radius: 50%; border: 2px solid var(--gold); opacity: 0; animation: tapRipple 1.5s ease-out infinite; }
@keyframes tapRipple {
  0%, 26% { transform: scale(.35); opacity: 0; }
  36% { transform: scale(.5); opacity: .95; }
  68% { transform: scale(1.6); opacity: 0; }
  100% { opacity: 0; }
}
.cs-wrap:hover .cs-tap { opacity: 0; transition: opacity .2s; }
@media (prefers-reduced-motion: reduce) { .nav-creative, .cs-finger, .cs-ripple { animation: none; } }


/* ---------- Reveal animation ---------- */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

/* ---------- Focus-visible (keyboard navigation) ---------- */
:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; border-radius: 6px; }
.nav-links a:focus-visible { outline-color: var(--gold); }
.nav-links a:focus-visible::after { width: 100%; }
.btn-primary:focus-visible, .chat-send:focus-visible, .btn-creative:focus-visible { outline-offset: 4px; }

/* ---------- Print ---------- */
@media print {
  html, body { background: #fff !important; color: #111 !important; }
  .bg-mesh, #constellation, .nav, .mobile-menu, .hero-orbit, .hero-socials,
  .chat, .tour-bar, .scroll-hint, .skip-link, .theme-toggle, .cs-wrap { display: none !important; }
  * { box-shadow: none !important; text-shadow: none !important; }
  .section, .hero { padding: 16px 0 !important; min-height: auto !important; }
  h1, h2, h3, .stat-num, .name-gold { color: #111 !important; background: none !important; -webkit-text-fill-color: #111 !important; }
  p, li, .hero-sub, .tl-body { color: #333 !important; }
  a { color: #1D4ED8 !important; text-decoration: underline; }
  a[href^="http"]::after { content: " (" attr(href) ")"; font-size: .8em; color: #555; }
  .reveal { opacity: 1 !important; transform: none !important; }
}

/* Cross-document view transitions (Chrome 126+; others ignore) */
@view-transition { navigation: auto; }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .hero { grid-template-columns: 1fr; min-height: auto; padding-top: 120px; gap: 30px; }
  .hero-orbit { justify-self: center; max-width: 100%; order: 3; }
  .about-grid { grid-template-columns: 1fr; }
  .projects-grid { grid-template-columns: repeat(2, 1fr); }
  .stats { grid-template-columns: repeat(2, 1fr); }
}
/* Nav collapses to hamburger at 900px — desktop nav needs ~860px of room */
@media (max-width: 900px) {
  .nav-links, .resume-btn, .cs-wrap { display: none; }
  .hamburger { display: flex; }
}
@media (max-width: 680px) {
  .projects-grid, .about-highlights { grid-template-columns: 1fr; }
  .section { padding: var(--sp-8) var(--sp-4); }
  .hero { padding: 108px 20px 48px; }
  .scroll-hint { display: none; }
  .stats { gap: 12px; }
}
