/* ————————————————————————————————————————————————
   coda.css: the real shelf, footer, and the fully
   designed reduced-motion chapter layout
   ———————————————————————————————————————————————— */

.track { position: relative; width: 100%; height: 0; }

.flow {
  position: relative;
  z-index: 5;
  background: linear-gradient(180deg, #080B20 0%, #0C1133 30%, #0D1338 62%, #080B20 100%);
}

.coda {
  display: grid;
  place-items: center;
  padding: clamp(6rem, 16vh, 11rem) 1.5rem clamp(4rem, 10vh, 7rem);
  text-align: center;
}
.coda__inner {
  max-width: 48rem;
  display: grid;
  justify-items: center;
}

.coda__title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: var(--step-3);
  line-height: 1.3;
  color: var(--ink);
  margin: 1.4rem 0 1.2rem;
  text-wrap: balance;
}
.coda__body {
  font-family: var(--serif);
  font-size: calc(var(--step-0) * 1.02);
  line-height: 1.85;
  color: var(--ink2);
  max-width: min(var(--measure), 36rem);
}

.realshelf {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  margin: 3.2rem 0 1.4rem;
}
.realspine {
  display: grid;
  gap: 0.7rem;
  justify-items: center;
}
.realspine__name {
  writing-mode: vertical-rl;
  display: grid;
  place-items: center;
  min-height: calc(148px + var(--rs, 0) * 9px);
  padding: 1.1rem 0;
  width: 46px;
  border-radius: 4px 4px 3px 3px;
  font: 300 0.78rem/1 var(--sans);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink2);
  background: linear-gradient(180deg, #1E2658 0%, #141B4E 60%, #10163F 100%);
  box-shadow:
    inset 1px 0 0 rgba(230, 188, 92, 0.16),
    inset -2px 0 5px rgba(4, 6, 18, 0.7),
    0 14px 30px rgba(4, 6, 18, 0.6);
  border-top: 2px solid rgba(230, 188, 92, 0.35);
  border-bottom: 2px solid rgba(230, 188, 92, 0.25);
  transition: filter 0.5s var(--soft), transform 0.7s var(--expo);
}
.realspine:nth-child(2n) .realspine__name { background: linear-gradient(180deg, #232B66 0%, #171E52 60%, #10163F 100%); }
.realspine:nth-child(3n) .realspine__name { background: linear-gradient(180deg, #1A2152 0%, #10163F 100%); }
.realspine:hover .realspine__name { filter: brightness(1.2); transform: translateY(-6px); }
.realspine__tag {
  font: 400 0.58rem/1 var(--sans);
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--goldui);
  opacity: 0.85;
}

.coda__honesty {
  font: 300 0.8rem/1.6 var(--sans);
  letter-spacing: 0.16em;
  color: var(--ink3);
}

.coda__divider {
  display: flex;
  align-items: center;
  gap: 1.1rem;
  margin: 4.2rem 0 3rem;
}
.coda__divider i {
  width: clamp(60px, 12vw, 110px);
  height: 1px;
  background: linear-gradient(90deg, rgba(230, 188, 92, 0), rgba(230, 188, 92, 0.5));
}
.coda__divider i:last-child { transform: scaleX(-1); }

.coda__tagline {
  font-family: var(--serif);
  font-style: italic;
  font-size: var(--step-2);
  color: var(--ink);
}
.coda__stat {
  font: 300 var(--step-1)/1 var(--sans);
  letter-spacing: 0.3em;
  color: var(--gold);
  margin: 1.1rem 0 2.4rem;
  padding-left: 0.3em;
}
.coda__invite {
  font-family: var(--serif);
  font-size: calc(var(--step-0) * 1.02);
  line-height: 1.85;
  color: var(--ink2);
  max-width: min(var(--measure), 36rem);
  margin-bottom: 2.8rem;
}
.coda__cta { display: grid; gap: 1.1rem; justify-items: center; margin-bottom: 3.4rem; }
.coda__claim {
  font: 300 0.84rem/1.6 var(--sans);
  letter-spacing: 0.08em;
  color: var(--ink3);
}
.coda__trust {
  font: 300 0.82rem/1.7 var(--sans);
  letter-spacing: 0.16em;
  color: var(--ink3);
}

/* ——— footer ——— */

.foot {
  border-top: 1px solid rgba(230, 188, 92, 0.14);
  background: linear-gradient(180deg, #0A0E2C 0%, #080B20 100%);
  padding: 3.4rem 1.5rem 4.2rem;
}
.foot__inner {
  max-width: 62rem;
  margin: 0 auto;
  display: grid;
  gap: 2.1rem;
  justify-items: center;
  text-align: center;
}
.foot__brand { display: grid; gap: 1rem; justify-items: center; }
.foot__brand svg { width: 22px; height: 22px; opacity: 0.9; }
.foot__company {
  font: 300 0.88rem/1.6 var(--sans);
  letter-spacing: 0.08em;
  color: var(--ink2);
}
.foot__nav { display: flex; flex-wrap: wrap; gap: 1.4rem 2.4rem; justify-content: center; }
.foot__nav a {
  font: 400 0.84rem/1 var(--sans);
  letter-spacing: 0.12em;
  color: var(--goldui);
  padding-bottom: 0.35rem;
  border-bottom: 1px solid rgba(212, 165, 57, 0);
  transition: color 0.3s, border-color 0.3s;
}
.foot__nav a:hover { color: var(--goldhov); border-color: rgba(246, 213, 92, 0.6); }
.foot__note {
  font-family: var(--serif);
  font-style: italic;
  font-size: 0.95rem;
  color: var(--ink3);
}

/* ————————————————————————————————————————————————
   Reduced motion: the hall as still chapters.
   Same copy, same candlelight, no camera.
   ———————————————————————————————————————————————— */

body.mode-linear .stage,
body.mode-linear .track,
body.mode-linear .rail,
body.mode-linear .booklayer,
body.mode-linear .scrollhint { display: none; }

body.mode-linear { overflow-y: auto; }

#linear:not(:empty) {
  position: relative;
  z-index: 5;
  background:
    radial-gradient(120% 60% at 50% 0%, rgba(28, 36, 92, 0.5) 0%, rgba(8, 11, 32, 0) 60%),
    linear-gradient(180deg, #080B20 0%, #0D1338 40%, #0C1133 100%);
}

.lch {
  position: relative;
  display: grid;
  place-items: center;
  padding: clamp(4.5rem, 12vh, 8rem) 1.5rem;
  text-align: center;
}
.lch--first { min-height: 46vh; }

.lch .io { opacity: 0; transition: opacity 0.24s ease; }
.lch .io.is-in { opacity: 1; }

.lch__inner { display: grid; justify-items: center; gap: 1.1rem; max-width: 52rem; }

#linear .poemline,
#linear .plaque,
#linear .roomtext,
#linear .last { transform: none; position: relative; left: auto; top: auto; }
#linear .poemline { margin: 0.5rem 0; }
#linear .niche { position: relative; }
#linear .alcove { display: grid; justify-items: center; }

/* static open spread */
.lspread {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  width: min(94vw, 64rem);
  min-height: 480px;
  border-radius: 6px;
  background: linear-gradient(165deg, #1B2358 0%, #141B4E 52%, #10163F 100%);
  box-shadow: 0 50px 130px rgba(4, 6, 18, 0.8), inset 0 0 0 1px rgba(230, 188, 92, 0.14);
  margin-top: 2rem;
}
.lspread .page { position: relative; inset: auto; min-height: 480px; }
.lspread__gutter {
  position: absolute;
  left: 50%;
  top: 2%;
  bottom: 2%;
  width: 2px;
  margin-left: -1px;
  background: linear-gradient(180deg, rgba(8, 11, 32, 0), rgba(8, 11, 32, 0.7) 12%, rgba(8, 11, 32, 0.7) 88%, rgba(8, 11, 32, 0));
}
.lspread .page [data-pi] { opacity: 1; transform: none; }

@media (max-width: 720px) {
  .lspread { grid-template-columns: 1fr; }
  .lspread__gutter { display: none; }
}

.lroom__books {
  display: flex;
  flex-wrap: wrap;
  gap: 1.6rem;
  justify-content: center;
  margin: 1.8rem 0 0.6rem;
}
.lroom__books .cbook {
  position: relative;
  left: auto;
  top: auto;
  transform: rotate(calc(var(--rz, 0deg) / 30));
}
.lroom__name {
  margin-top: 0.6rem;
  font: 400 0.68rem/1 var(--sans);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink3);
}

#linear .ghostbook { margin: 1.6rem auto; }
#linear .lastglow { display: none; }

@media (max-width: 480px) {
  .realshelf { gap: 8px; }
  .realspine__name { width: 40px; min-height: calc(128px + var(--rs, 0) * 8px); }
  .coda { padding-top: 5rem; }
}
