:root {
  --sky-0: #EAF6FC; --sky-1: #A9DAF0; --sky-2: #8FCDE4;
  --blue: #127395; --navy: #2E4F7C; --yellow: #FCD33A;
  --serif: "KV Serif Latin", "Noto Serif TC", "Songti TC", "STSong", serif;
  --sans: "KV Sans Latin", "Noto Sans TC", "PingFang TC", "Heiti TC", sans-serif;
  --pad: clamp(20px, 7vw, 112px);
  --top: max(17vh, 120px);
  --measure: 29em;
}

.kv3, .kv3 * { box-sizing: border-box; }
.kv3 { background: var(--sky-1); color: var(--navy); }
.kv3 {
  font-family: var(--sans); font-size: 17px; line-height: 1.9; font-weight: 400;
  background: linear-gradient(180deg, var(--sky-0), var(--sky-1) 55%, var(--sky-2));
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
.kv3 h1, .kv3 h2, .kv3 h3 { font-family: var(--serif); font-weight: 900; margin: 0; letter-spacing: 0.01em; font-feature-settings: "halt"; text-wrap: balance; }
.kv3 p { margin: 0; line-break: strict; text-wrap: pretty; }
.kv3 a { color: inherit; }
.w { white-space: nowrap; }
.kv3 :focus-visible { outline: 3px solid var(--yellow); outline-offset: 4px; border-radius: 2px; }

/* ---------- Stage ---------- */
#stage { position: absolute; inset: 0; overflow: hidden; z-index: 0; }
#stage > * { position: absolute; }
.sky { inset: 0; z-index: 0; background: linear-gradient(180deg, #EAF6FC 0%, #CDEAF7 22%, #A9DAF0 52%, #8FCDE4 78%, #8FCDE4 100%); }
.sky--dusk {
  opacity: 0;
  background:
    radial-gradient(120% 60% at 72% 72%, rgba(252, 211, 58, .55), rgba(252, 211, 58, 0) 60%),
    linear-gradient(180deg, #24406A 0%, #3A6893 36%, #6FA6C4 62%, #E9D98A 84%, #FCD33A 100%);
}
.glow { inset: 0; z-index: 0; background: radial-gradient(70vmax 50vmax at 82% 8%, rgba(255,255,255,.75), rgba(255,255,255,0) 60%); }
#snowBack { inset: 0; width: 100%; height: 100%; z-index: 1; }
#hero3d, #heroSeq { inset: 0; width: 100%; height: 100%; display: block; z-index: 2; }
#heroFlat { left: 0; top: 0; transform-origin: 0 0; display: none; will-change: transform; border-radius: 1.2%; z-index: 2; }
#world { inset: 0; z-index: 3; overflow: hidden; visibility: hidden; }
#world .layer { position: absolute; left: 0; top: 0; will-change: transform; overflow: visible; }
#world .layer svg { display: block; overflow: visible; }
#world .sweep {
  position: absolute; left: 0; width: 100%; pointer-events: none;
  background: repeating-linear-gradient(105deg, rgba(255,255,255,0) 0, rgba(255,255,255,0) 380px, rgba(255,255,255,.18) 560px, rgba(255,255,255,0) 760px, rgba(255,255,255,0) 1500px);
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 30%, #000 85%, transparent);
  mask-image: linear-gradient(to bottom, transparent, #000 30%, #000 85%, transparent);
}
.dusk-tint { inset: 0; z-index: 4; background: linear-gradient(180deg, rgba(36,64,106,.5) 0%, rgba(46,79,124,.42) 60%, rgba(46,79,124,.3) 100%); opacity: 0; pointer-events: none; }
#cloud {
  left: 0; top: 0; width: 120vw; height: 46vh; z-index: 4; opacity: 0; pointer-events: none; will-change: transform, opacity;
  background: radial-gradient(closest-side, rgba(28,62,99,.26), rgba(28,62,99,.12) 55%, rgba(28,62,99,0));
}
#birds { left: 0; top: 0; z-index: 4; opacity: 0; will-change: transform; width: 200px; height: 90px; }
#birds i { position: absolute; left: calc(var(--k) * 30px); top: calc(sin(var(--k) * 1.3rad) * 22px + 30px); display: block; animation: flap .42s ease-in-out infinite alternate; animation-delay: calc(var(--k) * -70ms); }
#birds i:nth-child(2n) { transform: scale(.8); }
@keyframes flap { from { transform: scaleY(1); } to { transform: scaleY(-.55); } }
#walker { left: 0; top: 0; z-index: 5; opacity: 0; will-change: transform; }
#walker svg { width: 100%; height: auto; display: block; overflow: visible; }
.prop svg { overflow: visible; }
.cow-front, .cow-rear, .cow-head, .cow-tail { transform-box: view-box; }
#snowFront { inset: 0; width: 100%; height: 100%; z-index: 6; }
#stage.is-end #hero3d, #stage.is-end #heroSeq { z-index: 5; }
#drips { left: 0; top: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; z-index: 7; filter: drop-shadow(0 6px 10px rgba(46,79,124,.18)); will-change: transform; }

/* Taipei lights */
.prop--t101 .win, .prop--city .win { opacity: .12; transition: opacity .5s ease; }
.prop--t101.lit .win, .prop--city.lit .win { opacity: 1; }
.instant .win { transition: none !important; }

#grain {
  position: absolute; inset: 0; z-index: 30; pointer-events: none; opacity: .2;
  background-size: 160px 160px; animation: grain .9s steps(6) infinite;
}
@keyframes grain { 0% { background-position: 0 0; } 20% { background-position: -40px 60px; } 40% { background-position: 70px -20px; } 60% { background-position: -90px -70px; } 80% { background-position: 30px 90px; } 100% { background-position: 0 0; } }

/* ---------- Story text ---------- */
#story { position: relative; z-index: 10; }
#track { position: relative; height: 1300vh; }
.kv3-pin { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; }

.mo #story { position: absolute; inset: 0; pointer-events: none; }
.mo .ch, .mo .hero > * { position: absolute; }
.mo .ch { left: var(--pad); top: var(--top); width: min(var(--measure), calc(100vw - 2 * var(--pad))); opacity: 0; }
.mo .ch.is-on { pointer-events: auto; }
.ch > * { position: relative; }
.ch::before {
  content: ""; position: absolute; inset: -22% -26% -26% -22%; z-index: -1; pointer-events: none;
  background: radial-gradient(closest-side, rgba(234,246,252,.92), rgba(234,246,252,.66) 55%, rgba(234,246,252,0));
}

.ch h2 { font-size: clamp(34px, 3.9vw, 58px); line-height: 1.22; color: var(--blue); margin-bottom: .55em; }
.ch h3 { font-size: clamp(30px, 3.2vw, 48px); line-height: 1.2; color: var(--blue); margin-bottom: .4em; }
.ch h2.ch__story { font-size: clamp(28px, 3vw, 44px); color: var(--navy); margin-bottom: .7em; }
.ch h3.year { font-size: clamp(76px, 9vw, 140px); line-height: .9; letter-spacing: -0.01em; margin-bottom: .2em; }
.ch p + p { margin-top: .9em; }

.years { list-style: none; margin: 1.3em 0 0; padding: 0; display: grid; gap: .35em; }
.years li { display: grid; grid-template-columns: 3.4em 1fr; align-items: baseline; }
.years b { font-family: var(--serif); font-weight: 900; font-size: 22px; color: var(--blue); }

.ch--dusk { color: #FFFFFF; }
.ch--dusk h3 { color: var(--yellow); }
.ch--dusk::before { background: radial-gradient(closest-side, rgba(36,64,106,.6), rgba(36,64,106,.3) 60%, rgba(36,64,106,0)); }

.nik { margin: 0; }
.nik img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%; border-radius: 50%; }
.mo .nik {
  position: relative; width: clamp(150px, 13vw, 210px); aspect-ratio: 1; margin-top: 1.4em;
  border-radius: 50%; padding: 7px; background: #fff;
  box-shadow: 0 24px 40px -18px rgba(46,79,124,.45), 0 4px 12px rgba(46,79,124,.16);
}

.mo .ch--values { width: calc(100vw - 2 * var(--pad)); }
.ch--values::before { inset: -18% -8% -20% -8%; }
.values { display: grid; grid-template-columns: repeat(3, minmax(0, 15em)); gap: 0 clamp(28px, 4vw, 64px); }
.values h3 { font-size: clamp(24px, 2.1vw, 32px); }

/* the closing frame mirrors the hero: copy on the left, links in the yellow band */
.mo .ch--close { top: 27vh; }
.ch--close h2 { font-size: clamp(44px, 5vw, 76px); color: #000;
  text-shadow: 0 0 0 #fff, 3px 0 0 #fff, -3px 0 0 #fff, 0 3px 0 #fff, 0 -3px 0 #fff, 2px 2px 0 #fff, -2px 2px 0 #fff, 2px -2px 0 #fff, -2px -2px 0 #fff, 0 12px 24px rgba(46,79,124,.25); }
.close-band {
  display: flex; flex-direction: column; align-items: center; gap: 1.1em;
  writing-mode: vertical-rl; background: var(--yellow); box-shadow: 0 18px 40px -16px rgba(46,79,124,.4);
}
.close-band a { font-family: var(--serif); font-weight: 900; color: #000; text-decoration: none; letter-spacing: .12em; font-size: clamp(24px, 2.2vw, 32px); padding: .2em 0; text-orientation: upright; }
.close-band a:hover { text-decoration: underline; text-decoration-thickness: 3px; text-underline-offset: 6px; }
.mo .close-band { position: absolute; right: 8vw; top: 0; padding: 14vh 0 5vh; width: clamp(64px, 5.6vw, 84px); border-radius: 0 0 42px 42px; transform: translateY(-105%); pointer-events: auto; flex-direction: row; justify-content: center; }

/* Hero */
.hero__label { display: none; }
.hero__title { color: #000; line-height: 1.04; font-size: clamp(56px, 7.4vw, 120px); }
.hero__title span { display: block; }
.hero__title span:first-child { letter-spacing: -0.015em; }
.hero__title {
  text-shadow:
    0 0 0 #fff, 4px 0 0 #fff, -4px 0 0 #fff, 0 4px 0 #fff, 0 -4px 0 #fff,
    3px 3px 0 #fff, -3px 3px 0 #fff, 3px -3px 0 #fff, -3px -3px 0 #fff,
    4px 2px 0 #fff, -4px 2px 0 #fff, 4px -2px 0 #fff, -4px -2px 0 #fff,
    2px 4px 0 #fff, -2px 4px 0 #fff, 2px -4px 0 #fff, -2px -4px 0 #fff,
    0 14px 28px rgba(46,79,124,.28);
}
.hero__lede { color: var(--navy); font-size: 21px; line-height: 1.8; max-width: 18em; }
.hero__claim {
  writing-mode: vertical-rl; font-family: var(--serif); font-weight: 900; color: #000; background: var(--yellow);
  letter-spacing: .1em; line-height: 1; text-orientation: upright;
  box-shadow: 0 18px 40px -16px rgba(46,79,124,.4);
}
.mo .hero__title { left: var(--pad); top: 27vh; }
.mo .hero__lede { left: var(--pad); top: calc(27vh + clamp(56px, 7.4vw, 120px) * 2.3); }
.mo .hero__claim { right: 8vw; top: 0; padding: 13vh 0 4.5vh; width: clamp(64px, 5.6vw, 84px); font-size: clamp(24px, 2.2vw, 32px); display: flex; align-items: center; border-radius: 0 0 42px 42px; }

/* ---------- Phone ---------- */
@media (max-width: 720px) {
  :root { --pad: 20px; --top: 12vh; }
  .ch h2 { font-size: 30px; }
  .ch h3 { font-size: 29px; }
  .ch h2.ch__story { font-size: 23px; }
  .ch h3.year { font-size: 70px; }
  .mo .hero__title { top: 12vh; font-size: 52px; }
  .hero__lede { font-size: 19px; }
  .mo .hero__lede { top: auto; bottom: 5vh; right: 84px; max-width: none; }
  .mo .hero__claim { right: 18px; width: 50px; font-size: 21px; padding: 10vh 0 3vh; border-radius: 0 0 26px 26px; }
  .mo .close-band { right: 18px; width: 54px; padding: 10vh 0 3vh; border-radius: 0 0 26px 26px; }
  .close-band a { font-size: 22px; }
  .mo .ch--close { top: 13vh; width: calc(100vw - 110px); }
  .ch--close h2 { font-size: 40px; }
  .mo .nik { width: 112px; padding: 5px; margin-top: 1em; }
  .values { grid-template-columns: 1fr; }
  .mo .values section { position: absolute; top: 0; left: 0; right: 0; opacity: 0; }
  .years li { grid-template-columns: 3.2em 1fr; }
}

/* ---------- Reduced motion: static reading version ---------- */
.rm #hero3d, .rm #heroSeq, .rm #heroFlat, .rm #walker, .rm #snowBack, .rm #snowFront, .rm #birds, .rm #cloud { display: none; }
.rm #world { visibility: visible; }
.rm #drips { filter: none; }
.rm #story { padding: 0 var(--pad) 18vh; max-width: 1100px; }
.rm .hero { position: relative; padding: 16vh 0 10vh; display: grid; gap: 28px; }
.rm .hero::before { content: ""; position: absolute; inset: 8vh -6vw 2vh -6vw; z-index: -1; background: radial-gradient(closest-side, rgba(234,246,252,.95), rgba(234,246,252,.8) 70%, rgba(234,246,252,0)); }
.rm .hero__label { display: block; width: 100%; height: auto; border-radius: 10px; box-shadow: 0 30px 60px -24px rgba(46,79,124,.45); order: 3; }
.rm .hero__claim { writing-mode: horizontal-tb; text-orientation: mixed; justify-self: start; padding: .5em .8em; font-size: 22px; }
.rm .ch { position: relative; max-width: var(--measure); margin: 0 0 22vh; }
.rm .ch--values { max-width: none; }
.rm .nik { width: 220px; aspect-ratio: 1; margin-top: 32px; border-radius: 50%; padding: 8px; background: #fff; }
.rm .ch::before { inset: -10% -14%; background: radial-gradient(closest-side, rgba(234,246,252,.96), rgba(234,246,252,.88) 70%, rgba(234,246,252,0)); }
.rm .ch--dusk { color: var(--navy); }
.rm .ch--dusk h3 { color: var(--blue); }
.rm .close-band { writing-mode: horizontal-tb; flex-direction: row; padding: .6em 1.2em; border-radius: 8px; width: max-content; margin-top: -16vh; }
@media (max-width: 720px) { .rm .values { gap: 28px; } }

/* Readability pass (Nikola, 2026-10-16): larger body text, darker ink, stronger snow haze behind copy */
.kv3 { font-size: 20px; line-height: 1.85; }
.mo .ch, .ch { color: #14222E; }
.ch p { font-size: 20px; font-weight: 500; }
.ch h2, .ch h3 { color: #0E5A77; }
.ch::before { inset: -30% -34% -34% -30%; background: radial-gradient(closest-side, rgba(246,251,254,.97), rgba(246,251,254,.9) 55%, rgba(246,251,254,.55) 78%, rgba(246,251,254,0)); }
.hero__lede { color: #14222E; font-size: 22px; font-weight: 500; }
.years b { font-size: 24px; }
:root { --measure: 27em; }
@media (max-width: 600px) {
  body, .ch p { font-size: 18px; }
  .hero__lede { font-size: 19px; }
}
.mo .ch--dusk, .ch--dusk { color: #FFFFFF; }
.ch--dusk p { color: #FFFFFF; }
.ch--dusk::before { background: radial-gradient(closest-side, rgba(20,34,46,.72), rgba(20,34,46,.5) 60%, rgba(20,34,46,0)); }

/* reduced motion: the section flows normally */
.rm #track { height: auto; }
.rm .kv3-pin { position: static; height: auto; overflow: visible; }

/* chapter scenes: illustration postcards with silent loops */
.kv3 .scene { margin: 0; width: 100%; height: 100%; border-radius: 18px; overflow: hidden; background: #EAF6FC;
  border: 6px solid #fff; box-shadow: 0 18px 40px -18px rgba(46,79,124,.55), 0 2px 6px rgba(46,79,124,.18); }
.kv3 .scene video, .kv3 .scene img { display: block; width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 720px) { .kv3 .scene { border-width: 4px; border-radius: 14px; } }

/* English version: Latin text in the vertical yellow bands reads sideways, body slightly tighter */
.kv3[lang^="en"] .hero__claim, .kv3[lang^="en"] .close-band a { text-orientation: mixed; letter-spacing: .04em; }
.kv3[lang^="en"] .hero__claim { font-size: clamp(20px, 1.8vw, 26px); }
.kv3[lang^="en"] .hero__title { font-size: clamp(52px, 6.6vw, 108px); }
.kv3[lang^="en"] .ch p, .kv3[lang^="en"] .hero__lede { line-height: 1.65; }
.kv3[lang^="en"] h1, .kv3[lang^="en"] h2, .kv3[lang^="en"] h3 { letter-spacing: -0.005em; font-feature-settings: normal; }
/* the site forces a system font on html[lang^=en] headings; keep the label serif inside the story */
html body .kv3.kv3 h1, html body .kv3.kv3 h2, html body .kv3.kv3 h3, html body .kv3.kv3 .years b,
html body .kv3.kv3 .close-band a, html body .kv3.kv3 .hero__claim { font-family: var(--serif) !important; font-weight: 900 !important; }
html body .kv3.kv3 p, html body .kv3.kv3 li span { font-family: var(--sans) !important; }
.kv3[lang^="en"] .hero__lede { max-width: 24em; }

/* dusk chapter: the year must read against the night sky */
html body .kv3.kv3 .ch--dusk h3 { color: var(--yellow) !important; text-shadow: 0 2px 18px rgba(20,34,46,.55); }

/* ending: real ways out of the story, in the label's colours */
.kv3 .close-band { display: none !important; }
.kv3 .exits { display: flex; flex-wrap: wrap; gap: 12px 12px; margin-top: 26px; max-width: 34em; pointer-events: auto; }
html body .kv3.kv3 .exit {
  display: inline-flex; align-items: center; min-height: 48px; padding: 0 22px; border-radius: 999px;
  font-family: var(--serif) !important; font-weight: 900; font-size: 17px; letter-spacing: .02em; line-height: 1;
  color: var(--navy); background: #fff; text-decoration: none; border: 2px solid var(--navy);
  box-shadow: 0 10px 22px -14px rgba(46,79,124,.55); transition: transform .18s ease, background-color .18s ease, color .18s ease;
}
html body .kv3.kv3 .exit--main { background: var(--yellow); border-color: var(--yellow); color: #000; font-size: 18px; padding: 0 28px; }
html body .kv3.kv3 .exit:hover { transform: translateY(-2px); background: var(--navy); border-color: var(--navy); color: #fff; }
html body .kv3.kv3 .exit--main:hover { background: #000; border-color: #000; color: var(--yellow); }
html body .kv3.kv3 .exit:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }
@media (max-width: 720px) {
  .kv3 .exits { gap: 10px; margin-top: 18px; }
  html body .kv3.kv3 .exit { min-height: 44px; padding: 0 16px; font-size: 15px; }
  html body .kv3.kv3 .exit--main { flex-basis: 100%; justify-content: center; }
}
.rm .kv3 .exits, .rm .exits { margin-bottom: 8vh; }

/* six reasons on desktop: two rows of three */
.kv3 .values { row-gap: clamp(14px, 2.2vh, 26px); }
@media (max-width: 720px) { .kv3 .values p { font-size: 18px; } }

@media (max-width: 720px) {
  .kv3 .years { gap: .1em; margin-top: .8em; }
  .kv3 .years li span { font-size: 16px; line-height: 1.5; }
  html body .kv3.kv3 .years b { font-size: 18px; }
}

/* the theme sets html{scroll-behavior:smooth}; with Lenis that double-smooths every wheel tick (jitter, worst in Firefox) */
html.lenis, html.lenis body { height: auto; }
html.lenis, html.kv3-page-html { scroll-behavior: auto !important; }
.lenis.lenis-stopped { overflow: hidden; }

/* phones: the ending and the 2019 timeline must fit above the site's bottom menu */
@media (max-width: 720px) {
  .mo .ch--close { top: 9%; width: calc(100vw - 2 * var(--pad)); }
  .ch--close h2 { font-size: 34px; line-height: 1.1; }
  .kv3 .ch--close p { font-size: 16px; line-height: 1.6; }
  .kv3 .exits { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 14px; max-width: none; }
  html body .kv3.kv3 .exit { min-height: 42px; padding: 0 10px; font-size: 14px; justify-content: center; text-align: center; letter-spacing: 0; }
  html body .kv3.kv3 .exit--main { grid-column: 1 / -1; font-size: 16px; }
}
@media (max-width: 720px) and (max-height: 760px) {
  :root { --top: 8vh; }
  .ch h3.year { font-size: 56px; }
  .kv3 .ch p { font-size: 16px; line-height: 1.6; }
  .kv3 .years li span { font-size: 15px; }
}
