﻿:root {
  --bg: #0d1117;
  --bg-2: #161b22;
  --ink: #e6edf3;
  --muted: #8b949e;
  --line: rgba(230, 237, 243, 0.1);
  --accent: #2f81f7;
  --accent-ink: #ffffff;
  --sage: #3fb950;
  --serif: "Libre Baskerville", "Iowan Old Style", Palatino, serif;
  --sans: "Source Sans 3", "Avenir Next", "Segoe UI", sans-serif;
  --max: 1180px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; color-scheme: light; overflow-x: clip; }
::selection { background: var(--accent); color: var(--accent-ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.08rem;
  line-height: 1.55;
  scrollbar-color: #30363d transparent;
}
img { max-width: 100%; display: block; }
a { color: inherit; }

/* ── Skip link ── */
.skip {
  position: absolute;
  left: 1rem;
  top: -4rem;
  background: var(--accent);
  color: var(--accent-ink);
  padding: 0.5rem 0.8rem;
  z-index: 5;
}
.skip:focus { top: 1rem; }

/* ── Nav ── */
.nav {
  position: sticky;
  top: 0;
  z-index: 4;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.9rem 6vw;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
.nav a { text-decoration: none; }
.brand {
  font-family: var(--serif);
  font-weight: 700;
  letter-spacing: -0.02em;
  font-size: 1.05rem;
}
.nav-links {
  display: flex;
  gap: 1.4rem;
  color: var(--muted);
  font-size: 0.92rem;
}
.nav-links a:hover { color: var(--ink); }
.nav-cta {
  color: var(--accent-ink) !important;
  background: var(--accent);
  padding: 0.4rem 0.75rem;
  font-weight: 600;
}

/* ── Layout ── */
.wrap { width: min(var(--max), calc(100% - 10vw)); margin: 0 auto; }

/* ── Progress rail & cursor dot ── */
.rail {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: 0 50%;
  z-index: 6;
  pointer-events: none;
}
.dot {
  display: none;
  position: fixed;
  width: 16px;
  height: 16px;
  margin: -8px 0 0 -8px;
  border: 1px solid var(--accent);
  border-radius: 50%;
  pointer-events: none;
  z-index: 7;
  mix-blend-mode: difference;
}
@media (hover: hover) and (pointer: fine) {
  html.motion .dot { display: block; }
}

/* ── Hero ── */
.hero {
  position: relative;
  display: block;
  padding: clamp(1.7rem, 4vw, 3.6rem) clamp(1.2rem, 4.5vw, 4rem) clamp(1.4rem, 3vw, 2.6rem);
}
.field {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}
.hero-frame {
  position: relative;
  z-index: 1;
  width: min(1140px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
  column-gap: clamp(1.6rem, 4vw, 4rem);
  align-items: center;
}
.hero-copy { min-width: 0; }
.kicker {
  color: var(--accent);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-size: 0.75rem;
  font-weight: 600;
  margin: 0 0 1.2rem;
}
.kicker::after {
  content: "";
  display: block;
  width: 3.2rem;
  height: 1px;
  margin-top: 0.85rem;
  background: var(--accent);
  transform-origin: left center;
}
h1 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(3.1rem, 6.2vw, 5.4rem);
  line-height: 1.02;
  letter-spacing: -0.02em;
  margin: 0 0 1.4rem;
}
h1 em {
  font-style: italic;
  font-weight: 400;
  color: var(--accent);
}
.lede {
  font-size: 1.25rem;
  max-width: 38rem;
  color: var(--ink);
  margin: 0 0 1.6rem;
}
.hero-aside {
  max-width: 34rem;
  margin: -0.4rem 0 0;
  color: var(--muted);
  font-size: 1.05rem;
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-top: 1.45rem;
}
.hero-points {
  list-style: none;
  margin: 1.5rem 0 0;
  padding: 0;
  max-width: 34rem;
  border-top: 1px solid var(--line);
}
.hero-points li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding: 0.62rem 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.98rem;
}
.hero-points span {
  color: var(--muted);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 0.72rem;
  font-weight: 600;
}
.hero-points a, .hero-points b {
  font-weight: 600;
  text-decoration: none;
  min-width: 0;
  text-align: right;
  overflow-wrap: anywhere;
}
.hero-points a:hover { color: var(--accent); }

/* Hero screen / video */
.hero-screen { position: relative; width: 100%; margin: 0; }
.bezel {
  position: relative;
  padding: 0.7rem;
  background: var(--bg-2);
  border: 1px solid var(--ink);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(47,129,247,0.15);
}
.bezel::before, .bezel::after {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  z-index: 2;
  pointer-events: none;
  border: 1px solid var(--accent);
}
.bezel::before { top: 10px; left: 10px; border-right: 0; border-bottom: 0; }
.bezel::after { right: 10px; bottom: 10px; border-left: 0; border-top: 0; }
.hero-video {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 5;
  height: auto;
  object-fit: cover;
  object-position: center 18%;
  background: #21262d;
}
.bezel figcaption, .sound-btn {
  position: absolute;
  z-index: 3;
  bottom: 1.15rem;
  background: rgba(13, 17, 23, 0.88);
  border: 1px solid rgba(230, 237, 243, 0.2);
  color: #e6edf3;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
}
.bezel figcaption { left: 1.15rem; padding: 0.35rem 0.7rem; }
.sound-btn {
  right: 1.15rem;
  padding: 0.4rem 0.75rem;
  font: inherit;
  font-size: 0.78rem;
  cursor: pointer;
  border-radius: 0;
}
.sound-btn:hover, .sound-btn[aria-pressed="true"] { border-color: #2f81f7; color: #ffffff; }

/* Hero entry animations */
html.motion .hero-copy > * {
  animation: hero-in 0.95s cubic-bezier(0.16, 1, 0.3, 1) both;
}
html.motion .hero-copy > *:nth-child(1) { animation-delay: 0.04s; }
html.motion .hero-copy > *:nth-child(2) { animation-delay: 0.12s; }
html.motion .hero-copy > *:nth-child(3) { animation-delay: 0.2s; }
html.motion .hero-copy > *:nth-child(4) { animation-delay: 0.28s; }
html.motion .hero-copy > *:nth-child(5) { animation-delay: 0.36s; }
html.motion .hero-copy > *:nth-child(6) { animation-delay: 0.44s; }
html.motion .kicker::after {
  animation: hero-rule 0.7s cubic-bezier(0.16, 1, 0.3, 1) 0.28s both;
}
html.motion .hero-screen {
  animation: hero-in 1.05s cubic-bezier(0.16, 1, 0.3, 1) 0.18s both;
}
@keyframes hero-in {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: none; }
}
@keyframes hero-rule {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}

/* Swap word */
.swap {
  display: inline-block;
  color: var(--accent);
  font-family: var(--serif);
  font-style: italic;
}
.sr {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}
html.motion .swap.tick { animation: swap-pop 0.45s ease; }
@keyframes swap-pop {
  from { opacity: 0; transform: translateY(0.25em); }
  to { opacity: 1; transform: none; }
}

/* ── Ticker ── */
.ticker {
  overflow: hidden;
  contain: inline-size;
  width: 100%;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 0.9rem 0;
  color: var(--muted);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 0.78rem;
}
.ticker:hover .ticker-track { animation-play-state: paused; }
.ticker-track {
  display: flex;
  gap: 2.4rem;
  width: max-content;
  animation: ticker 46s linear infinite;
}
@keyframes ticker {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

/* ── Sections ── */
section { padding: 4.5rem 0; border-top: 1px solid var(--line); }
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 2rem;
}
h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2rem, 4vw, 3rem);
  letter-spacing: -0.02em;
  margin: 0;
}
.index { color: var(--muted); font-size: 0.85rem; letter-spacing: 0.14em; text-transform: uppercase; }

/* ── Buttons ── */
.btn {
  display: inline-block;
  text-decoration: none;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 600;
  padding: 0.75rem 1.05rem;
  border-radius: 0;
}
.btn.ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
}
.btn.ghost:hover { border-color: var(--accent); color: var(--accent); background: rgba(47,129,247,0.08); }

/* ── Work list ── */
.work { display: grid; gap: 0; }
.piece {
  display: grid;
  grid-template-columns: 5rem 1fr auto;
  gap: 1.2rem;
  align-items: start;
  padding: 1.5rem 0;
  border-top: 1px solid var(--line);
  text-decoration: none;
  transition: color 0.2s ease;
}
.piece:last-child { border-bottom: 1px solid var(--line); }
.num {
  font-family: var(--serif);
  color: var(--accent);
  font-size: 1.3rem;
}
.piece h3 {
  margin: 0 0 0.35rem;
  font-family: var(--serif);
  font-size: 1.7rem;
  letter-spacing: -0.02em;
  font-weight: 400;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  flex-wrap: wrap;
}
.badge {
  font-family: var(--sans);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 999px;
  padding: 0.2rem 0.6rem;
  white-space: nowrap;
  background: rgba(47, 129, 247, 0.08);
}
.piece:hover h3 { color: var(--accent); }
.piece:hover .go { transform: translateX(0.25rem); }
.piece p { margin: 0; color: var(--muted); max-width: 46rem; }
.piece > div, .card, .contact > div { min-width: 0; }
.go { color: var(--accent); align-self: center; transition: transform 0.2s ease; }

/* Work layout with sticky art plate */
.work-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(220px, 0.62fr);
  gap: 1.6rem;
  align-items: start;
}
.stage { position: sticky; top: 5.2rem; }
.stage-frame {
  position: relative;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  border: 1px solid var(--ink);
  background: var(--bg-2);
}
.stage-frame::before, .stage-frame::after {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  z-index: 2;
  pointer-events: none;
  border: 1px solid var(--accent);
}
.stage-frame::before { top: 10px; left: 10px; border-right: 0; border-bottom: 0; }
.stage-frame::after { right: 10px; bottom: 10px; border-left: 0; border-top: 0; }
.plate {
  position: absolute;
  inset: 0;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.45s ease, transform 0.55s ease;
}
.plate.on { opacity: 1; transform: none; }
.plate svg { width: 100%; height: 100%; }
.stage-label {
  display: flex;
  gap: 0.7rem;
  margin: 0.7rem 0 0;
  color: var(--muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.78rem;
}
.stage-num { color: var(--accent); font-family: var(--serif); letter-spacing: 0; font-size: 1rem; }
.piece.is-on { background: rgba(47, 129, 247, 0.07); }

/* ── Decisions ── */
.decisions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
.card {
  background: var(--bg-2);
  border: 1px solid var(--line);
  padding: 1.4rem 1.4rem 1.3rem;
  transition: border-color 0.2s ease;
}
.card:hover { border-color: var(--accent); }
.card h3 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1.45rem;
  letter-spacing: -0.02em;
  margin: 0.4rem 0 0.6rem;
}
.card p { margin: 0; color: var(--muted); }
.card .tag { color: var(--sage); font-size: 0.75rem; letter-spacing: 0.14em; text-transform: uppercase; }

/* ── Tech Stack ── */
.stack-intro {
  color: var(--muted);
  margin: -0.5rem 0 1.5rem;
  font-size: 1rem;
}
.stack-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.8rem;
}
.stack-tab {
  padding: 0.45rem 0.9rem;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--muted);
  cursor: pointer;
  transition: border-color 0.18s, color 0.18s, background 0.18s;
  border-radius: 0;
  letter-spacing: 0.02em;
}
.stack-tab:hover { color: var(--ink); border-color: var(--ink); }
.stack-tab.active {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
}
.stack-panels { position: relative; }
.stack-panel {
  display: none;
}
.stack-panel.active { display: block; }

/* Tech grid */
.tech-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 0.8rem;
}
.tech-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  padding: 1.2rem 0.8rem 1rem;
  background: var(--bg-2);
  border: 1px solid var(--line);
  cursor: default;
  transition: border-color 0.2s ease, transform 0.2s ease;
  text-align: center;
}
.tech-item:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}
.tech-icon {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.tech-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  /* tint all icons to page ink so they match the palette */
  filter: brightness(0) invert(1) opacity(0.75);
  transition: filter 0.2s ease;
}
/* accent-colored icons (passed as c4341d in the URL) stay reddish */
.tech-item:hover .tech-icon img {
  filter: brightness(0) invert(1) saturate(200%) sepia(50%) hue-rotate(195deg) brightness(130%);
}
/* text fallback icons (MCP, RAG, Eval, WER) */
.tech-icon--text {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: -0.02em;
  line-height: 1;
}
.tech-item span {
  font-size: 0.82rem;
  color: var(--muted);
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1.3;
}

/* Stack panel entrance animation */
html.motion .stack-panel.active .tech-item {
  animation: tech-in 0.35s ease both;
}
html.motion .stack-panel.active .tech-item:nth-child(1) { animation-delay: 0.00s; }
html.motion .stack-panel.active .tech-item:nth-child(2) { animation-delay: 0.04s; }
html.motion .stack-panel.active .tech-item:nth-child(3) { animation-delay: 0.08s; }
html.motion .stack-panel.active .tech-item:nth-child(4) { animation-delay: 0.12s; }
html.motion .stack-panel.active .tech-item:nth-child(5) { animation-delay: 0.16s; }
html.motion .stack-panel.active .tech-item:nth-child(6) { animation-delay: 0.20s; }
html.motion .stack-panel.active .tech-item:nth-child(7) { animation-delay: 0.24s; }
html.motion .stack-panel.active .tech-item:nth-child(8) { animation-delay: 0.28s; }
@keyframes tech-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

/* ── Practice / How I work ── */
.practice-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 3rem;
  align-items: start;
}
.practice-photo img {
  width: 100%;
  height: 420px;
  object-fit: cover;
  object-position: center 32%;
  border: 1px solid var(--ink);
}
.pull {
  font-family: var(--serif);
  font-weight: 400;
  font-style: italic;
  font-size: clamp(1.7rem, 3vw, 2.35rem);
  letter-spacing: -0.03em;
  line-height: 1.25;
  margin: 0 0 1rem;
}
.note { color: var(--muted); margin: 0; }

/* Stats row */
.practice-stats {
  display: flex;
  gap: 2rem;
  margin-top: 2rem;
  padding-top: 1.4rem;
  border-top: 1px solid var(--line);
}
.stat { display: flex; flex-direction: column; gap: 0.2rem; }
.stat-num {
  font-family: var(--serif);
  font-size: 2.8rem;
  line-height: 1;
  color: var(--accent);
  letter-spacing: -0.03em;
}
.stat-label {
  font-size: 0.8rem;
  color: var(--muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* ── Contact ── */
.contact {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 2rem;
  align-items: end;
}
.contact h2 { font-size: clamp(2.6rem, 6vw, 5rem); }
.actions { display: flex; flex-wrap: wrap; gap: 0.7rem; }
.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 1.2rem;
  color: var(--muted);
  font-size: 0.95rem;
}
.meta.spaced { margin-top: 1.2rem; }
.meta a { color: var(--ink); }
.meta a:hover { color: var(--accent); }

/* ── Footer ── */
footer {
  padding: 1.4rem 0 2.4rem;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.9rem;
}
footer a { color: var(--ink); }

/* ── Reveal on scroll ── */
html.motion .reveal.show { animation: rise 0.7s both; }
@keyframes rise {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: none; }
}

/* ── Responsive ── */
@media (max-width: 860px) {
  .nav { padding-inline: 1rem; }
  .nav-links a:not(.nav-cta) { display: none; }
  .wrap { width: min(var(--max), calc(100% - 2rem)); }
  .hero { padding: 1.15rem 1rem 1.4rem; }
  .hero-frame { display: flex; flex-direction: column; gap: 0; }
  .hero-frame > * { min-width: 0; }
  .hero-copy { display: contents; }
  .hero-screen { order: 1; margin-top: 1.25rem; }
  .hero-points { order: 2; max-width: none; }
  .hero-video { aspect-ratio: 16 / 9; }
  .work-layout { grid-template-columns: 1fr; }
  .stage { position: relative; top: auto; }
  .stage-frame { aspect-ratio: 16 / 9; }
  .decisions { grid-template-columns: 1fr; }
  .practice-grid { grid-template-columns: 1fr; }
  .practice-photo { order: -1; }
  .practice-photo img { height: 72vw; min-height: 240px; }
  .tech-grid { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); }
  .contact { grid-template-columns: 1fr; }
  .section-head { flex-wrap: wrap; }
  .go { display: none; }
  .piece { grid-template-columns: 4rem 1fr; }
  h1 { font-size: clamp(2.7rem, 12vw, 3.3rem); }
  .contact h2 { font-size: clamp(2.2rem, 10vw, 3rem); }
  .lede, .piece p, .card p, .note, .pull { overflow-wrap: anywhere; }
  .practice-stats { gap: 1.2rem; flex-wrap: wrap; }
  .stat-num { font-size: 2.2rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .ticker-track { animation: none; }
  .piece, .go, .plate { transition: none; }
  .dot, .field { display: none; }
}
