:root {
  /* Design font tokens: Inter** and Grotesk** */
  --paper: #EEF1F4;
  --ink: #11161C;
  --mist: #B8C0C9;
  --slate: #2C3542;
  --cyan: #7EDDE8;
  --violet: #A7A2FF;
  --frozen: #DCEBFF;
  --space: "Space Grotesk", sans-serif;
  --inter: "Inter", sans-serif;
  --kr: "Noto Sans KR", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  background: var(--paper);
}

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

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, transparent 0 7.95%, rgba(17, 22, 28, 0.055) 8%, transparent 8.08%, transparent 49.95%, rgba(17, 22, 28, 0.045) 50%, transparent 50.06%, transparent 91.92%, rgba(17, 22, 28, 0.055) 92%, transparent 92.08%),
    linear-gradient(180deg, rgba(220, 235, 255, 0.34), transparent 28%, rgba(184, 192, 201, 0.16));
  z-index: 2;
}

.paper-grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.45;
  z-index: 4;
  mix-blend-mode: multiply;
  background-image:
    radial-gradient(circle at 20% 30%, rgba(17, 22, 28, 0.08) 0 1px, transparent 1.6px),
    radial-gradient(circle at 72% 62%, rgba(17, 22, 28, 0.055) 0 0.8px, transparent 1.4px),
    radial-gradient(circle at 45% 88%, rgba(126, 221, 232, 0.11) 0 1px, transparent 1.8px);
  background-size: 23px 19px, 31px 29px, 41px 37px;
}

.aurora-field {
  position: fixed;
  inset: -10vh -10vw;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

.aurora {
  position: absolute;
  width: 72vw;
  height: 22vh;
  border-radius: 999px;
  filter: blur(34px);
  opacity: 0.34;
  transform: rotate(-12deg);
  transition: transform 1.2s cubic-bezier(0.19, 1, 0.22, 1);
}

.aurora-one {
  left: 5vw;
  top: 12vh;
  background: linear-gradient(90deg, transparent, #7EDDE8, #A7A2FF, transparent);
}

.aurora-two {
  right: -12vw;
  top: 43vh;
  height: 18vh;
  opacity: 0.24;
  background: linear-gradient(90deg, transparent, #DCEBFF, #7EDDE8, transparent);
}

.aurora-three {
  left: 18vw;
  bottom: 4vh;
  height: 16vh;
  opacity: 0.18;
  background: linear-gradient(90deg, transparent, #A7A2FF, #DCEBFF, transparent);
}

.editorial-lines {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 3;
  pointer-events: none;
  fill: none;
  stroke: #11161C;
  stroke-width: 0.7;
  opacity: 0.18;
}

.folio-nav {
  position: fixed;
  right: 2.7vw;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.folio-nav button {
  border: 0;
  background: transparent;
  color: #2C3542;
  font: 500 10px/1 var(--space);
  letter-spacing: 0.22em;
  padding: 5px 0;
  opacity: 0.36;
  cursor: pointer;
  transition: opacity 0.5s ease, color 0.5s ease, transform 0.5s ease;
}

.folio-nav button.active {
  color: #11161C;
  opacity: 1;
  transform: translateX(-5px);
}

.monograph {
  position: relative;
  z-index: 1;
}

.spread {
  position: relative;
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 0;
  padding: 7.5vh 8vw;
  overflow: hidden;
  isolation: isolate;
}

.spread::before {
  content: attr(data-chapter);
  position: absolute;
  left: 8vw;
  top: 4.5vh;
  font-family: var(--space);
  font-size: 0.68rem;
  letter-spacing: 0.28em;
  color: #2C3542;
  opacity: 0.62;
}

.spread::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 6vh;
  bottom: 6vh;
  width: 1px;
  background: #11161C;
  opacity: 0.18;
}

.page {
  position: relative;
  min-height: 85vh;
  padding: clamp(28px, 5vw, 72px);
  transition: transform 1s cubic-bezier(0.19, 1, 0.22, 1), opacity 1s ease;
  will-change: transform;
}

.page-left {
  border-right: 0;
}

.quiet-page {
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

.dev-mark {
  position: absolute;
  top: 7vh;
  left: clamp(28px, 5vw, 76px);
  font-family: var(--space);
  font-size: clamp(18px, 2vw, 30px);
  letter-spacing: -0.04em;
}

.vertical-name {
  writing-mode: vertical-rl;
  text-orientation: mixed;
  font-family: var(--space);
  font-size: clamp(58px, 8vw, 128px);
  line-height: 0.82;
  letter-spacing: 0.16em;
  font-weight: 700;
  color: #11161C;
}

.hanko-seal {
  position: absolute;
  right: 11vw;
  bottom: 12vh;
  width: 72px;
  height: 72px;
  color: #11161C;
  opacity: 0.84;
}

.hanko-seal svg,
.hanko-seal rect,
.hanko-seal path {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 5;
  stroke-linejoin: round;
}

.note-page {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-right: 14vw;
}

.chapter-kicker,
.note-index {
  font-family: var(--space);
  font-size: 0.69rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: #2C3542;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  max-width: 590px;
  margin-top: 26px;
  font-family: var(--space);
  font-weight: 500;
  font-size: clamp(38px, 5.1vw, 82px);
  line-height: 0.94;
  letter-spacing: -0.065em;
}

.body-copy {
  max-width: 420px;
  margin-top: 34px;
  color: #2C3542;
  font-size: clamp(14px, 1.1vw, 17px);
  line-height: 1.75;
}

.meta-column {
  display: grid;
  gap: 9px;
  margin-top: 30px;
  padding-left: 18px;
  border-left: 1px solid rgba(17, 22, 28, 0.22);
  color: #2C3542;
  font: 500 0.72rem/1.3 var(--inter);
  letter-spacing: 0.07em;
}

.rotated-label {
  position: absolute;
  left: 3vw;
  bottom: 18vh;
  transform: rotate(-90deg);
  transform-origin: left center;
  font: 500 0.66rem/1 var(--space);
  letter-spacing: 0.28em;
  color: #2C3542;
  opacity: 0.58;
  text-transform: uppercase;
}

.folio {
  position: absolute;
  right: 8vw;
  bottom: 4.8vh;
  font: 500 0.68rem/1 var(--space);
  letter-spacing: 0.18em;
  color: #2C3542;
  opacity: 0.7;
}

.title-page {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  background: rgba(220, 235, 255, 0.22);
  box-shadow: inset 0 0 0 1px rgba(17, 22, 28, 0.08);
}

.display-number {
  font-family: var(--space);
  font-size: clamp(92px, 15vw, 230px);
  line-height: 0.75;
  letter-spacing: -0.09em;
  color: #B8C0C9;
}

.title-page h2,
.slate-page h2,
.notes-field h2,
.closing-page h2 {
  font-family: var(--space);
  font-size: clamp(44px, 7vw, 112px);
  line-height: 0.9;
  letter-spacing: -0.07em;
  font-weight: 600;
}

.columns-page {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-content: center;
  gap: clamp(24px, 4vw, 70px);
}

.note-block {
  border-top: 1px solid rgba(17, 22, 28, 0.28);
  padding-top: 18px;
}

.note-block h3,
.artifact-card h3 {
  margin-top: 22px;
  font-family: var(--space);
  font-size: clamp(22px, 2.3vw, 38px);
  line-height: 1.02;
  letter-spacing: -0.045em;
}

.note-block p,
.artifact-card p,
.notes-field p,
.closing-page p,
.system-row p {
  margin-top: 18px;
  color: #2C3542;
  font-size: 0.96rem;
  line-height: 1.75;
}

.code-footnote {
  grid-column: 1 / -1;
  align-self: end;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  border-top: 1px solid rgba(17, 22, 28, 0.2);
  padding-top: 15px;
  color: #2C3542;
  font-size: 0.73rem;
  letter-spacing: 0.1em;
}

.code-footnote code {
  font-family: var(--space);
  color: #11161C;
}

.slate-page {
  background: #2C3542;
  color: #EEF1F4;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 0 22px 70px rgba(17, 22, 28, 0.16);
}

.chapter-kicker.light {
  color: #DCEBFF;
  opacity: 0.8;
}

.diagram {
  position: relative;
  height: 170px;
  border: 1px solid rgba(238, 241, 244, 0.25);
  background-image: linear-gradient(rgba(238, 241, 244, 0.12) 1px, transparent 1px), linear-gradient(90deg, rgba(238, 241, 244, 0.12) 1px, transparent 1px);
  background-size: 28px 28px;
}

.diagram span {
  position: absolute;
  width: 10px;
  height: 10px;
  border: 1px solid #7EDDE8;
  background: #2C3542;
}

.diagram span:nth-child(1) { left: 18%; top: 36%; }
.diagram span:nth-child(2) { left: 47%; top: 20%; }
.diagram span:nth-child(3) { left: 68%; top: 58%; }
.diagram span:nth-child(4) { left: 82%; top: 34%; }

.system-list {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0;
}

.system-row {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 28px;
  padding: 28px 0;
  border-top: 1px solid rgba(17, 22, 28, 0.18);
}

.system-row:last-child {
  border-bottom: 1px solid rgba(17, 22, 28, 0.18);
}

.system-row span {
  font-family: var(--space);
  color: #A7A2FF;
  letter-spacing: 0.1em;
}

.notes-field {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.hangul {
  margin-top: 28px;
  font-family: var(--kr);
  color: #11161C !important;
  font-size: clamp(22px, 2.4vw, 36px) !important;
  letter-spacing: -0.04em;
}

.artifact-page {
  display: grid;
  place-items: center;
}

.artifact-card {
  width: min(420px, 100%);
  padding: 42px;
  background: rgba(238, 241, 244, 0.62);
  border: 1px solid rgba(17, 22, 28, 0.16);
  box-shadow: 18px 18px 0 rgba(184, 192, 201, 0.24);
}

.margin-map {
  position: absolute;
  right: 8%;
  bottom: 13%;
  display: grid;
  gap: 8px;
  font: 500 0.64rem/1 var(--space);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #2C3542;
  opacity: 0.58;
}

.closing-page {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-right: 12vw;
}

.colophon {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
}

.signal-link {
  display: inline-block;
  margin-top: 28px;
  color: #11161C;
  text-decoration: none;
  font-family: var(--space);
  font-size: clamp(32px, 5vw, 78px);
  line-height: 0.98;
  letter-spacing: -0.07em;
  transition: color 0.7s ease, text-shadow 0.7s ease;
}

.signal-link:hover {
  color: #2C3542;
  text-shadow: 0 0 28px rgba(126, 221, 232, 0.58);
}

.final-meta {
  margin-top: 42px;
}

.small-seal {
  margin-top: 54px;
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border: 1px solid #11161C;
  font-family: var(--space);
  font-weight: 700;
  letter-spacing: -0.08em;
}

.spread.is-visible .page-left {
  transform: translateX(var(--page-left-shift, 0)) translateY(var(--parallax, 0));
}

.spread.is-visible .page-right {
  transform: translateX(var(--page-right-shift, 0)) translateY(calc(var(--parallax, 0) * -0.6));
}

.spread:not(.is-visible) .page {
  opacity: 0.54;
}

@media (max-width: 860px) {
  .spread {
    grid-template-columns: 1fr;
    padding: 8vh 9vw;
  }

  .spread::after {
    left: 9vw;
    right: 9vw;
    top: 50%;
    bottom: auto;
    width: auto;
    height: 1px;
  }

  .page {
    min-height: auto;
    padding: 46px 0;
  }

  .note-page {
    padding-right: 0;
  }

  .columns-page {
    grid-template-columns: 1fr;
  }

  .vertical-name {
    writing-mode: horizontal-tb;
    font-size: clamp(52px, 16vw, 96px);
    letter-spacing: -0.08em;
  }

  .hanko-seal {
    right: 0;
    bottom: 6vh;
  }

  .folio-nav {
    display: none;
  }

  .rotated-label {
    left: 9vw;
  }
}
