:root {
  --sky-top: #0a0e2a;
  --sky-mid: #2a2752;
  --sky-warm: #8a5067;
  --sky-horizon: #e8a878;
  --horizon-glow: #f4cc94;
  --snow: #efe8d8;
  --snow-shadow: #b9b3c4;
  --lake-deep: #0b1530;
  --lake-mid: #1f2c54;
  --lake-glow: #5d6a8c;
  --mtn-far: #5e5a7e;
  --mtn-mid: #2a2a4e;
  --mtn-front: #0a0d22;
  --mtn-shadow: #060718;
  --ink: #efe8d8;
  --ink-dim: rgba(239, 232, 216, 0.62);
  --accent: oklch(78% 0.13 55);
  --trail: #f4cc94;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Space Grotesk', system-ui, sans-serif;
  background: var(--sky-top);
  color: var(--ink);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ─────────────── NAV ─────────────── */
.nav {
  position: fixed; top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 22px 40px;
  display: flex; justify-content: space-between; align-items: center;
  font-size: 13px; letter-spacing: 0.06em;
  mix-blend-mode: difference;
  color: #fff;
}
.nav-logo { display: flex; align-items: center; text-decoration: none; }
.nav-logo img { height: 44px; width: auto; display: block; }
.nav-links { display: flex; gap: 26px; font-family: 'JetBrains Mono', monospace; font-size: 11px; text-transform: uppercase; }
.nav-links a { color: inherit; text-decoration: none; opacity: 0.85; transition: opacity 0.2s; }
.nav-links a:hover { opacity: 1; }

/* ─────────────── SCENE ─────────────── */
.scene-wrap {
  position: relative;
  height: 520vh;
}
.scene-sticky {
  position: sticky;
  top: 0;
  height: 100vh;
  width: 100%;
  overflow: hidden;
}
.scene-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

/* ─────────────── HERO TEXT ─────────────── */
.hero-text {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0 24px;
  z-index: 5;
  pointer-events: none;
}
.hero-text .kicker {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--ink-dim);
  margin-bottom: 28px;
}
.hero-text h1 {
  font-family: 'Instrument Serif', serif;
  font-weight: 400;
  font-size: clamp(54px, 9vw, 148px);
  line-height: 0.96;
  letter-spacing: -0.01em;
  color: var(--ink);
  text-shadow: 0 4px 40px rgba(0,0,0,0.35);
}
.hero-text h1 em {
  font-style: italic;
  color: var(--horizon-glow);
}
.hero-text .scroll-cue {
  margin-top: 38px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: #ffe9c4;
  background: rgba(10, 13, 34, 0.55);
  border: 1px solid rgba(244, 204, 148, 0.45);
  padding: 12px 20px;
  border-radius: 999px;
  backdrop-filter: blur(6px);
  text-shadow: 0 1px 12px rgba(10, 13, 34, 0.8);
  box-shadow: 0 0 24px rgba(244, 204, 148, 0.15);
}
.hero-text .scroll-cue::before {
  content: '↓';
  font-size: 14px;
  color: var(--horizon-glow);
  animation: bob 2.4s ease-in-out infinite;
}
@keyframes bob { 0%,100% { transform: translateY(0); opacity: 0.6; } 50% { transform: translateY(5px); opacity: 1; } }

/* ─────────────── CHAPTERS ─────────────── */
.chapter {
  position: absolute;
  z-index: 6;
  color: var(--ink);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.6s ease, transform 0.6s ease;
  transform: translateY(20px);
  max-width: 460px;
}
.chapter.is-visible { opacity: 1; transform: translateY(0); }
.chapter .ch-tag {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--horizon-glow);
  margin-bottom: 16px;
  display: flex; align-items: center; gap: 12px;
}
.chapter .ch-tag::before {
  content: ''; width: 28px; height: 1px; background: currentColor; display: inline-block;
}
.chapter h2 {
  font-family: 'Instrument Serif', serif;
  font-weight: 400;
  font-size: clamp(34px, 4.4vw, 60px);
  line-height: 1.04;
  letter-spacing: -0.01em;
  margin-bottom: 18px;
  text-shadow: 0 2px 24px rgba(0,0,0,0.5);
}
.chapter h2 em { font-style: italic; color: var(--horizon-glow); }
.chapter p {
  font-size: 17px;
  line-height: 1.55;
  color: rgba(239, 232, 216, 0.88);
  text-shadow: 0 2px 18px rgba(0,0,0,0.5);
}

.chapter-1 { top: 16%; left: 7%; }
.chapter-2 { top: 18%; right: 7%; left: auto; text-align: right; }
.chapter-2 .ch-tag { justify-content: flex-end; }
.chapter-2 .ch-tag::before { display: none; }
.chapter-2 .ch-tag::after { content: ''; width: 28px; height: 1px; background: currentColor; }
.chapter-3 { top: 18%; left: 50%; transform: translate(-50%, 20px); text-align: center; }
.chapter-3.is-visible { transform: translate(-50%, 0); }
.chapter-3 .ch-tag { justify-content: center; }

/* ─────────────── POST-SCENE ─────────────── */
.after {
  position: relative;
  background: linear-gradient(180deg, #0a0d22 0%, #050714 100%);
  color: var(--ink);
}
.after::before {
  content: '';
  position: absolute;
  top: -120px; left: 0; right: 0; height: 120px;
  background: linear-gradient(180deg, transparent 0%, #0a0d22 100%);
  pointer-events: none;
}

.section {
  max-width: 1240px;
  margin: 0 auto;
  padding: 140px 40px 0;
}
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 32px;
  margin-bottom: 64px;
  border-top: 1px solid rgba(239,232,216,0.12);
  padding-top: 28px;
}
.section-head h3 {
  font-family: 'Instrument Serif', serif;
  font-weight: 400;
  font-size: clamp(40px, 5vw, 72px);
  line-height: 1;
  letter-spacing: -0.01em;
}
.section-head h3 em { font-style: italic; color: var(--horizon-glow); }
.section-head .label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--ink-dim);
  white-space: nowrap;
}

/* ─────────────── EXPERIENCE TIMELINE ─────────────── */
.timeline {
  list-style: none;
  margin: 0; padding: 0;
  border-top: 1px solid rgba(239,232,216,0.12);
}
.tl-item {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 48px;
  padding: 38px 0;
  border-bottom: 1px solid rgba(239,232,216,0.12);
  transition: background 0.3s;
}
.tl-item:hover { background: rgba(244, 204, 148, 0.025); }
.tl-when {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-top: 4px;
}
.tl-year {
  font-family: 'Instrument Serif', serif;
  font-size: 30px;
  line-height: 1;
  color: var(--horizon-glow);
}
.tl-status {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--ink-dim);
}
.tl-body { max-width: 760px; }
.tl-role {
  font-family: 'Instrument Serif', serif;
  font-size: 30px;
  line-height: 1.1;
  margin-bottom: 6px;
}
.tl-org {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  letter-spacing: 0.12em;
  color: var(--ink);
  margin-bottom: 16px;
  text-transform: uppercase;
}
.tl-loc { color: var(--ink-dim); text-transform: none; letter-spacing: 0.06em; }
.tl-body p {
  font-size: 15px;
  line-height: 1.6;
  color: rgba(239,232,216,0.72);
  max-width: 60ch;
}
.tl-dur {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-dim);
}
.tl-link {
  display: inline-block;
  margin-top: 14px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--horizon-glow);
  text-decoration: none;
  border-bottom: 1px solid rgba(244, 204, 148, 0.4);
  padding-bottom: 2px;
  transition: color 0.2s, border-color 0.2s;
}
.tl-link:hover { color: var(--ink); border-color: var(--ink); }
.tl-item.is-hidden { display: none; }
.timeline.is-expanded .tl-item.is-hidden {
  display: grid;
  animation: tlFade 0.5s ease both;
}
@keyframes tlFade {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.tl-toggle-wrap {
  display: flex;
  justify-content: center;
  margin-top: 32px;
}
.tl-toggle {
  background: transparent;
  border: 1px solid rgba(244, 204, 148, 0.3);
  color: var(--ink);
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  padding: 14px 28px;
  border-radius: 999px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  transition: background 0.25s, border-color 0.25s, color 0.25s;
}
.tl-toggle:hover {
  background: rgba(244, 204, 148, 0.08);
  border-color: var(--horizon-glow);
  color: var(--horizon-glow);
}
.tl-toggle-icon {
  display: inline-block;
  width: 18px; height: 18px;
  border: 1px solid currentColor;
  border-radius: 50%;
  text-align: center;
  font-size: 13px;
  line-height: 16px;
  transition: transform 0.3s;
}
.tl-toggle[aria-expanded="true"] .tl-toggle-icon { transform: rotate(45deg); }

/* ─────────────── PROJECTS ─────────────── */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 32px;
}
.filter-btn {
  background: transparent;
  border: 1px solid rgba(239,232,216,0.16);
  color: var(--ink-dim);
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  padding: 9px 16px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}
.filter-btn:hover { color: var(--ink); border-color: rgba(244,204,148,0.4); }
.filter-btn.active {
  background: var(--horizon-glow);
  border-color: var(--horizon-glow);
  color: #0a0d22;
}
.project.is-out { display: none; }
.project.is-paged-out { display: none; }
.view-all-wrap { display: flex; flex-direction: column; align-items: center; gap: 28px; margin-top: 48px; }
.pager { display: flex; align-items: center; gap: 20px; }
.pager-status {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--ink-dim);
  min-width: 80px;
  text-align: center;
}
.pager-btn {
  background: transparent;
  border: 1px solid rgba(239,232,216,0.16);
  color: var(--ink);
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  padding: 11px 20px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s, opacity 0.2s;
}
.pager-btn:hover:not(:disabled) { border-color: var(--horizon-glow); color: var(--horizon-glow); }
.pager-btn:disabled { opacity: 0.3; cursor: not-allowed; }
.view-all-btn {
  text-decoration: none;
  background: transparent;
  border: 1px solid rgba(244, 204, 148, 0.3);
  color: var(--ink);
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  padding: 14px 28px;
  border-radius: 999px;
  transition: background 0.25s, border-color 0.25s, color 0.25s;
}
.view-all-btn:hover {
  background: rgba(244, 204, 148, 0.08);
  border-color: var(--horizon-glow);
  color: var(--horizon-glow);
}

/* ─────────────── ABOUT / PORTRAIT ─────────────── */
.about-grid {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 64px;
  align-items: center;
}
.portrait {
  margin: 0;
  position: relative;
}
.portrait img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  object-position: center 28%;
  border-radius: 6px;
  filter: saturate(1.05) contrast(1.02);
  box-shadow:
    0 30px 80px -20px rgba(0,0,0,0.6),
    0 0 0 1px rgba(244,204,148,0.18),
    0 0 40px rgba(244,204,148,0.08);
}
.portrait::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 6px;
  background: linear-gradient(180deg, transparent 60%, rgba(10,13,34,0.35));
  pointer-events: none;
}
.portrait figcaption {
  position: absolute;
  left: 16px;
  bottom: 14px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--ink);
  text-shadow: 0 1px 8px rgba(0,0,0,0.7);
  z-index: 2;
}
.about-copy { max-width: 540px; }
.about-lede {
  font-family: 'Instrument Serif', serif;
  font-style: italic;
  font-size: 36px;
  color: var(--horizon-glow);
  margin: 0 0 18px;
  line-height: 1;
}
.about-copy p {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 17px;
  line-height: 1.7;
  color: var(--ink-dim);
  margin: 0 0 14px;
}
.about-stats {
  display: flex;
  gap: 36px;
  margin-top: 32px;
  padding-top: 28px;
  border-top: 1px solid rgba(239,232,216,0.1);
}
.about-stat { display: flex; flex-direction: column; gap: 6px; }
.about-num {
  font-family: 'Instrument Serif', serif;
  font-size: 38px;
  line-height: 1;
  color: var(--ink);
}
.about-lab {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--ink-dim);
}

/* ─────────────── PROJECTS GRID ─────────────── */
.projects {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 28px;
}
.project {
  grid-column: span 6;
  position: relative;
  background: rgba(239,232,216,0.025);
  border: 1px solid rgba(239,232,216,0.08);
  border-radius: 4px;
  padding: 32px;
  transition: background 0.3s, border-color 0.3s, transform 0.3s;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 280px;
  text-decoration: none;
  color: inherit;
}
.project:hover {
  background: rgba(239,232,216,0.05);
  border-color: rgba(244, 204, 148, 0.4);
  transform: translateY(-2px);
}
.project.featured { grid-column: span 12; min-height: 340px; }
.project-meta {
  display: flex; justify-content: space-between;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--ink-dim);
  margin-bottom: 24px;
}
.project-meta .num { color: var(--horizon-glow); }
.project h4 {
  font-family: 'Instrument Serif', serif;
  font-weight: 400;
  font-size: 36px;
  line-height: 1.05;
  margin-bottom: 12px;
}
.project.featured h4 { font-size: 52px; }
.project p {
  font-size: 14.5px;
  line-height: 1.55;
  color: rgba(239,232,216,0.7);
  margin-bottom: 22px;
  max-width: 56ch;
}
.project-tags {
  margin-top: auto;
  display: flex; gap: 8px; flex-wrap: wrap;
}
.project-tags span {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.1em;
  padding: 5px 10px;
  border: 1px solid rgba(239,232,216,0.18);
  border-radius: 999px;
  color: rgba(239,232,216,0.78);
}
.project-arrow {
  position: absolute; top: 28px; right: 28px;
  width: 38px; height: 38px;
  border: 1px solid rgba(239,232,216,0.2);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.3s, border-color 0.3s, transform 0.3s;
  color: var(--ink);
  text-decoration: none;
}
.project:hover .project-arrow {
  background: var(--horizon-glow);
  border-color: var(--horizon-glow);
  color: #0a0d22;
  transform: rotate(-45deg);
}

/* ─────────────── CONTACT ─────────────── */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  border-top: 1px solid rgba(239,232,216,0.12);
  border-bottom: 1px solid rgba(239,232,216,0.12);
}
.contact-cell {
  padding: 44px 32px;
  border-right: 1px solid rgba(239,232,216,0.12);
  text-decoration: none;
  color: var(--ink);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 220px;
  transition: background 0.3s;
  position: relative;
}
.contact-cell:last-child { border-right: none; }
.contact-cell:hover { background: rgba(244, 204, 148, 0.06); }
.contact-cell .c-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--ink-dim);
}
.contact-cell .c-value {
  font-family: 'Instrument Serif', serif;
  font-size: 32px;
  line-height: 1.05;
  margin-top: 36px;
}
.contact-cell .c-value em { font-style: italic; color: var(--horizon-glow); }

/* ─────────────── FOOTER ─────────────── */
.footer {
  max-width: 1240px;
  margin: 0 auto;
  padding: 80px 40px 60px;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-dim);
}
.footer .sig {
  font-family: 'Instrument Serif', serif;
  font-style: italic;
  font-size: 22px;
  text-transform: none;
  letter-spacing: 0;
  color: var(--ink);
}

/* ─────────────── SNOW PARTICLES ─────────────── */
.snow-layer {
  position: absolute; inset: 0;
  pointer-events: none;
  z-index: 4;
}
.flake {
  position: absolute;
  top: -10px;
  background: #fff;
  border-radius: 50%;
  opacity: 0.7;
  animation: fall linear infinite;
}
@keyframes fall {
  to { transform: translateY(110vh); }
}

/* ─────────────── TWEAKS PANEL ─────────────── */
.tweaks {
  position: fixed;
  right: 24px; bottom: 24px;
  width: 260px;
  background: rgba(10, 13, 34, 0.92);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(244, 204, 148, 0.18);
  border-radius: 8px;
  padding: 18px;
  color: var(--ink);
  z-index: 200;
  font-size: 13px;
  display: none;
  box-shadow: 0 24px 60px rgba(0,0,0,0.5);
}
.tweaks.is-open { display: block; }
.tweaks-head {
  display: flex; justify-content: space-between; align-items: center;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--ink-dim);
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(239,232,216,0.08);
}
.tweaks-head button {
  background: none; border: none; color: var(--ink); cursor: pointer;
  font-size: 16px; line-height: 1;
}
.tweak-row { margin-bottom: 16px; }
.tweak-row:last-child { margin-bottom: 0; }
.tweak-row label {
  display: block;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-dim);
  margin-bottom: 8px;
}
.seg {
  display: flex; gap: 4px;
  background: rgba(239,232,216,0.04);
  padding: 3px;
  border-radius: 6px;
}
.seg button {
  flex: 1;
  background: none; border: none;
  padding: 7px 8px;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 12px;
  color: var(--ink-dim);
  cursor: pointer;
  border-radius: 4px;
  transition: background 0.2s, color 0.2s;
}
.seg button.active { background: rgba(244,204,148,0.22); color: var(--ink); }
.swatches { display: flex; gap: 8px; }
.swatches button {
  width: 28px; height: 28px; border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.2s, border-color 0.2s;
}
.swatches button.active { border-color: var(--ink); transform: scale(1.08); }

/* ─────────────── RESPONSIVE ─────────────── */
@media (max-width: 900px) {
  .nav { padding: 18px 22px; }
  .nav-links { gap: 16px; }
  .nav-links a:not(.cta) { display: none; }
  .chapter { max-width: 78vw; }
  .chapter-1, .chapter-2 { left: 7%; right: 7%; text-align: left; top: 14%; }
  .chapter-2 .ch-tag { justify-content: flex-start; }
  .chapter-2 .ch-tag::after { display: none; }
  .chapter-2 .ch-tag::before { content: ''; width: 28px; height: 1px; background: currentColor; display: inline-block; }
  .section { padding: 100px 22px 0; }
  .section-head { flex-direction: column; gap: 16px; margin-bottom: 40px; }
  .project, .project.featured { grid-column: span 12; }
  .about-grid { grid-template-columns: 1fr; gap: 36px; }
  .portrait { max-width: 320px; }
  .about-stats { gap: 24px; flex-wrap: wrap; }
  .contact-grid { grid-template-columns: 1fr; }
  .contact-cell { border-right: none; border-bottom: 1px solid rgba(239,232,216,0.12); }
  .contact-cell:last-child { border-bottom: none; }
  .footer { flex-direction: column; gap: 18px; padding: 60px 22px 40px; }
}
