@font-face {
  font-family: "Inter Tight";
  src: url("assets/intertight.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --paper: #fff;
  --ink: #0b0b0b;
  --red: #e3241b;
  --margin: clamp(20px, 3.2vw, 48px);
  --gap: clamp(16px, 1.6vw, 24px);
  --rule: 6px;
  --ease: cubic-bezier(.2, .8, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Inter Tight", "Helvetica Neue", Arial, sans-serif;
  font-size: 18px;
  line-height: 1.45;
  letter-spacing: .004em;
  word-spacing: .03em;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, p, ol, dl, dd { margin: 0; padding: 0; }
ol { list-style: none; }
a { color: inherit; text-decoration: none; }
::selection { background: var(--red); color: #fff; }

a:focus-visible, summary:focus-visible {
  outline: 3px solid var(--red);
  outline-offset: 3px;
}

.flow[data-tone="red"] a:focus-visible { outline-color: #000; }

.hot { color: var(--red); }

.skip {
  position: fixed;
  top: -80px;
  left: var(--margin);
  z-index: 20;
  padding: 10px 16px;
  background: var(--ink);
  color: #fff;
}

.skip:focus { top: 10px; }

/* Top bar: sits on the same four columns as everything below it */

.bar {
  position: absolute;
  inset: 0 0 auto;
  z-index: 5;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  column-gap: var(--gap);
  align-items: center;
  height: 84px;
  padding-inline: var(--margin);
  font-size: 17px;
  font-weight: 500;
}

.wordmark {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -.035em;
  line-height: 1;
}

.bar-end {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.bar-link {
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 5px;
  text-decoration-color: transparent;
  transition: text-decoration-color .2s;
}

.bar-link:hover { text-decoration-color: currentColor; }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 22px;
  background: var(--ink);
  color: #fff;
  font-size: 17px;
  font-weight: 600;
  transition: background-color .2s, color .2s;
}

.button:hover { background: var(--red); }

.button-invert {
  align-self: flex-start;
  margin-top: 36px;
  min-height: 56px;
  padding: 0 32px;
  background: #000;
  font-size: 20px;
}

.button-invert:hover { background: #fff; color: #000; }

/* First screen: the sentence, then the whole path at a glance */

.hero {
  display: grid;
  grid-template-rows: 1fr auto;
  min-height: 100vh;
  min-height: 100svh;
  padding: 84px var(--margin) var(--margin);
}

h1 {
  align-self: center;
  padding-block: 24px;
  font-size: clamp(40px, min(6vw, 11.4vh), 136px);
  font-weight: 700;
  line-height: 1.04;
  letter-spacing: -.018em;
  word-spacing: .04em;
  text-wrap: balance;
}

.index {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  column-gap: var(--gap);
}

.index li { position: relative; }

.index li::before {
  content: "";
  display: block;
  height: 8px;
  background: var(--ink);
  transform-origin: left;
  transition: background-color .2s;
}

.index li:hover::before { background: var(--red); }

.index a {
  display: grid;
  gap: 2px;
  padding-top: 12px;
}

.index-n {
  color: var(--red);
  font-size: clamp(56px, min(6vw, 10vh), 104px);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -.04em;
}

.index strong {
  margin-top: 8px;
  font-size: clamp(20px, 1.7vw, 28px);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -.012em;
}

.index a > span:last-child {
  max-width: 30ch;
  font-size: clamp(16px, 1.2vw, 19px);
  line-height: 1.3;
}

/* The path: one giant counter holds still while the steps scroll past it */

.flow {
  --bg: var(--paper);
  --fg: var(--ink);
  --accent: var(--red);
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  column-gap: var(--gap);
  padding-inline: var(--margin);
  background: var(--bg);
  color: var(--fg);
  transition: background-color .55s ease, color .55s ease;
}

.flow[data-tone="ink"] { --bg: var(--ink); --fg: #fff; --accent: var(--red); }
.flow[data-tone="red"] { --bg: var(--red); --fg: #000; --accent: #000; }

.rail {
  position: sticky;
  top: 0;
  grid-column: 1 / 3;
  display: flex;
  gap: 18px;
  align-self: start;
  height: 100vh;
  height: 100svh;
}

.digit-window {
  --h: 100vh;
  --size: min(88vh, 46vw);
  flex: none;
  width: calc(var(--size) * .86);
  height: var(--h);
  margin-left: calc(var(--size) * -.03);
  overflow: hidden;
  color: var(--accent);
  font-size: calc(var(--size) * 1.3);
  font-weight: 700;
  transition: color .55s ease;
}

@supports (height: 100svh) {
  .digit-window { --h: 100svh; }
}

.digits {
  transform: translate3d(0, calc(var(--roll, 0) * var(--h) * -1), 0);
  will-change: transform;
}

.digits span {
  display: block;
  height: var(--h);
  line-height: var(--h);
}

.of {
  align-self: flex-end;
  padding-bottom: var(--margin);
  font-size: clamp(20px, 1.7vw, 28px);
  font-weight: 700;
  letter-spacing: -.012em;
  white-space: nowrap;
}

.steps { grid-column: 3 / 5; }

.step {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 100vh;
  min-height: 100svh;
  padding-block: clamp(72px, 12vh, 120px);
  scroll-margin-top: 0;
}

.step h2 {
  font-size: clamp(38px, min(4.7vw, 9vh), 96px);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -.016em;
  word-spacing: .04em;
  text-wrap: balance;
}

.lede {
  max-width: 34em;
  margin-top: 26px;
  font-size: clamp(19px, 1.45vw, 24px);
  line-height: 1.38;
}

.status {
  margin-bottom: 18px;
  font-size: clamp(19px, 1.45vw, 24px);
  font-weight: 700;
  color: var(--accent);
  transition: color .55s ease;
}

.gains { margin-top: 36px; }

.gains > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr);
  column-gap: var(--gap);
  align-items: baseline;
  padding-block: 12px 16px;
  border-top: var(--rule) solid currentColor;
}

.gains dt {
  font-size: clamp(30px, 3vw, 52px);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -.012em;
}

.gains dd { font-size: 18px; line-height: 1.32; }

.note {
  max-width: 34em;
  margin-top: 16px;
  font-size: 18px;
  font-weight: 600;
  line-height: 1.32;
}

.fork {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: var(--gap);
  margin-top: 40px;
}

.fork > div {
  padding-top: 14px;
  border-top: var(--rule) solid currentColor;
}

.fork > div:last-child { border-top-color: var(--accent); }

.fork h3 {
  font-size: clamp(30px, 3vw, 52px);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -.012em;
}

.fork > div:last-child h3 { color: var(--accent); }

.fork p { margin-top: 12px; font-size: clamp(18px, 1.3vw, 21px); line-height: 1.35; }

.facts { margin-top: 36px; }

.facts > div {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  column-gap: var(--gap);
  align-items: baseline;
  padding-block: 12px;
  border-top: 2px solid currentColor;
}

.facts dt { font-size: 17px; font-weight: 700; }
.facts dd { font-size: 18px; line-height: 1.32; overflow-wrap: anywhere; }

/* Bracketed text marks everything that still has to be filled in */

.ph {
  text-decoration: underline dashed 1.5px;
  text-underline-offset: 5px;
  letter-spacing: .01em;
}

/* Questions */

.faq {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  column-gap: var(--gap);
  padding: clamp(72px, 9vw, 136px) var(--margin);
}

.faq h2 {
  grid-column: 1 / 3;
  max-width: 9em;
  font-size: clamp(38px, min(4.7vw, 9vh), 96px);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -.016em;
  word-spacing: .04em;
}

.faq-list {
  grid-column: 3 / 5;
  border-bottom: var(--rule) solid var(--ink);
}

.faq-list details { border-top: var(--rule) solid var(--ink); }

summary {
  position: relative;
  padding: 18px 44px 20px 0;
  font-size: clamp(21px, 1.7vw, 28px);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -.012em;
  list-style: none;
  cursor: pointer;
  transition: color .2s;
}

summary::-webkit-details-marker { display: none; }
summary:hover { color: var(--red); }

summary::before, summary::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 2px;
  width: 22px;
  height: 3px;
  margin-top: -2px;
  background: currentColor;
  transition: transform .25s var(--ease);
}

summary::after { transform: rotate(90deg); }
details[open] > summary::after { transform: rotate(0); }

details p {
  max-width: 34em;
  padding: 0 44px 24px 0;
  font-size: clamp(18px, 1.3vw, 21px);
  line-height: 1.4;
}

/* Close */

.contact {
  padding: clamp(72px, 9vw, 136px) var(--margin) clamp(48px, 5vw, 72px);
  background: var(--ink);
  color: #fff;
}

.contact h2 {
  font-size: clamp(56px, 11.2vw, 240px);
  font-weight: 700;
  line-height: .98;
  letter-spacing: -.028em;
  word-spacing: .03em;
}

.contact-lede {
  max-width: 30em;
  margin-top: 32px;
  font-size: clamp(21px, 1.9vw, 30px);
  line-height: 1.28;
  letter-spacing: -.01em;
}

.contact-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  column-gap: var(--gap);
  margin-top: clamp(48px, 6vw, 88px);
}

.contact-grid > div {
  padding-top: 12px;
  border-top: var(--rule) solid #fff;
}

.contact-grid > div:first-child { grid-column: span 2; }
.contact-grid dt { font-size: 17px; font-weight: 700; }

.contact-grid dd {
  margin-top: 6px;
  font-size: clamp(19px, 1.45vw, 24px);
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px var(--margin);
  background: var(--ink);
  color: #fff;
  font-size: 17px;
  font-weight: 500;
}

/* Motion: everything starts from the JS class, so nothing hides without it */

.js h1 { visibility: hidden; }
.js h1.is-split { visibility: visible; }

.w {
  display: inline-block;
  overflow: hidden;
  padding-bottom: .14em;
  margin-bottom: -.14em;
  vertical-align: top;
}

.w > span {
  display: inline-block;
  transform: translateY(112%);
  animation: rise .85s var(--ease) forwards;
  animation-delay: calc(var(--i) * 26ms);
}

.js .index li::before {
  transform: scaleX(0);
  animation: draw .9s var(--ease) forwards;
  animation-delay: calc(.45s + var(--n) * 90ms);
}

.js .index a {
  opacity: 0;
  animation: lift .7s var(--ease) forwards;
  animation-delay: calc(.6s + var(--n) * 90ms);
}

.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity .7s ease, transform .8s var(--ease);
  transition-delay: calc(var(--i, 0) * 70ms);
}

.reveal.is-in { opacity: 1; transform: none; }

@keyframes rise { to { transform: none; } }
@keyframes draw { to { transform: none; } }
@keyframes lift {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}

/* Narrow screens */

@media (max-width: 1100px) {
  .bar { grid-template-columns: auto 1fr; column-gap: 24px; }
  .bar-note { display: none; }
  .bar-end { justify-content: flex-end; gap: 24px; }
  h1 { font-size: clamp(38px, min(7.6vw, 11vh), 88px); }
  .index { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 24px; }
  .index-n { font-size: 56px; }
}

@media (max-width: 900px) {
  .flow { display: block; }

  .rail {
    z-index: 3;
    gap: 10px;
    height: auto;
    margin-inline: calc(var(--margin) * -1);
    padding: 10px var(--margin) 6px;
    background: var(--bg);
    transition: background-color .55s ease;
  }

  .digit-window { --h: 76px; --size: 76px; width: 62px; margin-left: 0; }
  .of { padding-bottom: 8px; font-size: 20px; }

  .step {
    min-height: 0;
    padding-block: 40px 88px;
    scroll-margin-top: 90px;
  }

  .step h2, .faq h2 { font-size: clamp(38px, 8.4vw, 64px); }
  .lede { font-size: 20px; }

  .faq { display: block; }
  .faq h2 { margin-bottom: 36px; }

  .contact-grid { grid-template-columns: minmax(0, 1fr); row-gap: 24px; }
  .contact-grid > div:first-child { grid-column: auto; }
}

@media (max-width: 560px) {
  .bar { height: 72px; }
  .bar .bar-link { display: none; }
  .wordmark { font-size: 24px; }
  .hero { padding-top: 72px; }
  h1 { padding-block: 20px 28px; font-size: clamp(36px, 10.6vw, 52px); line-height: 1.04; }

  .index { grid-template-columns: minmax(0, 1fr); row-gap: 0; }
  .index li::before { height: 4px; }

  .index a {
    grid-template-columns: 44px minmax(0, 1fr);
    column-gap: 8px;
    padding-block: 8px 12px;
  }

  .index-n { grid-row: span 2; font-size: 44px; }
  .index strong { margin-top: 2px; font-size: 21px; }
  .index a > span:last-child { font-size: 16px; }

  .gains > div { grid-template-columns: minmax(0, 1fr); row-gap: 4px; }
  .fork { grid-template-columns: minmax(0, 1fr); row-gap: 28px; }
  .facts > div { grid-template-columns: minmax(0, 1fr); row-gap: 2px; }
  .button-invert { align-self: stretch; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }

  .js h1 { visibility: visible; }
  .js .index li::before { transform: none; }
  .js .index a { opacity: 1; }
  .reveal { opacity: 1; transform: none; }
}

/* One shared layout for all languages. */
.language-switch { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.language-switch a { display: inline-flex; align-items: center; justify-content: center; min-width: 32px; min-height: 44px; text-decoration: none; }
.language-switch a[aria-current="true"] { font-weight: 700; text-decoration: underline; text-underline-offset: .3em; text-decoration-thickness: 2px; }
.language-switch a:hover { color: var(--red); }
.language-switch a:focus-visible { outline: 3px solid var(--red); outline-offset: 2px; }
.language-switch span { opacity: .45; }

.bar { grid-template-columns: 1fr 1fr .8fr 1.7fr; }
.bar-end { gap: 12px; }
:lang(zh) body { font-family: "Inter Tight", "PingFang SC", "Microsoft YaHei", sans-serif; }
:lang(zh) h1 { line-height: 1.2; }
:lang(zh) .faq h2, :lang(zh) .contact h2 { line-height: 1.15; }
@media (max-width: 1100px) {
  .bar { grid-template-columns: auto 1fr; }
}
@media (max-width: 560px) {
  .bar-end { gap: 10px; }
  .bar .button { padding-inline: 12px; }
  .language-switch { gap: 3px; font-size: 15px; }
}

/* The list uses the shared layout; its Chinese content awaits the next translation. */
[data-chinese-only] { display: none; }
html:lang(zh) [data-chinese-only] { display: block; }
.competition-note { font-size: inherit; }
html:lang(zh) span.competition-note[data-chinese-only] { display: inline; }
.competition-note a { text-decoration: underline; text-underline-offset: .2em; }
#competition-question { scroll-margin-top: 32px; }
.project-link { text-decoration: underline; text-underline-offset: .18em; overflow-wrap: anywhere; }
