/* ───────────────────────────── Tokens ───────────────────────────── */
:root {
  --bg: #08090b;
  --bg-soft: #0b0d10;
  --panel: #0f1216;
  --panel-hi: #13171c;
  --line: rgba(255, 255, 255, 0.09);
  --line-hi: rgba(255, 255, 255, 0.16);
  --text: #e9e7e2;
  --muted: #97999e;
  --accent: #c8f560;
  --accent-soft: rgba(200, 245, 96, 0.14);
  --violet: #9d8cff;
  --serif: "Instrument Serif", "Iowan Old Style", Georgia, serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Consolas, monospace;
  --radius: 18px;
  --maxw: 1160px;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 92px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-weight: 300;
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body::after {
  /* film grain */
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
}

::selection { background: var(--accent); color: #0a0b06; }

a { color: inherit; text-decoration: none; }
ul { list-style: none; margin: 0; padding: 0; }
h1, h2, h3, h4 { margin: 0; font-weight: 400; letter-spacing: -0.02em; }
p { margin: 0; }
em { font-family: var(--serif); font-style: italic; color: var(--accent); letter-spacing: 0; }
.accent { color: var(--accent); }
.muted { color: var(--muted); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 clamp(20px, 5vw, 40px);
}

/* ─────────────────────────── Chrome ─────────────────────────── */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  z-index: 60;
  background: transparent;
}
.scroll-progress span {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--accent), var(--violet));
  transition: width 0.1s linear;
}

.cursor-glow {
  position: fixed;
  width: 620px;
  height: 620px;
  border-radius: 50%;
  left: 0;
  top: 0;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 0;
  opacity: 0;
  transition: opacity 0.5s ease;
  background: radial-gradient(circle, rgba(200, 245, 96, 0.07), transparent 62%);
}
body.has-pointer .cursor-glow { opacity: 1; }

.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 16px clamp(20px, 5vw, 40px);
  border-bottom: 1px solid transparent;
  transition: background 0.3s ease, border-color 0.3s ease, padding 0.3s ease;
}
.nav.is-stuck {
  background: rgba(8, 9, 11, 0.78);
  backdrop-filter: blur(16px) saturate(1.3);
  -webkit-backdrop-filter: blur(16px) saturate(1.3);
  border-bottom-color: var(--line);
  padding-top: 12px;
  padding-bottom: 12px;
}

.brand { display: flex; align-items: center; gap: 10px; font-family: var(--mono); font-size: 14px; letter-spacing: 0.01em; }
.brand-mark {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: var(--accent);
  color: #0a0b06;
  font-family: var(--serif);
  font-size: 19px;
  font-style: italic;
  font-weight: 600;
}
.brand-text { color: #d9d7d2; }

/* Section jump menu: collapsed to the current section, options on hover/focus */
.nav-sections { position: relative; display: flex; }

.nav-sections-toggle {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 8px 15px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}
.nav-sections:hover .nav-sections-toggle,
.nav-sections:focus-within .nav-sections-toggle,
.nav-sections.is-open .nav-sections-toggle {
  color: var(--text);
  border-color: var(--line-hi);
  background: rgba(255, 255, 255, 0.04);
}
.nav-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}
.nav-sections-toggle .chev {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.25s ease;
}
.nav-sections:hover .nav-sections-toggle .chev,
.nav-sections:focus-within .nav-sections-toggle .chev,
.nav-sections.is-open .nav-sections-toggle .chev { transform: rotate(180deg); }

.nav-links {
  position: absolute;
  top: 100%;
  left: 50%;
  display: grid;
  gap: 2px;
  min-width: 210px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(12, 14, 17, 0.97);
  backdrop-filter: blur(20px);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translate(-50%, -6px);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
}
.nav-sections:hover .nav-links,
.nav-sections:focus-within .nav-links,
.nav-sections.is-open .nav-links {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translate(-50%, 8px);
}
.nav-links a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 13px;
  font-size: 13.5px;
  color: var(--muted);
  border-radius: 10px;
  transition: color 0.2s ease, background 0.2s ease;
}
.nav-links a:hover { color: var(--text); background: rgba(255, 255, 255, 0.05); }
.nav-links a.is-active { color: var(--text); background: var(--accent-soft); }
.nav-links a.is-active::after {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
}

.nav-actions { display: flex; align-items: center; gap: 12px; }

.menu-toggle {
  display: none;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: transparent;
  cursor: pointer;
  padding: 0;
  place-items: center;
  gap: 5px;
}
.menu-toggle span {
  display: block;
  width: 16px;
  height: 1.5px;
  background: var(--text);
  transition: transform 0.25s ease, opacity 0.25s ease;
}
.menu-toggle[aria-expanded="true"] span:first-child { transform: translateY(3.5px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] span:last-child { transform: translateY(-3px) rotate(-45deg); }

.mobile-menu[hidden] { display: none; }
.mobile-menu {
  position: fixed;
  top: 60px;
  left: 12px;
  right: 12px;
  z-index: 49;
  display: grid;
  gap: 4px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(12, 14, 17, 0.97);
  backdrop-filter: blur(20px);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
}
.mobile-menu a {
  padding: 11px 12px;
  border-radius: 10px;
  color: #d3d1cc;
  font-size: 15px;
}
.mobile-menu a:hover { background: rgba(255, 255, 255, 0.05); }
.mobile-menu .btn { justify-content: center; margin-top: 6px; }

/* ─────────────────────────── Buttons ─────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 13px 22px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-family: var(--sans);
  font-size: 14.5px;
  font-weight: 500;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, color 0.2s ease;
  white-space: nowrap;
}
.btn svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.25s ease;
}
.btn:hover svg { transform: translateX(4px); }
.btn-primary {
  background: var(--accent);
  color: #0a0b06;
  box-shadow: 0 0 0 rgba(200, 245, 96, 0);
}
.btn-primary:hover {
  background: #d7ff7d;
  transform: translateY(-2px);
  box-shadow: 0 12px 34px rgba(200, 245, 96, 0.18);
}
.btn-ghost {
  border-color: var(--line-hi);
  color: var(--text);
  background: rgba(255, 255, 255, 0.02);
}
.btn-ghost:hover { border-color: rgba(200, 245, 96, 0.5); color: var(--accent); transform: translateY(-2px); }
.btn-small { padding: 9px 16px; font-size: 13px; }
.btn-large { padding: 16px 28px; font-size: 16px; }

/* ─────────────────────────── Hero ─────────────────────────── */
.hero {
  position: relative;
  padding: clamp(120px, 16vw, 180px) 0 0;
  overflow: hidden;
}
.hero-grid {
  position: absolute;
  inset: 0;
  z-index: 0;
  background-image:
    linear-gradient(to right, rgba(255, 255, 255, 0.045) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.045) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: radial-gradient(ellipse 80% 65% at 50% 15%, #000 20%, transparent 78%);
  -webkit-mask-image: radial-gradient(ellipse 80% 65% at 50% 15%, #000 20%, transparent 78%);
}
.hero::before {
  content: "";
  position: absolute;
  z-index: 0;
  width: 720px;
  height: 720px;
  top: -320px;
  right: -180px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(157, 140, 255, 0.16), transparent 66%);
  filter: blur(20px);
  animation: drift 18s ease-in-out infinite alternate;
}
.hero::after {
  content: "";
  position: absolute;
  z-index: 0;
  width: 560px;
  height: 560px;
  bottom: -260px;
  left: -160px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(200, 245, 96, 0.1), transparent 68%);
  filter: blur(20px);
  animation: drift 22s ease-in-out infinite alternate-reverse;
}
@keyframes drift {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(-40px, 40px, 0) scale(1.1); }
}

.hero-inner {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.75fr);
  gap: clamp(32px, 6vw, 72px);
  align-items: center;
  padding-bottom: clamp(64px, 9vw, 110px);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 26px;
  padding: 7px 15px 7px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.025);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.02em;
  color: #b9b7b2;
}
.pulse {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 rgba(200, 245, 96, 0.5);
  animation: pulse 2.4s ease-out infinite;
  flex: none;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(200, 245, 96, 0.5); }
  70% { box-shadow: 0 0 0 9px rgba(200, 245, 96, 0); }
  100% { box-shadow: 0 0 0 0 rgba(200, 245, 96, 0); }
}

h1 {
  font-family: var(--serif);
  font-size: clamp(46px, 7.4vw, 88px);
  line-height: 0.98;
  letter-spacing: -0.025em;
  max-width: 15ch;
}
h1 em { font-size: 0.98em; }

.lede {
  margin-top: 26px;
  max-width: 52ch;
  color: #b4b2ad;
  font-size: clamp(16px, 1.5vw, 18px);
  line-height: 1.7;
}

.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 34px; }

.rotator {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 34px;
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--muted);
}
.rotator-label {
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-radius: 5px;
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.rotator-text { color: var(--accent); }
.rotator-text.is-swapping { opacity: 0; transform: translateY(-4px); }
.rotator-text { transition: opacity 0.28s ease, transform 0.28s ease; display: inline-block; }

.hero-card { position: relative; display: flex; justify-content: center; }

.terminal {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 390px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(165deg, #12161b, #0b0e11 65%);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  overflow: hidden;
  transform: rotate(-1.2deg);
  transition: transform 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.terminal:hover { transform: rotate(0deg) translateY(-4px); }
.terminal-bar {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
}
.dot { width: 9px; height: 9px; border-radius: 50%; display: block; }
.dot.red { background: #ff5f57; }
.dot.amber { background: #febc2e; }
.dot.green { background: #28c840; }
.terminal-title {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 10.5px;
  color: #6f7276;
}
.terminal-body {
  margin: 0;
  padding: 20px 18px 24px;
  font-family: var(--mono);
  font-size: 12.4px;
  line-height: 1.85;
  color: #cfcdc8;
  white-space: pre-wrap;
}
.t-muted { color: #6f7276; }
.t-key { color: var(--accent); }
.t-green { color: #7ae2a0; }
.caret {
  display: inline-block;
  width: 7px;
  height: 14px;
  background: var(--accent);
  vertical-align: -2px;
  animation: blink 1.1s steps(2, start) infinite;
}
@keyframes blink { to { visibility: hidden; } }

.orbit-badge {
  position: absolute;
  z-index: 1;
  right: -6px;
  bottom: -46px;
  width: 132px;
  height: 132px;
}
.orbit-badge svg { width: 100%; height: 100%; animation: spin 26s linear infinite; }
.orbit-badge text {
  font-family: var(--mono);
  font-size: 9.4px;
  letter-spacing: 0.22em;
  fill: #8b8d91;
}
.orbit-dot {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 9px;
  height: 9px;
  margin: -4.5px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 22px var(--accent);
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Marquee */
.marquee {
  position: relative;
  z-index: 2;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 18px 0;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.012);
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.marquee-track {
  display: flex;
  gap: 44px;
  width: max-content;
  animation: marquee 34s linear infinite;
}
.marquee-track span {
  font-family: var(--mono);
  font-size: 12.5px;
  letter-spacing: 0.06em;
  color: #7e8185;
  text-transform: uppercase;
  white-space: nowrap;
}
.marquee:hover .marquee-track { animation-play-state: paused; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ─────────────────────────── Sections ─────────────────────────── */
.section { position: relative; z-index: 2; padding: clamp(76px, 10vw, 130px) 0; }
.section + .section { border-top: 1px solid rgba(255, 255, 255, 0.05); }

.section-label {
  margin-bottom: 18px;
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #7c7f83;
}
.section-title {
  font-family: var(--serif);
  font-size: clamp(34px, 4.8vw, 58px);
  line-height: 1.04;
  letter-spacing: -0.015em;
}
.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
  flex-wrap: wrap;
  margin-bottom: 44px;
}

/* About */
.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  gap: clamp(32px, 6vw, 72px);
  align-items: start;
}
.about-copy { display: grid; gap: 20px; color: #b4b2ad; }
.about-copy p { max-width: 60ch; }

.now-panel {
  margin-top: 10px;
  padding: 22px 24px;
  border: 1px solid var(--line);
  border-left: 2px solid var(--accent);
  border-radius: 0 14px 14px 0;
  background: linear-gradient(90deg, rgba(200, 245, 96, 0.045), transparent 70%);
}
.now-head {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 14px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}
.now-list { display: grid; gap: 10px; font-size: 14.5px; color: #c3c1bc; }
.now-list li { display: flex; gap: 12px; align-items: baseline; }
.now-list span {
  flex: none;
  width: 76px;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #75787c;
}

/* Skills */
.skill-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(238px, 1fr));
  gap: 16px;
  margin-top: 44px;
}
.card {
  position: relative;
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(170deg, var(--panel-hi), var(--panel));
  transition: border-color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
  overflow: hidden;
}
.card::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.35s ease;
  background: radial-gradient(420px circle at var(--cx, 50%) var(--cy, 0%), rgba(200, 245, 96, 0.07), transparent 70%);
  pointer-events: none;
}
.card:hover { border-color: rgba(200, 245, 96, 0.28); transform: translateY(-4px); box-shadow: 0 20px 46px rgba(0, 0, 0, 0.35); }
.card:hover::before { opacity: 1; }

.skill-card h3 { font-size: 19px; margin-bottom: 8px; font-weight: 500; letter-spacing: -0.01em; }
.skill-card p { font-size: 14px; color: var(--muted); margin-bottom: 18px; }
.card-index {
  display: block;
  margin-bottom: 18px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  color: #5f6367;
}

.chips { display: flex; flex-wrap: wrap; gap: 7px; }
.chips li {
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.022);
  font-family: var(--mono);
  font-size: 11.5px;
  color: #a9a7a2;
}
.chips.compact li { padding: 3px 8px; font-size: 10.5px; }

/* Filters */
.filters {
  display: flex;
  gap: 6px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.02);
}
.filter {
  padding: 7px 15px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 13px;
  cursor: pointer;
  transition: color 0.2s ease, background 0.2s ease;
}
.filter:hover { color: var(--text); }
.filter.is-active { background: var(--accent); color: #0a0b06; font-weight: 500; }

/* Work */
.work-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.work-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 240px;
  cursor: pointer;
  padding: 28px;
}
.work-card.is-wide { grid-column: span 2; min-height: 300px; }
.work-card.is-wide h3 { font-size: clamp(30px, 3.4vw, 42px); }
.work-card h3 {
  font-family: var(--serif);
  font-size: clamp(24px, 2.4vw, 30px);
  line-height: 1.1;
}
.work-card:hover h3 { color: var(--accent); transition: color 0.25s ease; }
.work-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.work-tag {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: #7f8286;
}
.work-year { font-family: var(--mono); font-size: 11px; color: #5f6367; }
.work-sub { color: var(--muted); font-size: 14.5px; max-width: 46ch; }
.work-points { display: grid; gap: 8px; margin-top: 2px; color: #abaaa6; font-size: 14px; max-width: 68ch; }
.work-points li { position: relative; padding-left: 18px; }
.work-points li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 6px;
  height: 1px;
  background: var(--accent);
}
.work-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  flex-wrap: wrap;
}
.work-open {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--mono);
  font-size: 11.5px;
  color: #8d9094;
  transition: color 0.2s ease, gap 0.2s ease;
}
.work-card:hover .work-open { color: var(--accent); gap: 11px; }
.work-card.is-hidden { display: none; }

/* Modal */
.work-modal {
  width: min(680px, calc(100vw - 32px));
  max-height: min(86vh, 760px);
  padding: 0;
  border: 1px solid var(--line-hi);
  border-radius: 20px;
  background: #0d1013;
  color: var(--text);
  overflow: auto;
  box-shadow: 0 40px 120px rgba(0, 0, 0, 0.7);
}
.work-modal::backdrop {
  background: rgba(4, 5, 6, 0.72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.work-modal[open] { animation: modalIn 0.28s cubic-bezier(0.2, 0.8, 0.2, 1); }
@keyframes modalIn {
  from { opacity: 0; transform: translateY(14px) scale(0.985); }
  to { opacity: 1; transform: none; }
}
.modal-inner { position: relative; padding: clamp(26px, 4vw, 44px); }
.modal-close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.03);
  color: #b9b7b2;
  font-size: 12px;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}
.modal-close:hover { background: var(--accent); color: #0a0b06; transform: rotate(90deg); }
#modalTitle {
  margin: 10px 0 14px;
  font-family: var(--serif);
  font-size: clamp(30px, 4vw, 42px);
  line-height: 1.05;
  padding-right: 40px;
}
.modal-summary { color: #b9b7b2; font-size: 16px; }
.modal-stack { display: flex; flex-wrap: wrap; gap: 7px; margin: 22px 0 26px; }
.modal-stack span {
  padding: 4px 10px;
  border: 1px solid rgba(200, 245, 96, 0.25);
  border-radius: 6px;
  background: var(--accent-soft);
  font-family: var(--mono);
  font-size: 11px;
  color: #d4ef98;
}
.modal-inner h4 {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #7c7f83;
  margin-bottom: 14px;
}
.modal-list { display: grid; gap: 12px; }
.modal-list li {
  position: relative;
  padding-left: 20px;
  font-size: 14.5px;
  color: #c2c0bb;
  line-height: 1.65;
}
.modal-list li::before {
  content: "→";
  position: absolute;
  left: 0;
  color: var(--accent);
  font-size: 12px;
  top: 0.2em;
}
.modal-foot {
  margin-top: 26px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 11.5px;
  color: #7c7f83;
}

/* Optimise */
.optimise-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(32px, 6vw, 72px);
  align-items: center;
}
.optimise-grid .muted { margin-top: 22px; max-width: 50ch; }
.optimise-grid .muted + .muted { margin-top: 14px; }

.calc { padding: 28px; background: linear-gradient(165deg, #12161b, #0b0e11); }
.calc-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 26px; }
.calc-head h3 { font-size: 18px; font-weight: 500; }
.calc-badge {
  padding: 3px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #8a8d91;
}
.field { margin-bottom: 22px; }
.field label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 11px;
  font-size: 13.5px;
  color: #a9a7a2;
}
.field output {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--accent);
}

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent) 0%, var(--accent) var(--fill, 50%), rgba(255, 255, 255, 0.1) var(--fill, 50%));
  cursor: pointer;
  outline-offset: 8px;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--accent);
  box-shadow: 0 0 0 4px rgba(200, 245, 96, 0.12);
  transition: transform 0.15s ease;
}
input[type="range"]:hover::-webkit-slider-thumb { transform: scale(1.15); }
input[type="range"]::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--accent);
}
input[type="range"]::-moz-range-track { height: 3px; background: rgba(255, 255, 255, 0.1); }

.calc-results {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}
.calc-num {
  display: block;
  font-family: var(--serif);
  font-size: clamp(30px, 4vw, 40px);
  line-height: 1;
  letter-spacing: -0.02em;
}
.calc-label { display: block; margin-top: 8px; font-size: 12px; color: #83868a; }
.calc-note { margin-top: 20px; font-size: 11.5px; color: #6f7276; font-family: var(--mono); line-height: 1.6; }

/* Timeline */
.timeline { margin-top: 46px; display: grid; gap: 0; }
.timeline-item {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  gap: clamp(20px, 4vw, 56px);
  padding: 34px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  position: relative;
}
.timeline-item:last-child { border-bottom: 1px solid rgba(255, 255, 255, 0.07); }
.timeline-item::before {
  content: "";
  position: absolute;
  left: 0;
  top: -1px;
  width: 0;
  height: 1px;
  background: var(--accent);
  transition: width 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.timeline-item:hover::before { width: 76px; }
.timeline-meta { display: grid; gap: 6px; align-content: start; }
.timeline-period { font-family: var(--mono); font-size: 12px; color: #d3d1cc; }
.timeline-place { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.09em; text-transform: uppercase; color: #6f7276; }
.timeline-body h3 { font-size: 20px; font-weight: 500; margin-bottom: 4px; }
.timeline-org { font-size: 13.5px; color: var(--accent); margin-bottom: 14px; }
.timeline-body ul { display: grid; gap: 9px; color: #a9a7a2; font-size: 14.5px; max-width: 68ch; }
.timeline-body li { position: relative; padding-left: 17px; }
.timeline-body li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.7em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  border: 1px solid #5c6064;
}

/* Contact */
.contact { padding-top: clamp(90px, 12vw, 150px); padding-bottom: clamp(90px, 12vw, 150px); }
.contact-inner { position: relative; z-index: 2; max-width: 880px; }
.contact::before {
  content: "";
  position: absolute;
  z-index: 0;
  left: 50%;
  top: 40%;
  transform: translate(-50%, -50%);
  width: 900px;
  height: 520px;
  background: radial-gradient(ellipse, rgba(200, 245, 96, 0.08), transparent 65%);
  pointer-events: none;
}
.contact-title {
  font-family: var(--serif);
  font-size: clamp(38px, 6.2vw, 74px);
  line-height: 1.02;
  letter-spacing: -0.02em;
}
.contact .lede { margin-top: 24px; }
.contact-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 38px; }
.contact-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 26px;
  margin-top: 40px;
  padding-top: 26px;
  border-top: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 12.5px;
}
.contact-links a { color: #c3c1bc; transition: color 0.2s ease; }
.contact-links a:hover { color: var(--accent); }
.contact-note { color: #6f7276; margin-left: auto; }

/* Footer */
.footer { border-top: 1px solid var(--line); padding: 26px 0; position: relative; z-index: 2; }
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  font-family: var(--mono);
  font-size: 11.5px;
  color: #75787c;
  flex-wrap: wrap;
}
.footer-note { color: #5f6367; }
.back-top { color: #a9a7a2; transition: color 0.2s ease; }
.back-top:hover { color: var(--accent); }

/* Toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 80;
  transform: translate(-50%, 20px);
  padding: 11px 18px;
  border: 1px solid rgba(200, 245, 96, 0.3);
  border-radius: 999px;
  background: #14180f;
  color: var(--accent);
  font-family: var(--mono);
  font-size: 12px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

/* Reveal */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.2, 0.8, 0.2, 1); }
.reveal.is-in { opacity: 1; transform: none; }

/* ─────────────────────────── Responsive ─────────────────────────── */
@media (max-width: 980px) {
  .nav-sections { display: none; }
  .menu-toggle { display: grid; }
  .hero-inner { grid-template-columns: 1fr; }
  .hero-card { justify-content: flex-start; margin-top: 8px; }
  .terminal { max-width: 100%; transform: none; }
  .orbit-badge { display: none; }
  .about-grid, .optimise-grid { grid-template-columns: 1fr; }
  .work-grid { grid-template-columns: 1fr; }
  .work-card.is-wide { grid-column: span 1; }
  .timeline-item { grid-template-columns: 1fr; gap: 14px; }
  .timeline-meta { display: flex; align-items: baseline; gap: 14px; }
  .contact-note { margin-left: 0; }
}

@media (max-width: 560px) {
  body { font-size: 16px; }
  .nav-actions .btn { display: none; }
  .section-head { align-items: flex-start; }
  .filters { width: 100%; justify-content: space-between; }
  .filter { padding: 7px 11px; font-size: 12px; }
  .work-card, .card { padding: 22px; }
  .calc { padding: 22px; }
  .calc-results { grid-template-columns: 1fr; gap: 20px; }
  .contact-actions .btn { width: 100%; justify-content: center; }
  .footer-inner { justify-content: center; text-align: center; }
}

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