:root {
  /* compliance tokens from typography brief: KR** labels only timestamps coordinates */
  --paper: #E9E0CC;
  --night: #071018;
  --blue: #7DA7C7;
  --red: #C1121F;
  --dust: #A9A39A;
  --violet: #2A1B2D;
  --ink: #111111;
  --serif: 'Noto Serif KR', serif;
  --sans: 'IBM Plex Sans KR', sans-serif;
  --impact: 'Black Han Sans', sans-serif;
  --mono: 'Roboto Mono', monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--night);
  color: var(--paper);
  font-family: var(--sans);
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at 20% 10%, rgba(125, 167, 199, 0.14), transparent 30%),
    radial-gradient(circle at 80% 85%, rgba(42, 27, 45, 0.65), transparent 36%),
    linear-gradient(115deg, rgba(7, 16, 24, 0.95), rgba(17, 17, 17, 0.88));
  pointer-events: none;
  z-index: -3;
}

.noise-layer,
.scanline-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

.noise-layer {
  z-index: 30;
  opacity: 0.16;
  mix-blend-mode: overlay;
  background-image:
    radial-gradient(circle at 12% 19%, rgba(233, 224, 204, 0.7) 0 1px, transparent 1px),
    radial-gradient(circle at 78% 41%, rgba(233, 224, 204, 0.5) 0 1px, transparent 1px),
    radial-gradient(circle at 32% 76%, rgba(17, 17, 17, 0.75) 0 1px, transparent 1px);
  background-size: 19px 23px, 31px 29px, 13px 17px;
}

.scanline-layer {
  z-index: 31;
  opacity: 0.22;
  background: repeating-linear-gradient(to bottom, rgba(125, 167, 199, 0.18) 0 1px, transparent 1px 5px);
  animation: scanDrift 7s linear infinite;
}

.emergency-strip {
  position: fixed;
  z-index: 40;
  top: 0;
  right: clamp(14px, 3vw, 38px);
  width: clamp(44px, 5vw, 70px);
  height: 100vh;
  background: linear-gradient(180deg, rgba(193, 18, 31, 0.96), rgba(193, 18, 31, 0.48), rgba(193, 18, 31, 0.92));
  box-shadow: 0 0 34px rgba(193, 18, 31, 0.42), -12px 0 42px rgba(7, 16, 24, 0.8);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-direction: column;
  padding: 24px 0;
  transition: filter 300ms ease, transform 300ms ease;
}

.emergency-strip.pulse { filter: brightness(1.45); transform: scaleX(1.08); }

.strip-code,
.strip-label {
  writing-mode: vertical-rl;
  text-orientation: mixed;
  color: var(--paper);
  letter-spacing: 0.18em;
  font-family: var(--mono);
  font-weight: 700;
}

.strip-label {
  font-family: var(--impact);
  font-size: clamp(1.4rem, 3vw, 2.6rem);
}

.chapter {
  min-height: 100vh;
  position: relative;
  padding: clamp(64px, 8vw, 120px) clamp(28px, 8vw, 132px);
  isolation: isolate;
  overflow: hidden;
}

.chapter::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(7, 16, 24, 0.92), transparent 18%, transparent 74%, rgba(7, 16, 24, 0.72));
  z-index: -1;
}

.paper {
  color: var(--ink);
  background:
    linear-gradient(120deg, rgba(255,255,255,0.22), transparent 28%, rgba(42, 27, 45, 0.08) 84%),
    repeating-linear-gradient(0deg, rgba(17, 17, 17, 0.035) 0 1px, transparent 1px 18px),
    var(--paper);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.48), 0 0 0 1px rgba(17, 17, 17, 0.15) inset;
  position: relative;
}

.paper::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.34;
  pointer-events: none;
  background-image: radial-gradient(circle, rgba(17,17,17,0.16) 0 0.8px, transparent 1px);
  background-size: 9px 10px;
  mix-blend-mode: multiply;
}

.doc-kicker {
  margin: 0 0 20px;
  color: rgba(17, 17, 17, 0.72);
  font-family: var(--mono);
  font-size: clamp(0.7rem, 1vw, 0.9rem);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.doc-kicker::after {
  content: " KR* KR** labels only timestamps coordinates";
  display: none;
}

.chapter-opening {
  display: grid;
  place-items: center;
  background: radial-gradient(circle at 50% 50%, rgba(42, 27, 45, 0.42), transparent 46%);
}

.blackout-field {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(7, 16, 24, 1), rgba(17, 17, 17, 0.9));
}

.hero-paper {
  width: min(900px, 78vw);
  min-height: 54vh;
  padding: clamp(34px, 6vw, 78px);
  transform: rotate(-3deg);
  clip-path: polygon(0 3%, 96% 0, 100% 80%, 93% 100%, 4% 96%);
  animation: paperFloat 6s ease-in-out infinite;
}

.domain-title {
  margin: 0;
  font-family: var(--impact);
  font-size: clamp(4.8rem, 15vw, 14rem);
  line-height: 0.82;
  color: var(--ink);
  letter-spacing: -0.06em;
  text-shadow: 4px 3px 0 rgba(193, 18, 31, 0.48), -3px -2px 0 rgba(125, 167, 199, 0.34);
  max-width: 112%;
  transform: translateX(-3%);
}

.proclamation-copy {
  width: min(560px, 80%);
  margin: 30px 0 0;
  font-family: var(--serif);
  font-size: clamp(1rem, 1.6vw, 1.35rem);
  line-height: 1.75;
}

.tape {
  position: absolute;
  width: 120px;
  height: 34px;
  background: rgba(169, 163, 154, 0.55);
  top: 20px;
  mix-blend-mode: multiply;
  border-left: 2px solid rgba(233, 224, 204, 0.32);
  border-right: 2px solid rgba(233, 224, 204, 0.32);
}

.tape-left { left: 10%; transform: rotate(-9deg); }
.tape-right { right: 12%; transform: rotate(12deg); }

.censor-row { display: flex; gap: 12px; margin-top: 28px; }
.censor-row span { display: block; height: 16px; background: var(--ink); }
.censor-row span:nth-child(1) { width: 25%; }
.censor-row span:nth-child(2) { width: 14%; }
.censor-row span:nth-child(3) { width: 34%; }

.stamp {
  position: absolute;
  color: var(--red);
  border: 6px solid var(--red);
  font-family: var(--impact);
  letter-spacing: 0.08em;
  mix-blend-mode: multiply;
  opacity: 0;
  transform: scale(1.8) rotate(-12deg);
  filter: url('#none');
}

.is-active .stamp,
.stamp.is-hit {
  animation: stampHit 520ms cubic-bezier(.18,1.35,.36,1) forwards;
}

.stamp-emergency {
  top: 13%;
  right: 9%;
  font-size: clamp(2.8rem, 7vw, 6.6rem);
  padding: 8px 18px 2px;
}

.edge-caption {
  position: absolute;
  bottom: 7vh;
  left: 6vw;
  width: min(480px, 54vw);
  color: var(--dust);
  font-family: var(--serif);
  line-height: 1.8;
}

.paused-clock {
  position: absolute;
  right: 11vw;
  bottom: 12vh;
  width: 130px;
  height: 130px;
  border: 2px solid rgba(125, 167, 199, 0.48);
  border-radius: 50%;
  opacity: 0.62;
}

.hand {
  position: absolute;
  left: 50%;
  top: 50%;
  height: 12px;
  background: var(--ink);
  transform-origin: left center;
}

.hand-hour { width: 42px; transform: rotate(-90deg); }
.hand-minute { width: 58px; transform: rotate(0deg); background: var(--red); }

.chapter-map {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(260px, 0.75fr);
  gap: clamp(24px, 5vw, 74px);
  align-items: center;
}

.map-board {
  position: relative;
  min-height: 72vh;
  border: 1px solid rgba(125, 167, 199, 0.32);
  background: linear-gradient(145deg, rgba(7, 16, 24, 0.7), rgba(42, 27, 45, 0.46));
  box-shadow: 0 0 0 14px rgba(17, 17, 17, 0.2), inset 0 0 70px rgba(125, 167, 199, 0.08);
  transform: rotate(1.2deg);
}

.curfew-map {
  position: absolute;
  inset: 6% 4%;
  width: 92%;
  height: 88%;
}

.map-lines path {
  fill: none;
  stroke: var(--paper);
  stroke-width: 2;
  opacity: 0.78;
  stroke-dasharray: 900;
  stroke-dashoffset: 900;
  transition: stroke-dashoffset 1200ms ease;
}

.curfew-zones polygon {
  fill: rgba(193, 18, 31, 0.46);
  stroke: var(--red);
  stroke-width: 3;
  transform-box: fill-box;
  transform-origin: center;
  transform: scale(0.22);
  opacity: 0;
  transition: transform 900ms cubic-bezier(.18,.88,.32,1), opacity 500ms ease;
}

.evidence-pins circle { fill: var(--blue); stroke: var(--night); stroke-width: 3; }
.chapter-map.is-active .map-lines path { stroke-dashoffset: 0; }
.chapter-map.is-active .curfew-zones polygon { transform: scale(1); opacity: 1; }
.chapter-map.is-active .curfew-zones polygon:nth-child(2) { transition-delay: 180ms; }
.chapter-map.is-active .curfew-zones polygon:nth-child(3) { transition-delay: 320ms; }

.map-label {
  position: absolute;
  z-index: 2;
  background: var(--paper);
  color: var(--ink);
  padding: 8px 12px;
  font-family: var(--mono);
  font-size: 0.76rem;
  box-shadow: 8px 8px 0 rgba(193, 18, 31, 0.35);
}

.label-north { top: 14%; left: 11%; transform: rotate(-7deg); }
.label-river { bottom: 18%; right: 8%; transform: rotate(5deg); }

.map-order {
  padding: clamp(28px, 4vw, 54px);
  transform: rotate(-2.2deg);
  clip-path: polygon(3% 0, 100% 2%, 96% 96%, 0 100%);
}

.map-order h2,
.form-sheet h2,
.loose-paper h2 {
  font-family: var(--serif);
  font-size: clamp(2.2rem, 4.2vw, 5.4rem);
  line-height: 1.1;
  margin: 0 0 24px;
}

.map-order p,
.form-sheet p,
.loose-paper p {
  font-family: var(--serif);
  line-height: 1.82;
  font-size: clamp(1rem, 1.35vw, 1.25rem);
}

.stamp-control { left: 54%; top: 42%; font-size: 4.8rem; padding: 4px 16px; }

.chapter-transcript {
  display: grid;
  place-items: center;
  background: linear-gradient(180deg, rgba(17,17,17,0.32), rgba(7,16,24,0.95));
}

.broadcast-frame {
  position: relative;
  width: min(980px, 82vw);
  min-height: 68vh;
  border: 3px solid rgba(125, 167, 199, 0.72);
  background:
    linear-gradient(90deg, transparent 0 47%, rgba(125, 167, 199, 0.12) 48% 52%, transparent 53%),
    rgba(7, 16, 24, 0.86);
  box-shadow: 0 0 80px rgba(125, 167, 199, 0.18), inset 0 0 90px rgba(0, 0, 0, 0.7);
  padding: clamp(24px, 4vw, 56px);
  overflow: hidden;
}

.broadcast-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(0deg, transparent 0 10px, rgba(125, 167, 199, 0.14) 10px 11px);
  pointer-events: none;
}

.broadcast-header {
  display: flex;
  justify-content: space-between;
  color: var(--blue);
  font-family: var(--mono);
  font-weight: 700;
  letter-spacing: 0.08em;
  border-bottom: 1px solid rgba(125, 167, 199, 0.5);
  padding-bottom: 18px;
}

.transcript-lines { margin-top: 50px; }
.transcript-lines p {
  margin: 0;
  padding: 18px 0;
  color: var(--paper);
  font-family: var(--sans);
  font-size: clamp(1.3rem, 2.5vw, 3rem);
  font-weight: 700;
  line-height: 1.18;
  border-bottom: 1px solid rgba(233, 224, 204, 0.14);
  text-shadow: 2px 0 rgba(193, 18, 31, 0.45), -2px 0 rgba(125, 167, 199, 0.42);
  transition: transform 120ms linear, opacity 120ms linear;
}

.transcript-lines span { color: var(--blue); font-family: var(--mono); font-size: 0.48em; margin-right: 16px; }

.static-block {
  position: absolute;
  background: var(--paper);
  mix-blend-mode: difference;
  opacity: 0.72;
  animation: staticJump 1.8s steps(2) infinite;
}

.static-one { width: 24%; height: 46px; right: 14%; top: 31%; }
.static-two { width: 17%; height: 72px; left: 10%; bottom: 18%; animation-delay: 400ms; }

.typed-domain {
  position: absolute;
  left: 5vw;
  bottom: 8vh;
  font-family: var(--mono);
  font-size: clamp(1.4rem, 3vw, 4rem);
  color: rgba(233, 224, 204, 0.18);
  letter-spacing: 0.22em;
}

.stamp-record { right: 15vw; top: 16vh; font-size: 5rem; border-radius: 50%; padding: 20px 24px; }

.chapter-forms { min-height: 118vh; }
.form-wall { position: relative; height: 95vh; }
.form-sheet { position: absolute; padding: clamp(24px, 4vw, 46px); }
.sheet-a { width: min(560px, 52vw); min-height: 580px; left: 7%; top: 4%; transform: rotate(-4deg); }
.sheet-b { width: min(520px, 48vw); min-height: 470px; right: 14%; top: 16%; transform: rotate(5deg); background-color: rgba(233, 224, 204, 0.9); }
.sheet-c { width: min(360px, 34vw); min-height: 320px; left: 42%; bottom: 6%; transform: rotate(-1deg); }
.carbon { box-shadow: 18px 18px 0 rgba(125, 167, 199, 0.18), 0 28px 70px rgba(0,0,0,0.48); }
.form-lines i { display: block; height: 18px; border-bottom: 2px solid rgba(17,17,17,0.34); margin: 30px 0; }
.censor-tape { margin-top: 30px; padding: 14px; background: var(--ink); color: var(--paper); font-family: var(--mono); transform: rotate(1.5deg); }
.annotation-loop { width: 72%; margin-top: 12px; overflow: visible; }
.annotation-loop path { fill: none; stroke: var(--red); stroke-width: 5; stroke-linecap: round; stroke-dasharray: 620; stroke-dashoffset: 620; transition: stroke-dashoffset 1200ms ease; }
.chapter-forms.is-active .annotation-loop path { stroke-dashoffset: 0; }
.stamp-small { right: 22px; top: 20px; font-size: 2.6rem; padding: 2px 10px; }
.staple-holes { position: absolute; left: 18px; top: 28px; display: grid; gap: 18px; }
.staple-holes span { width: 9px; height: 9px; border-radius: 50%; background: rgba(17,17,17,0.38); }

.chapter-release {
  display: grid;
  place-items: center;
  background: linear-gradient(180deg, var(--night) 0%, var(--violet) 42%, var(--dust) 100%);
}

.dawn-space {
  position: absolute;
  inset: 20vh 0 0 0;
  background: linear-gradient(180deg, transparent, rgba(169, 163, 154, 0.55));
}

.loose-paper {
  width: min(780px, 76vw);
  min-height: 58vh;
  padding: clamp(34px, 6vw, 72px);
  transform: rotate(2deg) translateY(8vh);
  clip-path: polygon(0 0, 94% 4%, 100% 92%, 9% 100%);
  transition: transform 700ms ease, box-shadow 700ms ease;
}

.chapter-release.is-active .loose-paper { transform: rotate(-1deg) translateY(0); box-shadow: 0 40px 110px rgba(0,0,0,0.56); }
.faded-domain { font-family: var(--impact); font-size: clamp(3.2rem, 8vw, 8rem); color: rgba(17, 17, 17, 0.13); letter-spacing: -0.04em; }
.stamp-release { right: 12%; bottom: 12%; font-size: 5.4rem; border-radius: 50%; padding: 22px 24px; }
.final-clock { position: absolute; left: 8vw; bottom: 12vh; width: clamp(120px, 16vw, 220px); opacity: 0.5; }
.final-clock circle, .clock-bar { fill: none; stroke: var(--paper); stroke-width: 8; stroke-linecap: square; }
.clock-bar { stroke: var(--ink); transform-origin: 110px 110px; }
.chapter-release.is-active .bar-one { animation: clockRelease 3s ease-in-out infinite; }
.chapter-release.is-active .bar-two { animation: clockRelease 3s ease-in-out infinite reverse; }

@keyframes stampHit {
  0% { opacity: 0; transform: scale(1.8) rotate(-16deg); filter: blur(2px); }
  62% { opacity: 0.95; transform: scale(0.92) rotate(-9deg); filter: blur(0); }
  100% { opacity: 0.82; transform: scale(1) rotate(-11deg); }
}

@keyframes paperFloat { 0%, 100% { transform: rotate(-3deg) translateY(0); } 50% { transform: rotate(-2.4deg) translateY(-8px); } }
@keyframes scanDrift { from { transform: translateY(0); } to { transform: translateY(28px); } }
@keyframes staticJump { 0%, 100% { transform: translate(0,0); } 50% { transform: translate(18px,-8px); } }
@keyframes clockRelease { 0%, 100% { transform: rotate(0deg); } 50% { transform: rotate(22deg); } }

@media (max-width: 900px) {
  .emergency-strip { right: 0; width: 38px; }
  .chapter { padding-right: 58px; }
  .chapter-map { grid-template-columns: 1fr; }
  .map-board { min-height: 56vh; }
  .sheet-a, .sheet-b, .sheet-c { width: min(640px, 78vw); position: relative; left: auto; right: auto; top: auto; bottom: auto; margin: 0 auto 28px; }
  .form-wall { height: auto; }
  .broadcast-header { display: grid; gap: 10px; }
}
