/* Rodrigo Valle — Portfolio
   Dark editorial. Built around CSS custom props so theme & accent are tweakable. */

:root {
  /* Dark — verified WCAG 2.2 AA:
     #F5F5F0 on #0E0E0E ≈ 18.6:1 (AAA body)
     #A6A6A2 on #0E0E0E ≈ 8.1:1  (AAA body)  — was #888887
     #8A8A86 on #0E0E0E ≈ 5.6:1  (AA body)   — was #5A5A58, only used for ≥12px UI labels
     #7FB3A8 on #0E0E0E ≈ 9.4:1  (AAA)
     border 3:1 contrast for non-text UI per SC 1.4.11 */
  --bg: #0E0E0E;
  --surface: #161616;
  --surface-2: #1B1B1B;
  --border: rgba(255, 255, 255, 0.14);
  --border-strong: rgba(255, 255, 255, 0.22);
  --text: #F5F5F0;
  --text-muted: #A6A6A2;
  --text-dim: #8A8A86;
  --accent: #7FB3A8; /* muted teal */
  --accent-soft: rgba(127, 179, 168, 0.14);

  --maxw: 1200px;
  --pad: clamp(20px, 4vw, 56px);
  --gutter: clamp(16px, 2vw, 28px);

  --font: "Hellix", "Manrope", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --t: 200ms;

  color-scheme: dark;
}

[data-theme="light"] {
  /* Light — verified WCAG 2.2 AA:
     #14140F on #F7F6F2 ≈ 17.4:1 (AAA body)
     #4F4F4B on #F7F6F2 ≈ 7.9:1  (AAA body)  — was #5C5C58 (still passing)
     #6F6F6A on #F7F6F2 ≈ 4.9:1  (AA body)   — was #A8A6A0 (failed)
     #2F6F62 on #F7F6F2 ≈ 5.8:1  (AA)        */
  --bg: #F7F6F2;
  --surface: #FFFFFF;
  --surface-2: #EDEBE5;
  --border: rgba(14, 14, 14, 0.16);
  --border-strong: rgba(14, 14, 14, 0.28);
  --text: #14140F;
  --text-muted: #4F4F4B;
  --text-dim: #6F6F6A;
  --accent: #2F6F62;
  --accent-soft: rgba(47, 111, 98, 0.10);
  color-scheme: light;
}

/* Reset */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: transparent;
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.7;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-feature-settings: "ss01", "cv11";
  transition: background-color var(--t) var(--ease), color var(--t) var(--ease);
}
img, svg { display: block; max-width: 100%; }
button { font-family: inherit; }

/* Layout */
.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding-left: var(--pad);
  padding-right: var(--pad);
}

/* Top nav */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in oklab, var(--bg) 86%, transparent);
  backdrop-filter: saturate(140%) blur(12px);
  -webkit-backdrop-filter: saturate(140%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 64px;
}
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  color: var(--text); text-decoration: none;
  font-weight: 500; font-size: 14px; letter-spacing: -0.005em;
}
.brand .mark {
  width: 22px; height: 22px; border-radius: 4px;
  border: 1px solid var(--border-strong);
  display: grid; place-items: center;
  font-size: 11px; font-weight: 500; letter-spacing: 0.04em;
  color: var(--text-muted);
}
.brand:hover .mark { color: var(--accent); border-color: var(--accent); transition: all var(--t) var(--ease); }
.nav-links { display: flex; gap: 28px; align-items: center; }
.nav-links a {
  color: var(--text-muted); text-decoration: none;
  font-size: 13px; letter-spacing: 0.005em;
  transition: color var(--t) var(--ease);
}
.nav-links a:hover, .nav-links a.active { color: var(--text); }
.nav-links a.active::after {
  content: ""; display: block; height: 1px; background: var(--accent);
  margin-top: 4px;
}
.nav-cta {
  font-size: 13px; color: var(--text);
  border: 1px solid var(--border-strong);
  padding: 7px 14px; border-radius: 999px;
  text-decoration: none;
  transition: all var(--t) var(--ease);
}
.nav-cta:hover { border-color: var(--accent); color: var(--accent); }

/* Type scale */
.eyebrow {
  font-size: 11.5px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--text-dim); font-weight: 500;
}
.eyebrow .dot {
  display: inline-block; width: 6px; height: 6px; border-radius: 999px;
  background: var(--accent); margin-right: 10px; vertical-align: middle;
  box-shadow: 0 0 0 4px var(--accent-soft);
}
h1, h2, h3, h4 { font-weight: 300; letter-spacing: -0.02em; line-height: 1.08; margin: 0; }
h1 { font-size: clamp(40px, 6.4vw, 92px); letter-spacing: -0.035em; }
h2 { font-size: clamp(30px, 3.4vw, 48px); letter-spacing: -0.025em; }
h3 { font-size: clamp(20px, 1.8vw, 26px); font-weight: 400; letter-spacing: -0.012em; }
p { margin: 0; color: var(--text-muted); }
p.lead { color: var(--text); font-size: 18px; line-height: 1.6; max-width: 64ch; font-weight: 300; }
.text-pri { color: var(--text); }
.text-mut { color: var(--text-muted); }
.text-dim { color: var(--text-dim); }
.text-acc { color: var(--accent); }

a.link {
  color: var(--text); text-decoration: none;
  border-bottom: 1px solid var(--border-strong);
  transition: border-color var(--t) var(--ease), color var(--t) var(--ease);
}
a.link:hover { color: var(--accent); border-bottom-color: var(--accent); }

/* Section spacing */
section { padding: clamp(72px, 10vw, 144px) 0; border-bottom: 1px solid var(--border); }
section.tight { padding: clamp(56px, 7vw, 96px) 0; }
section:last-of-type { border-bottom: 0; }

/* Hero */
.hero { padding-top: clamp(80px, 11vw, 168px); padding-bottom: clamp(64px, 8vw, 120px); }
.hero h1 { max-width: 14ch; margin-bottom: 32px; }
.hero .sub { max-width: 56ch; }
.hero-meta {
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
  margin-top: 48px;
}
.cta {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 22px;
  background: var(--text); color: var(--bg);
  border: 1px solid var(--text);
  border-radius: 999px; text-decoration: none;
  font-size: 14px; font-weight: 500; letter-spacing: -0.005em;
  transition: all var(--t) var(--ease);
}
.cta:hover { background: var(--accent); border-color: var(--accent); color: var(--bg); }
.cta .arrow { transition: transform var(--t) var(--ease); }
.cta:hover .arrow { transform: translateX(3px); }

.cta-ghost {
  display: inline-flex; align-items: center; gap: 8px;
  color: var(--text-muted); font-size: 13px; text-decoration: none;
  transition: color var(--t) var(--ease);
}
.cta-ghost::before {
  content: ""; display: inline-block; width: 6px; height: 6px;
  border-radius: 999px; background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}
.cta-ghost:hover { color: var(--text); }

/* Stats bar */
.stats {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 0; border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.stat { padding: 36px 28px 36px 10px; border-right: 1px solid var(--border); }
.stat:first-child { padding-left: 0; }
.stat:last-child { border-right: 0; padding-right: 0; }
.stat .num {
  font-size: clamp(28px, 3vw, 40px); font-weight: 300; letter-spacing: -0.02em;
  color: var(--text); line-height: 1; margin-bottom: 12px;
}
.stat .lbl { font-size: 13.5px; color: var(--text-muted); line-height: 1.5; max-width: 30ch; }
@media (max-width: 760px) {
  .stats { grid-template-columns: 1fr; }
  .stat { border-right: 0; border-bottom: 1px solid var(--border); padding: 24px 0; }
  .stat:last-child { border-bottom: 0; }
}

/* Section header */
.sec-head {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-bottom: 56px; gap: 32px; flex-wrap: wrap;
}
.sec-head h2 { max-width: 18ch; }
.sec-head .meta { font-size: 13px; color: var(--text-dim); font-variant-numeric: tabular-nums; }

/* Projects grid */
.proj-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: var(--gutter);
}
@media (max-width: 980px) { .proj-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) { .proj-grid { grid-template-columns: 1fr; } }

.proj {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 24px;
  text-decoration: none; color: inherit;
  display: flex; flex-direction: column;
  min-height: 280px;
  cursor: pointer;
  transition: transform var(--t) var(--ease), border-color var(--t) var(--ease), background-color var(--t) var(--ease);
}
.proj:hover {
  transform: translateY(-2px);
  border-color: var(--border-strong);
  background: var(--surface-2);
}
.proj .idx {
  font-family: var(--mono); font-size: 11px;
  color: var(--text-dim); letter-spacing: 0.04em;
}
.proj .visual {
  flex: 1; min-height: 120px;
  margin: 22px 0 24px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg);
  position: relative; overflow: hidden;
  display: grid; place-items: center;
}
.proj h3 { font-size: 19px; line-height: 1.2; margin-bottom: 10px; max-width: 22ch; transition: color var(--t) var(--ease);}
.proj:hover h3 { color: var(--accent); }
.proj .tags {
  display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px;
}
.tag {
  font-size: 11px; letter-spacing: 0.02em;
  color: var(--text-muted);
  border: 1px solid var(--border);
  padding: 3px 8px; border-radius: 4px;
  background: transparent;
  white-space: nowrap;
}
.proj .arrow-tl {
  position: absolute; top: 24px; right: 24px;
  width: 28px; height: 28px; border-radius: 999px;
  border: 1px solid var(--border);
  display: grid; place-items: center;
  color: var(--text-dim);
  transition: all var(--t) var(--ease);
}
.proj:hover .arrow-tl { color: var(--accent); border-color: var(--accent); transform: rotate(-45deg); }

/* Project visuals (abstracted thumbnails) */
.viz {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  color: var(--text-dim);
}

/* About */
.about {
  display: grid; grid-template-columns: 1.3fr 1fr;
  gap: clamp(40px, 8vw, 120px);
  align-items: start;
}
@media (max-width: 880px) { .about { grid-template-columns: 1fr; } }
.about p + p { margin-top: 22px; }
.about-quote {
  font-size: clamp(22px, 2.4vw, 30px);
  line-height: 1.35; font-weight: 300; letter-spacing: -0.018em;
  color: var(--text); max-width: 22ch;
  border-left: 1px solid var(--accent);
  padding: 4px 0 4px 28px;
}
.about-quote .cite {
  display: block; margin-top: 18px;
  font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--text-dim); font-weight: 500;
}

/* Why me */
.why-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 0;
  border-top: 1px solid var(--border);
}
@media (max-width: 880px) { .why-grid { grid-template-columns: 1fr; } }
.why-cell {
  padding: 36px 28px 36px 10px;
  border-right: 1px solid var(--border);
}
.why-cell:first-child { padding-left: 0; }
.why-cell:last-child { border-right: 0; padding-right: 0; }
.why-cell .num {
  font-family: var(--mono); font-size: 11px; color: var(--text-dim);
  letter-spacing: 0.06em; margin-bottom: 18px;
}
.why-cell h3 { font-size: 21px; font-weight: 400; margin-bottom: 12px; letter-spacing: -0.01em; }
.why-cell p { font-size: 14.5px; line-height: 1.65; }
@media (max-width: 880px) {
  .why-cell { border-right: 0; border-bottom: 1px solid var(--border); padding: 28px 0; }
  .why-cell:last-child { border-bottom: 0; }
}

/* Contact */
.contact {
  display: grid; grid-template-columns: 1.1fr 1fr;
  gap: clamp(40px, 6vw, 96px);
  align-items: center;
}
@media (max-width: 880px) { .contact { grid-template-columns: 1fr; } }
.contact-card {
  position: relative;
  border: 1px solid color-mix(in oklab, var(--accent) 22%, var(--border));
  background:
    linear-gradient(135deg,
      color-mix(in oklab, var(--accent) 14%, transparent) 0%,
      color-mix(in oklab, var(--accent) 4%, transparent) 50%,
      color-mix(in oklab, var(--surface) 70%, transparent) 100%);
  -webkit-backdrop-filter: blur(22px) saturate(150%);
  backdrop-filter: blur(22px) saturate(150%);
  border-radius: 18px;
  padding: 36px;
  box-shadow:
    inset 0 1px 0 color-mix(in oklab, white 18%, transparent),
    0 24px 60px -28px color-mix(in oklab, var(--accent) 40%, transparent);
  overflow: hidden;
}
.contact-card::before {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(60% 80% at 100% 0%, color-mix(in oklab, var(--accent) 18%, transparent) 0%, transparent 60%),
    radial-gradient(60% 80% at 0% 100%, color-mix(in oklab, var(--accent) 10%, transparent) 0%, transparent 60%);
  pointer-events: none; z-index: 0;
}
.contact-card > * { position: relative; z-index: 1; }
.contact-card .row { border-bottom-color: color-mix(in oklab, white 10%, transparent); }
.contact-card .row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 18px 0; border-bottom: 1px solid var(--border);
  font-size: 14px;
}
.contact-card .row:last-child { border-bottom: 0; padding-bottom: 0; }
.contact-card .row:first-child { padding-top: 0; }
.contact-card .row .k { color: var(--text-dim); font-size: 12px; letter-spacing: 0.04em; text-transform: uppercase; }
.contact-card .row .v { color: var(--text); }
.contact-card .row a.v { transition: color var(--t) var(--ease); }
.contact-card .row a.v:hover { color: var(--accent); }
.contact-card .row .available {
  display: inline-flex; align-items: center; gap: 8px;
}
.contact-card .row .available::before {
  content: ""; width: 7px; height: 7px; border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
  animation: pulse 2.4s var(--ease) infinite;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 4px var(--accent-soft); }
  50% { box-shadow: 0 0 0 8px transparent; }
}

/* Footer */
.foot {
  padding: 40px 0 48px;
  border-top: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: flex-end;
  gap: 24px; flex-wrap: wrap;
}
.foot .tag-line {
  max-width: 56ch; color: var(--text-muted); font-size: 13.5px; line-height: 1.6;
}
.foot .meta { font-size: 12px; color: var(--text-dim); font-variant-numeric: tabular-nums; }

/* Page transitions */
.page-enter { animation: pageIn 360ms var(--ease) both; }
@keyframes pageIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Reveal on scroll */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity 700ms var(--ease), transform 700ms var(--ease); }
.reveal.in { opacity: 1; transform: none; }

/* Projects index page */
.projects-intro {
  max-width: 64ch; margin-bottom: 48px;
  font-size: 17px; line-height: 1.7; color: var(--text-muted);
}
.projects-intro strong { color: var(--text); font-weight: 400; }
.filters {
  display: flex; gap: 8px; flex-wrap: wrap;
  margin-bottom: 40px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 14px 0;
}
.filter {
  font-size: 12.5px; color: var(--text-muted);
  border: 1px solid transparent;
  padding: 6px 12px; border-radius: 999px;
  background: transparent; cursor: pointer;
  transition: all var(--t) var(--ease);
}
.filter:hover { color: var(--text); }
.filter.active {
  color: var(--text); border-color: var(--border-strong);
  background: var(--surface);
}
.filter .count {
  margin-left: 6px; color: var(--text-dim); font-variant-numeric: tabular-nums;
  font-size: 11px;
}

/* Projects index list (full-width row layout) */
.proj-list { border-top: 1px solid var(--border); }
.proj-row {
  display: grid;
  grid-template-columns: 60px 1.5fr 2fr 1fr 32px;
  gap: 24px; align-items: center;
  padding: 28px 0;
  border-bottom: 1px solid var(--border);
  text-decoration: none; color: inherit;
  transition: padding var(--t) var(--ease), background var(--t) var(--ease);
  cursor: pointer;
}
.proj-row:hover { padding-left: 12px; padding-right: 12px; }
.proj-row .idx { font-family: var(--mono); font-size: 11px; color: var(--text-dim); letter-spacing: 0.04em; }
.proj-row .title { font-size: 22px; font-weight: 400; letter-spacing: -0.01em; color: var(--text); transition: color var(--t) var(--ease);}
.proj-row:hover .title { color: var(--accent); }
.proj-row .excerpt { font-size: 14px; color: var(--text-muted); line-height: 1.55; max-width: 50ch; }
.proj-row .tags { display: flex; gap: 6px; flex-wrap: wrap; }
.proj-row .arrow {
  width: 28px; height: 28px; border-radius: 999px;
  border: 1px solid var(--border);
  display: grid; place-items: center;
  color: var(--text-dim);
  transition: all var(--t) var(--ease);
}
.proj-row:hover .arrow { color: var(--accent); border-color: var(--accent); }
@media (max-width: 980px) {
  .proj-row { grid-template-columns: 40px 1fr 32px; gap: 16px; }
  .proj-row .excerpt, .proj-row .tags { display: none; }
}

/* Case study */
.cs-hero { padding: clamp(40px, 7vw, 96px) 0 clamp(32px, 5vw, 64px); }
.cs-hero .crumb {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12.5px; color: var(--text-muted); text-decoration: none;
  margin-bottom: 36px;
  transition: color var(--t) var(--ease);
}
.cs-hero .crumb:hover { color: var(--text); }
.cs-hero h1 { font-size: clamp(36px, 5.4vw, 76px); max-width: 18ch; margin-bottom: 32px; }
.cs-hero .summary { font-size: 19px; color: var(--text-muted); max-width: 60ch; line-height: 1.55; font-weight: 300; }
.cs-meta {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin-top: 56px;
}
.cs-meta .item {
  padding: 24px 24px 24px 10px;
  border-right: 1px solid var(--border);
}
.cs-meta .item:first-child { padding-left: 0; }
.cs-meta .item:last-child { border-right: 0; padding-right: 0; }
.cs-meta .k { font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-dim); margin-bottom: 8px; }
.cs-meta .v { font-size: 14px; color: var(--text); }
@media (max-width: 760px) {
  .cs-meta { grid-template-columns: 1fr 1fr; }
  .cs-meta .item:nth-child(2) { border-right: 0; padding-right: 0; }
  .cs-meta .item:nth-child(1), .cs-meta .item:nth-child(2) { border-bottom: 1px solid var(--border); }
}

.cs-section { padding: clamp(56px, 6vw, 96px) 0; border-bottom: 1px solid var(--border); }
.cs-grid {
  display: grid; grid-template-columns: 220px 1fr;
  gap: clamp(24px, 4vw, 80px);
  align-items: start;
}
@media (max-width: 880px) { .cs-grid { grid-template-columns: 1fr; gap: 16px; } }
.cs-grid .label {
  font-size: 11.5px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--text-dim); font-weight: 500; padding-top: 6px;
}
.cs-grid .body { font-size: 17px; line-height: 1.7; color: var(--text); font-weight: 300; max-width: 64ch; }
.cs-grid .body p + p { margin-top: 18px; }
.cs-grid .body em { color: var(--accent); font-style: normal; }
.cs-grid .body .process-note {
  font-size: clamp(19px, 1.8vw, 22px);
  line-height: 1.55; font-weight: 300; letter-spacing: -0.012em;
  color: var(--text); border-left: 1px solid var(--accent);
  padding: 6px 0 6px 24px; max-width: 60ch;
}

.cs-list { display: flex; flex-direction: column; gap: 14px; margin: 0; padding: 0; list-style: none; }
.cs-list li {
  display: grid; grid-template-columns: 24px 1fr;
  gap: 16px; padding: 14px 0; border-top: 1px solid var(--border);
  font-size: 15px; color: var(--text); line-height: 1.55;
}
.cs-list li:last-child { border-bottom: 1px solid var(--border); }
.cs-list li .num { color: var(--text-dim); font-family: var(--mono); font-size: 11px; padding-top: 4px; }

.cs-visuals {
  display: grid; grid-template-columns: repeat(2, 1fr);
  gap: var(--gutter);
}
@media (max-width: 760px) { .cs-visuals { grid-template-columns: 1fr; } }
.cs-visual {
  border: 1px solid var(--border);
  border-radius: 8px; background: var(--surface);
  aspect-ratio: 4/3;
  position: relative; overflow: hidden;
  display: grid; place-items: center;
  padding: 24px;
}
.cs-visual.tall { aspect-ratio: 3/4; }
.cs-visual.wide { grid-column: 1 / -1; aspect-ratio: 16/9; }
.cs-visual .cap {
  position: absolute; left: 16px; bottom: 14px;
  font-size: 11px; color: var(--text-dim);
  letter-spacing: 0.04em;
}
.cs-visual .nda {
  position: absolute; top: 16px; right: 16px;
  font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--text-dim);
  border: 1px solid var(--border);
  padding: 3px 7px; border-radius: 4px;
}

.outcomes { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--gutter); }
@media (max-width: 760px) { .outcomes { grid-template-columns: 1fr; } }
.outcome {
  border-top: 1px solid var(--border-strong);
  padding-top: 22px;
}
.outcome .big {
  font-size: clamp(34px, 3.6vw, 52px); font-weight: 300;
  letter-spacing: -0.025em; color: var(--text); line-height: 1;
  margin-bottom: 14px;
}
.outcome .desc { font-size: 14px; color: var(--text-muted); line-height: 1.55; }

.cs-next {
  display: grid; grid-template-columns: 1fr auto;
  gap: 24px; align-items: center;
  padding: clamp(48px, 6vw, 80px) 0;
  border-top: 1px solid var(--border);
  text-decoration: none; color: inherit;
  transition: padding var(--t) var(--ease);
}
.cs-next:hover { padding-left: 12px; padding-right: 12px; }
.cs-next .label { font-size: 11.5px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-dim); margin-bottom: 12px; }
.cs-next .title { font-size: clamp(28px, 3.6vw, 48px); font-weight: 300; letter-spacing: -0.02em; color: var(--text); transition: color var(--t) var(--ease); }
.cs-next:hover .title { color: var(--accent); }
.cs-next .arrow {
  width: 56px; height: 56px; border-radius: 999px;
  border: 1px solid var(--border-strong);
  display: grid; place-items: center; color: var(--text);
  transition: all var(--t) var(--ease);
}
.cs-next:hover .arrow { background: var(--accent); border-color: var(--accent); color: var(--bg); }

/* ── Career timeline ───────────────────────────────────────────── */
.career {
  list-style: none; margin: 0; padding: 0;
  border-top: 1px solid var(--border);
}
.career-item {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: clamp(24px, 4vw, 80px);
  padding: clamp(36px, 4.5vw, 56px) 0;
  border-bottom: 1px solid var(--border);
  align-items: start;
}
.career-when {
  position: relative;
  padding-left: 0;
}
.career-when .years {
  font-family: var(--mono);
  font-size: 13px; letter-spacing: 0.02em;
  color: var(--text-muted);
  display: flex; align-items: baseline; gap: 8px;
  font-variant-numeric: tabular-nums;
}
.career-when .years .from { color: var(--text); font-weight: 500; font-size: 14px; }
.career-when .years .dash { color: var(--text-dim); }
.career-when .years .to { color: var(--text-muted); }
.career-when .years .to.now {
  color: var(--accent);
  text-transform: uppercase; letter-spacing: 0.08em; font-size: 11px;
}
.career-when .dot-rail {
  margin-top: 18px;
  display: flex; align-items: center; gap: 8px;
}
.career-when .dot-rail .d {
  width: 8px; height: 8px; border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: transparent;
}
.career-when .dot-rail .d.live {
  background: var(--accent); border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}
.career-what .role-line {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  margin-bottom: 20px;
}
.career-what h3 {
  font-size: clamp(22px, 2.4vw, 30px);
  font-weight: 400; letter-spacing: -0.018em;
  color: var(--text); line-height: 1.15;
}
.career-what .badge {
  font-size: 10.5px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--accent);
  border: 1px solid var(--accent);
  background: var(--accent-soft);
  padding: 3px 8px; border-radius: 4px;
  font-weight: 500;
}
.career-what p {
  font-size: 16px; line-height: 1.7;
  color: var(--text-muted);
  max-width: 64ch;
}
.career-what p + p { margin-top: 16px; }
.career-tags {
  display: flex; gap: 6px; flex-wrap: wrap;
  margin-top: 22px;
}
@media (max-width: 760px) {
  .career-item { grid-template-columns: 1fr; gap: 18px; }
  .career-when .dot-rail { display: none; }
}

/* ── Education & Certifications ───────────────────────────────── */
.edu-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: clamp(40px, 6vw, 96px);
  border-top: 1px solid var(--border);
  padding-top: 40px;
}
@media (max-width: 880px) { .edu-grid { grid-template-columns: 1fr; gap: 56px; } }
.edu-col-h {
  font-size: 11.5px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--text-dim); font-weight: 500; margin-bottom: 28px;
}
.edu-list { list-style: none; margin: 0; padding: 0; }
.edu-list li {
  display: grid; grid-template-columns: 100px 1fr;
  gap: 24px; padding: 22px 0;
  border-top: 1px solid var(--border);
}
.edu-list li:last-child { border-bottom: 1px solid var(--border); }
.edu-when {
  font-family: var(--mono); font-size: 12px;
  color: var(--text-muted); padding-top: 4px;
  font-variant-numeric: tabular-nums;
}
.edu-body h3 {
  font-size: 19px; font-weight: 400; letter-spacing: -0.012em;
  color: var(--text); margin-bottom: 6px; line-height: 1.3;
}
.edu-body h3.cert { font-size: 17px; }
.edu-org { font-size: 13.5px; color: var(--text-muted); }
.edu-note {
  margin-top: 12px; font-size: 14.5px; line-height: 1.6;
  color: var(--text-muted); max-width: 50ch;
}
.edu-note em { color: var(--accent); font-style: normal; }

/* ── Awards ────────────────────────────────────────────────────── */
.awards-grid {
  display: grid; grid-template-columns: repeat(2, 1fr);
  gap: var(--gutter);
  border-top: 1px solid var(--border);
}
@media (max-width: 760px) { .awards-grid { grid-template-columns: 1fr; } }
.award {
  position: relative;
  padding: 36px 28px 36px 28px;
  border: 1px solid color-mix(in oklab, var(--accent) 18%, var(--border));
  border-radius: 18px;
  background:
    linear-gradient(140deg,
      color-mix(in oklab, var(--accent) 12%, transparent) 0%,
      color-mix(in oklab, var(--accent) 3%, transparent) 55%,
      color-mix(in oklab, var(--surface) 60%, transparent) 100%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  backdrop-filter: blur(20px) saturate(140%);
  box-shadow:
    inset 0 1px 0 color-mix(in oklab, white 16%, transparent),
    0 20px 50px -28px color-mix(in oklab, var(--accent) 36%, transparent);
  overflow: hidden;
  transition: transform 300ms var(--ease), box-shadow 300ms var(--ease), border-color 300ms var(--ease);
}
.award::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(70% 90% at 100% 0%, color-mix(in oklab, var(--accent) 16%, transparent) 0%, transparent 60%);
  pointer-events: none; z-index: 0;
}
.award > * { position: relative; z-index: 1; }
.award:hover {
  transform: translateY(-3px);
  border-color: color-mix(in oklab, var(--accent) 35%, var(--border));
  box-shadow:
    inset 0 1px 0 color-mix(in oklab, white 22%, transparent),
    0 28px 60px -24px color-mix(in oklab, var(--accent) 50%, transparent);
}
.awards-grid { border-top: 0; gap: clamp(20px, 2.4vw, 32px); }
.award-year {
  font-family: var(--mono); font-size: 12px;
  color: var(--accent); letter-spacing: 0.04em;
  margin-bottom: 16px;
}
.award h3 {
  font-size: clamp(22px, 2vw, 26px); font-weight: 400;
  letter-spacing: -0.014em; color: var(--text); line-height: 1.2;
  margin-bottom: 8px;
}
.award-org {
  font-size: 13.5px; color: var(--text-muted);
  margin-bottom: 14px;
}
.award p { font-size: 14.5px; line-height: 1.6; max-width: 42ch; }

/* ── Featured project showcase (Aurora-inspired) ───────────────── */
.featured .feat-list {
  list-style: none; margin: 0; padding: 0;
  border-top: 1px solid var(--border-strong);
}
.feat-row { border-bottom: 1px solid var(--border); }
.feat-link {
  display: grid;
  grid-template-columns: auto 1fr 280px auto;
  gap: clamp(20px, 3vw, 56px);
  align-items: center;
  padding: clamp(28px, 4vw, 56px) 12px;
  text-decoration: none; color: inherit;
  position: relative; overflow: hidden;
  transition: padding-left var(--t) var(--ease), padding-right var(--t) var(--ease);
}
.feat-link::before {
  /* Aurora wash that reveals on hover */
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(40% 100% at 80% 50%, color-mix(in oklab, var(--accent) 22%, transparent) 0%, transparent 70%),
    radial-gradient(50% 120% at 10% 0%, color-mix(in oklab, var(--accent) 12%, transparent) 0%, transparent 60%);
  opacity: 0; transition: opacity 400ms var(--ease);
  pointer-events: none;
}
.feat-link:hover::before { opacity: 1; }
.feat-link:hover { padding-left: 24px; padding-right: 24px; }
.feat-row:hover { border-color: var(--accent); }

.feat-idx {
  font-family: var(--mono); font-size: clamp(20px, 2vw, 28px);
  color: var(--text-dim); font-weight: 400;
  letter-spacing: 0.02em; line-height: 1;
  font-variant-numeric: tabular-nums;
  align-self: start; padding-top: 8px;
  transition: color var(--t) var(--ease);
  position: relative; z-index: 1;
}
.feat-link:hover .feat-idx { color: var(--accent); }

.feat-body { position: relative; z-index: 1; min-width: 0; }
.feat-title {
  font-size: clamp(28px, 3.6vw, 48px);
  font-weight: 300; letter-spacing: -0.025em;
  color: var(--text); line-height: 1.05;
  margin-bottom: 14px;
  transition: color var(--t) var(--ease), transform var(--t) var(--ease);
}
.feat-link:hover .feat-title { color: var(--accent); }
.feat-excerpt {
  font-size: 15.5px; line-height: 1.55;
  color: var(--text-muted); max-width: 50ch;
  margin-bottom: 18px;
}
.feat-tags { display: flex; gap: 6px; flex-wrap: wrap; }

.feat-viz {
  position: relative; z-index: 1;
  height: 140px; width: 100%;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: color-mix(in oklab, var(--surface) 80%, transparent);
  overflow: hidden;
  display: grid; place-items: center;
  padding: 16px;
  transition: border-color var(--t) var(--ease), transform 400ms var(--ease);
}
.feat-link:hover .feat-viz {
  border-color: var(--accent);
  transform: scale(1.02);
}

.feat-arrow {
  position: relative; z-index: 1;
  width: 44px; height: 44px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  display: grid; place-items: center;
  color: var(--text-muted);
  transition: all 300ms var(--ease);
}
.feat-link:hover .feat-arrow {
  background: var(--accent); border-color: var(--accent);
  color: var(--bg); transform: rotate(-8deg) scale(1.05);
}

@media (max-width: 980px) {
  .feat-link { grid-template-columns: auto 1fr auto; gap: 20px; }
  .feat-viz { display: none; }
}
@media (max-width: 620px) {
  .feat-link { grid-template-columns: auto 1fr; }
  .feat-arrow { display: none; }
  .feat-idx { padding-top: 4px; }
}

/* Selection */
::selection { background: var(--accent); color: var(--bg); }

/* Focus — WCAG 2.2 SC 2.4.11 / 2.4.13: visible, ≥3:1 against adjacent colours, ≥2px thick */
:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}
.proj:focus-visible, .proj-row:focus-visible, .cs-next:focus-visible,
.cta:focus-visible, .nav-cta:focus-visible {
  outline-offset: 4px;
}

/* Theme toggle — icon-only button */
.theme-toggle-icon {
  appearance: none;
  width: 36px; height: 36px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: color-mix(in oklab, var(--surface) 88%, transparent);
  color: var(--text-muted);
  cursor: pointer;
  display: inline-grid; place-items: center;
  position: relative; overflow: hidden;
  transition: color var(--t) var(--ease), border-color var(--t) var(--ease), background-color var(--t) var(--ease);
}
.theme-toggle-icon:hover {
  color: var(--text);
  border-color: var(--accent);
  background: color-mix(in oklab, var(--accent-soft) 100%, transparent);
}
.theme-toggle-icon .t-ico {
  position: relative; width: 16px; height: 16px;
  display: inline-block;
}
.theme-toggle-icon .ico {
  position: absolute; inset: 0;
  width: 16px; height: 16px;
  transition: transform 360ms var(--ease), opacity 220ms var(--ease);
}
.theme-toggle-icon .t-ico[data-show="sun"] .ico-sun { opacity: 1; transform: rotate(0) scale(1); }
.theme-toggle-icon .t-ico[data-show="sun"] .ico-moon { opacity: 0; transform: rotate(60deg) scale(0.6); }
.theme-toggle-icon .t-ico[data-show="moon"] .ico-sun { opacity: 0; transform: rotate(-60deg) scale(0.6); }
.theme-toggle-icon .t-ico[data-show="moon"] .ico-moon { opacity: 1; transform: rotate(0) scale(1); }
@media (max-width: 540px) {
  .nav-links a:not(.nav-cta) { display: none; }
}

/* ── Aurora background ─────────────────────────────────────────── */
.aurora {
  position: fixed; inset: 0;
  z-index: 0; pointer-events: none;
  overflow: hidden;
  background: var(--bg);
  isolation: isolate;
}
.aurora::after {
  /* Subtle film-grain over the gradient to keep it editorial */
  content: ""; position: absolute; inset: 0;
  background-image:
    radial-gradient(rgba(255,255,255,0.012) 1px, transparent 1px),
    radial-gradient(rgba(0,0,0,0.012) 1px, transparent 1px);
  background-size: 3px 3px, 3px 3px;
  background-position: 0 0, 1.5px 1.5px;
  mix-blend-mode: overlay; opacity: 0.5;
}
.aurora .blob {
  position: absolute;
  width: 80vmax; height: 80vmax;
  border-radius: 50%;
  filter: blur(110px);
  opacity: var(--blob-opacity, 0.42);
  mix-blend-mode: screen;
  will-change: transform;
}
[data-theme="light"] .aurora .blob {
  --blob-opacity: 0.32;
  mix-blend-mode: multiply;
  filter: blur(120px);
}
.aurora .blob.a { background: radial-gradient(circle at 50% 50%, #3A29FF 0%, rgba(58,41,255,0) 60%); top: -30vmax; left: -20vmax; animation: blobA 22s ease-in-out infinite alternate; }
.aurora .blob.b { background: radial-gradient(circle at 50% 50%, #FF94B4 0%, rgba(255,148,180,0) 60%); top: -10vmax; right: -25vmax; animation: blobB 26s ease-in-out infinite alternate; }
.aurora .blob.c { background: radial-gradient(circle at 50% 50%, #FF3232 0%, rgba(255,50,50,0) 60%); bottom: -30vmax; left: 10vmax; animation: blobC 30s ease-in-out infinite alternate; }
.aurora .veil {
  /* Pull the body content forward over the aurora; readability layer */
  position: absolute; inset: 0;
  background: linear-gradient(180deg,
    color-mix(in oklab, var(--bg) 55%, transparent) 0%,
    color-mix(in oklab, var(--bg) 78%, transparent) 40%,
    color-mix(in oklab, var(--bg) 92%, transparent) 100%);
}
@keyframes blobA {
  0%   { transform: translate3d(0, 0, 0) scale(1); }
  100% { transform: translate3d(8vmax, 6vmax, 0) scale(1.1); }
}
@keyframes blobB {
  0%   { transform: translate3d(0, 0, 0) scale(1); }
  100% { transform: translate3d(-10vmax, 8vmax, 0) scale(0.9); }
}
@keyframes blobC {
  0%   { transform: translate3d(0, 0, 0) scale(1); }
  100% { transform: translate3d(6vmax, -10vmax, 0) scale(1.15); }
}
/* Make sure body content sits above aurora */
.nav, main, .foot { position: relative; z-index: 1; }
@media (prefers-reduced-motion: reduce) {
  .aurora .blob { animation: none !important; }
}

/* Reduce motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
