@import url('assets/colors_and_type.css');
@import url('https://fonts.googleapis.com/css2?family=Noto+Serif+SC:wght@300;400;500&family=Noto+Serif+KR:wght@300;400;500&family=Noto+Serif+JP:wght@300;400;500&display=swap');
@import url('https://chinese-fonts-cdn.deno.dev/packages/xiaolai/dist/XiaolaiSC-Regular/result.css');

:root {
  --font-ch: 'XiaolaiSC', 'Noto Serif SC', 'Cormorant Garamond', serif;
  --ease-out: cubic-bezier(0.22, 0.61, 0.36, 1);
  --ease-soft: cubic-bezier(0.16, 1, 0.3, 1);
}

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

html, body {
  margin: 0;
  padding: 0;
  background: var(--kd-paper);
  color: var(--fg-1);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

html { scroll-behavior: smooth; }
body { overflow-x: hidden; }

::selection { background: var(--kd-brown-700); color: #fff; }

a { color: inherit; }

/* ============================================================
   Screen shell
   ============================================================ */
.screen {
  position: relative;
  min-height: 100vh;
  width: 100%;
  padding: 140px clamp(32px, 6vw, 96px) 80px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
}

.screen__label {
  position: absolute;
  top: 96px;
  left: clamp(32px, 6vw, 96px);
  display: flex;
  align-items: center;
  gap: 14px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--fg-4);
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity 800ms var(--ease-out) 200ms, transform 800ms var(--ease-out) 200ms;
}
.reveal.in .screen__label {
  opacity: 1; transform: translateY(0);
}
.screen__label .tick {
  width: 28px; height: 1px; background: var(--border-2);
  transform-origin: left;
  transform: scaleX(0);
  transition: transform 700ms var(--ease-out) 500ms;
}
.reveal.in .screen__label .tick { transform: scaleX(1); }

/* ============================================================
   Motion primitives
   ============================================================ */

/* Per-char stagger — characters drop + fade in */
.split { display: inline-block; }
.char {
  display: inline-block;
  opacity: 0;
  transform: translateY(0.6em) rotate(2deg);
  filter: blur(4px);
  transition:
    opacity 900ms var(--ease-soft),
    transform 900ms var(--ease-soft),
    filter 900ms var(--ease-soft);
  will-change: transform, opacity, filter;
}
.reveal.in .char {
  opacity: 1;
  transform: translateY(0) rotate(0);
  filter: blur(0);
}

/* Soft fade-up (for blocks) */
.soft {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 900ms var(--ease-out), transform 900ms var(--ease-out);
}
.reveal.in .soft, .soft.in { opacity: 1; transform: translateY(0); }
.soft--delay-1 { transition-delay: 200ms; }
.soft--delay-2 { transition-delay: 400ms; }
.soft--delay-3 { transition-delay: 600ms; }
.soft--delay-4 { transition-delay: 900ms; }
.soft--delay-5 { transition-delay: 1200ms; }

/* Horizontal wipe-in — text slides up from behind a mask, plus brown sweep */
.wipe {
  display: block;
  position: relative;
  overflow: hidden;
  padding-right: 0.1em;
}
.wipe::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--kd-brown-700);
  transform-origin: left;
  transform: scaleX(1);
  transition: transform 1000ms var(--ease-soft);
}
.reveal.in .wipe::after { transform-origin: right; transform: scaleX(0); }

/* Simple line (kept for Scene 03 quotes) */
.line {
  display: block;
  line-height: 1.25;
}
.line > span {
  display: inline-block;
  transform: translateY(24px);
  opacity: 0;
  transition: transform 900ms var(--ease-out), opacity 900ms var(--ease-out);
}
.reveal.in .line > span { transform: translateY(0); opacity: 1; }
.reveal.in .line:nth-child(1) > span { transition-delay: 0ms; }
.reveal.in .line:nth-child(2) > span { transition-delay: 180ms; }
.reveal.in .line:nth-child(3) > span { transition-delay: 360ms; }

/* hairline that draws itself */
.draw-hline {
  height: 1px;
  background: var(--border-2);
  transform-origin: left center;
  transform: scaleX(0);
  transition: transform 1200ms var(--ease-out);
}
.reveal.in .draw-hline { transform: scaleX(1); }

.draw-vline {
  width: 1px;
  background: var(--border-2);
  transform-origin: top center;
  transform: scaleY(0);
  transition: transform 1400ms var(--ease-out) 200ms;
}
.reveal.in .draw-vline { transform: scaleY(1); }

/* ============================================================
   Nav
   ============================================================ */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 72px;
  display: flex; align-items: center;
  padding: 0 clamp(32px, 6vw, 96px);
  z-index: 50;
  transition: background 420ms var(--ease-out), border-color 420ms var(--ease-out);
  border-bottom: 1px solid transparent;
}
.nav--scrolled {
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom-color: var(--border-1);
}
.nav__brand { display: flex; align-items: center; gap: 14px; text-decoration: none; }
.nav__brand-mark {
  height: 26px;
  width: auto;
  display: block;
}
.nav__brand-mono {
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.32em;
  color: var(--kd-brown-700);
}
.nav__brand-ch {
  font-family: var(--font-ch);
  font-weight: 400;
  font-size: 13px;
  letter-spacing: 0.22em;
  color: var(--fg-3);
  padding-left: 14px;
  border-left: 1px solid var(--border-1);
  white-space: nowrap;
}
.nav__spacer { flex: 1; }
.nav__meta {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.24em;
  white-space: nowrap;
  text-transform: uppercase;
  color: var(--fg-4);
}

/* ============================================================
   Progress rail
   ============================================================ */
.rail {
  position: fixed;
  top: 50%;
  right: 32px;
  transform: translateY(-50%);
  z-index: 40;
  display: flex; flex-direction: column; gap: 18px;
  align-items: center;
}
.rail__dot {
  width: 4px; height: 4px; border-radius: 50%;
  background: var(--kd-brown-300);
  transition: background 240ms var(--ease-out), transform 240ms var(--ease-out);
  cursor: pointer;
  border: 0; padding: 0;
}
.rail__dot--active {
  background: var(--kd-brown-700);
  transform: scale(1.6);
}

/* ============================================================
   Scene 01 — Overture
   ============================================================ */
.s01__wrap { max-width: 1400px; margin: 0 auto; width: 100%; position: relative; }
.s01__wrap--split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 64px;
  align-items: center;
}
.s01__copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.s01__visual {
  position: relative;
  aspect-ratio: 1 / 1;
  width: 100%;
  max-width: 620px;
  justify-self: center;
}
.globe {
  position: relative;
  width: 100%;
  height: 100%;
  opacity: 0;
  transform: scale(0.92);
  transition: opacity 1600ms var(--ease-soft) 300ms, transform 1600ms var(--ease-soft) 300ms;
}
.reveal.in .globe { opacity: 1; transform: scale(1); }
.globe__canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.globe__whirl {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  transform-origin: 50% 50%;
}
.globe__whirl--a { animation: globeSpinA 10s linear infinite; }
.globe__whirl--b { animation: globeSpinB 18s linear infinite reverse; }
.globe__whirl--c { animation: globeSpinC 28s linear infinite; }
@keyframes globeSpinA { to { transform: rotate(360deg); } }
@keyframes globeSpinB { to { transform: rotate(360deg); } }
@keyframes globeSpinC { to { transform: rotate(360deg); } }
.s01__eyebrow {
  font-family: var(--font-sans);
  font-size: 11px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--kd-brown-700);
  margin-bottom: 64px;
}
.s01__title {
  font-family: var(--font-ch);
  font-weight: 300;
  font-size: clamp(38px, 4.4vw, 64px);
  line-height: 1.35;
  letter-spacing: 0.02em;
  color: var(--fg-1);
  margin: 0;
}
[lang="en"] .s01__title {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-weight: 300;
  font-size: clamp(34px, 4.2vw, 60px);
  line-height: 1.25;
  letter-spacing: 0.005em;
  max-width: 18ch;
}
.s01__line { display: block; }
.s01__line + .s01__line { margin-top: 0.1em; }
.s01__foot {
  display: flex; justify-content: space-between; align-items: flex-end;
  margin-top: 64px;
  gap: 32px;
}
.s01__en {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 300;
  font-size: 22px;
  color: var(--fg-3);
  max-width: 360px;
  line-height: 1.5;
}
.s01__est {
  position: absolute;
  right: 0;
  bottom: 0;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--fg-4);
  text-align: right;
  line-height: 1.8;
  white-space: nowrap;
}
.s01__est-locale {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 300;
  font-size: 15px;
  letter-spacing: 0.14em;
  color: var(--fg-3);
  text-transform: uppercase;
  display: inline-block;
  margin-top: 4px;
  transform: translateX(4px);
}

/* ============================================================
   Scene 02 — Position
   ============================================================ */
.s02__wrap { max-width: 1100px; margin: 0 auto; width: 100%; }
.s02__body {
  font-family: var(--font-ch);
  font-weight: 300;
  font-size: clamp(32px, 3.6vw, 52px);
  line-height: 1.55;
  letter-spacing: 0.02em;
  color: var(--fg-1);
  margin: 0;
  display: flex; flex-direction: column; gap: 8px;
}
.s02__body .accent {
  color: var(--kd-brown-700);
  font-weight: 400;
}
.s02__footer {
  margin-top: 96px;
  display: flex; align-items: center; gap: 24px;
}
.s02__caption {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 18px;
  color: var(--fg-4);
  letter-spacing: 0.02em;
}

/* ============================================================
   Scene 03 — Diptych
   ============================================================ */
.s03__wrap {
  max-width: 1280px; margin: 0 auto; width: 100%;
  display: grid;
  grid-template-columns: 1fr 1px 1fr;
  gap: clamp(48px, 8vw, 128px);
  align-items: center;
}
.s03__col {
  display: flex; flex-direction: column; gap: 28px;
  opacity: 0;
  transition: opacity 1200ms var(--ease-soft), transform 1200ms var(--ease-soft);
}
.s03__col--slideL { transform: translateX(-60px); }
.s03__col--slideR { transform: translateX(60px); }
.reveal.in .s03__col { opacity: 1; transform: translateX(0); }
.s03__col--right { text-align: right; justify-self: end; }

.s03__rule {
  width: 36px; height: 1px; background: var(--kd-brown-700);
  transform-origin: left;
  transform: scaleX(0);
  transition: transform 900ms var(--ease-out) 700ms;
}
.s03__col--right .s03__rule {
  margin-left: auto;
  transform-origin: right;
}
.reveal.in .s03__rule { transform: scaleX(1); }

.s03__quote {
  font-family: var(--font-ch);
  font-weight: 300;
  font-size: clamp(32px, 3.4vw, 52px);
  line-height: 1.4;
  letter-spacing: 0.02em;
  color: var(--fg-1);
  margin: 0;
}
.s03__quote .soft-accent { color: var(--kd-brown-700); }
.s03__caption {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 300;
  font-size: 18px;
  letter-spacing: 0.02em;
  color: var(--fg-4);
  margin-top: 16px;
}
.s03__divider {
  height: 60%;
  align-self: center;
  justify-self: center;
  background: var(--border-2);
  width: 1px;
}

/* ============================================================
   Scene 04 — Four
   ============================================================ */
.s04 { background: var(--kd-brown-50); }
.s04__wrap { max-width: 1200px; margin: 0 auto; width: 100%; }
.s04__head-row {
  display: flex; align-items: baseline; gap: 24px;
  margin-bottom: 80px; padding-bottom: 24px;
  border-bottom: 1px solid var(--border-1);
  flex-wrap: wrap;
}
.s04__head-ch {
  margin: 0;
  font-family: var(--font-ch);
  font-weight: 300;
  font-size: clamp(36px, 4vw, 64px);
  letter-spacing: 0.04em;
  color: var(--fg-1);
}
.s04__head-en {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 300;
  font-size: 20px;
  color: var(--fg-4);
}

.s04__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: clamp(64px, 8vw, 160px);
  row-gap: 72px;
}
.s04__item {
  padding-top: 28px;
  display: flex; flex-direction: column; gap: 18px;
  position: relative;
}
.s04__rule {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: var(--kd-brown-600);
  /* draw-hline handles the transform; we just override the timing via inline delay */
}
.s04__num {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.32em;
  color: var(--kd-brown-600);
}
.s04__head {
  display: flex; align-items: baseline; gap: 16px;
}
.s04__is {
  font-family: var(--font-ch);
  font-weight: 300;
  font-size: 22px;
  color: var(--fg-3);
  letter-spacing: 0.12em;
}
.s04__what {
  font-family: var(--font-ch);
  font-weight: 500;
  font-size: clamp(36px, 3vw, 48px);
  color: var(--kd-brown-700);
  letter-spacing: 0.04em;
}
.s04__body {
  margin: 0;
  font-family: var(--font-ch);
  font-weight: 300;
  font-size: clamp(16px, 1.3vw, 20px);
  line-height: 1.7;
  color: var(--fg-1);
  letter-spacing: 0.04em;
  max-width: 420px;
}
.s04__en {
  margin: 0;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 15px;
  color: var(--fg-4);
  letter-spacing: 0.02em;
}

/* ============================================================
   Scene 05 — Ethos
   ============================================================ */
.s05 { background: var(--kd-brown-700); color: #fff; overflow: hidden; }
.s05 .screen__label { color: rgba(255,255,255,0.55); }
.s05 .screen__label .tick { background: rgba(255,255,255,0.35); }
.s05::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 30%, rgba(255,255,255,0.06), transparent 40%),
    radial-gradient(circle at 80% 70%, rgba(255,255,255,0.05), transparent 45%);
  pointer-events: none;
  opacity: 0;
  transition: opacity 1800ms var(--ease-out);
}
.reveal.in.s05::before { opacity: 1; }

.s05__wrap { max-width: 1200px; margin: 0 auto; width: 100%; text-align: center; position: relative; z-index: 1; }
.s05__eyebrow {
  font-family: var(--font-sans);
  font-size: 11px;
  letter-spacing: 0.42em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.55);
  margin-bottom: 64px;
}
.s05__title {
  font-family: var(--font-ch);
  font-weight: 300;
  font-size: clamp(64px, 9vw, 128px);
  letter-spacing: 0.22em;
  line-height: 1.2;
  color: #fff;
  margin: 0;
}
[lang="en"] .s05__title {
  font-size: clamp(52px, 6.8vw, 96px);
  letter-spacing: 0.04em;
  font-weight: 300;
  font-style: italic;
  font-family: 'Cormorant Garamond', serif;
}
.s05__title .char {
  /* override blur for the title on dark — looks softer */
  transform: translateY(0.5em) scale(0.94);
  filter: blur(8px);
}
.reveal.in .s05__title .char {
  transform: translateY(0) scale(1);
  filter: blur(0);
}

.s05__rule {
  width: 48px; height: 1px; background: rgba(255,255,255,0.55);
  margin: 64px auto;
  transform-origin: center;
  transform: scaleX(0);
  transition: transform 1100ms var(--ease-soft) 1600ms, width 800ms var(--ease-out) 2400ms;
}
.reveal.in .s05__rule { transform: scaleX(1); width: 120px; }

.s05__body {
  font-family: var(--font-ch);
  font-weight: 300;
  font-size: clamp(22px, 2vw, 30px);
  line-height: 1.5;
  letter-spacing: 0.08em;
  color: rgba(255,255,255,0.9);
  margin: 0;
}
.s05__en {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 300;
  font-size: 18px;
  letter-spacing: 0.04em;
  color: rgba(255,255,255,0.5);
  margin-top: 48px;
}

/* ============================================================
   Scene 06 — Practice
   ============================================================ */
.s06__wrap { width: 100%; max-width: 1400px; margin: 0 auto; }
.s06__header {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-bottom: 64px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border-1);
}
.s06__eyebrow {
  font-family: var(--font-sans);
  font-size: 11px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--kd-brown-700);
}
.s06__caption {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 300;
  font-size: 18px;
  color: var(--fg-4);
}
.s06__row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--border-1);
  border: 1px solid var(--border-1);
}
.s06__cell {
  background: var(--kd-paper);
  aspect-ratio: 1 / 1.15;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 28px 32px;
  position: relative;
  overflow: hidden;
  transition: background 420ms var(--ease-out);
  cursor: default;
}
/* ambient dot drifts behind glyph */
.s06__cell::before {
  content: '';
  position: absolute;
  width: 180px; height: 180px;
  top: 50%; left: 50%;
  border-radius: 50%;
  background: radial-gradient(circle, var(--kd-brown-100), transparent 65%);
  transform: translate(-50%, -50%) scale(0.6);
  opacity: 0;
  transition: opacity 600ms var(--ease-out), transform 600ms var(--ease-out);
  pointer-events: none;
}
.s06__cell:hover::before { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.s06__cell:hover { background: var(--kd-brown-50); }
.s06__cell:hover .s06__glyph { color: var(--kd-brown-700); transform: translateY(-6px); }

.s06__glyph-wrap {
  margin: auto 0;
  display: flex; justify-content: center; align-items: center;
  position: relative;
  z-index: 1;
}
.s06__glyph {
  font-family: var(--font-ch);
  font-weight: 300;
  font-size: clamp(110px, 13vw, 200px);
  line-height: 1;
  color: var(--fg-1);
  text-align: center;
  display: inline-block;
  transform: scale(0.5) translateY(40px);
  opacity: 0;
  filter: blur(12px);
  transition:
    transform 1100ms var(--ease-soft),
    opacity 900ms var(--ease-out),
    filter 900ms var(--ease-out),
    color 500ms var(--ease-out);
}
.reveal.in .s06__cell:nth-child(1) .s06__glyph { transition-delay: 200ms; }
.reveal.in .s06__cell:nth-child(2) .s06__glyph { transition-delay: 450ms; }
.reveal.in .s06__cell:nth-child(3) .s06__glyph { transition-delay: 700ms; }
.reveal.in .s06__cell:nth-child(4) .s06__glyph { transition-delay: 950ms; }
.reveal.in .s06__glyph {
  transform: scale(1) translateY(0);
  opacity: 1;
  filter: blur(0);
}

.s06__foot {
  position: relative;
  z-index: 1;
  font-family: var(--font-ch);
  font-weight: 400;
  font-size: 14px;
  letter-spacing: 0.12em;
  color: var(--fg-3);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 600ms var(--ease-out), transform 600ms var(--ease-out);
}
.reveal.in .s06__cell:nth-child(1) .s06__foot { transition-delay: 700ms; }
.reveal.in .s06__cell:nth-child(2) .s06__foot { transition-delay: 900ms; }
.reveal.in .s06__cell:nth-child(3) .s06__foot { transition-delay: 1100ms; }
.reveal.in .s06__cell:nth-child(4) .s06__foot { transition-delay: 1300ms; }
.reveal.in .s06__foot { opacity: 1; transform: translateY(0); }

.s06__runner {
  margin-top: 56px; text-align: center;
  font-family: var(--font-ch);
  font-weight: 300;
  font-size: clamp(28px, 3vw, 44px);
  letter-spacing: 1em;
  color: var(--kd-brown-700);
}
[lang="en"] .s06__runner {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-weight: 400;
  font-size: clamp(22px, 2.4vw, 34px);
  letter-spacing: 0.16em;
}

/* ============================================================
   Scene 07 — Colophon
   ============================================================ */
.s07 { background: var(--kd-brown-900); color: var(--kd-brown-200); }
.s07 .screen__label { color: rgba(255,255,255,0.4); }
.s07 .screen__label .tick { background: rgba(255,255,255,0.3); }

.s07__wrap { max-width: 1200px; margin: 0 auto; width: 100%; display: flex; flex-direction: column; gap: 96px; }

.s07__lockup {
  display: flex; align-items: center;
  padding-bottom: 48px;
  border-bottom: 1px solid rgba(255,255,255,0.12);
}
.s07__logo {
  height: clamp(48px, 6vw, 88px);
  width: auto;
  opacity: 0;
  transform: translateY(16px) scale(0.96);
  filter: blur(8px);
  transition:
    opacity 1200ms var(--ease-soft) 200ms,
    transform 1200ms var(--ease-soft) 200ms,
    filter 1200ms var(--ease-soft) 200ms;
}
.reveal.in .s07__logo {
  opacity: 1;
  transform: translateY(0) scale(1);
  filter: blur(0);
}

.s07__info {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 80px;
}
.s07__group { display: flex; flex-direction: column; gap: 16px; }
.s07__group h4 {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  font-weight: 500;
  color: rgba(255,255,255,0.55);
}
.s07__group p {
  margin: 0;
  font-family: var(--font-ch);
  font-weight: 300;
  font-size: 20px;
  line-height: 1.7;
  letter-spacing: 0.02em;
  color: #fff;
}
.s07__group .en {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 300;
  font-size: 16px;
  color: rgba(255,255,255,0.45);
  letter-spacing: 0.04em;
}

.s07__baseline {
  display: flex; justify-content: space-between; align-items: center;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.4);
  padding-top: 48px;
  border-top: 1px solid rgba(255,255,255,0.08);
}

/* ============================================================
   Font switcher
   ============================================================ */
.fontsw {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--border-1);
  border-radius: 999px;
  box-shadow: 0 8px 24px rgba(60, 34, 24, 0.12);
}
.fontsw__label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--fg-4);
  padding: 0 12px 0 14px;
  border-right: 1px solid var(--border-1);
  margin-right: 4px;
}
.fontsw__btn {
  font-family: var(--font-sans);
  font-size: 13px;
  letter-spacing: 0.08em;
  padding: 8px 14px;
  background: transparent;
  white-space: nowrap;
  color: var(--fg-3);
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  transition: background 240ms var(--ease-out), color 240ms var(--ease-out);
}
.fontsw__btn:hover { color: var(--kd-brown-700); }
.fontsw__btn--active {
  background: var(--kd-brown-700);
  color: #fff;
}
.fontsw__btn--active:hover { color: #fff; }

/* ============================================================
   Responsive — iPhone / iPad / Android
   ============================================================ */

/* Safe-area (iPhone notch / home indicator) */
@supports (padding: env(safe-area-inset-top)) {
  .nav {
    padding-left: max(clamp(32px, 6vw, 96px), env(safe-area-inset-left));
    padding-right: max(clamp(32px, 6vw, 96px), env(safe-area-inset-right));
    padding-top: env(safe-area-inset-top);
    height: calc(72px + env(safe-area-inset-top));
  }
  .screen {
    padding-left: max(clamp(32px, 6vw, 96px), env(safe-area-inset-left));
    padding-right: max(clamp(32px, 6vw, 96px), env(safe-area-inset-right));
  }
  .screen__label {
    left: max(clamp(32px, 6vw, 96px), env(safe-area-inset-left));
  }
  .fontsw {
    bottom: max(24px, calc(env(safe-area-inset-bottom) + 16px));
  }
}

/* Use dynamic viewport on modern iOS so content accounts for Safari toolbars */
@supports (height: 100dvh) {
  .screen { min-height: 100dvh; }
}

/* Tablet and below */
@media (max-width: 1024px) {
  .screen { padding-top: 120px; padding-bottom: 120px; justify-content: flex-start; }
  .screen__label { top: 88px; }
}

/* Phones */
@media (max-width: 820px) {
  .rail { display: none; }
  .nav { height: 60px; }
  @supports (padding: env(safe-area-inset-top)) {
    .nav { height: calc(60px + env(safe-area-inset-top)); }
  }
  .nav__brand-mark { height: 22px; }
  .nav__brand-ch { font-size: 12px; padding-left: 10px; letter-spacing: 0.18em; }
  .nav__meta { font-size: 10px; letter-spacing: 0.18em; }

  .screen {
    padding-top: 112px;
    padding-bottom: 88px;
    min-height: auto;
  }
  .screen__label { top: 76px; font-size: 10px; letter-spacing: 0.2em; }

  /* Scene 01 */
  .s01__wrap--split { grid-template-columns: 1fr; gap: 32px; }
  .s01__visual { max-width: 360px; aspect-ratio: 1 / 1; order: -1; }
  .s01__eyebrow { margin-bottom: 40px; }
  .s01__title { font-size: clamp(34px, 9vw, 56px); line-height: 1.35; }
  .s01__foot { flex-direction: column; gap: 32px; align-items: flex-start; margin-top: 56px; }
  .s01__en { font-size: 18px; }
  .s01__est { position: static; text-align: left; margin-top: 32px; }
  .s01__est-locale { font-size: 16px; }

  /* Scene 02 */
  .s02__body { font-size: clamp(24px, 6.4vw, 36px); line-height: 1.5; }
  .s02__footer { margin-top: 56px; }
  .s02__caption { font-size: 15px; }

  /* Scene 03 */
  .s03__wrap { grid-template-columns: 1fr; gap: 64px; }
  .s03__divider { display: none; }
  .s03__col--right { text-align: left; justify-self: start; }
  .s03__col--right .s03__rule { margin-left: 0; transform-origin: left; }
  .s03__col--slideL, .s03__col--slideR { transform: translateY(24px); }
  .reveal.in .s03__col { transform: translate(0, 0); }
  .s03__quote { font-size: clamp(24px, 6.4vw, 36px); }
  .s03__caption { font-size: 15px; }

  /* Scene 04 */
  .s04__head-row { margin-bottom: 48px; gap: 12px; }
  .s04__head-ch { font-size: clamp(28px, 7vw, 40px); }
  .s04__head-en { font-size: 16px; }
  .s04__grid { grid-template-columns: 1fr; row-gap: 44px; }
  .s04__item { padding-top: 20px; gap: 14px; }
  .s04__head { gap: 12px; flex-wrap: wrap; }
  .s04__is { font-size: 18px; }
  .s04__what { font-size: clamp(28px, 7vw, 36px); }
  .s04__body { font-size: 16px; line-height: 1.75; }
  .s04__en { font-size: 13px; }

  /* Scene 05 */
  .s05__eyebrow { margin-bottom: 40px; font-size: 10px; letter-spacing: 0.3em; }
  .s05__title { font-size: clamp(44px, 14vw, 72px); letter-spacing: 0.15em; }
  .s05__rule { margin: 44px auto; }
  .reveal.in .s05__rule { width: 80px; }
  .s05__body { font-size: clamp(17px, 4.4vw, 22px); letter-spacing: 0.04em; line-height: 1.7; }
  .s05__en { font-size: 14px; margin-top: 32px; }

  /* Scene 06 */
  .s06__header { margin-bottom: 40px; flex-direction: column; align-items: flex-start; gap: 10px; }
  .s06__caption { font-size: 15px; }
  .s06__row { grid-template-columns: 1fr 1fr; }
  .s06__cell { padding: 20px 18px; aspect-ratio: 1 / 1.1; }
  /* hover is irrelevant on touch — use :active for a tap affordance */
  .s06__cell:hover { background: var(--kd-paper); }
  .s06__cell:hover::before { opacity: 0; }
  .s06__cell:hover .s06__glyph { color: var(--fg-1); transform: none; }
  .s06__cell:active { background: var(--kd-brown-50); }
  .s06__cell:active .s06__glyph { color: var(--kd-brown-700); }
  .s06__glyph { font-size: clamp(72px, 22vw, 128px); }
  .s06__foot { font-size: 11px; letter-spacing: 0.08em; }
  .s06__runner { font-size: clamp(22px, 6.6vw, 32px); letter-spacing: 0.6em; margin-top: 40px; }
  [lang="en"] .s06__runner { font-size: clamp(18px, 5vw, 26px); letter-spacing: 0.12em; }

  /* Scene 07 */
  .s07__wrap { gap: 64px; }
  .s07__lockup { padding-bottom: 36px; }
  .s07__logo { height: clamp(40px, 10vw, 56px); }
  .s07__info { grid-template-columns: 1fr; gap: 44px; }
  .s07__group p { font-size: 17px; line-height: 1.65; }
  .s07__group .en { font-size: 14px; }
  .s07__baseline { flex-direction: column; gap: 14px; align-items: flex-start; font-size: 10px; letter-spacing: 0.18em; padding-top: 32px; }

  /* Font switcher — prevent overflow off small screens */
  .fontsw {
    overflow-x: auto;
    max-width: calc(100vw - 32px);
    -webkit-overflow-scrolling: touch;
    padding: 5px;
  }
  .fontsw__label { display: none; }
  .fontsw__btn { font-size: 12px; padding: 8px 12px; white-space: nowrap; }
}

/* Very small phones (iPhone SE, etc) */
@media (max-width: 380px) {
  .nav__brand-ch { display: none; }
  .screen { padding-left: 24px; padding-right: 24px; }
  @supports (padding: env(safe-area-inset-left)) {
    .screen {
      padding-left: max(24px, env(safe-area-inset-left));
      padding-right: max(24px, env(safe-area-inset-right));
    }
  }
  .s01__title { font-size: clamp(30px, 10vw, 44px); }
  .s05__title { font-size: clamp(38px, 16vw, 60px); }
}

/* Taps on iOS — kill the default gray flash, keep our own affordances */
a, button { -webkit-tap-highlight-color: transparent; }

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .char, .soft, .s03__col, .s07__logo, .s06__glyph, .s06__foot {
    opacity: 1 !important;
    transform: none !important;
    filter: none !important;
  }
  .wipe::after { transform: scaleX(0) !important; }
  .draw-hline, .draw-vline, .s03__rule, .s05__rule { transform: none !important; }
}
