/* ==========================================================================
   Areeba Fatah — Portfolio
   ========================================================================== */

:root {
  --void: #050c09;
  --panel: #0a1611;
  --raised: #102219;
  --line: #183126;
  --ink: #ecfbf3;
  --fog: #8aa698;
  --accent: #1a9a62;
  --accent-deep: #137a4d;
  --gold: #4ecf8e;
  --accent-rgb: 26, 154, 98;
  --gold-rgb: 78, 207, 142;
  --glass: rgba(5, 12, 9, 0.75);
  --shadow: 0 30px 80px -30px rgba(0, 0, 0, 0.85), 0 0 0 1px rgba(26, 154, 98, 0.04);
  --grad: linear-gradient(135deg, #1a9a62 0%, #4ecf8e 100%);
  --on-accent: #ffffff;

  --font-display: "Sora", sans-serif;
  --font-body: "Manrope", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;

  --radius: 18px;
  --radius-sm: 10px;
  --nav-h: 72px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

[data-theme="light"] {
  --void: #f3f9f5;
  --panel: #ffffff;
  --raised: #e7f3ec;
  --line: #d2e5da;
  --ink: #07170f;
  --fog: #4e665a;
  --accent: #0d9b58;
  --accent-deep: #087a45;
  --gold: #0b7d57;
  --accent-rgb: 13, 155, 88;
  --gold-rgb: 11, 125, 87;
  --glass: rgba(243, 249, 245, 0.8);
  --shadow: 0 30px 70px -35px rgba(10, 60, 35, 0.3);
  --grad: linear-gradient(135deg, #0d9b58 0%, #16c47a 100%);
  --on-accent: #ffffff;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  background: var(--void);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.7;
  overflow-x: hidden;
  transition: background 0.4s ease, color 0.4s ease;
}
img, svg, canvas { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
ul { list-style: none; }
::selection { background: rgba(var(--accent-rgb), 0.35); color: var(--ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

/* Subtle grain + grid atmosphere */
body::before {
  content: "";
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: -1;
  background:
    radial-gradient(900px 500px at 15% -10%, rgba(var(--accent-rgb), 0.10), transparent 70%),
    radial-gradient(700px 500px at 100% 30%, rgba(var(--accent-rgb), 0.06), transparent 70%);
}

/* ---------- Layout ---------- */
.container { width: min(1120px, 100% - 2.5rem); margin-inline: auto; }
.section { padding: 88px 0; position: relative; }
.section--tight { padding: 56px 0 0; }
.section--tight-top { padding-top: 36px; }
.section--panel { background: var(--panel); border-block: 1px solid var(--line); }
.section-head { margin-bottom: 44px; max-width: 720px; }
.section-head--center { margin-inline: auto; text-align: center; }
.section-head--row {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end;
  gap: 20px; max-width: none;
}
.section-head--row > div { max-width: 640px; }

main { padding-top: var(--nav-h); }

/* ---------- Typography ---------- */
h1, h2, h3, h4 { font-family: var(--font-display); line-height: 1.15; letter-spacing: -0.025em; }
h2 { font-size: clamp(1.7rem, 3.2vw, 2.45rem); font-weight: 700; }
.hl { color: var(--accent); }
h3 { font-size: 1.25rem; font-weight: 700; }
p { color: var(--fog); }
.lead { font-size: 1.08rem; color: var(--fog); max-width: 62ch; }
.mono { font-family: var(--font-mono); }
.grad-text {
  background: var(--grad);
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
}

.eyebrow {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 12px; letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 18px;
}
.eyebrow::before {
  content: ""; width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 12px rgba(var(--accent-rgb), 0.9);
}
@keyframes caret { 50% { opacity: 0; } }

/* ---------- Buttons (label swap on hover) ---------- */
.btn {
  position: relative;
  display: inline-grid;
  overflow: hidden;
  height: 50px;
  padding: 0 26px;
  border-radius: 12px;
  font-family: var(--font-body);
  font-size: 14px; font-weight: 600;
  letter-spacing: 0.01em;
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease), border-color 0.3s;
}
.btn span {
  grid-area: 1 / 1;
  display: flex; align-items: center; justify-content: center; gap: 0.5rem;
  transition: transform 0.45s var(--ease);
}
.btn span + span { transform: translateY(110%); }
.btn:hover span:first-child { transform: translateY(-110%); }
.btn:hover span + span { transform: translateY(0); }
.btn:hover { transform: translateY(-2px); }
.btn--fill { background: var(--accent); color: var(--on-accent); box-shadow: 0 12px 40px -12px rgba(var(--accent-rgb), 0.7); }
.btn--fill:hover { box-shadow: 0 16px 50px -10px rgba(var(--accent-rgb), 0.85); }
.btn--ghost { border: 1px solid var(--line); background: var(--panel); }
.btn--ghost:hover { border-color: var(--accent); }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; }

.link-arrow {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-family: var(--font-mono); font-size: 13px; letter-spacing: 0.06em;
  color: var(--accent);
}
.link-arrow::after { content: "→"; transition: transform 0.3s var(--ease); }
.link-arrow:hover::after { transform: translateX(5px); }

/* ---------- Navbar ---------- */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  height: var(--nav-h);
  background: var(--glass);
  backdrop-filter: blur(18px) saturate(1.4);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s, background 0.4s;
}
.nav.is-scrolled { border-bottom-color: var(--line); }
.nav__inner { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.logo { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 800; font-size: 1.2rem; }
.logo__mark {
  width: 36px; height: 36px; border-radius: 10px;
  display: grid; place-items: center;
  background: var(--grad); color: var(--on-accent);
  font-size: 0.95rem; letter-spacing: -0.04em;
}
.logo__dot { color: var(--gold); }
.nav__links { display: flex; align-items: center; gap: 6px; }
.nav__links a {
  position: relative;
  padding: 8px 14px;
  font-family: var(--font-body); font-size: 14px; font-weight: 500;
  color: var(--fog);
  border-radius: 10px;
  transition: color 0.25s, background 0.25s;
}
.nav__links a:hover { color: var(--ink); }
.nav__links a.is-active { color: var(--ink); background: rgba(var(--accent-rgb), 0.12); }
.nav__actions { display: flex; align-items: center; gap: 8px; }
.icon-btn {
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border: 1px solid var(--line); border-radius: 12px;
  transition: border-color 0.25s, transform 0.25s;
}
.icon-btn:hover { border-color: var(--accent); transform: rotate(-8deg); }
.icon-btn svg { width: 18px; height: 18px; }
.theme-toggle .icon-sun { display: none; }
[data-theme="light"] .theme-toggle .icon-sun { display: block; }
[data-theme="light"] .theme-toggle .icon-moon { display: none; }
.burger { display: none; }
.burger span, .burger span::before, .burger span::after {
  display: block; width: 18px; height: 2px; background: var(--ink); border-radius: 2px;
  position: relative; transition: transform 0.3s var(--ease), background 0.3s;
}
.burger span::before, .burger span::after { content: ""; position: absolute; left: 0; }
.burger span::before { top: -6px; }
.burger span::after { top: 6px; }
.nav.is-open .burger span { background: transparent; }
.nav.is-open .burger span::before { transform: translateY(6px) rotate(45deg); }
.nav.is-open .burger span::after { transform: translateY(-6px) rotate(-45deg); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: calc(100vh - var(--nav-h));
  display: flex; align-items: center;
  overflow: hidden;
  padding: 48px 0 64px;
}
#neural { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; opacity: 0.55; }
.hero::after {
  content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(640px 420px at 88% 18%, rgba(var(--accent-rgb), 0.16), transparent 70%),
    radial-gradient(480px 340px at 8% 88%, rgba(var(--gold-rgb), 0.08), transparent 70%),
    linear-gradient(to bottom, transparent 68%, var(--void));
}
.hero .container { position: relative; z-index: 1; }
.hero__grid { display: grid; grid-template-columns: 1fr; gap: 40px; align-items: center; }
.hero__grid > *, .detail-layout > *, .split > *, .grid > * { min-width: 0; }
.status-pill {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 7px 14px; margin-bottom: 22px;
  border: 1px solid var(--line); border-radius: 999px;
  background: rgba(var(--accent-rgb), 0.06);
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--fog);
}
.status-pill i {
  width: 8px; height: 8px; border-radius: 50%; background: var(--gold);
  box-shadow: 0 0 0 0 rgba(var(--gold-rgb), 0.7);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  70% { box-shadow: 0 0 0 10px rgba(var(--gold-rgb), 0); }
  100% { box-shadow: 0 0 0 0 rgba(var(--gold-rgb), 0); }
}
.hero__brand {
  font-family: var(--font-display); font-weight: 800;
  font-size: clamp(1.55rem, 3.4vw, 2.15rem);
  color: var(--ink); margin-bottom: 14px; letter-spacing: -0.03em;
}
.hero h1 {
  font-size: clamp(1.9rem, 4.2vw, 3.15rem);
  font-weight: 700;
  line-height: 1.12;
  max-width: 16ch;
}
.hero h1 .hl { display: inline; }
.typer {
  margin-top: 18px; min-height: 1.6em;
  font-family: var(--font-mono); font-size: clamp(0.95rem, 1.6vw, 1.15rem);
  color: var(--accent);
}
.typer::before { content: ""; }
.typer__cursor { display: inline-block; width: 0.5em; height: 1.05em; vertical-align: -0.12em; background: var(--gold); margin-left: 2px; animation: caret 1s steps(1) infinite; }
.hero__text { margin-top: 18px; max-width: 52ch; font-size: 1.05rem; line-height: 1.65; }
.hero .btn-row { margin-top: 30px; }

/* Clean hero highlight panel (replaces crowded dashboard) */
.hero-panel {
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background:
    linear-gradient(165deg, rgba(var(--accent-rgb), 0.08), transparent 45%),
    var(--panel);
  box-shadow: var(--shadow);
}
.hero-panel__head {
  display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between;
  gap: 8px 16px; margin-bottom: 22px; padding-bottom: 16px; border-bottom: 1px solid var(--line);
}
.hero-panel__role { display: block; font-family: var(--font-display); font-weight: 700; font-size: 1.05rem; }
.hero-panel__dates {
  display: block; margin-top: 4px;
  font-family: var(--font-mono); font-size: 12px; color: var(--fog);
}
.hero-panel__org {
  font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.08em;
  color: var(--accent); text-transform: uppercase; padding-top: 4px;
}
.hero-panel__list { display: grid; gap: 16px; }
.hero-panel__list li { display: grid; gap: 2px; }
.hero-panel__list strong {
  font-family: var(--font-display); font-size: 1.35rem; font-weight: 800; color: var(--ink); line-height: 1.2;
}
.hero-panel__list span { font-size: 0.92rem; color: var(--fog); }
.hero-panel__tags {
  display: flex; flex-wrap: wrap; gap: 8px; margin-top: 24px; padding-top: 18px;
  border-top: 1px solid var(--line);
}
.hero-panel__tags span {
  padding: 5px 11px; border-radius: 8px;
  font-family: var(--font-mono); font-size: 11.5px;
  color: var(--ink); background: var(--raised); border: 1px solid var(--line);
}

.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px 28px; margin-top: 46px; }
.stat__label { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.22em; text-transform: uppercase; color: var(--fog); }
.stat__value { font-family: var(--font-display); font-weight: 700; font-size: 1.7rem; color: var(--ink); }

/* Terminal card in hero */
.terminal {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--panel) 88%, transparent);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.terminal__bar { display: flex; align-items: center; gap: 7px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.terminal__bar i { width: 11px; height: 11px; border-radius: 50%; background: var(--line); }
.terminal__bar i:nth-child(1) { background: #ff6b6b; }
.terminal__bar i:nth-child(2) { background: var(--gold); }
.terminal__bar i:nth-child(3) { background: var(--accent); }
.terminal__bar span { margin-left: auto; font-family: var(--font-mono); font-size: 11px; color: var(--fog); }
.terminal__body { padding: 22px 22px 26px; font-family: var(--font-mono); font-size: 13px; line-height: 1.9; overflow-x: auto; }
.terminal__body pre { font-family: inherit; }
.terminal__body .k { color: var(--accent); }
.terminal__body .s { color: var(--gold); }
.terminal__body .c { color: var(--fog); }
.terminal__body .p { color: var(--ink); }

/* ---------- Toolkit strip ---------- */
.toolkit {
  border-block: 1px solid var(--line);
  padding: 28px 0;
  background: color-mix(in srgb, var(--panel) 70%, transparent);
}
.toolkit__label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 16px;
}
.toolkit__list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 12px;
}
.toolkit__list li {
  padding: 9px 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--panel);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  white-space: nowrap;
}

/* ---------- Cards ---------- */
.card {
  position: relative;
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  transition: transform 0.45s var(--ease), border-color 0.3s, box-shadow 0.45s var(--ease);
}
.section--panel .card { background: var(--void); }
.card:hover { border-color: rgba(var(--accent-rgb), 0.5); box-shadow: var(--shadow); }
.card h3 { margin-bottom: 10px; }

.grid { display: grid; gap: 22px; }
.grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }

.icon-tile {
  width: 46px; height: 46px; margin-bottom: 20px;
  border-radius: 12px;
  display: grid; place-items: center;
  background: rgba(var(--accent-rgb), 0.1);
  color: var(--accent);
  border: 1px solid rgba(var(--accent-rgb), 0.25);
}
.icon-tile svg { width: 22px; height: 22px; }

/* Project cards with gradient border + tilt */
.project-card {
  position: relative;
  display: flex; flex-direction: column;
  padding: 28px;
  border-radius: var(--radius);
  background: var(--panel);
  border: 1px solid var(--line);
  transform-style: preserve-3d;
  transition: transform 0.4s var(--ease), border-color 0.3s, box-shadow 0.4s var(--ease), opacity 0.4s, scale 0.4s;
  isolation: isolate;
  min-height: 100%;
}
.section--panel .project-card { background: var(--void); }
.project-card::before {
  content: ""; position: absolute; inset: -1px; z-index: -1;
  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: 0; transition: opacity 0.4s;
}
.project-card::after {
  content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit;
  background: radial-gradient(400px circle at var(--mx, 50%) var(--my, 0%), rgba(var(--accent-rgb), 0.12), transparent 50%);
  opacity: 0; transition: opacity 0.4s;
}
.project-card:hover { box-shadow: var(--shadow); border-color: transparent; }
.project-card:hover::before, .project-card:hover::after { opacity: 1; }
.project-card__top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 22px; }
.project-card__idx { font-family: var(--font-mono); font-size: 12px; color: var(--fog); }
.project-card h3 { font-size: 1.35rem; margin-bottom: 10px; }
.project-card p { font-size: 0.95rem; flex: 1; }
.project-card .chips { margin-top: 22px; }
.project-card__metric {
  display: flex; align-items: baseline; gap: 8px; margin-top: 20px;
  padding-top: 18px; border-top: 1px dashed var(--line);
}
.project-card__metric b { font-family: var(--font-display); font-size: 1.5rem; }
.project-card__metric span { font-family: var(--font-mono); font-size: 11px; color: var(--fog); letter-spacing: 0.08em; text-transform: uppercase; }
.project-card .link-arrow { margin-top: 18px; }
.project-card.is-hidden { display: none; }

.tag {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 11px;
  border-radius: 999px;
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--gold);
  border: 1px solid rgba(var(--gold-rgb), 0.35);
  background: rgba(var(--gold-rgb), 0.07);
}
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 5px 12px;
  border-radius: 8px;
  font-family: var(--font-mono); font-size: 12px;
  color: var(--ink);
  background: var(--raised);
  border: 1px solid var(--line);
}

/* Mini "other work" cards */
.mini-card {
  display: flex; flex-direction: column; gap: 8px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--panel);
  transition: border-color 0.3s, transform 0.35s var(--ease);
}
.mini-card:hover { border-color: rgba(var(--accent-rgb), 0.5); transform: translateY(-4px); }
.mini-card h4 { font-size: 1.05rem; }
.mini-card p { font-size: 0.9rem; }
.mini-card small { font-family: var(--font-mono); font-size: 11px; color: var(--accent); letter-spacing: 0.06em; }

/* ---------- Filters ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 44px; }
.filter {
  padding: 9px 18px;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-family: var(--font-mono); font-size: 12.5px;
  color: var(--fog);
  transition: all 0.3s var(--ease);
}
.filter:hover { color: var(--ink); border-color: var(--accent); }
.filter.is-active { color: var(--on-accent); background: var(--grad); border-color: transparent; }
.filter sup { font-size: 10px; margin-left: 3px; opacity: 0.7; }

/* ---------- Page header (inner pages) ---------- */
.page-head { padding: 72px 0 48px; position: relative; overflow: hidden; }
.page-head::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; z-index: -1;
  background: radial-gradient(700px 360px at 80% 0%, rgba(var(--accent-rgb), 0.14), transparent 70%);
}
.page-head h1 { font-size: clamp(2rem, 4.8vw, 3.4rem); font-weight: 800; letter-spacing: -0.03em; margin-bottom: 16px; max-width: 18ch; }

/* ---------- About / timeline ---------- */
.split { display: grid; gap: 48px; grid-template-columns: 1fr; }
.timeline { position: relative; padding-left: 30px; }
.timeline::before { content: ""; position: absolute; left: 6px; top: 8px; bottom: 8px; width: 1px; background: linear-gradient(var(--accent), var(--gold), transparent); }
.timeline__item { position: relative; padding-bottom: 42px; }
.timeline__item:last-child { padding-bottom: 0; }
.timeline__item::before {
  content: ""; position: absolute; left: -30px; top: 8px;
  width: 13px; height: 13px; border-radius: 50%;
  background: var(--void); border: 2px solid var(--accent);
  box-shadow: 0 0 0 5px rgba(var(--accent-rgb), 0.12);
}
.timeline__meta { font-family: var(--font-mono); font-size: 12px; color: var(--gold); letter-spacing: 0.1em; text-transform: uppercase; }
.timeline__item h3 { margin: 6px 0 4px; }
.timeline__org { color: var(--accent); font-family: var(--font-mono); font-size: 13px; margin-bottom: 14px; }
.bullets li { position: relative; padding-left: 22px; margin-bottom: 9px; color: var(--fog); }
.bullets li::before { content: "▹"; position: absolute; left: 0; color: var(--accent); }
.bullets li strong { color: var(--ink); font-weight: 500; }

.skill-group h4 { font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--gold); margin-bottom: 14px; font-weight: 500; }
.skills-grid { display: grid; gap: 28px; }
.skill-group {
  padding: 0;
  border: 0;
  background: transparent;
}
.chip--accent {
  color: var(--on-accent);
  background: var(--accent);
  border-color: transparent;
  font-weight: 600;
}

.edu-block {
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--void);
}
.section--panel .edu-block { background: var(--void); }
.awards-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }

.focus-list {
  display: grid;
  gap: 0;
  border-top: 1px solid var(--line);
}
.focus-item {
  padding: 28px 0;
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 10px;
}
.focus-item h3 { margin: 0; }
@media (min-width: 700px) {
  .focus-item {
    grid-template-columns: 240px 1fr;
    gap: 32px;
    align-items: start;
  }
}

.award { display: flex; gap: 16px; align-items: flex-start; }
.award__num { font-family: var(--font-display); font-size: 2.2rem; font-weight: 800; line-height: 1; color: var(--ink); }
.award p strong { color: var(--ink); }

/* ---------- Detail page ---------- */
.breadcrumb { font-family: var(--font-mono); font-size: 12.5px; color: var(--fog); margin-bottom: 30px; display: flex; flex-wrap: wrap; gap: 8px; }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb span { color: var(--line); }
.detail-hero { padding: 70px 0 50px; position: relative; }
.detail-hero::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; z-index: -1;
  background: radial-gradient(800px 420px at 90% 0%, rgba(var(--accent-rgb), 0.18), transparent 70%),
              radial-gradient(500px 300px at 0% 100%, rgba(var(--gold-rgb), 0.08), transparent 70%);
}
.detail-hero h1 { font-size: clamp(2rem, 4.8vw, 3.4rem); font-weight: 800; letter-spacing: -0.03em; margin: 18px 0; max-width: 18ch; }
.detail-hero .lead { font-size: 1.15rem; }
.meta-row { display: flex; flex-wrap: wrap; gap: 14px 34px; margin-top: 34px; padding-top: 26px; border-top: 1px solid var(--line); }
.meta-row div { display: flex; flex-direction: column; gap: 3px; }
.meta-row dt { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--fog); }
.meta-row dd { color: var(--ink); font-weight: 500; }

.detail-layout { display: grid; grid-template-columns: 1fr; gap: 56px; }
.detail-block { margin-bottom: 64px; }
.detail-block:last-child { margin-bottom: 0; }
.detail-block h2 { font-size: clamp(1.5rem, 3vw, 2rem); margin-bottom: 20px; display: flex; align-items: baseline; gap: 14px; }
.detail-block h2 small { font-family: var(--font-mono); font-size: 12px; color: var(--accent); font-weight: 400; letter-spacing: 0.1em; }
.detail-block > p { margin-bottom: 14px; font-size: 1.04rem; }

.pipeline { display: grid; gap: 14px; counter-reset: step; }
.pipeline__step {
  position: relative;
  padding: 20px 22px 20px 66px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--panel);
  counter-increment: step;
}
.pipeline__step::before {
  content: counter(step, decimal-leading-zero);
  position: absolute; left: 20px; top: 20px;
  font-family: var(--font-mono); font-size: 13px; color: var(--accent);
}
.pipeline__step:not(:last-child)::after {
  content: ""; position: absolute; left: 30px; bottom: -15px; width: 1px; height: 14px; background: var(--accent);
}
.pipeline__step h4 { font-family: var(--font-body); font-size: 1.02rem; font-weight: 600; letter-spacing: 0; margin-bottom: 4px; }
.pipeline__step p { font-size: 0.93rem; }

.metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; }
.metric {
  padding: 24px 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: linear-gradient(160deg, rgba(var(--accent-rgb), 0.08), transparent 60%), var(--panel);
}
.metric__value { font-family: var(--font-display); font-weight: 800; font-size: 2.1rem; line-height: 1.1; }
.metric__label { margin-top: 6px; font-family: var(--font-mono); font-size: 11.5px; color: var(--fog); letter-spacing: 0.04em; }
.note {
  margin-top: 16px; padding: 14px 18px;
  border-left: 2px solid var(--gold);
  background: rgba(var(--gold-rgb), 0.06);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 0.9rem; color: var(--fog);
}

.aside-card { position: sticky; top: calc(var(--nav-h) + 24px); display: grid; gap: 22px; }
.aside-card .card { padding: 24px; }
.aside-card h4 { font-family: var(--font-mono); font-size: 11.5px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--gold); margin-bottom: 14px; font-weight: 500; }

.pager { display: grid; grid-template-columns: 1fr; gap: 14px; margin-top: 80px; }
.pager a {
  display: flex; flex-direction: column; gap: 6px;
  padding: 24px; border: 1px solid var(--line); border-radius: var(--radius);
  transition: border-color 0.3s, transform 0.35s var(--ease);
}
.pager a:hover { border-color: var(--accent); transform: translateY(-3px); }
.pager small { font-family: var(--font-mono); font-size: 11.5px; color: var(--accent); letter-spacing: 0.12em; text-transform: uppercase; }
.pager b { font-family: var(--font-display); font-size: 1.2rem; }
.pager__next { text-align: right; }

/* ---------- Contact ---------- */
.contact-card {
  display: flex; align-items: center; gap: 18px;
  padding: 24px;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--panel);
  transition: border-color 0.3s, transform 0.35s var(--ease);
}
.contact-card:hover { border-color: var(--accent); transform: translateY(-3px); }
.contact-card .icon-tile { margin: 0; flex-shrink: 0; }
.contact-card small { display: block; font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--fog); }
.contact-card b { font-weight: 500; word-break: break-word; }

.cta {
  position: relative; overflow: hidden;
  padding: 56px 36px;
  border-radius: 24px;
  border: 1px solid var(--line);
  background:
    radial-gradient(500px 300px at 100% 0%, rgba(var(--accent-rgb), 0.18), transparent 70%),
    radial-gradient(400px 260px at 0% 100%, rgba(var(--gold-rgb), 0.10), transparent 70%),
    var(--panel);
  text-align: center;
}
.cta h2 { max-width: 22ch; margin: 0 auto 16px; font-size: clamp(1.6rem, 3vw, 2.2rem); }
.cta p { max-width: 52ch; margin: 0 auto 28px; }
.cta .btn-row { justify-content: center; }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--line); padding: 50px 0 36px; margin-top: 40px; }
.footer__grid { display: grid; gap: 30px; grid-template-columns: 1fr; align-items: start; }
.footer__links { display: flex; flex-wrap: wrap; gap: 8px 22px; font-family: var(--font-mono); font-size: 13px; color: var(--fog); }
.footer__links a:hover { color: var(--accent); }
.socials { display: flex; gap: 10px; }
.footer__bottom { margin-top: 36px; padding-top: 24px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; font-family: var(--font-mono); font-size: 12px; color: var(--fog); }

/* ---------- Floating UI ---------- */
.cursor-glow {
  position: fixed; left: 0; top: 0; z-index: -1;
  width: 520px; height: 520px; margin: -260px 0 0 -260px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(var(--accent-rgb), 0.10), transparent 60%);
  pointer-events: none;
  transition: opacity 0.4s;
  will-change: transform;
}
.to-top {
  position: fixed; right: 22px; bottom: 22px; z-index: 40;
  width: 46px; height: 46px; border-radius: 14px;
  display: grid; place-items: center;
  background: var(--grad); color: var(--on-accent);
  box-shadow: 0 10px 30px -8px rgba(var(--accent-rgb), 0.6);
  opacity: 0; transform: translateY(16px); pointer-events: none;
  transition: opacity 0.3s, transform 0.3s var(--ease);
}
.to-top.is-visible { opacity: 1; transform: none; pointer-events: auto; }
.to-top svg { width: 18px; height: 18px; }

/* ---------- Reveal animations ---------- */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity 0.9s var(--ease), transform 0.9s var(--ease); }
.reveal.is-in { opacity: 1; transform: none; }
.project-card.reveal.is-in { transition: transform 0.25s ease-out, border-color 0.3s, box-shadow 0.4s var(--ease), opacity 0.6s; transition-delay: 0s; }
.reveal[data-delay="1"] { transition-delay: 0.08s; }
.reveal[data-delay="2"] { transition-delay: 0.16s; }
.reveal[data-delay="3"] { transition-delay: 0.24s; }
.reveal[data-delay="4"] { transition-delay: 0.32s; }

.rise { animation: rise 1s var(--ease) both; }
.rise-2 { animation: rise 1s 0.15s var(--ease) both; }
@keyframes rise { from { opacity: 0; transform: translateY(24px); } }

/* ---------- Dashboard hero panel ---------- */
.dash {
  position: relative;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background:
    radial-gradient(420px 260px at 100% 0%, rgba(var(--accent-rgb), 0.14), transparent 70%),
    var(--panel);
  box-shadow: var(--shadow);
}
.dash__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.dash__title { font-family: var(--font-display); font-weight: 600; font-size: 0.95rem; }
.dash__live { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--accent); font-weight: 500; }
.dash__live::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); animation: pulse 2s infinite; box-shadow: 0 0 0 0 rgba(var(--accent-rgb), .6); }
.dash__row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.dash__kpi {
  padding: 16px; border-radius: 14px;
  background: var(--raised); border: 1px solid var(--line);
}
.dash__kpi small { display: block; font-size: 12px; color: var(--fog); }
.dash__kpi b { display: block; font-family: var(--font-display); font-size: 1.9rem; line-height: 1.2; margin-top: 4px; }
.dash__kpi i { font-style: normal; display: inline-block; margin-top: 6px; padding: 2px 8px; border-radius: 6px; font-size: 11px; font-weight: 600; color: var(--on-accent); background: var(--accent); }
.dash__chart {
  margin-top: 12px; padding: 16px 16px 10px;
  border-radius: 14px; background: var(--raised); border: 1px solid var(--line);
}
.dash__chart-head { display: flex; justify-content: space-between; font-size: 12px; color: var(--fog); margin-bottom: 12px; }
.dash__chart-head b { color: var(--ink); font-weight: 600; }
.bars { display: flex; align-items: flex-end; gap: 8px; height: 110px; }
.bars span {
  flex: 1; height: var(--h); border-radius: 6px 6px 3px 3px;
  background: linear-gradient(to top, rgba(var(--accent-rgb), 0.25), rgba(var(--accent-rgb), 0.55));
  transform-origin: bottom; animation: grow 1.2s var(--ease) both;
}
.bars span:last-child { background: var(--accent); box-shadow: 0 0 20px rgba(var(--accent-rgb), .5); }
.bars span:nth-child(2) { animation-delay: .05s } .bars span:nth-child(3) { animation-delay: .1s }
.bars span:nth-child(4) { animation-delay: .15s } .bars span:nth-child(5) { animation-delay: .2s }
.bars span:nth-child(6) { animation-delay: .25s } .bars span:nth-child(7) { animation-delay: .3s }
@keyframes grow { from { transform: scaleY(0); } }
.bars-x { display: flex; gap: 8px; margin-top: 8px; }
.bars-x span { flex: 1; text-align: center; font-family: var(--font-mono); font-size: 10px; color: var(--fog); }
.dash__list { margin-top: 12px; display: grid; gap: 10px; }
.dash__item { display: grid; grid-template-columns: 1fr 90px auto; align-items: center; gap: 12px; font-size: 13px; }
.dash__item span:first-child { color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.meter { height: 6px; border-radius: 6px; background: var(--line); overflow: hidden; }
.meter i { display: block; height: 100%; width: var(--w); background: var(--accent); border-radius: inherit; }
.dash__item b { font-family: var(--font-mono); font-size: 12px; color: var(--accent); font-weight: 500; }
.dash__badge {
  position: absolute; top: -22px; right: -14px;
  width: 78px; height: 78px; border-radius: 50%;
  display: grid; place-items: center; text-align: center;
  background: var(--accent); color: var(--on-accent);
  font-family: var(--font-display); font-weight: 800; font-size: 1.05rem; line-height: 1;
  box-shadow: 0 0 0 8px rgba(var(--accent-rgb), 0.12), 0 20px 40px -10px rgba(var(--accent-rgb), .6);
  animation: float 5s ease-in-out infinite;
}
.dash__badge small { display: block; font-family: var(--font-body); font-size: 9px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; margin-top: 3px; }
@keyframes float { 50% { transform: translateY(-8px); } }

/* ---------- Stats band ---------- */
.stats-band { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.stat-card {
  padding: 22px 20px; border-radius: 16px;
  border: 1px solid var(--line); background: var(--panel);
}
.stat-card b { display: block; font-family: var(--font-display); font-size: clamp(1.7rem, 3.4vw, 2.3rem); font-weight: 800; color: var(--accent); line-height: 1.1; }
.stat-card span { font-size: 13.5px; color: var(--fog); }

/* ---------- Project thumbnails ---------- */
.project-card__thumb {
  position: relative; overflow: hidden;
  height: 150px; margin: -8px -8px 22px; border-radius: 14px;
  border: 1px solid var(--line);
  background:
    radial-gradient(260px 160px at var(--tx, 80%) 0%, rgba(var(--accent-rgb), 0.35), transparent 70%),
    linear-gradient(rgba(var(--accent-rgb), 0.07) 1px, transparent 1px) 0 0 / 22px 22px,
    linear-gradient(90deg, rgba(var(--accent-rgb), 0.07) 1px, transparent 1px) 0 0 / 22px 22px,
    var(--raised);
  display: flex; flex-direction: column; justify-content: flex-start; padding: 18px 18px;
}
.project-card__thumb svg { position: absolute; inset: auto 0 0 0; width: 100%; height: 50%; opacity: .9; }
.project-card__thumb > b { position: relative; font-family: var(--font-display); font-weight: 800; font-size: 1.9rem; line-height: 1; color: var(--ink); }
.project-card__thumb > span { position: relative; font-size: 12px; color: var(--fog); margin-top: 6px; }
.project-card__thumb .project-card__idx { position: absolute; top: 14px; right: 16px; margin: 0; }

/* Card surface: soft green glow at top */
.card, .project-card, .mini-card, .contact-card, .metric, .pipeline__step {
  background-image: linear-gradient(180deg, rgba(var(--accent-rgb), 0.045), transparent 40%);
}
.tag { color: var(--accent); border-color: rgba(var(--accent-rgb), .35); background: rgba(var(--accent-rgb), .08); }

/* ---------- Responsive ---------- */
@media (min-width: 640px) {
  .stats { grid-template-columns: repeat(4, auto); justify-content: start; gap: 28px 44px; }
  .stats-band { grid-template-columns: repeat(4, 1fr); }
  .grid-2 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .pager { grid-template-columns: 1fr 1fr; }
  .footer__grid { grid-template-columns: 1fr auto; }
}

@media (min-width: 900px) {
  .hero__grid { grid-template-columns: 1.2fr 0.9fr; gap: 56px; }
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
  .grid-4 { grid-template-columns: repeat(4, 1fr); }
  .split { grid-template-columns: 0.9fr 1.1fr; gap: 64px; }
  .detail-layout { grid-template-columns: 1fr 320px; gap: 64px; }
  .pipeline--row { grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); }
}

@media (max-width: 899px) {
  .burger { display: grid; }
  .nav__links {
    position: fixed; top: var(--nav-h); left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 4px;
    padding: 16px 20px 26px;
    background: var(--void);
    border-bottom: 1px solid var(--line);
    transform: translateY(-120%);
    opacity: 0;
    transition: transform 0.45s var(--ease), opacity 0.3s;
    z-index: -1;
  }
  .nav.is-open .nav__links { transform: none; opacity: 1; }
  .nav__links a { padding: 14px 16px; font-size: 15px; border-radius: 12px; }
  .aside-card { position: static; }
  .section { padding: 68px 0; }
  .hero { min-height: auto; padding: 40px 0 48px; }
  .cursor-glow { display: none; }
}

@media (max-width: 639px) {
  .nav__cv { display: none; }
  .hero-panel { padding: 22px; }
  .hero-panel__list strong { font-size: 1.2rem; }
  .cta { padding: 42px 22px; }
  .card, .project-card { padding: 22px; }
  .edu-block { padding: 22px; }
  .terminal__body { font-size: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; }
}
