:root {
  --ground: #0c0e12;
  --ink: #e9e5dc;
  --muted: #858a93;
  --rule: rgba(233, 229, 220, 0.2);
  --boid: #d8d2c4;
  --heat: #ff8a5b;
  --ember: #ff5a3c;
  --fog: #0c0e12;
  --sky: #3a3f4a;
  --shade: #14161b;
  color-scheme: dark;
}

html { scroll-behavior: smooth; scroll-snap-type: y mandatory; }
body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: "Jost", "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-weight: 200;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
canvas#flock {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 0;
}

nav.jump {
  position: fixed;
  top: clamp(20px, 4vh, 40px);
  right: clamp(24px, 7vw, 120px);
  z-index: 2;
  display: flex;
  gap: 26px;
  font-size: 17px;
  font-weight: 300;
  letter-spacing: 0.14em;
  text-transform: lowercase;
}
nav.jump a {
  color: var(--muted);
  text-decoration: none;
  padding-bottom: 3px;
  border-bottom: 1px solid transparent;
  transition: color 0.25s, border-color 0.25s;
}
nav.jump a:hover, nav.jump a:focus-visible { color: var(--ink); outline: none; }
nav.jump a.on { color: var(--ink); border-bottom-color: var(--rule); }

nav.jump { align-items: flex-start; }
.rail {
  position: relative;
  display: flex;
  align-items: flex-start;
  height: 36px;
  margin-top: -8px;
  max-width: 0;
  margin-left: -26px;
  opacity: 0;
  overflow: hidden;
  transition: max-width 0.7s ease, margin-left 0.7s ease, opacity 0.5s;
  pointer-events: none;
}
.rail.on { max-width: 260px; margin-left: 0; opacity: 1; pointer-events: auto; }
/* Each dash is drawn inside a box much taller than itself, so it is easy to hit. */
.rail .tick {
  position: relative;
  display: block;
  width: 26px;
  height: 36px;
  padding: 0;
  border: 0;
  flex-shrink: 0;
  transition: opacity 0.35s ease;
}
.rail .tick::after {
  content: '';
  position: absolute;
  left: 5px;
  right: 5px;
  top: 17px;
  height: 4px;
  background: var(--rule);
  transition: background-color 0.4s ease;
}
.rail .tick:hover::after, .rail .tick:focus-visible::after { background: var(--muted); }
.rail .tick:focus-visible { outline: none; }
.rail .tick.on { opacity: 0; }
.rail .marker {
  position: absolute;
  left: 0;
  top: 13px;
  fill: var(--ink);
  will-change: transform;
  pointer-events: none;
}

section {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  min-height: 100svh;
  scroll-snap-align: start;
  display: flex;
  box-sizing: border-box;
  padding: clamp(24px, 7vw, 120px);
  pointer-events: none;
}
section .inner { display: flex; flex-direction: column; gap: clamp(16px, 2.4vh, 28px); max-width: min(620px, 86vw); perspective: 1100px; perspective-origin: 50% 50%; }
section .inner > * { pointer-events: auto; will-change: transform, opacity, filter; transform-origin: 0% 50%; }
section.story.right .inner > * { transform-origin: 100% 50%; }
section.hello { align-items: flex-end; }
section.story { align-items: center; }
section.story.right { justify-content: flex-end; }
section.contact { align-items: flex-end; }

h1 {
  margin: 0;
  display: flex;
  align-items: baseline;
  gap: 0.2em;
  font-size: clamp(64px, 9vw, 124px);
  font-weight: 200;
  line-height: 0.95;
  letter-spacing: 0.02em;
  text-transform: lowercase;
  cursor: default;
  position: relative;
}
.han-note {
  position: fixed;
  z-index: 2;
  width: min(420px, 80vw);
  transform: translate(-50%, 0);
  text-align: center;
  font-family: "Newsreader", "Iowan Old Style", Georgia, serif;
  font-weight: 300;
  font-size: 17px;
  line-height: 1.45;
  color: var(--muted);
  pointer-events: none;
  user-select: text;
  opacity: 0;
  transition: opacity 0.5s;
}
.han-note.on { opacity: 1; pointer-events: auto; }
.han-note .pinyin {
  display: block;
  font-style: normal;
  font-size: 19px;
  color: var(--ink);
  margin-bottom: 8px;
}

h2 {
  margin: 0;
  font-family: "Newsreader", "Iowan Old Style", Georgia, serif;
  font-weight: 300;
  font-size: clamp(34px, 4.4vw, 58px);
  line-height: 1.08;
  letter-spacing: -0.01em;
  text-wrap: balance;
}
.eyebrow {
  margin: 0;
  font-size: 15px;
  font-weight: 300;
  letter-spacing: 0.18em;
  text-transform: lowercase;
  color: var(--muted);
}
.line {
  margin: 0;
  font-family: "Newsreader", "Iowan Old Style", Georgia, serif;
  font-weight: 300;
  font-size: clamp(19px, 2.2vw, 26px);
  line-height: 1.4;
  max-width: 24em;
  text-wrap: pretty;
}
.nowrap { white-space: nowrap; }
.word {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  margin: 0;
  cursor: pointer;
  border-bottom: 1px solid var(--rule);
  transition: color 0.3s, border-color 0.3s;
}
.word:hover, .word:focus-visible, .word.held { color: var(--heat); border-bottom-color: var(--heat); outline: none; }
.big-links { display: flex; flex-direction: column; gap: 6px; }
.big-links a {
  color: var(--ink);
  text-decoration: none;
  font-size: clamp(30px, 4vw, 48px);
  font-weight: 200;
  letter-spacing: 0.03em;
  text-transform: lowercase;
  line-height: 1.25;
  border-bottom: 1px solid transparent;
  align-self: flex-start;
  transition: border-color 0.25s, color 0.25s;
}
.big-links a:hover, .big-links a:focus-visible { border-bottom-color: var(--rule); outline: none; }
.cipher {
  font: inherit;
  font-size: clamp(22px, 2.6vw, 34px);
  font-weight: 200;
  letter-spacing: 0.04em;
  color: var(--ink);
  background: none;
  border: 0;
  padding: 0;
  margin: 4px 0 0 0;
  cursor: pointer;
  text-align: left;
  align-self: flex-start;
  border-bottom: 1px solid transparent;
  transition: color 0.3s, border-color 0.3s;
  font-variant-numeric: tabular-nums;
}
.cipher:hover, .cipher:focus-visible { border-bottom-color: var(--rule); outline: none; }
.cipher.turning { color: var(--heat); }
.big-links a.mail { font-size: clamp(22px, 2.6vw, 34px); letter-spacing: 0.04em; margin-top: 4px; }
.hintline {
  margin: 0;
  font-family: "Newsreader", "Iowan Old Style", Georgia, serif;
  font-style: italic;
  font-weight: 300;
  font-size: 17px;
  color: var(--muted);
}
.hint {
  position: fixed;
  left: clamp(24px, 7vw, 120px);
  bottom: 18px;
  z-index: 2;
  font-size: 12px;
  letter-spacing: 0.18em;
  color: var(--muted);
  text-transform: lowercase;
  transition: opacity 0.6s;
}
.hint.gone { opacity: 0; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; scroll-snap-type: none; }
  section .inner > * { transform: none !important; opacity: 1 !important; filter: none !important; }
}

@media (max-width: 720px), (max-aspect-ratio: 5/6) {
  section.story, section.story.right { align-items: flex-end; justify-content: flex-start; }
  section.story.right .inner > * { transform-origin: 0% 50%; }
  section .inner { max-width: 100%; }
  nav.jump { gap: 18px; font-size: 15px; }
  .rail.on { max-width: 182px; }
  .hint { display: none; }
}
