:root {
  color-scheme: dark;
  --bg: #080808;
  --text: #f4f4f0;
  --muted: #8c8c88;
  --line: rgba(255, 255, 255, 0.14);
  --soft-line: rgba(255, 255, 255, 0.08);
  --accent: #d7ff45;
  --max: 1120px;
  --content: 880px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "PingFang SC", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}

[hidden] { display: none !important; }
body.intro-active { overflow: hidden; }

a { color: inherit; text-decoration: none; }

.site-header {
  position: fixed;
  z-index: 20;
  top: 0;
  left: 0;
  width: 100%;
  height: 72px;
  padding: 0 max(28px, calc((100vw - var(--max)) / 2));
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(to bottom, rgba(8, 8, 8, 0.96), rgba(8, 8, 8, 0.72), transparent);
  backdrop-filter: blur(8px);
}

.brand {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .18em;
}

nav { display: flex; gap: 28px; }
nav a {
  color: #b7b7b2;
  font-size: 13px;
  transition: color .25s ease;
}
nav a:hover, nav a:focus-visible { color: var(--text); }

main { width: min(var(--content), calc(100% - 48px)); margin: 0 auto; }

.hero {
  min-height: 92vh;
  padding: 150px 0 96px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.eyebrow, .section-kicker {
  margin: 0 0 28px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .18em;
  text-transform: uppercase;
}

.hero h1 {
  margin: 0;
  font-size: clamp(68px, 12vw, 142px);
  line-height: .88;
  letter-spacing: -.075em;
  font-weight: 650;
}

.hero-intro {
  max-width: 760px;
  margin: 56px 0 0;
  font-size: clamp(21px, 3.1vw, 34px);
  line-height: 1.48;
  letter-spacing: -.035em;
}

.hero-tagline {
  max-width: 680px;
  margin: 28px 0 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.75;
}

.content-section {
  padding: 108px 0;
  border-top: 1px solid var(--line);
}

.capability-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 56px;
}

.capability {
  padding: 28px 0 38px;
  border-top: 1px solid var(--soft-line);
}

.capability h2, .timeline h2 {
  margin: 0 0 12px;
  font-size: 20px;
  line-height: 1.35;
  letter-spacing: -.02em;
}

.capability p, .timeline p, .project-summary {
  margin: 0;
  color: #a6a6a1;
  font-size: 14px;
  line-height: 1.75;
}

.timeline-item {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 34px;
  padding: 34px 0 54px;
  border-top: 1px solid var(--soft-line);
}

.timeline-period { color: var(--muted); font-size: 12px; line-height: 1.6; }
.timeline-company { margin: 0 0 6px; font-size: 24px; letter-spacing: -.03em; }
.timeline-role { margin: 0 0 26px; color: var(--muted); font-size: 13px; }
.timeline-detail { margin-top: 22px; }
.timeline-detail h2 { font-size: 15px; }

.project-row {
  position: relative;
  display: grid;
  grid-template-columns: 64px 1fr auto;
  gap: 22px;
  align-items: start;
  padding: 30px 0 34px;
  border-top: 1px solid var(--soft-line);
  transition: padding .25s ease, color .25s ease;
}

.project-row::before {
  content: "";
  position: absolute;
  left: 0;
  top: -1px;
  width: 0;
  height: 1px;
  background: var(--accent);
  transition: width .35s ease;
}

.project-row:hover::before { width: 100%; }
.project-row:hover { padding-left: 10px; }
.project-code, .project-status { color: var(--muted); font-size: 11px; letter-spacing: .08em; }
.project-name { margin: 0 0 10px; font-size: 25px; letter-spacing: -.035em; }
.project-status { max-width: 150px; text-align: right; line-height: 1.5; }

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--soft-line);
  border-bottom: 1px solid var(--soft-line);
}

.stat { min-height: 190px; padding: 34px 24px 28px 0; border-right: 1px solid var(--soft-line); }
.stat:last-child { border-right: 0; padding-left: 28px; }
.stat:nth-child(2) { padding-left: 28px; }
.stat-value { display: block; font-size: clamp(48px, 7vw, 76px); line-height: 1; letter-spacing: -.06em; }
.stat-label { display: block; margin-top: 12px; color: var(--muted); font-size: 12px; }

.contact-section { padding-bottom: 160px; }
.contact-lead { max-width: 690px; margin: 0 0 52px; font-size: clamp(24px, 4vw, 38px); line-height: 1.45; letter-spacing: -.04em; }
.contact-item {
  display: grid;
  grid-template-columns: 120px 1fr auto;
  align-items: center;
  min-height: 74px;
  border-top: 1px solid var(--soft-line);
  transition: color .2s ease;
}
.contact-item:last-child { border-bottom: 1px solid var(--soft-line); }
.contact-kind { color: var(--muted); font-size: 12px; }
.contact-value { font-size: 18px; }
.contact-arrow { font-size: 24px; transition: transform .2s ease; }
.contact-item:hover .contact-arrow { transform: translate(4px, -4px); }

.word-stage {
  position: relative;
  width: 100%;
  height: min(66vh, 640px);
  min-height: 460px;
  overflow: hidden;
  border-top: 1px solid var(--line);
  background: #050505;
}

#word-canvas { width: 100%; height: 100%; display: block; }
.word-wall { display: none; }
.footer-meta {
  position: absolute;
  left: max(24px, calc((100vw - var(--max)) / 2));
  right: max(24px, calc((100vw - var(--max)) / 2));
  bottom: 20px;
  display: flex;
  justify-content: space-between;
  color: #656561;
  font-size: 10px;
  letter-spacing: .14em;
  pointer-events: none;
}

.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity .7s cubic-bezier(.2,.7,.2,1), transform .7s cubic-bezier(.2,.7,.2,1);
}
.reveal.is-visible { opacity: 1; transform: translateY(0); }

/* First-visit moon landing */
.intro-seen .moon-intro { display: none; }
.moon-intro {
  position: fixed;
  z-index: 100;
  inset: 0;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 95%, rgba(190, 190, 184, .16), transparent 45%),
    #020202;
  cursor: pointer;
  transition: opacity .65s ease, visibility .65s ease;
}

#moon-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.moon-grain, .pixel-sky {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,.024) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.024) 1px, transparent 1px);
  background-size: 6px 6px;
  mask-image: linear-gradient(to bottom, rgba(0,0,0,.7), rgba(0,0,0,.15) 42%, #000 100%);
}

.moon-copy {
  position: absolute;
  z-index: 2;
  left: max(28px, calc((100vw - var(--max)) / 2));
  top: 50%;
  transform: translateY(-56%);
  width: min(760px, calc(100vw - 56px));
  transition: opacity .45s ease, transform .8s cubic-bezier(.2,.75,.2,1);
}
.moon-index { margin: 0 0 28px; color: #858581; font-size: 10px; letter-spacing: .18em; }
.moon-copy h1 { margin: 0; font-size: clamp(50px, 7.6vw, 110px); line-height: .98; letter-spacing: -.07em; font-weight: 620; }
.moon-enter {
  width: 148px;
  height: 50px;
  margin-top: 48px;
  padding: 0 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #111;
  background: #f2f2ed;
  border: 0;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  transition: width .25s ease, background .25s ease;
}
.moon-enter:hover, .moon-enter:focus-visible { width: 164px; background: var(--accent); }
.moon-hint { position: absolute; z-index: 2; right: 28px; bottom: 25px; margin: 0; color: #6f6f6b; font-size: 9px; letter-spacing: .2em; }
.moon-intro.is-leaving { pointer-events: none; }
.moon-intro.is-leaving .moon-copy { opacity: 0; transform: translateY(-62%) scale(.96); }
.moon-intro.is-leaving .moon-hint { opacity: 0; }
.moon-intro.is-static::before {
  content: "";
  position: absolute;
  left: -15%;
  right: -15%;
  bottom: -35%;
  height: 65%;
  border-radius: 50% 50% 0 0;
  background: radial-gradient(ellipse at 50% 0%, #777772 0, #292927 34%, #080808 70%);
  filter: contrast(1.25);
}

/* Selected works */
.works-page { min-height: 100vh; overflow-x: hidden; background: #030303; }
.works-main { width: 100%; max-width: none; margin: 0; }
.works-heading {
  position: relative;
  z-index: 4;
  width: min(var(--max), calc(100% - 56px));
  margin: 0 auto;
  padding: 122px 0 22px;
}
.works-heading .eyebrow { margin-bottom: 14px; }
.works-heading h1 { margin: 0; font-size: clamp(46px, 6vw, 82px); line-height: 1; letter-spacing: -.055em; }
.works-heading > p:last-child { max-width: 570px; margin: 18px 0 0; color: var(--muted); font-size: 14px; line-height: 1.7; }
.carousel-section {
  position: relative;
  min-height: 720px;
  height: calc(100vh - 230px);
  overflow: hidden;
  border-top: 1px solid var(--soft-line);
  isolation: isolate;
}
.carousel-section::after {
  content: "";
  position: absolute;
  z-index: -1;
  left: 50%;
  top: 26%;
  width: min(62vw, 900px);
  height: min(26vw, 360px);
  transform: translateX(-50%);
  background: radial-gradient(ellipse, rgba(255,255,255,.2), rgba(255,255,255,.055) 42%, transparent 72%);
  filter: blur(12px);
}
.pixel-sky {
  z-index: -2;
  opacity: .9;
  background-image:
    radial-gradient(circle, rgba(255,255,255,.16) 0 2px, transparent 3px),
    linear-gradient(rgba(255,255,255,.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.018) 1px, transparent 1px);
  background-size: 86px 73px, 8px 8px, 8px 8px;
  background-position: 12px 8px, 0 0, 0 0;
}
.work-carousel {
  position: absolute;
  inset: 0;
  perspective: 1200px;
  transform-style: preserve-3d;
  cursor: grab;
  touch-action: pan-y;
  user-select: none;
}
.work-carousel:active { cursor: grabbing; }
.work-card {
  --card-x: 0px;
  --card-y: 0px;
  --card-z: 0px;
  --card-rotate: 0deg;
  --card-tilt: 0deg;
  --card-scale: 1;
  position: absolute;
  left: 50%;
  top: 35%;
  width: clamp(230px, 18vw, 294px);
  aspect-ratio: .72;
  display: block;
  color: #161616;
  transform: translate(-50%, -50%) translate3d(var(--card-x), var(--card-y), var(--card-z)) rotateY(var(--card-tilt)) rotateZ(var(--card-rotate)) scale(var(--card-scale));
  transform-origin: 50% 100%;
  transition: transform .72s cubic-bezier(.18,.72,.16,1), opacity .45s ease, filter .45s ease;
  filter: brightness(.58) contrast(1.08);
  will-change: transform;
}
.work-card.is-active { filter: brightness(1) contrast(1); }
.work-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 8px; }
.card-stack {
  position: absolute;
  inset: 12px -12px -12px 12px;
  border: 2px solid #e8e8e3;
  box-shadow: 8px 8px 0 rgba(230,230,225,.65), 16px 16px 0 rgba(230,230,225,.28);
}
.card-surface {
  position: absolute;
  inset: 0;
  padding: 16px;
  display: grid;
  grid-template-rows: auto 1fr auto auto;
  gap: 12px;
  overflow: hidden;
  border: 3px solid #f3f3ef;
  background:
    linear-gradient(rgba(0,0,0,.035) 50%, transparent 50%),
    #e9e9e5;
  background-size: 100% 4px;
  box-shadow: 0 18px 38px rgba(0,0,0,.38);
}
.card-surface::after {
  content: "";
  position: absolute;
  right: 10px;
  top: 70px;
  width: 8px;
  height: 116px;
  background: repeating-linear-gradient(to bottom, #777 0 4px, transparent 4px 10px);
  opacity: .35;
}
.card-label { position: relative; z-index: 2; padding: 12px 13px; overflow: hidden; color: #f0f0ec; background: #242424; font-size: 15px; font-weight: 650; white-space: nowrap; text-overflow: ellipsis; }
.card-visual {
  position: relative;
  min-height: 170px;
  overflow: hidden;
  background:
    linear-gradient(135deg, transparent 20%, rgba(0,0,0,.12) 20% 21%, transparent 21% 49%, rgba(0,0,0,.16) 49% 51%, transparent 51%),
    radial-gradient(circle at 34% 38%, var(--card-accent) 0 3px, transparent 4px),
    repeating-linear-gradient(90deg, rgba(0,0,0,.18) 0 3px, transparent 3px 9px),
    #b9b9b4;
  background-size: auto, 16px 16px, auto, auto;
}
.card-visual.has-image { background-position: center; background-size: cover; filter: grayscale(1) contrast(1.18); }
.card-visual::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent 48%, rgba(255,255,255,.18) 50%, transparent 52%); mix-blend-mode: screen; }
.card-short { align-self: end; font-size: clamp(28px, 3vw, 46px); font-weight: 800; letter-spacing: -.075em; overflow-wrap: anywhere; }
.card-category, .card-code { font-size: 9px; letter-spacing: .16em; }
.card-code { position: absolute; right: 15px; bottom: 16px; padding: 7px 9px; color: #f0f0ec; background: #242424; }
.work-card:hover .card-surface { border-color: var(--card-accent); }
.carousel-controls {
  position: absolute;
  z-index: 30;
  left: 50%;
  bottom: 148px;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 20px;
}
.carousel-controls button { width: 42px; height: 38px; color: var(--text); border: 1px solid var(--line); background: rgba(8,8,8,.74); font-size: 18px; cursor: pointer; }
.carousel-controls button:hover { color: #111; background: var(--accent); }
.carousel-controls p { min-width: 52px; margin: 0; color: var(--muted); font-size: 11px; text-align: center; letter-spacing: .12em; }
.carousel-caption { position: absolute; z-index: 30; left: 50%; bottom: 54px; width: min(660px, calc(100% - 48px)); transform: translateX(-50%); text-align: center; }
.carousel-caption h2 { margin: 0 0 9px; font-size: 23px; letter-spacing: -.03em; }
.carousel-caption p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.65; }
.carousel-tip { position: absolute; z-index: 30; right: 28px; bottom: 24px; margin: 0; color: #686864; font-size: 9px; letter-spacing: .12em; }

/* Project details */
.project-main { width: min(var(--max), calc(100% - 56px)); margin: 0 auto; padding: 132px 0 120px; }
.back-link { display: inline-block; margin-bottom: 90px; color: var(--muted); font-size: 12px; }
.back-link:hover { color: var(--text); }
.project-hero { position: relative; min-height: 620px; padding: 40px 0 100px; border-bottom: 1px solid var(--line); }
.project-code-large { position: absolute; top: 24px; right: 0; margin: 0; color: #343431; font-size: clamp(110px, 21vw, 290px); line-height: .8; font-weight: 750; letter-spacing: -.08em; pointer-events: none; }
.project-hero > .eyebrow { margin-bottom: 30px; font-size: 14px; letter-spacing: .2em; }
.project-hero h1 { position: relative; z-index: 1; max-width: 920px; margin: 0; font-size: clamp(48px, 6.2vw, 82px); line-height: 1.02; letter-spacing: -.055em; }
.project-lead { position: relative; z-index: 1; max-width: 760px; margin: 52px 0 0; color: #c8c8c3; font-size: clamp(20px, 2.5vw, 30px); line-height: 1.55; letter-spacing: -.025em; }
.project-meta { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 34px; max-width: 860px; margin: 72px 0 0; }
.project-meta div { padding-top: 20px; border-top: 1px solid var(--soft-line); }
.project-meta dt { margin-bottom: 10px; color: var(--muted); font-size: 12px; font-weight: 600; letter-spacing: .12em; }
.project-meta dd { margin: 0; font-size: 17px; line-height: 1.6; letter-spacing: -.01em; }
.project-results { padding: 110px 0; border-bottom: 1px solid var(--line); }
.result-list { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--soft-line); }
.result-item { min-height: 260px; padding: 26px 28px 30px 0; border-right: 1px solid var(--soft-line); }
.result-item + .result-item { padding-left: 28px; }
.result-item:last-child { border-right: 0; }
.result-item span { color: var(--muted); font-size: 10px; letter-spacing: .14em; }
.result-item p { margin: 76px 0 0; font-size: 18px; line-height: 1.55; letter-spacing: -.02em; }
.project-sections { padding-top: 20px; }
.project-section { display: grid; grid-template-columns: 110px 1fr; gap: 40px; padding: 86px 0; border-bottom: 1px solid var(--line); }
.section-number { margin: 5px 0 0; color: var(--muted); font-size: 11px; }
.project-section h2 { margin: 0 0 28px; font-size: clamp(30px, 4vw, 48px); letter-spacing: -.045em; }
.project-section p, .project-section li { color: #aaa9a4; font-size: 15px; line-height: 1.85; }
.project-section ul { margin: 0; padding: 0; list-style: none; }
.project-section li { position: relative; padding: 14px 0 14px 24px; border-top: 1px solid var(--soft-line); }
.project-section li::before { content: "↳"; position: absolute; left: 0; color: var(--accent); }
.film-story { padding: 120px 0; border-bottom: 1px solid var(--line); }
.film-heading { max-width: 680px; margin-bottom: 72px; }
.film-heading h2 { margin: 0; font-size: clamp(40px, 6vw, 72px); line-height: 1.06; letter-spacing: -.055em; }
.film-layout { display: grid; grid-template-columns: minmax(280px, 430px) 1fr; gap: 10vw; align-items: start; }
.film-track { position: relative; padding: 22px 24px; background: #d9d9d4; }
.film-track::before, .film-track::after { content: ""; position: absolute; top: 0; bottom: 0; width: 12px; background: repeating-linear-gradient(to bottom, #111 0 10px, transparent 10px 20px); }
.film-track::before { left: 6px; }
.film-track::after { right: 6px; }
.film-frame { position: relative; aspect-ratio: 16 / 10; margin: 8px 0; overflow: hidden; background: #343432; border: 5px solid #111; }
.film-frame img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(1) contrast(1.08); opacity: .82; }
.film-copy { padding-top: 18px; }
.film-step { min-height: 230px; padding: 0 0 60px; }
.film-step span { color: var(--accent); font-size: 10px; letter-spacing: .18em; }
.film-step h3 { margin: 14px 0 16px; font-size: 30px; letter-spacing: -.04em; }
.film-step p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.8; }
.project-next { padding-top: 100px; }
.project-next a { display: flex; flex-direction: column; gap: 22px; padding: 50px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.project-next span { color: var(--muted); font-size: 10px; letter-spacing: .16em; }
.project-next strong { font-size: clamp(30px, 5vw, 64px); line-height: 1.15; letter-spacing: -.05em; }

@media (max-width: 720px) {
  .site-header { height: 62px; padding: 0 20px; }
  nav { gap: 16px; }
  nav a:nth-child(2) { display: none; }
  main { width: min(100% - 36px, var(--content)); }
  .hero { min-height: 84vh; padding: 126px 0 72px; }
  .hero h1 { font-size: clamp(64px, 24vw, 104px); }
  .hero-intro { margin-top: 42px; }
  .content-section { padding: 78px 0; }
  .capability-grid { grid-template-columns: 1fr; }
  .timeline-item { grid-template-columns: 1fr; gap: 16px; }
  .project-row { grid-template-columns: 44px 1fr; }
  .project-status { grid-column: 2; text-align: left; max-width: none; }
  .stats { grid-template-columns: 1fr; }
  .stat, .stat:nth-child(2), .stat:last-child { min-height: 138px; padding: 26px 0; border-right: 0; border-bottom: 1px solid var(--soft-line); }
  .stat:last-child { border-bottom: 0; }
  .contact-item { grid-template-columns: 84px 1fr auto; }
  .contact-value { font-size: 15px; overflow-wrap: anywhere; }
  .moon-copy { left: 22px; width: calc(100vw - 44px); }
  .moon-copy h1 { font-size: clamp(48px, 15vw, 76px); }
  .moon-hint { left: 22px; right: auto; }
  .works-heading { width: calc(100% - 40px); padding-top: 104px; }
  .carousel-section { min-height: 650px; height: calc(100vh - 195px); }
  .work-card { top: 34%; width: 218px; }
  .carousel-controls { bottom: 154px; }
  .carousel-caption { bottom: 58px; }
  .carousel-tip { display: none; }
  .project-main { width: calc(100% - 36px); padding-top: 110px; }
  .back-link { margin-bottom: 52px; }
  .project-hero { min-height: 0; padding-bottom: 72px; }
  .project-code-large { top: 20px; font-size: 36vw; }
  .project-hero > .eyebrow { margin-bottom: 22px; font-size: 12px; }
  .project-hero h1 { font-size: clamp(44px, 14vw, 64px); }
  .project-meta { grid-template-columns: 1fr; }
  .result-list { grid-template-columns: 1fr; }
  .result-item, .result-item + .result-item { min-height: 0; padding: 26px 0 34px; border-right: 0; border-bottom: 1px solid var(--soft-line); }
  .result-item:last-child { border-bottom: 0; }
  .result-item p { margin-top: 38px; }
  .project-section { grid-template-columns: 48px 1fr; gap: 12px; padding: 64px 0; }
  .film-layout { grid-template-columns: 1fr; gap: 48px; }
  .film-track { max-width: 430px; }
  .film-step { min-height: 0; padding-bottom: 48px; }
}

@media (max-height: 800px) and (min-width: 721px) {
  .works-heading { padding: 96px 0 18px; }
  .works-heading h1 { font-size: 60px; }
  .works-heading > p:last-child { margin-top: 12px; }
  .carousel-section { min-height: 500px; height: calc(100vh - 218px); }
  .work-card { top: 34%; width: 220px; }
  .carousel-controls { bottom: 92px; }
  .carousel-caption { bottom: 18px; }
  .carousel-tip { display: none; }
}

@media (max-width: 480px), (prefers-reduced-motion: reduce) {
  #word-canvas { display: none; }
  .word-stage { min-height: 380px; height: auto; padding: 64px 20px 84px; }
  .word-wall { display: flex; flex-wrap: wrap; gap: 10px; }
  .word-wall span { padding: 10px 13px; border: 1px solid var(--line); border-radius: 999px; font-size: 12px; }
  .reveal { opacity: 1; transform: none; transition: none; }
}

@media (prefers-reduced-motion: reduce) {
  .work-card { transition: none; }
  .moon-intro { scroll-behavior: auto; }
}
