:root {
  /* Noto Sans KR, Inter, and IBM Plex Sans KR from Google Fonts */
  --curfew-midnight: #071426;
  --archive-navy: #102A43;
  --nordic-paper: #E8EEF2;
  --moonlit-blue: #8FB3D9;
  --signal-amber: #D6A84F;
  --muted-redaction: #7B2D35;
  --frost-gray: #AAB7C4;
  --ledger-width: 26vw;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--curfew-midnight);
  color: var(--nordic-paper);
  font-family: "Noto Sans KR", "Inter", sans-serif;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(232,238,242,.035) 1px, transparent 1px) 0 0 / 72px 72px,
    linear-gradient(0deg, rgba(232,238,242,.025) 1px, transparent 1px) 0 0 / 72px 72px,
    radial-gradient(circle at 68% 12%, rgba(143,179,217,.12), transparent 28rem);
  pointer-events: none;
  z-index: 0;
}

.site-shell { min-height: 100vh; position: relative; z-index: 1; }
.night-ledger {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--ledger-width);
  min-width: 285px;
  padding: 34px 28px;
  background: linear-gradient(180deg, rgba(16,42,67,.96), rgba(7,20,38,.98));
  border-right: 1px solid rgba(143,179,217,.28);
  box-shadow: 18px 0 60px rgba(0,0,0,.34);
  display: flex;
  flex-direction: column;
  gap: 28px;
  z-index: 10;
}

.case-label { border: 1px solid rgba(232,238,242,.18); padding: 18px; background: rgba(232,238,242,.025); }
.micro, .chapter-kicker, .ledger-clock small, .document-tabs span, .polar-note, .archive-signoff {
  font-family: "Inter", sans-serif;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.micro { color: var(--signal-amber); font-size: 11px; font-weight: 800; }
.case-label h1 { margin: 9px 0 8px; font-size: clamp(28px, 3vw, 44px); line-height: 1; font-weight: 700; }
.case-label p { margin: 0; color: var(--frost-gray); font-size: 14px; }
.ledger-clock { padding-bottom: 20px; border-bottom: 1px solid rgba(170,183,196,.25); }
.ledger-clock span { display: block; font-family: "Inter", sans-serif; color: var(--moonlit-blue); font-size: 42px; font-weight: 800; }
.ledger-clock small { color: var(--frost-gray); font-size: 10px; }

.ledger-nav { display: grid; gap: 10px; }
.ledger-item {
  position: relative;
  display: grid;
  grid-template-columns: 48px 1fr 22px;
  align-items: center;
  min-height: 54px;
  padding: 0 12px;
  color: var(--frost-gray);
  text-decoration: none;
  border: 1px solid rgba(170,183,196,.16);
  background: rgba(232,238,242,.018);
  transition: border-color .6s ease, color .6s ease, background .6s ease, clip-path .7s ease;
  clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
}
.ledger-item b { font-family: "Inter", sans-serif; color: var(--moonlit-blue); font-size: 12px; letter-spacing: .12em; }
.ledger-item span { font-size: 15px; font-weight: 500; }
.ledger-item i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 1px solid currentColor;
  transition: box-shadow .7s ease, background .7s ease, transform .7s ease;
}
.ledger-item.active {
  color: var(--nordic-paper);
  border-color: rgba(214,168,79,.65);
  background: rgba(214,168,79,.09);
  clip-path: polygon(0 0, calc(100% - 18px) 0, 100% 50%, calc(100% - 18px) 100%, 0 100%);
}
.ledger-item.active i { background: var(--signal-amber); box-shadow: 0 0 18px var(--signal-amber); transform: scale(1.35); }
.moon-phase { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; margin-top: auto; }
.moon-phase span { height: 28px; border-radius: 50%; border: 1px solid rgba(143,179,217,.35); background: linear-gradient(90deg, var(--moonlit-blue) var(--fill, 12%), transparent var(--fill, 12%)); opacity: .45; transition: opacity .6s, background .6s, border-color .6s; }
.moon-phase span.lit { opacity: 1; border-color: var(--moonlit-blue); }
.document-tabs { display: flex; gap: 8px; }
.document-tabs span { border: 1px solid rgba(170,183,196,.25); padding: 8px 10px; font-size: 10px; color: var(--frost-gray); }

.dossier { margin-left: var(--ledger-width); position: relative; }
.star-map { position: fixed; inset: 0 0 0 var(--ledger-width); width: calc(100vw - var(--ledger-width)); height: 100vh; pointer-events: none; z-index: 1; opacity: .74; }
.star-map path { fill: none; stroke: var(--moonlit-blue); stroke-width: 1; stroke-dasharray: 6 12; opacity: .42; transition: stroke-dashoffset 1.8s ease, opacity 1.2s ease; }
.star-map circle { fill: var(--nordic-paper); opacity: .65; }
.star-map .polar { fill: var(--signal-amber); filter: drop-shadow(0 0 9px #D6A84F); }
.star-map.obstructed path { opacity: .08; stroke-dashoffset: 72; }

.chamber { min-height: 100vh; position: relative; display: grid; place-items: center; padding: 7vh 6vw; isolation: isolate; }
.chamber-inner { width: min(1120px, 100%); min-height: 72vh; position: relative; display: grid; grid-template-columns: 1.35fr .78fr; gap: clamp(28px, 5vw, 72px); align-items: center; z-index: 3; }
.artifact {
  position: relative;
  background: rgba(232,238,242,.92);
  color: var(--archive-navy);
  box-shadow: 0 34px 90px rgba(0,0,0,.42), 0 0 0 1px rgba(232,238,242,.2);
  transition: transform 1.25s ease, clip-path 1.25s ease, opacity 1s ease;
}
.chamber:not(.seen) .artifact { transform: translateY(34px) scale(.985); opacity: .82; }
.chamber.seen .artifact { transform: translateY(0) scale(1); opacity: 1; }
.proclamation-doc { min-height: 520px; padding: clamp(28px, 4vw, 56px); clip-path: polygon(0 0, 94% 0, 100% 9%, 100% 100%, 0 100%); }
.doc-head { display: flex; justify-content: space-between; border-bottom: 1px solid rgba(16,42,67,.24); padding-bottom: 18px; font-family: "Inter", sans-serif; font-weight: 800; letter-spacing: .08em; }
.doc-head em { color: var(--muted-redaction); font-style: normal; }
.proclamation-doc h2, .closing-note h2 { font-family: "IBM Plex Sans KR", sans-serif; font-size: clamp(34px, 5vw, 68px); line-height: 1.05; letter-spacing: -.04em; margin: 48px 0 24px; }
.proclamation-doc p, .closing-note p { color: #102A43; font-size: 19px; line-height: 1.75; max-width: 680px; }
.redaction { position: absolute; background: var(--muted-redaction); height: 34px; transform-origin: left center; transform: scaleX(0); opacity: .96; }
.redaction.animate { animation: redactSlide 1.3s cubic-bezier(.2,.7,.1,1) forwards; }
.proclamation-doc .redaction { left: 56px; right: 16%; top: 166px; }
.paper-lines { position: absolute; left: 56px; right: 56px; bottom: 54px; display: grid; gap: 18px; }
.paper-lines i { height: 1px; background: rgba(16,42,67,.22); }
.chapter-text { align-self: center; max-width: 430px; padding: 28px 0 28px 28px; border-left: 1px solid rgba(143,179,217,.42); background: linear-gradient(90deg, rgba(16,42,67,.3), transparent); }
.right-strip { border-left: 0; border-right: 1px solid rgba(143,179,217,.42); padding: 28px 28px 28px 0; text-align: right; background: linear-gradient(270deg, rgba(16,42,67,.3), transparent); }
.chapter-kicker { color: var(--signal-amber); font-size: 11px; font-weight: 800; }
.chapter-text h3 { font-size: clamp(27px, 3vw, 44px); line-height: 1.18; margin: 18px 0; letter-spacing: -.035em; }
.chapter-text p { color: var(--frost-gray); line-height: 1.9; font-size: 17px; }
.polar-note { position: absolute; top: 5%; right: 10%; color: var(--moonlit-blue); font-size: 10px; border-top: 1px solid rgba(143,179,217,.5); padding-top: 9px; }

.city-plan { min-height: 520px; padding: 0; overflow: hidden; background: var(--archive-navy); color: var(--nordic-paper); clip-path: polygon(4% 0, 100% 0, 96% 100%, 0 94%); }
.map-grid { position: absolute; inset: 0; background: linear-gradient(90deg, rgba(143,179,217,.23) 1px, transparent 1px) 0 0/62px 62px, linear-gradient(0deg, rgba(143,179,217,.2) 1px, transparent 1px) 0 0/62px 62px; }
.curfew-line { position: absolute; inset: 8%; width: 84%; height: 84%; }
.curfew-line path { fill: none; stroke: var(--moonlit-blue); stroke-width: 3; stroke-dasharray: 690; stroke-dashoffset: 690; transition: stroke-dashoffset 2s ease; }
.curfew-line .boundary { stroke: var(--signal-amber); stroke-width: 5; }
.seen .curfew-line path { stroke-dashoffset: 0; }
.stamp { position: absolute; right: 34px; top: 36px; border: 2px solid var(--signal-amber); color: var(--signal-amber); padding: 12px 18px; font-weight: 700; transform: rotate(-3deg); }
.notice-strip { position: absolute; left: 0; right: 0; bottom: 0; background: var(--nordic-paper); color: var(--archive-navy); padding: 18px 28px; font-family: "Inter", sans-serif; letter-spacing: .08em; }

.decree-eclipse { position: fixed; top: 38vh; left: 102vw; z-index: 2; width: 54vw; height: 150px; background: #071426; border: 1px solid rgba(123,45,53,.8); color: var(--muted-redaction); display: grid; place-items: center; font-family: "Inter", sans-serif; font-weight: 800; letter-spacing: .16em; box-shadow: 0 28px 80px rgba(0,0,0,.65); transition: transform 1.5s cubic-bezier(.2,.7,.1,1); }
.decree-eclipse.cross { transform: translateX(-128vw); }
.newspaper-collage { min-height: 510px; display: grid; grid-template-columns: 1fr 1fr; gap: 22px; padding: 40px; background: var(--nordic-paper); overflow: hidden; }
.column { border-left: 1px solid rgba(16,42,67,.26); padding-left: 18px; font-size: 30px; line-height: 1.32; font-weight: 700; word-break: keep-all; }
.column.thin { font-family: "Inter", sans-serif; font-size: 13px; letter-spacing: .16em; color: rgba(16,42,67,.68); }
.waveform { position: absolute; left: 42px; right: 42px; bottom: 58px; display: flex; align-items: end; gap: 12px; height: 98px; }
.waveform i { flex: 1; background: var(--archive-navy); opacity: .28; height: var(--h, 40%); }
.waveform i:nth-child(2) { --h: 84%; }.waveform i:nth-child(3) { --h: 28%; }.waveform i:nth-child(4) { --h: 66%; }.waveform i:nth-child(5) { --h: 48%; }.waveform i:nth-child(6) { --h: 90%; }.waveform i:nth-child(7) { --h: 35%; }
.newspaper-collage .broad { left: 36px; right: 36px; top: 166px; }.newspaper-collage .short { left: 52%; right: 12%; top: 268px; }

.court-plan { min-height: 520px; background: #E8EEF2; padding: 42px; overflow: hidden; }
.bench { height: 92px; border: 2px solid rgba(16,42,67,.44); border-radius: 90px 90px 10px 10px; }
.aisle { position: absolute; left: 47%; top: 150px; bottom: 0; width: 56px; background: rgba(143,179,217,.22); }
.seats { margin-top: 52px; height: 210px; background: repeating-linear-gradient(90deg, rgba(16,42,67,.18) 0 36px, transparent 36px 58px), repeating-linear-gradient(0deg, rgba(16,42,67,.14) 0 24px, transparent 24px 48px); }
blockquote { position: absolute; left: 58px; bottom: 58px; max-width: 560px; margin: 0; font-family: "IBM Plex Sans KR", sans-serif; font-size: 26px; line-height: 1.45; color: var(--archive-navy); }
.seal-crop { position: absolute; right: -28px; top: -28px; width: 154px; height: 154px; border-radius: 50%; border: 3px solid rgba(123,45,53,.55); color: rgba(123,45,53,.55); display: grid; place-items: center; font-size: 38px; font-weight: 700; }

.archive-stack { min-height: 530px; background: transparent; box-shadow: none; color: var(--archive-navy); }
.folder { position: absolute; left: 4%; right: 8%; height: 170px; background: var(--nordic-paper); border: 1px solid rgba(143,179,217,.35); box-shadow: 0 22px 60px rgba(0,0,0,.34); padding: 26px; display: flex; justify-content: space-between; font-weight: 700; }
.folder.top { top: 30px; transform: rotate(-1deg); z-index: 3; }.folder.mid { top: 150px; left: 10%; transform: rotate(2deg); z-index: 2; }.folder.low { top: 272px; right: 0; transform: rotate(-2deg); z-index: 1; }
.folder b { font-family: "Inter", sans-serif; color: var(--muted-redaction); letter-spacing: .1em; }
.constellation-card { position: absolute; right: 4%; bottom: 4%; width: 230px; height: 142px; background: var(--archive-navy); border: 1px solid rgba(143,179,217,.42); z-index: 4; }
.constellation-card i { position: absolute; width: 7px; height: 7px; border-radius: 50%; background: var(--signal-amber); box-shadow: 0 0 12px var(--signal-amber); }
.constellation-card i:nth-child(1){left:25px;top:88px}.constellation-card i:nth-child(2){left:72px;top:40px}.constellation-card i:nth-child(3){left:136px;top:66px}.constellation-card i:nth-child(4){left:188px;top:27px}
.constellation-card svg { position: absolute; inset: 18px; width: calc(100% - 36px); height: calc(100% - 36px); }.constellation-card path { fill: none; stroke: var(--moonlit-blue); stroke-width: 2; }

.final-chamber { overflow: hidden; }
.horizon { position: absolute; left: 0; right: 0; bottom: 0; height: 17vh; background: linear-gradient(180deg, transparent, rgba(143,179,217,.22) 34%, rgba(232,238,242,.94) 36%, rgba(232,238,242,.94)); z-index: 0; }
.closing-note { padding: clamp(34px, 5vw, 68px); min-height: 470px; background: var(--nordic-paper); clip-path: polygon(0 0, 100% 0, 100% 88%, 94% 100%, 0 100%); }
.stable-star { color: var(--signal-amber); font-size: 38px; filter: drop-shadow(0 0 14px #D6A84F); }
.archive-signoff { margin-top: 44px; color: var(--archive-navy); font-size: 11px; border-top: 1px solid rgba(16,42,67,.2); padding-top: 16px; }

@keyframes redactSlide { 0% { transform: scaleX(0); } 100% { transform: scaleX(1); } }

@media (max-width: 900px) {
  :root { --ledger-width: 0px; }
  .night-ledger { inset: 0 0 auto 0; width: 100%; min-width: 0; height: 154px; padding: 14px; display: grid; grid-template-columns: 1fr; gap: 10px; overflow: hidden; }
  .case-label { padding: 10px 12px; display: flex; align-items: baseline; gap: 12px; }
  .case-label h1 { font-size: 22px; margin: 0; }.case-label p, .ledger-clock, .moon-phase, .document-tabs { display: none; }
  .ledger-nav { display: flex; overflow-x: auto; gap: 8px; }
  .ledger-item { min-width: 118px; min-height: 44px; grid-template-columns: 34px 1fr 12px; }
  .dossier { margin-left: 0; padding-top: 154px; }
  .star-map { inset: 154px 0 0 0; width: 100vw; height: calc(100vh - 154px); }
  .chamber { padding: 5vh 20px; }
  .chamber-inner { grid-template-columns: 1fr; min-height: 78vh; gap: 26px; }
  .chapter-text, .right-strip { text-align: left; border-right: 0; border-left: 1px solid rgba(143,179,217,.42); padding: 20px 0 20px 20px; }
  .proclamation-doc, .city-plan, .newspaper-collage, .court-plan, .closing-note { min-height: 430px; }
  .decree-eclipse { width: 82vw; height: 112px; }
}
