:root {
  --ink: #070c18;
  --ink2: #0b1120;
  --deep: #03060e;
  --frost: #9fd8e8;
  --frost-bright: #eaf4f8;
  --steel: #9fb4c4;
  --dim: #6e8494;
  --line: #5fa8c4;
  --seal: #c4453d;
  --serif:
    "Didot", "Bodoni MT", "Playfair Display", Georgia, "Times New Roman", serif;
  --body: Georgia, "Times New Roman", serif;
  --mono: "Courier New", Courier, monospace;
}
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
}
body {
  background: linear-gradient(
    180deg,
    var(--ink2) 0%,
    var(--ink) 50%,
    var(--deep) 100%
  );
  background-attachment: fixed;
  color: var(--steel);
  font-family: var(--body);
  min-height: 100vh;
  line-height: 1.75;
}
::selection {
  background: var(--line);
  color: var(--deep);
}

/* ---------- shared ---------- */
.screen {
  display: none;
  min-height: 100vh;
  animation: rise 0.7s ease both;
}
.screen.active {
  display: block;
}
@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  .screen {
    animation: none;
  }
  .floorline {
    animation: none;
  }
}

.mono {
  font-family: var(--mono);
}
.stampbtn {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.8rem;
  letter-spacing: 0.2em;
  color: var(--frost);
  background: none;
  border: 1px solid var(--line);
  padding: 0.8em 1.6em;
  cursor: pointer;
  transition: all 0.25s;
  text-transform: uppercase;
}
.stampbtn:hover {
  background: rgba(95, 168, 196, 0.12);
  color: var(--frost-bright);
  border-color: var(--frost);
}
.stampbtn:focus-visible {
  outline: 2px solid var(--frost);
  outline-offset: 3px;
}
.sealbtn {
  border-color: var(--seal);
  color: var(--seal);
}
.sealbtn:hover {
  background: rgba(196, 69, 61, 0.1);
  color: #e06a62;
  border-color: #e06a62;
}

/* ---------- hero ---------- */
#hero {
  display: block;
  text-align: center;
  padding: 0 1rem;
  position: relative;
  overflow: hidden;
}
.hero-inner {
  max-width: 880px;
  margin: 0 auto;
  padding-top: 9vh;
}
.eyebrow {
  font-family: var(--body);
  font-size: 0.85rem;
  letter-spacing: 0.7em;
  color: var(--steel);
  text-indent: 0.7em;
}
h1 {
  font-family: var(--serif);
  font-weight: 400;
  color: var(--frost-bright);
  font-size: clamp(2.4rem, 7vw, 4.6rem);
  letter-spacing: 0.08em;
  line-height: 1.12;
  margin: 0.35em 0 0.2em;
}
.subtitle {
  font-size: 0.9rem;
  letter-spacing: 0.5em;
  color: var(--steel);
  text-indent: 0.5em;
}
.subtitle::before,
.subtitle::after {
  content: "/";
  color: var(--line);
  margin: 0 1em;
}
.scene {
  display: block;
  margin: 1.5rem auto 0;
  width: min(92vw, 640px);
  height: auto;
}
.hero-cta {
  margin: 1.2rem 0 3rem;
}
.epigraph {
  font-style: italic;
  color: var(--dim);
  font-size: 0.95rem;
  letter-spacing: 0.15em;
  margin-top: 1.4rem;
}

/* ---------- docket ---------- */
#docket {
  padding: 9vh 1.2rem 12vh;
}
.docket-wrap {
  max-width: 760px;
  margin: 0 auto;
}
.docket-head {
  text-align: center;
  margin-bottom: 3.2rem;
}
.docket-head h2 {
  font-family: var(--serif);
  font-weight: 400;
  color: var(--frost-bright);
  font-size: clamp(1.7rem, 4vw, 2.5rem);
  letter-spacing: 0.2em;
}
.docket-head .mono {
  display: block;
  margin-top: 0.9rem;
  font-size: 0.75rem;
  letter-spacing: 0.25em;
  color: var(--dim);
}
.case {
  display: flex;
  align-items: baseline;
  gap: 1.4rem;
  padding: 1.15rem 0.6rem;
  border-bottom: 1px solid rgba(95, 168, 196, 0.22);
  cursor: pointer;
  transition: background 0.2s;
}
.case:first-of-type {
  border-top: 1px solid rgba(95, 168, 196, 0.22);
}
.case:hover {
  background: rgba(95, 168, 196, 0.07);
}
.case .num {
  font-family: var(--mono);
  color: var(--line);
  font-size: 0.85rem;
  min-width: 3.2em;
}
.case .name {
  font-family: var(--serif);
  color: var(--frost-bright);
  font-size: 1.25rem;
  letter-spacing: 0.06em;
  flex: 1;
}
.case .meta {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  color: var(--dim);
  text-align: right;
  white-space: nowrap;
}
.case .meta b {
  color: var(--frost);
  font-weight: normal;
}
@media (max-width: 560px) {
  .case {
    flex-wrap: wrap;
  }
  .case .meta {
    width: 100%;
    text-align: left;
    margin-left: 4.6em;
  }
}

/* ---------- chapter reader ---------- */
.chapter {
  padding: 8vh 1.2rem 10vh;
}
.ch-wrap {
  max-width: 680px;
  margin: 0 auto;
}
.ch-head {
  text-align: center;
  margin-bottom: 3.4rem;
}
.ch-head .file {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.3em;
  color: var(--dim);
}
.ch-head h2 {
  font-family: var(--serif);
  font-weight: 400;
  color: var(--frost-bright);
  font-size: clamp(1.9rem, 5vw, 2.8rem);
  letter-spacing: 0.1em;
  margin: 0.5em 0 0.4em;
}
.floorline {
  height: 1px;
  width: 200px;
  margin: 0 auto;
  background: linear-gradient(
    90deg,
    transparent,
    var(--frost) 50%,
    transparent
  );
}
.prose p {
  margin: 0 0 1.35em;
  color: #c3d2dc;
  font-size: 1.06rem;
  text-align: justify;
  hyphens: auto;
}
.prose p:first-of-type::first-letter {
  font-family: var(--serif);
  font-size: 3.4em;
  float: left;
  line-height: 0.82;
  padding: 0.04em 0.12em 0 0;
  color: var(--frost);
}
.prose em {
  color: #e2eef4;
}
.prose hr {
  border: none;
  text-align: center;
  margin: 2.4em 0;
  height: auto;
}
.prose hr::after {
  content: "\2735\2002\2735\2002\2735";
  color: var(--line);
  font-size: 0.8rem;
  letter-spacing: 0.5em;
}
.v {
  font-family: var(--mono);
  color: var(--frost);
  background: rgba(95, 168, 196, 0.06);
  border-left: 2px solid var(--line);
  padding: 0.7em 1.1em;
  letter-spacing: 0.08em;
  font-size: 0.92rem;
  text-align: left !important;
  hyphens: none;
}
.checksum {
  margin-top: 4rem;
  text-align: center;
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.25em;
  color: var(--dim);
  border-top: 1px solid rgba(95, 168, 196, 0.2);
  padding-top: 1.6rem;
}
.checksum .ok {
  color: var(--frost);
}
.checksum .bad {
  color: var(--seal);
}
.ch-nav {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 2.6rem;
}
.progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  background: var(--frost);
  width: 0;
  z-index: 9;
  transition: width 0.2s;
  opacity: 0.7;
}
.home-link {
  position: fixed;
  top: 14px;
  right: 16px;
  z-index: 9;
  font-family: var(--mono);
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  color: var(--dim);
  background: rgba(7, 12, 24, 0.8);
  border: 1px solid rgba(95, 168, 196, 0.3);
  padding: 0.5em 0.9em;
  cursor: pointer;
  display: none;
}
.home-link:hover {
  color: var(--frost);
}
.stamp {
  display: inline-block;
  transform: rotate(-6deg);
  border: 2px solid var(--seal);
  color: var(--seal);
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.15em;
  padding: 0.7em 1.1em;
  opacity: 0.92;
  line-height: 1.5;
}
