/* =============================================================================
   LEITZPHONE EMAGAZINE - TIER MAX
   Three.js + GSAP + ScrollTrigger + Lenis editorial long-read
   Headings: Space Grotesk (EmagDisplay)   ·   Body: FK Roman (EmagSerif) + SF Pro (EmagSans)
   ============================================================================= */

/* --- @font-face -------------------- */
@font-face { font-family: EmagSans; src: url("../fonts/sf-pro-display-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: EmagSans; src: url("../fonts/sf-pro-display-600.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: EmagSans; src: url("../fonts/sf-pro-display-800.woff2") format("woff2"); font-weight: 800; font-display: swap; }

/* FK Roman - used for body paragraphs only */
@font-face { font-family: EmagSerif; src: url("../fonts/fk-roman-standard-regular.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: EmagSerif; src: url("../fonts/fk-roman-standard-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: EmagSerif; src: url("../fonts/fk-roman-standard-bold.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }

/* Space Grotesk - display / headings (2 subsets, variable wght 300-700) */
@font-face {
  font-family: EmagDisplay;
  src: url("../fonts/space-grotesk-latin.woff2") format("woff2");
  font-weight: 300 700;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: EmagDisplay;
  src: url("../fonts/space-grotesk-vietnamese.woff2") format("woff2");
  font-weight: 300 700;
  font-display: swap;
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}

@font-face { font-family: EmagMono; src: url("../fonts/jetbrains-mono-500.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: EmagSamsungSans; src: url("../fonts/samsung-sharp-sans-bold.woff2") format("woff2"); font-weight: 700; font-display: swap; }

/* --- Tokens --------------------------------------------------------- */
.td-emag__wrapper {
  --leica-red: #E20612;
  --ink: #0A0A0A;
  --ink-2: #1A1A1A;
  --paper: #F4F2EC;
  --paper-2: #ECE9E1;
  --stone: #787469;
  --stone-2: #A8A49B;
  --hairline: rgba(10,10,10,0.14);
  --hairline-light: rgba(244,242,236,0.18);

  --font-display: "EmagDisplay", "Space Grotesk", -apple-system, sans-serif;
  --font-sans: "EmagSans", -apple-system, sans-serif;
  --font-serif: "EmagSerif", "Times New Roman", serif;
  --font-mono: "EmagMono", "Courier New", monospace;
  --font-badge: "EmagSamsungSans", "EmagSans", sans-serif;

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-inout: cubic-bezier(0.76, 0, 0.24, 1);
  --ease-expo: cubic-bezier(0.87, 0, 0.13, 1);

  --gutter: clamp(1.25rem, 3vw, 3rem);
  --content-w: 42rem;   /* text column */
  --wide-w: 60rem;      /* wide landscape images */
  --col-max: 1440px;

  --stroke-v: 0;
  --stroke-h: 0;
}

/* --- Reset / base --------------------------------------------------------- */
* { box-sizing: border-box; margin: 0; padding: 0; }
html { overflow-x: hidden; }
body {
  font-family: var(--font-sans);
  font-size: 100%;
  line-height: 1.5;
  color: var(--ink, #0A0A0A);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { all: unset; cursor: pointer; font: inherit; }

/* --- Wrapper owns bg + grain + Leica doodle pattern ----------------------- */
.td-emag__wrapper {
  position: relative;
  background-color: var(--paper);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='440' height='440' viewBox='0 0 440 440'><g fill='none' stroke='%231a1a1a' stroke-width='0.8' stroke-linecap='round' stroke-linejoin='round' opacity='0.06'><g transform='translate(30,50)'><rect x='0' y='8' width='90' height='52' rx='3'/><rect x='25' y='0' width='40' height='10' rx='1'/><circle cx='45' cy='34' r='16'/><circle cx='45' cy='34' r='10'/><circle cx='45' cy='34' r='4'/><rect x='10' y='14' width='12' height='8'/><circle cx='78' cy='20' r='4'/></g><g transform='translate(220,70) rotate(-6)'><rect x='0' y='0' width='170' height='30'/><line x1='0' y1='7' x2='170' y2='7'/><line x1='0' y1='23' x2='170' y2='23'/><line x1='42' y1='7' x2='42' y2='23'/><line x1='85' y1='7' x2='85' y2='23'/><line x1='128' y1='7' x2='128' y2='23'/></g><g transform='translate(95,230)'><circle cx='0' cy='0' r='26'/><circle cx='0' cy='0' r='18'/><line x1='0' y1='-26' x2='0' y2='-30'/><line x1='26' y1='0' x2='30' y2='0'/><line x1='0' y1='26' x2='0' y2='30'/><line x1='-26' y1='0' x2='-30' y2='0'/><line x1='18' y1='-18' x2='21' y2='-21'/><line x1='18' y1='18' x2='21' y2='21'/><line x1='-18' y1='18' x2='-21' y2='21'/><line x1='-18' y1='-18' x2='-21' y2='-21'/></g><g transform='translate(305,270) rotate(15)'><rect x='0' y='6' width='70' height='42' rx='2'/><rect x='20' y='0' width='30' height='7' rx='1'/><circle cx='35' cy='28' r='12'/><circle cx='35' cy='28' r='7'/><rect x='8' y='11' width='9' height='6'/></g><g transform='translate(70,370)'><rect x='0' y='-18' width='44' height='36' rx='4'/><rect x='6' y='-13' width='32' height='26'/><line x1='10' y1='-8' x2='34' y2='-8'/><line x1='10' y1='-3' x2='34' y2='-3'/><line x1='10' y1='2' x2='34' y2='2'/><line x1='10' y1='7' x2='34' y2='7'/><circle cx='46' cy='0' r='5'/></g><g transform='translate(340,370)'><circle cx='0' cy='0' r='26'/><circle cx='0' cy='0' r='18'/><circle cx='0' cy='0' r='3'/><line x1='0' y1='-26' x2='0' y2='-21'/><line x1='13' y1='-22.5' x2='10.5' y2='-18.2'/><line x1='22.5' y1='-13' x2='18.2' y2='-10.5'/><line x1='26' y1='0' x2='21' y2='0'/><line x1='22.5' y1='13' x2='18.2' y2='10.5'/><line x1='13' y1='22.5' x2='10.5' y2='18.2'/><line x1='0' y1='26' x2='0' y2='21'/><line x1='-13' y1='22.5' x2='-10.5' y2='18.2'/><line x1='-22.5' y1='13' x2='-18.2' y2='10.5'/><line x1='-26' y1='0' x2='-21' y2='0'/><line x1='-22.5' y1='-13' x2='-18.2' y2='-10.5'/><line x1='-13' y1='-22.5' x2='-10.5' y2='-18.2'/></g></g></svg>");
  background-size: 440px 440px;
  background-repeat: repeat;
  color: var(--ink);
  overflow: hidden;
}
.td-emag__wrapper::before {
  content: "";
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 100;
  opacity: 0.04;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 0.6 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  mix-blend-mode: multiply;
}

/* =============================================================================
   CMS PARENT WRAPPER OVERRIDES (MANDATORY — VCCorp/Genk CMS)
   ============================================================================= */
.sp-body-content,
.sp-body-content .w980,
.sp-body-content .w980 .sp-detail,
.sp-body-content .sp-detail-maincontent,
.sp-body-content .sp-detail-content,
.sp-detail-content[data-role="content"] {
  width: 100% !important;
  max-width: 100% !important;
  padding: 0 !important;
  margin-left: auto !important;
  margin-right: auto !important;
  overflow: visible !important;
  background: #F4F2EC !important;
}
[data-role=content] div,
[data-role=content] span {
  color: inherit;
  font-size: inherit;
  font-family: inherit;
}
.sp-detail,
.sp-detail-content { padding: 0 !important; }
.sp-body-content .sp-detail .sp-sapo { display: none !important; }
.sp-detail-content .detail-emagazine { padding: 0 !important; }
.k14-sp-wrapper,
.k14-sp-wrapper .sp-body-content,
.k14-sp-wrapper .sp-body-content .sp-detail,
.genk-sp-wrapper,
.genk-sp-wrapper .sp-body-content,
.genk-sp-wrapper .sp-body-content .sp-detail { background: #F4F2EC !important; }

/* =============================================================================
   TYPOGRAPHY - Space Grotesk for all headings, FK Roman for body paragraphs
   ============================================================================= */
.td-emag__wrapper .td-body,
.td-emag__wrapper .td-lead {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  line-height: 1.7;
  font-weight: 400;
  color: var(--ink);
  max-width: var(--content-w);
  margin-left: auto;
  margin-right: auto;
}
.td-emag__wrapper .td-body + .td-body { margin-top: 1.4rem; }
.td-emag__wrapper .td-body b,
.td-emag__wrapper .td-body strong { font-weight: 700; color: var(--ink); }
.td-emag__wrapper .td-body i,
.td-emag__wrapper .td-body em { font-style: italic; }

/* HERO title - Space Grotesk heavy */
.td-emag__wrapper .td-hero__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(3rem, 7.5vw, 6.5rem);
  line-height: 1.02;
  letter-spacing: -0.035em;
  color: var(--ink);
  text-shadow: 0 2px 18px rgba(244,242,236,0.55);
}

/* Chapter title - Space Grotesk bold, centered */
.td-emag__wrapper .td-chapter-title,
.td-emag__wrapper .td-chapter-title[data-reveal-mask] {
  display: block;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.25rem, 4vw, 3.5rem);
  line-height: 1.05;
  letter-spacing: -0.025em;
  color: var(--ink);
  margin: 0 auto 2.75rem;
  max-width: var(--content-w);
  overflow: hidden;
  text-align: center;
}
.td-emag__wrapper .td-chapter-title > span {
  display: inline-block;
  will-change: transform;
}

/* S2 Chapter-index title - Space Grotesk medium */
.td-emag__wrapper #scene-index .td-index__title {
  font-family: var(--font-display);
  font-weight: 500;
  letter-spacing: -0.02em;
}

/* S6 / section eyebrows */
.td-emag__wrapper .td-outro__eyebrow,
.td-emag__wrapper #scene-index .td-index__eyebrow {
  font-family: var(--font-mono);
}

/* Labels / mono */
.td-emag__wrapper .td-meta,
.td-emag__wrapper .td-eyebrow,
.td-emag__wrapper .td-byline__label,
.td-emag__wrapper .td-chapter__eyebrow {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--stone);
}

/* Caption */
.td-emag__wrapper .td-caption,
.td-emag__wrapper figcaption {
  font-family: var(--font-sans);
  font-size: 0.875rem;
  line-height: 1.55;
  color: var(--stone);
  font-style: italic;
  margin-top: 0.75rem;
  max-width: var(--content-w);
  margin-left: auto; margin-right: auto;
  padding: 0 1rem;
  text-align: center;
}

/* =============================================================================
   eMAG BADGE - prominent (≥ 1rem per project rule)
   ============================================================================= */
.td-emag__wrapper .td-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.1em;
  font-family: var(--font-badge);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.01em;
  color: #fff;
  background: #333;
  padding: 0.42em 0.95em 0.38em;
  border-radius: 3px;
  line-height: 1;
  text-transform: none;
}
.td-emag__wrapper .td-tag__accent {
  color: var(--leica-red);
  font-weight: 800;
}

/* =============================================================================
   S1 - HERO
   ============================================================================= */
#scene-hero {
  position: relative;
  height: 100vh;
  min-height: 680px;
  overflow: hidden;
  background: var(--paper);
}
#scene-hero .td-hero-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

/* --- Leica rangefinder deco ---------------------------------------------- */
#scene-hero .td-hero__deco {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  opacity: 0;
}

/* Corner brackets - rangefinder viewfinder frame (thicker 2px stroke) */
#scene-hero .td-hero__bracket {
  position: absolute;
  width: 1.75rem;
  height: 1.75rem;
  border: 2px solid var(--ink);
  opacity: 0.35;
}
#scene-hero .td-hero__bracket--tl {
  top: 5.5rem; left: 3rem;
  border-right: 0; border-bottom: 0;
}
#scene-hero .td-hero__bracket--tr {
  top: 5.5rem; right: 3rem;
  border-left: 0; border-bottom: 0;
}
#scene-hero .td-hero__bracket--bl {
  bottom: 9rem; left: 3rem;
  border-right: 0; border-top: 0;
}
#scene-hero .td-hero__bracket--br {
  bottom: 9rem; right: 3rem;
  border-left: 0; border-top: 0;
}

/* Inner frameline (90mm FoV) - nested smaller brackets, lighter */
#scene-hero .td-hero__bracket--inner {
  width: 1.25rem;
  height: 1.25rem;
  border-width: 1.5px;
  opacity: 0.26;
}
#scene-hero .td-hero__bracket--inner.td-hero__bracket--tl {
  top: 11rem; left: 11rem;
}
#scene-hero .td-hero__bracket--inner.td-hero__bracket--tr {
  top: 11rem; right: 11rem;
}
#scene-hero .td-hero__bracket--inner.td-hero__bracket--bl {
  bottom: 13rem; left: 11rem;
}
#scene-hero .td-hero__bracket--inner.td-hero__bracket--br {
  bottom: 13rem; right: 11rem;
}

/* Frameline pair label: focal lengths "35 · 90" — display font for Leica numerics */
#scene-hero .td-hero__frame-label {
  position: absolute;
  top: 5.5rem;
  right: 5rem;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  color: var(--stone);
  opacity: 0.65;
}

/* Center reticle */
#scene-hero .td-hero__reticle {
  position: absolute;
  left: 50%; top: 50%;
  width: 2.25rem; height: 2.25rem;
  transform: translate(-50%, -50%);
  opacity: 0.22;
}
#scene-hero .td-hero__reticle-h,
#scene-hero .td-hero__reticle-v {
  position: absolute;
  background: var(--ink);
}
#scene-hero .td-hero__reticle-h {
  left: 0; right: 0; top: 50%;
  height: 1px;
  transform: translateY(-0.5px);
}
#scene-hero .td-hero__reticle-v {
  top: 0; bottom: 0; left: 50%;
  width: 1px;
  transform: translateX(-0.5px);
}
#scene-hero .td-hero__reticle-dot {
  position: absolute;
  left: 50%; top: 50%;
  width: 0.3rem; height: 0.3rem;
  background: var(--leica-red);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  opacity: 1;
}

/* EV scale vertical - left side (Leica numerics → display font) */
#scene-hero .td-hero__ev {
  position: absolute;
  left: 2.75rem;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.55rem;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 0.76rem;
  letter-spacing: 0.05em;
  color: var(--stone);
}
#scene-hero .td-hero__ev-label {
  font-family: var(--font-mono);
  font-weight: 500;
  color: var(--ink);
  margin-bottom: 0.6rem;
  font-size: 0.58rem;
  letter-spacing: 0.35em;
  opacity: 0.7;
}
#scene-hero .td-hero__ev-mark {
  position: relative;
  padding-left: 1.2rem;
  line-height: 1;
  transition: color 0.3s;
  opacity: 0.6;
}
#scene-hero .td-hero__ev-mark::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 0.6rem;
  height: 1.5px;
  background: var(--stone);
  transform: translateY(-50%);
}
#scene-hero .td-hero__ev-mark.is-active {
  color: var(--leica-red);
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 0;
  opacity: 1;
}
#scene-hero .td-hero__ev-mark.is-active::before {
  width: 0.95rem;
  height: 2.5px;
  background: var(--leica-red);
}

/* Right rail: rotated vertical text */
#scene-hero .td-hero__rail {
  position: absolute;
  right: 3rem;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
}
#scene-hero .td-hero__rail-text {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 0.72rem;
  letter-spacing: 0.28em;
  color: var(--stone);
  opacity: 0.6;
}

/* Bottom specs strip - Leica camera values → display font */
#scene-hero .td-hero__specs {
  position: absolute;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 0.85rem;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 0.8rem;
  letter-spacing: 0.05em;
  color: var(--ink);
  opacity: 0.75;
  white-space: nowrap;
}
#scene-hero .td-hero__specs-sep {
  width: 0.3rem;
  height: 0.3rem;
  background: var(--leica-red);
  border-radius: 50%;
  opacity: 0.85;
}
#scene-hero .td-hero__specs-mode {
  color: var(--leica-red);
  font-weight: 700;
}

#scene-hero .td-hero__overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  grid-template-rows: auto 1fr auto;
  padding: clamp(1.5rem, 2.5vw, 2.5rem) var(--gutter);
  pointer-events: none;
}
#scene-hero .td-hero__top {
  display: flex; justify-content: space-between; align-items: flex-start;
  opacity: 0;
}
#scene-hero .td-hero__brand {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--ink);
  display: flex; align-items: center; gap: 0.6rem;
}
#scene-hero .td-hero__brand::before {
  content: ""; width: 0.55em; height: 0.55em; background: var(--leica-red); border-radius: 50%;
}
#scene-hero .td-hero__text {
  align-self: center;
  max-width: 78rem;
  margin: 0 auto;
  text-align: center;
  padding: 0 1rem;
}
#scene-hero .td-hero__title-top,
#scene-hero .td-hero__title-bottom {
  display: block;
  opacity: 0;
}
#scene-hero .td-hero__title-top  { text-align: left;  padding-left: clamp(0rem, 2vw, 4rem); }
#scene-hero .td-hero__title-bottom { text-align: right; padding-right: clamp(0rem, 2vw, 4rem); font-family: var(--font-serif); font-style: italic; font-weight: 400; }
#scene-hero .td-hero__bottom {
  display: flex; justify-content: space-between; align-items: flex-end; gap: 2rem;
  opacity: 0;
}
#scene-hero .td-byline {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink);
  max-width: 18rem;
  line-height: 1.7;
}
#scene-hero .td-byline__label { color: var(--stone); display: block; margin-bottom: 0.3rem; }
#scene-hero .td-hero__excerpt {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.05rem;
  line-height: 1.55;
  color: var(--ink);
  max-width: 30rem;
  text-align: right;
}

/* =============================================================================
   S2 - CHAPTER INDEX (editorial TOC: cinematic reel + chapter list)
   ============================================================================= */
#scene-index {
  position: relative;
  padding: clamp(5rem, 8vw, 9rem) var(--gutter);
  max-width: 1680px;
  margin: 0 auto;
}

#scene-index .td-index__kicker {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  margin: 0 auto clamp(3rem, 5vw, 5rem);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.42em;
  text-transform: uppercase;
  color: var(--stone);
  text-indent: 0.42em;
  max-width: 48rem;
}
#scene-index .td-index__kicker-line {
  flex: 1 1 clamp(3rem, 6vw, 6rem);
  max-width: 9rem;
  height: 1px;
  background: var(--leica-red);
  opacity: 0.7;
  transform: scaleX(var(--stroke-h, 0));
  transform-origin: center;
  transition: transform 1.1s var(--ease-inout);
}
#scene-index.td-visible .td-index__kicker-line { transform: scaleX(1); }
#scene-index .td-index__kicker-text { white-space: nowrap; }

#scene-index .td-index__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: clamp(2rem, 4vw, 5rem);
  align-items: stretch;
}

/* --- Reel: Three.js canvas + bottom label bar ----------------------------- */
#scene-index .td-index__reel {
  position: relative;
  height: clamp(520px, 68vh, 720px);
  background: var(--ink);
  overflow: hidden;
  border-radius: 2px;
}
#scene-index .td-index__reel canvas {
  width: 100%; height: 100%; display: block;
  cursor: pointer;
}
#scene-index .td-index__reel-bar {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 2rem 2rem 1.5rem;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  color: var(--paper);
  background: linear-gradient(to top, rgba(10,9,7,0.82) 0%, rgba(10,9,7,0) 100%);
  z-index: 2;
  pointer-events: none;
}
#scene-index .td-index__reel-label {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: rgba(244,242,236,0.65);
}
#scene-index .td-index__reel-number {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 0.92rem;
  letter-spacing: 0.22em;
  color: var(--paper);
}

/* --- Side panel: spotlight + chapter list --------------------------------- */
#scene-index .td-index__side {
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}

#scene-index .td-index__spotlight {
  padding: 1.25rem 0 1.75rem;
  border-top: 1px solid var(--leica-red);
}
#scene-index .td-index__spotlight-eyebrow {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--leica-red);
  margin-bottom: 1rem;
}
#scene-index .td-index__spotlight-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.6rem, 2.4vw, 2.1rem);
  line-height: 1.12;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin-bottom: 0.9rem;
  min-height: 4.7rem;
}
#scene-index .td-index__spotlight-summary {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1rem;
  line-height: 1.55;
  color: var(--stone);
  min-height: 3.1rem;
}

/* --- Chapter list --------------------------------------------------------- */
#scene-index .td-index__list {
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--hairline);
}
#scene-index .td-index__row {
  display: grid;
  grid-template-columns: 2.5rem 1fr;
  column-gap: 1rem;
  align-items: center;
  padding: 0.8rem 0;
  border-bottom: 1px solid var(--hairline);
  cursor: pointer;
  position: relative;
  transition: padding-left 0.45s var(--ease-out);
}
#scene-index .td-index__row::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 2px;
  background: var(--leica-red);
  transform: scaleY(0);
  transform-origin: center;
  transition: transform 0.45s var(--ease-out);
}
#scene-index .td-index__row:hover { padding-left: 0.4rem; }
#scene-index .td-index__row-num {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  letter-spacing: 0.18em;
  color: var(--stone-2);
  transition: color 0.35s;
}
#scene-index .td-index__row-title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1rem;
  line-height: 1.3;
  color: var(--ink);
  transition: color 0.35s;
}
#scene-index .td-index__row.is-active {
  padding-left: 0.9rem;
}
#scene-index .td-index__row.is-active::before { transform: scaleY(1); }
#scene-index .td-index__row.is-active .td-index__row-num { color: var(--leica-red); }
#scene-index .td-index__row.is-active .td-index__row-title { color: var(--leica-red); font-weight: 700; }

/* =============================================================================
   S3 - LONG-READ READER
   Text column = 42rem; wide images bleed to 60rem; grids full viewport.
   ============================================================================= */
.td-reader {
  position: relative;
  padding: clamp(5rem, 8vw, 9rem) var(--gutter);
  max-width: var(--wide-w);
  margin: 0 auto;
}
.td-content {
  max-width: var(--wide-w);
  width: 100%;
  margin: 0 auto;
  position: relative;
}
.td-chapter {
  position: relative;
  padding: clamp(4rem, 6vw, 6rem) 0;
  border-top: 1px solid var(--hairline);
}
.td-chapter:first-child { border-top: 0; padding-top: 0; }
.td-chapter--hook { border-top: 0; padding-top: 1rem; }

.td-chapter__eyebrow {
  color: var(--leica-red);
  margin: 0 auto 1.75rem;
  max-width: var(--content-w);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.42em;
  text-transform: uppercase;
  text-indent: 0.42em;
}
.td-chapter__eyebrow::before,
.td-chapter__eyebrow::after {
  content: "";
  flex: 0 0 1.75rem;
  height: 1px;
  background: var(--leica-red);
  opacity: 0.6;
}
.td-chapter__eyebrow-dial {
  display: inline-flex;
  align-items: center;
  color: var(--leica-red);
  line-height: 0;
  transform-origin: center;
  will-change: transform, opacity;
}
.td-chapter__eyebrow-dial svg { display: block; }
.td-chapter__eyebrow-text { display: inline-block; }
.td-chapter__eyebrow-aperture {
  display: inline-flex;
  align-items: center;
  padding-left: 0.7em;
  margin-left: 0.1em;
  border-left: 1px solid rgba(226, 6, 18, 0.35);
  color: var(--leica-red);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.95em;
  letter-spacing: 0.02em;
  text-indent: 0;
  text-transform: none;
  opacity: 0.9;
  will-change: transform, opacity;
}

/* Chapter title frame: rangefinder corner brackets around title (2px stroke) */
.td-chapter__title-frame {
  position: relative;
  max-width: calc(var(--content-w) + 3.5rem);
  margin: 0 auto 2.75rem;
  padding: 1.75rem 2rem 2rem;
}
.td-chapter__title-frame > .td-chapter-title {
  margin: 0 auto;
}
.td-chapter__frame-corner {
  position: absolute;
  width: 1.4rem;
  height: 1.4rem;
  border: 2px solid var(--leica-red);
  opacity: 0;
  transform-origin: center;
  will-change: transform, opacity;
  pointer-events: none;
}
.td-chapter__frame-corner--tl { top: 0; left: 0; border-right: 0; border-bottom: 0; }
.td-chapter__frame-corner--tr { top: 0; right: 0; border-left: 0; border-bottom: 0; }
.td-chapter__frame-corner--bl { bottom: 0; left: 0; border-right: 0; border-top: 0; }
.td-chapter__frame-corner--br { bottom: 0; right: 0; border-left: 0; border-top: 0; }

/* Pullquote corner brackets (same rangefinder language, 2px stroke) */
.td-pullquote { position: relative; }
.td-pullquote__corner {
  position: absolute;
  width: 1.15rem;
  height: 1.15rem;
  border: 2px solid var(--leica-red);
  opacity: 0;
  transform-origin: center;
  will-change: transform, opacity;
  pointer-events: none;
}
.td-pullquote__corner--tl { top: 0.55rem; left: 0.55rem; border-right: 0; border-bottom: 0; }
.td-pullquote__corner--tr { top: 0.55rem; right: 0.55rem; border-left: 0; border-bottom: 0; }
.td-pullquote__corner--bl { bottom: 0.55rem; left: 0.55rem; border-right: 0; border-top: 0; }
.td-pullquote__corner--br { bottom: 0.55rem; right: 0.55rem; border-left: 0; border-top: 0; }
.td-chapter__eyebrow .td-chapter__eyebrow-dot {
  width: 0.35rem;
  height: 0.35rem;
  background: var(--leica-red);
  border-radius: 50%;
  flex: 0 0 auto;
  transform: translateY(-0.05em);
}

/* --- Figures - natural ratio, content-width --------------------------------
   .td-figure = 100% of the 60rem content column (≈ 960px). Natural image
   ratio (no object-fit). Portrait modifier caps to text-column width.
   ------------------------------------------------------------------------- */
.td-figure {
  margin: 4.5rem auto;
  width: 100%;
  max-width: var(--wide-w);
  position: relative;
}
.td-figure--portrait {
  max-width: var(--content-w);
}
.td-figure img {
  width: 100%;
  height: auto;
  background: var(--paper-2);
  display: block;
}
.td-figure a { display: block; }
.td-figure figcaption {
  display: block;
  font-family: var(--font-sans);
  font-size: 0.875rem;
  line-height: 1.55;
  color: var(--stone);
  font-style: italic;
  margin-top: 0.85rem;
  text-align: center;
  padding: 0 1rem;
  max-width: var(--content-w);
  margin-left: auto;
  margin-right: auto;
}

/* --- Galleries: natural ratio, full-viewport breakout ----------------------- */
.td-gallery {
  margin: 4rem 0;
  display: grid;
  gap: 6px;
  width: 100vw;
  max-width: none;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
}
.td-gallery[data-cols="2"] { grid-template-columns: 1fr 1fr; }
.td-gallery[data-cols="3"] { grid-template-columns: 1fr 1fr 1fr; }
.td-gallery[data-cols="4"] { grid-template-columns: 1fr 1fr 1fr 1fr; }
.td-gallery .td-gallery__cell {
  position: relative;
  cursor: zoom-in;
  background: var(--paper-2);
}
.td-gallery .td-gallery__cell img {
  width: 100%;
  height: auto;
  display: block;
}
.td-gallery .td-gallery__caption {
  grid-column: 1 / -1;
  font-family: var(--font-sans);
  font-size: 0.875rem;
  color: var(--stone);
  font-style: italic;
  margin-top: 0.6rem;
  padding: 0 var(--gutter);
  max-width: calc(var(--content-w) + 2 * var(--gutter));
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}

/* Pull quote - FK Roman italic with watermark quote marks + label + corners */
.td-pullquote {
  margin: 4rem auto;
  padding: 4rem 3.5rem 3rem;
  border-top: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline);
  font-family: var(--font-serif);
  font-weight: 400;
  font-style: italic;
  font-size: clamp(1.5rem, 2.4vw, 2.25rem);
  line-height: 1.35;
  letter-spacing: -0.005em;
  color: var(--ink);
  text-align: center;
  max-width: var(--wide-w);
  position: relative;
  overflow: hidden;
}
.td-pullquote__label {
  position: absolute;
  top: 1.4rem;
  left: 50%;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 0.68rem;
  letter-spacing: 0.38em;
  text-indent: 0.38em;
  text-transform: uppercase;
  color: var(--stone);
  font-style: normal;
  will-change: transform, opacity;
}
.td-pullquote__label-dot {
  width: 0.35rem;
  height: 0.35rem;
  background: var(--leica-red);
  border-radius: 50%;
  flex: 0 0 auto;
}
.td-pullquote__mark {
  position: absolute;
  font-family: var(--font-serif);
  font-weight: 700;
  font-style: italic;
  font-size: clamp(7rem, 13vw, 11rem);
  line-height: 0.7;
  color: var(--leica-red);
  opacity: 0;
  pointer-events: none;
  user-select: none;
  will-change: transform, opacity;
  transform-origin: center;
}
.td-pullquote__mark--open {
  top: 2.2rem;
  left: 1.5rem;
}
.td-pullquote__mark--close {
  bottom: 0.5rem;
  right: 1.5rem;
}

/* =============================================================================
   S4 - HORIZONTAL PHOTOWALK
   ============================================================================= */
#scene-photowalk {
  position: relative;
  height: 100vh;
  width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  margin-top: 6rem;
  margin-bottom: 6rem;
  overflow: hidden;
  background: #0A0907;
}
#scene-photowalk .td-photowalk__track {
  display: flex;
  height: 100%;
  align-items: center;
  will-change: transform;
}
/* Slide width = height × image aspect ratio → image fills exact slide, adjacent
   slides touch edge-to-edge (no letterbox gap). All photowalk images are
   2560×2103/2104. */
#scene-photowalk .td-photowalk__slide {
  flex: 0 0 auto;
  height: 100%;
  aspect-ratio: 2560 / 2103;
  position: relative;
}
#scene-photowalk .td-photowalk__slide img {
  width: 100%;
  height: 100%;
  display: block;
}
#scene-photowalk .td-photowalk__index {
  position: absolute;
  top: 2rem; left: 2rem;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  letter-spacing: 0.3em;
  color: var(--paper);
  display: flex; gap: 0.5rem;
  z-index: 5;
}
#scene-photowalk .td-photowalk__index b {
  color: var(--leica-red);
  font-weight: 500;
}
#scene-photowalk .td-photowalk__label {
  position: absolute;
  top: 2rem; right: 2rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: var(--paper);
  opacity: 0.6;
}
/* =============================================================================
   S5 - PULL-QUOTE PILLAR
   ============================================================================= */
#scene-quote {
  position: relative;
  width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  padding: clamp(6rem, 10vw, 10rem) 2rem;
  background: var(--ink);
  color: var(--paper);
  overflow: hidden;
  text-align: center;
}
#scene-quote .td-quote__watermark {
  position: absolute;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(12rem, 22vw, 22rem);
  line-height: 0.8;
  color: var(--paper);
  opacity: 0.05;
  pointer-events: none;
  user-select: none;
  z-index: 1;
  letter-spacing: -0.05em;
}
#scene-quote .td-quote__watermark--l { top: 3rem; left: -3vw; }
#scene-quote .td-quote__watermark--r { bottom: 3rem; right: -3vw; }

#scene-quote .td-quote__inner {
  position: relative;
  z-index: 2;
  max-width: 64rem;
  margin: 0 auto;
}
#scene-quote .td-quote__block {
  margin-bottom: 2.5rem;
}
#scene-quote .td-quote__block:last-child { margin-bottom: 0; }
#scene-quote .td-quote__lead {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--stone-2);
  display: block;
  margin-bottom: 1.2rem;
}
#scene-quote .td-quote__ask {
  display: block;
  color: var(--paper);
  /* FK Roman has real italic glyphs with full Vietnamese diacritic support -
     Space Grotesk has no italic, synthesized slant mangled diacritics. */
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(1.75rem, 3.5vw, 3.25rem);
  line-height: 1.2;
  letter-spacing: -0.01em;
}
#scene-quote .td-quote__reply {
  display: block;
  margin-top: 1.1rem;
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: 0.95rem;
  line-height: 1.55;
  color: rgba(244,242,236,0.55);
  letter-spacing: 0.02em;
}
#scene-quote .td-quote__divider {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 3rem 0;
  gap: 1rem;
}
#scene-quote .td-quote__divider::before,
#scene-quote .td-quote__divider::after {
  content: ""; width: 4rem; height: 1px; background: var(--hairline-light);
}
#scene-quote .td-quote__divider-dot {
  width: 0.55rem; height: 0.55rem;
  background: var(--leica-red);
  border-radius: 50%;
}

#scene-quote .td-quote__word {
  display: inline-block;
  margin-right: 0.12em;
  padding: 0 0.15em 0.06em 0.04em;
  overflow: hidden;
  vertical-align: bottom;
}
#scene-quote .td-quote__word > span {
  display: inline-block;
  transform: translateY(110%);
  will-change: transform;
}

/* =============================================================================
   S6 - FINAL GALLERY + OUTRO
   ============================================================================= */
#scene-outro {
  padding: clamp(6rem, 9vw, 10rem) var(--gutter) 6rem;
  background: var(--paper);
}
#scene-outro .td-outro__eyebrow {
  display: flex; align-items: center; gap: 1rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--stone);
  margin-bottom: 3rem;
  max-width: var(--col-max);
  margin-left: auto; margin-right: auto;
}
#scene-outro .td-outro__eyebrow::after {
  content: ""; flex: 1; height: 1px; background: var(--hairline);
}
.td-final-gallery {
  column-count: 3;
  column-gap: 3px;
  max-width: var(--col-max);
  margin: 0 auto 5rem;
}
.td-final-gallery .td-final-gallery__cell {
  display: block;
  position: relative;
  cursor: zoom-in;
  background: var(--paper-2);
  break-inside: avoid;
  margin-bottom: 3px;
}
.td-final-gallery .td-final-gallery__cell img {
  width: 100%;
  height: auto;
  display: block;
}

.td-footer {
  max-width: var(--col-max);
  margin: 0 auto;
  padding: 4rem 0 2rem;
  border-top: 1px solid var(--hairline);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2rem;
  align-items: end;
}
.td-footer__brand {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
}
.td-footer__brand .dot {
  display: inline-block; width: 0.5em; height: 0.5em;
  background: var(--leica-red); border-radius: 50%;
  margin-right: 0.4em; transform: translateY(-0.1em);
}
.td-footer__meta {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--stone);
  line-height: 1.7;
}
.td-footer__meta .sep { color: var(--hairline); margin: 0 0.5rem; }

/* =============================================================================
   UTILITIES + REDUCED MOTION
   ============================================================================= */
.td-emag__wrapper [data-reveal-mask] {
  display: inline-block;
  overflow: hidden;
  vertical-align: bottom;
}
.td-emag__wrapper [data-reveal-mask] > span {
  display: inline-block;
  transform: translateY(100%);
  will-change: transform;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  #scene-hero .td-hero__top,
  #scene-hero .td-hero__bottom,
  #scene-hero .td-hero__title-top,
  #scene-hero .td-hero__title-bottom { opacity: 1 !important; }
  #scene-quote .td-quote__word > span { transform: none !important; }
  [data-reveal-mask] > span { transform: none !important; }
}
