@import url("https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,500;0,600;1,600&family=IBM+Plex+Mono:wght@400;500;600&family=Space+Grotesk:wght@400;500;600;700&display=swap");

:root {
  --sanctuary-ink: #07141b;
  --sanctuary-deep: #0a2028;
  --sanctuary-teal: #173b42;
  --sanctuary-oxide: #54868a;
  --sanctuary-paper: #eee5d1;
  --sanctuary-paper-bright: #faf5e8;
  --sanctuary-brass: #c99d4f;
  --sanctuary-gold: #efbd61;
  --sanctuary-red: #9e3b35;
  --sanctuary-line: rgba(201, 157, 79, 0.28);
  --sanctuary-shadow: 0 28px 80px rgba(1, 10, 14, 0.28);
  --sanctuary-serif: "Cormorant Garamond", Georgia, serif;
  --sanctuary-sans: "Space Grotesk", "Segoe UI", sans-serif;
  --sanctuary-mono: "IBM Plex Mono", Consolas, monospace;
  --sanctuary-radius: 3px;
  --hero-shift: 0px;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 88px;
  background: var(--sanctuary-ink);
}

body {
  overflow-x: hidden;
  color: var(--sanctuary-ink);
  background:
    linear-gradient(rgba(7, 20, 27, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(7, 20, 27, 0.035) 1px, transparent 1px),
    var(--sanctuary-paper);
  background-size: 32px 32px;
  font-family: var(--sanctuary-sans);
  text-rendering: optimizeLegibility;
}

body::selection,
body *::selection {
  color: var(--sanctuary-ink);
  background: var(--sanctuary-gold);
}

body::before {
  position: fixed;
  z-index: 9999;
  inset: 0 0 auto;
  height: 3px;
  content: "";
  pointer-events: none;
  background: linear-gradient(90deg, var(--sanctuary-red), var(--sanctuary-gold), var(--sanctuary-oxide));
  transform: scaleX(var(--scroll-progress, 0));
  transform-origin: left center;
}

.shell {
  width: min(1440px, calc(100% - 64px));
  margin-inline: auto;
}

h1,
h2,
h3,
blockquote {
  font-family: var(--sanctuary-serif);
  font-weight: 600;
  letter-spacing: -0.035em;
}

p,
li,
dd,
td {
  line-height: 1.68;
}

a {
  text-underline-offset: 0.22em;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--sanctuary-gold);
  outline-offset: 4px;
}

.eyebrow,
.micro,
.hero-book-number,
.diary-progress-label,
.series-book > p:first-of-type,
.discovery-card > div:first-child,
.masthead,
.button,
.format-link,
.diary-tags,
.widget-kicker {
  font-family: var(--sanctuary-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* Masthead */
.masthead {
  position: sticky;
  z-index: 500;
  top: 0;
  color: #f7efd9;
  border-bottom: 1px solid rgba(239, 189, 97, 0.28);
  background: rgba(5, 16, 22, 0.91);
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.18);
  backdrop-filter: blur(18px) saturate(120%);
}

.masthead .shell {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
}

.masthead > .shell > a:first-child,
.masthead > a:first-child {
  position: relative;
  color: #fff7e5;
  text-decoration: none;
  white-space: nowrap;
}

.masthead > .shell > a:first-child::before,
.masthead > a:first-child::before {
  display: inline-block;
  width: 9px;
  height: 9px;
  margin-right: 12px;
  content: "";
  border: 1px solid var(--sanctuary-gold);
  border-radius: 50%;
  background: var(--sanctuary-red);
  box-shadow: 0 0 0 5px rgba(239, 189, 97, 0.08);
}

.masthead nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: clamp(12px, 1.55vw, 25px);
}

.masthead nav a {
  position: relative;
  padding-block: 28px;
  color: rgba(255, 248, 231, 0.72);
  font-size: 0.7rem;
  font-weight: 600;
  text-decoration: none;
  transition: color 180ms ease;
}

.masthead nav a::after {
  position: absolute;
  right: 0;
  bottom: 19px;
  left: 0;
  height: 2px;
  content: "";
  background: var(--sanctuary-gold);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 220ms ease;
}

.masthead nav a:hover,
.masthead nav a[aria-current="page"] {
  color: #fff8e7;
}

.masthead nav a:hover::after,
.masthead nav a[aria-current="page"]::after {
  transform: scaleX(1);
  transform-origin: left;
}

.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  color: #fff5de;
  border: 1px solid var(--sanctuary-line);
  background: transparent;
  font: 600 0.7rem var(--sanctuary-mono);
}

/* Cinematic hero */
.hero {
  position: relative;
  isolation: isolate;
  min-height: min(940px, calc(100svh - 76px));
  overflow: hidden;
  color: #fff8e9;
  border-bottom: 1px solid var(--sanctuary-line);
  background:
    linear-gradient(90deg, rgba(4, 15, 21, 0.98) 0%, rgba(4, 15, 21, 0.87) 38%, rgba(4, 15, 21, 0.45) 68%, rgba(4, 15, 21, 0.7) 100%),
    linear-gradient(180deg, rgba(7, 20, 27, 0.15), rgba(7, 20, 27, 0.92)),
    url("/assets/sanctuary-hero-v2.webp") center calc(50% + var(--hero-shift)) / cover no-repeat;
}

.hero::before {
  position: absolute;
  z-index: -1;
  inset: 0;
  content: "";
  pointer-events: none;
  opacity: 0.16;
  background-image: repeating-linear-gradient(104deg, transparent 0 17px, rgba(255, 255, 255, 0.18) 18px, transparent 19px 31px);
  background-size: 210% 100%;
  animation: sanctuary-rain 18s linear infinite;
}

.hero::after {
  position: absolute;
  z-index: -1;
  inset: auto 0 0;
  height: 34%;
  content: "";
  pointer-events: none;
  background: linear-gradient(transparent, var(--sanctuary-ink));
}

.hero-grid {
  min-height: inherit;
  display: grid;
  grid-template-columns: minmax(0, 0.82fr) minmax(520px, 1.18fr);
  align-items: center;
  gap: clamp(48px, 7vw, 120px);
  padding-block: clamp(88px, 11vw, 150px);
}

.hero-copy {
  position: relative;
  z-index: 2;
  max-width: 720px;
  animation: sanctuary-arrive 900ms cubic-bezier(0.2, 0.76, 0.22, 1) both;
}

.hero-copy::before {
  display: block;
  width: 82px;
  height: 6px;
  margin-bottom: 28px;
  content: "";
  background: linear-gradient(90deg, var(--sanctuary-red) 0 38%, var(--sanctuary-gold) 38% 100%);
  box-shadow: 0 0 32px rgba(239, 189, 97, 0.25);
}

.hero .eyebrow {
  color: var(--sanctuary-gold);
  font-size: clamp(0.72rem, 1vw, 0.86rem);
}

.series-hero-title,
.hero h1 {
  max-width: 820px;
  margin: 18px 0 26px;
  color: #fff8e7;
  font-size: clamp(4rem, 7.4vw, 8.5rem);
  line-height: 0.82;
  text-wrap: balance;
  text-shadow: 0 12px 45px rgba(0, 0, 0, 0.34);
}

.series-hero-title em,
.hero h1 em {
  display: block;
  color: var(--sanctuary-gold);
  font-weight: 500;
}

.hero .lede {
  max-width: 680px;
  color: rgba(255, 248, 231, 0.91);
  font-size: clamp(1.1rem, 1.6vw, 1.42rem);
}

.hero-format-note {
  max-width: 650px;
  padding: 18px 20px;
  color: rgba(255, 248, 231, 0.78);
  border-left: 3px solid var(--sanctuary-brass);
  background: rgba(7, 20, 27, 0.55);
  backdrop-filter: blur(8px);
}

.hero .micro {
  max-width: 680px;
  color: rgba(255, 248, 231, 0.54);
  font-size: 0.66rem;
  line-height: 1.8;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-block: 30px;
}

.button {
  display: inline-flex;
  min-height: 50px;
  align-items: center;
  justify-content: center;
  padding: 13px 20px;
  border: 1px solid currentColor;
  border-radius: var(--sanctuary-radius);
  font-size: 0.72rem;
  font-weight: 600;
  text-decoration: none;
  transition: color 180ms ease, background 180ms ease, transform 180ms ease, box-shadow 180ms ease;
}

.button:hover {
  transform: translateY(-3px);
}

.button-primary {
  color: var(--sanctuary-ink);
  border-color: var(--sanctuary-gold);
  background: var(--sanctuary-gold);
  box-shadow: 0 12px 34px rgba(239, 189, 97, 0.18);
}

.button-primary:hover {
  background: #ffd177;
  box-shadow: 0 18px 44px rgba(239, 189, 97, 0.26);
}

.button-secondary {
  color: inherit;
  border-color: rgba(255, 248, 231, 0.42);
  background: rgba(255, 255, 255, 0.035);
}

.button-secondary:hover {
  color: var(--sanctuary-ink);
  border-color: var(--sanctuary-paper-bright);
  background: var(--sanctuary-paper-bright);
}

/* Carousels */
.carousel-frame {
  min-width: 0;
}

.hero .carousel-frame {
  position: relative;
  z-index: 3;
  align-self: stretch;
  display: flex;
  min-width: 0;
  flex-direction: column;
  justify-content: center;
}

.hero-books,
.series-grid.is-enhanced-carousel {
  display: flex;
  min-width: 0;
  gap: 18px;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scroll-behavior: smooth;
  scroll-snap-type: inline mandatory;
  scrollbar-width: none;
  cursor: grab;
}

.hero-books::-webkit-scrollbar,
.series-grid.is-enhanced-carousel::-webkit-scrollbar {
  display: none;
}

.hero-books.is-dragging,
.series-grid.is-dragging {
  cursor: grabbing;
  scroll-behavior: auto;
  user-select: none;
}

.hero-book {
  position: relative;
  width: clamp(278px, 27vw, 365px);
  min-width: clamp(278px, 27vw, 365px);
  padding: 14px;
  overflow: hidden;
  color: #f8f1e2;
  border: 1px solid rgba(239, 189, 97, 0.34);
  border-radius: 4px;
  background: linear-gradient(155deg, rgba(17, 43, 51, 0.94), rgba(5, 17, 23, 0.96));
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.42);
  scroll-snap-align: start;
  transition: border-color 220ms ease, transform 260ms ease, box-shadow 260ms ease;
  animation: sanctuary-card-in 700ms calc(150ms + var(--card-index, 0) * 90ms) both;
}

.hero-book::before {
  position: absolute;
  z-index: 2;
  inset: 0;
  content: "";
  pointer-events: none;
  border: 7px solid rgba(255, 255, 255, 0.025);
}

.hero-book:hover {
  border-color: rgba(239, 189, 97, 0.75);
  box-shadow: 0 36px 90px rgba(0, 0, 0, 0.56);
  transform: translateY(-7px) rotate(-0.35deg);
}

.hero-book img {
  width: 100%;
  aspect-ratio: 0.675;
  display: block;
  object-fit: cover;
  border: 1px solid rgba(239, 189, 97, 0.42);
  filter: saturate(0.82) contrast(1.05);
  transition: filter 240ms ease, transform 550ms cubic-bezier(0.2, 0.7, 0.2, 1);
}

.hero-book:hover img {
  filter: saturate(1) contrast(1.08);
  transform: scale(1.018);
}

.hero-book-number {
  margin: 2px 0 11px;
  color: var(--sanctuary-gold);
  font-size: 0.62rem;
}

.hero-book h2 {
  margin: 17px 2px 5px;
  color: #fff7e8;
  font-size: clamp(1.8rem, 2.3vw, 2.45rem);
  line-height: 0.92;
}

.hero-book > p:not(.hero-book-number) {
  color: rgba(255, 248, 231, 0.7);
  font-size: 0.87rem;
  line-height: 1.55;
}

.format-links {
  display: grid;
  gap: 7px;
  margin-top: 15px;
}

.format-link {
  display: grid;
  grid-template-columns: 105px 1fr;
  gap: 10px;
  padding: 10px 11px;
  color: #f8efdc;
  border: 1px solid rgba(239, 189, 97, 0.15);
  background: rgba(255, 255, 255, 0.025);
  font-size: 0.58rem;
  line-height: 1.4;
  text-decoration: none;
  transition: border-color 160ms ease, background 160ms ease;
}

.format-link strong {
  color: var(--sanctuary-gold);
}

.format-link span {
  color: rgba(255, 248, 231, 0.56);
  letter-spacing: 0;
  text-transform: none;
}

.format-link:hover {
  border-color: rgba(239, 189, 97, 0.52);
  background: rgba(239, 189, 97, 0.08);
}

.carousel-controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}

.carousel-control {
  width: 48px;
  height: 43px;
  color: var(--sanctuary-gold);
  border: 1px solid rgba(239, 189, 97, 0.35);
  border-radius: 2px;
  background: rgba(7, 20, 27, 0.74);
  font: 500 1.1rem var(--sanctuary-mono);
  cursor: pointer;
  transition: color 160ms ease, background 160ms ease, transform 160ms ease;
}

.carousel-control:hover:not(:disabled) {
  color: var(--sanctuary-ink);
  background: var(--sanctuary-gold);
  transform: translateY(-2px);
}

.carousel-control:disabled {
  opacity: 0.28;
  cursor: not-allowed;
}

.carousel-count {
  min-width: 78px;
  color: rgba(255, 248, 231, 0.56);
  font: 500 0.67rem var(--sanctuary-mono);
  letter-spacing: 0.08em;
  text-align: center;
}

.series-section .carousel-controls {
  justify-content: flex-start;
}

.series-section .carousel-control {
  color: var(--sanctuary-deep);
  border-color: rgba(7, 20, 27, 0.32);
  background: transparent;
}

.series-section .carousel-control:hover:not(:disabled) {
  color: var(--sanctuary-paper-bright);
  background: var(--sanctuary-deep);
}

.series-section .carousel-count {
  color: rgba(7, 20, 27, 0.62);
}

/* Status ticker */
.ticker {
  position: relative;
  z-index: 3;
  overflow: hidden;
  color: var(--sanctuary-gold);
  border-block: 1px solid rgba(239, 189, 97, 0.24);
  background: #06171e;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.16);
}

.ticker::before,
.ticker::after {
  position: absolute;
  z-index: 2;
  top: 0;
  bottom: 0;
  width: 10vw;
  content: "";
}

.ticker::before {
  left: 0;
  background: linear-gradient(90deg, #06171e, transparent);
}

.ticker::after {
  right: 0;
  background: linear-gradient(-90deg, #06171e, transparent);
}

.ticker-line {
  width: max-content;
  padding-block: 14px;
  font: 500 0.68rem var(--sanctuary-mono);
  letter-spacing: 0.15em;
  animation: sanctuary-ticker 36s linear infinite;
}

/* Section system */
.section {
  position: relative;
  padding-block: clamp(86px, 10vw, 150px);
}

.section > .shell > .eyebrow,
.diary-introduction > .eyebrow,
.cta .eyebrow {
  color: var(--sanctuary-red);
  font-size: 0.7rem;
  font-weight: 600;
}

.section h2,
.cta h2 {
  max-width: 900px;
  margin-block: 15px 24px;
  font-size: clamp(3.1rem, 6vw, 6.4rem);
  line-height: 0.9;
  text-wrap: balance;
}

.section-intro {
  max-width: 780px;
  color: rgba(7, 20, 27, 0.72);
  font-size: clamp(1.05rem, 1.4vw, 1.27rem);
}

.diary-section {
  color: #f6efdf;
  background:
    radial-gradient(circle at 10% 18%, rgba(84, 134, 138, 0.23), transparent 35%),
    linear-gradient(135deg, #071920, #0d2a31 68%, #07171d);
}

.diary-section::before {
  position: absolute;
  inset: 0;
  content: "";
  pointer-events: none;
  opacity: 0.11;
  background-image: linear-gradient(rgba(239, 189, 97, 0.22) 1px, transparent 1px), linear-gradient(90deg, rgba(239, 189, 97, 0.22) 1px, transparent 1px);
  background-size: 46px 46px;
}

.diary-layout {
  position: relative;
  display: grid;
  grid-template-columns: minmax(280px, 0.72fr) minmax(480px, 1.28fr);
  align-items: start;
  gap: clamp(46px, 7vw, 110px);
}

.diary-introduction {
  position: sticky;
  top: 116px;
}

.diary-section h2 {
  color: #fff5df;
}

.diary-section .section-intro,
.diary-schedule span {
  color: rgba(255, 248, 231, 0.68);
}

.diary-schedule {
  display: grid;
  gap: 8px;
  margin: 28px 0;
  padding: 18px 20px;
  border-left: 3px solid var(--sanctuary-gold);
  background: rgba(255, 255, 255, 0.035);
}

.diary-sheet {
  position: relative;
  color: var(--sanctuary-ink);
  border: 1px solid rgba(239, 189, 97, 0.64);
  border-radius: 2px;
  background:
    linear-gradient(rgba(7, 20, 27, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(7, 20, 27, 0.04) 1px, transparent 1px),
    var(--sanctuary-paper-bright);
  background-size: 28px 28px;
  box-shadow: 18px 18px 0 rgba(201, 157, 79, 0.13), var(--sanctuary-shadow);
  transform: rotate(0.45deg);
  transition: transform 260ms ease, box-shadow 260ms ease;
}

.diary-sheet:hover {
  box-shadow: 10px 14px 0 rgba(201, 157, 79, 0.17), 0 34px 90px rgba(0, 0, 0, 0.34);
  transform: rotate(0deg) translateY(-4px);
}

.diary-sheet::after {
  position: absolute;
  top: 22px;
  right: 24px;
  width: 72px;
  height: 72px;
  content: "307";
  display: grid;
  place-items: center;
  color: rgba(158, 59, 53, 0.7);
  border: 2px solid rgba(158, 59, 53, 0.5);
  border-radius: 50%;
  font: 600 0.78rem var(--sanctuary-mono);
  transform: rotate(-11deg);
}

.diary-record-meta,
.diary-record-footer {
  border-color: rgba(7, 20, 27, 0.2);
}

.diary-tags li {
  border: 1px solid rgba(7, 20, 27, 0.28);
  background: rgba(7, 20, 27, 0.035);
}

.diary-progress-bar {
  background: linear-gradient(90deg, var(--sanctuary-red), var(--sanctuary-gold));
}

.section-dark {
  color: #fff5df;
  background:
    radial-gradient(circle at 78% 10%, rgba(201, 157, 79, 0.1), transparent 32%),
    var(--sanctuary-ink);
}

.section-dark .section-intro,
.section-dark p {
  color: rgba(255, 248, 231, 0.68);
}

.cards,
.list-grid,
.discovery-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 18px;
  margin-top: clamp(36px, 5vw, 68px);
}

.card,
.list-card,
.discovery-card {
  position: relative;
  padding: clamp(26px, 3vw, 42px);
  overflow: hidden;
  border: 1px solid rgba(7, 20, 27, 0.18);
  background: rgba(250, 245, 232, 0.76);
  box-shadow: 0 18px 50px rgba(7, 20, 27, 0.06);
  transition: border-color 220ms ease, transform 260ms ease, box-shadow 260ms ease;
}

.card {
  grid-column: span 4;
  color: #f9f1e1;
  border-color: rgba(239, 189, 97, 0.2);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.012));
}

.list-card,
.discovery-card {
  grid-column: span 3;
}

.card::before,
.list-card::before,
.discovery-card::before {
  position: absolute;
  top: 0;
  left: 0;
  width: 68px;
  height: 4px;
  content: "";
  background: linear-gradient(90deg, var(--sanctuary-red), var(--sanctuary-gold));
}

.card:hover,
.list-card:hover,
.discovery-card:hover {
  border-color: rgba(201, 157, 79, 0.62);
  box-shadow: 0 28px 70px rgba(7, 20, 27, 0.13);
  transform: translateY(-8px);
}

.card h3,
.list-card h3,
.discovery-card h3 {
  margin: 8px 0 13px;
  font-size: clamp(1.8rem, 2.6vw, 2.65rem);
  line-height: 0.98;
}

.dossier {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(460px, 1.1fr);
  gap: clamp(50px, 8vw, 130px);
  padding: clamp(38px, 5vw, 70px);
  border: 1px solid rgba(7, 20, 27, 0.24);
  background: rgba(250, 245, 232, 0.68);
  box-shadow: 16px 16px 0 rgba(84, 134, 138, 0.13);
}

.dossier::before {
  position: absolute;
  top: -12px;
  left: 50%;
  width: 110px;
  height: 24px;
  content: "";
  border: 1px solid rgba(7, 20, 27, 0.18);
  background: rgba(201, 157, 79, 0.7);
  transform: translateX(-50%) rotate(-1deg);
}

.dossier blockquote {
  margin: 0;
  color: var(--sanctuary-ink);
  font-size: clamp(2.8rem, 5vw, 5.6rem);
  line-height: 0.92;
}

.dossier dl {
  margin: 0;
  border: 1px solid rgba(7, 20, 27, 0.24);
}

.dossier dt,
.dossier dd {
  padding: 16px 20px;
  border-bottom: 1px solid rgba(7, 20, 27, 0.15);
}

.dossier dt {
  color: var(--sanctuary-red);
  font: 600 0.68rem var(--sanctuary-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.discovery-section {
  background:
    radial-gradient(circle at 82% 10%, rgba(239, 189, 97, 0.16), transparent 24%),
    var(--sanctuary-paper-bright);
}

.discovery-card a {
  color: var(--sanctuary-red);
  font: 600 0.7rem var(--sanctuary-mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.discovery-card-acid {
  color: #f9f1e1;
  border-color: var(--sanctuary-teal);
  background: var(--sanctuary-teal);
}

.discovery-card-acid a {
  color: var(--sanctuary-gold);
}

.cta {
  position: relative;
  overflow: hidden;
  color: #fff5df;
  border-block: 1px solid rgba(239, 189, 97, 0.24);
  background:
    linear-gradient(90deg, rgba(7, 20, 27, 0.97), rgba(7, 20, 27, 0.77)),
    url("/assets/sanctuary-hero-v2.webp") center 72% / cover;
}

.cta::after {
  position: absolute;
  right: 4vw;
  bottom: -42px;
  content: "CLEARED";
  color: rgba(158, 59, 53, 0.23);
  border: 8px double rgba(158, 59, 53, 0.23);
  padding: 12px 24px;
  font: 600 clamp(3rem, 9vw, 8rem) var(--sanctuary-mono);
  letter-spacing: 0.08em;
  transform: rotate(-8deg);
}

.cta-grid {
  position: relative;
  z-index: 2;
  min-height: 420px;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 50px;
}

.cta h2 {
  color: #fff5df;
}

.series-section {
  background: var(--sanctuary-paper);
}

.series-section .carousel-frame {
  margin-top: clamp(38px, 5vw, 70px);
}

.series-grid.is-enhanced-carousel {
  margin-top: 0;
  padding: 9px 4px 34px;
}

.series-book {
  width: clamp(300px, 31vw, 410px);
  min-width: clamp(300px, 31vw, 410px);
  padding: 18px;
  border: 1px solid rgba(7, 20, 27, 0.22);
  background: rgba(250, 245, 232, 0.72);
  box-shadow: 12px 12px 0 var(--sanctuary-deep), 0 22px 60px rgba(7, 20, 27, 0.11);
  scroll-snap-align: start;
  transition: transform 260ms ease, box-shadow 260ms ease;
}

.series-book:hover {
  box-shadow: 7px 9px 0 var(--sanctuary-deep), 0 30px 70px rgba(7, 20, 27, 0.16);
  transform: translateY(-7px);
}

.series-book img {
  width: 100%;
  aspect-ratio: 0.675;
  object-fit: cover;
  filter: saturate(0.9) contrast(1.03);
}

.series-book h3 {
  margin-bottom: 10px;
  font-size: clamp(2rem, 3vw, 3rem);
  line-height: 0.94;
}

.series-book a {
  display: inline-flex;
  margin: 3px 3px 3px 0;
  padding: 8px 10px;
  color: var(--sanctuary-deep);
  border: 1px solid rgba(7, 20, 27, 0.28);
  font: 600 0.62rem var(--sanctuary-mono);
  text-decoration: none;
  text-transform: uppercase;
  transition: color 160ms ease, background 160ms ease;
}

.series-book a:hover {
  color: var(--sanctuary-paper-bright);
  background: var(--sanctuary-deep);
}

/* Secondary pages */
body:not(:has(.hero)) main {
  min-height: 72vh;
}

body:not(:has(.hero)) main > :first-child {
  position: relative;
  overflow: hidden;
}

body:not(:has(.hero)) main > :first-child::before {
  position: absolute;
  z-index: -1;
  inset: 0;
  content: "";
  opacity: 0.12;
  background: url("/assets/sanctuary-hero-v2.webp") center / cover;
  mask-image: linear-gradient(#000, transparent);
}

main table {
  width: 100%;
  border-collapse: collapse;
  background: rgba(250, 245, 232, 0.72);
  box-shadow: var(--sanctuary-shadow);
}

main th {
  color: #fff3dc;
  background: var(--sanctuary-deep);
  font: 600 0.7rem var(--sanctuary-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

main th,
main td {
  padding: 16px 18px;
  border: 1px solid rgba(7, 20, 27, 0.17);
}

main input,
main textarea,
main select {
  min-height: 50px;
  padding: 12px 14px;
  color: var(--sanctuary-ink);
  border: 1px solid rgba(7, 20, 27, 0.34);
  border-radius: 1px;
  background: rgba(250, 245, 232, 0.86);
  font: 500 1rem var(--sanctuary-sans);
}

main input:hover,
main textarea:hover,
main select:hover {
  border-color: var(--sanctuary-brass);
}

footer {
  position: relative;
  min-height: 150px;
  display: flex;
  align-items: center;
  color: rgba(255, 248, 231, 0.62);
  border-top: 1px solid rgba(239, 189, 97, 0.24);
  background: #051319;
  font: 500 0.7rem var(--sanctuary-mono);
  letter-spacing: 0.05em;
}

/* Floating field terminal */
.sanctuary-widget {
  position: fixed;
  z-index: 900;
  right: 22px;
  bottom: 22px;
  width: min(330px, calc(100vw - 32px));
  overflow: hidden;
  color: #f8f0de;
  border: 1px solid rgba(239, 189, 97, 0.48);
  border-radius: 3px;
  background: rgba(5, 19, 25, 0.94);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.42);
  backdrop-filter: blur(18px) saturate(125%);
  transition: box-shadow 180ms ease, opacity 180ms ease;
}

.sanctuary-widget.is-dragging {
  box-shadow: 0 34px 100px rgba(0, 0, 0, 0.56);
  opacity: 0.94;
}

.widget-bar {
  min-height: 45px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 11px 9px 14px;
  border-bottom: 1px solid rgba(239, 189, 97, 0.22);
  background: rgba(255, 255, 255, 0.035);
  cursor: move;
  touch-action: none;
}

.widget-kicker {
  color: var(--sanctuary-gold);
  font-size: 0.58rem;
}

.widget-toggle {
  width: 29px;
  height: 27px;
  color: #f8f0de;
  border: 1px solid rgba(239, 189, 97, 0.28);
  background: transparent;
  cursor: pointer;
}

.widget-body {
  display: grid;
  gap: 14px;
  padding: 16px;
}

.sanctuary-widget.is-collapsed .widget-body {
  display: none;
}

.widget-status {
  display: grid;
  grid-template-columns: 10px 1fr auto;
  align-items: center;
  gap: 10px;
  font: 500 0.62rem var(--sanctuary-mono);
  letter-spacing: 0.04em;
}

.widget-light {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #67b79b;
  box-shadow: 0 0 14px rgba(103, 183, 155, 0.8);
  animation: sanctuary-pulse 2.2s ease-in-out infinite;
}

.widget-time {
  color: rgba(255, 248, 231, 0.58);
}

.widget-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.widget-stat {
  padding: 11px;
  border: 1px solid rgba(239, 189, 97, 0.16);
  background: rgba(255, 255, 255, 0.025);
}

.widget-stat strong,
.widget-stat span {
  display: block;
}

.widget-stat strong {
  color: var(--sanctuary-gold);
  font: 600 1.35rem var(--sanctuary-serif);
}

.widget-stat span {
  margin-top: 3px;
  color: rgba(255, 248, 231, 0.48);
  font: 500 0.53rem var(--sanctuary-mono);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.widget-links {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.widget-links a {
  padding: 10px;
  color: #f8f0de;
  border: 1px solid rgba(239, 189, 97, 0.24);
  font: 500 0.56rem var(--sanctuary-mono);
  text-align: center;
  text-decoration: none;
  text-transform: uppercase;
  transition: color 160ms ease, background 160ms ease;
}

.widget-links a:hover {
  color: var(--sanctuary-ink);
  background: var(--sanctuary-gold);
}

/* Reveals */
.has-motion [data-reveal] {
  opacity: 0;
  transform: translateY(34px);
  transition: opacity 700ms ease, transform 800ms cubic-bezier(0.2, 0.72, 0.2, 1);
}

.has-motion [data-reveal].is-visible {
  opacity: 1;
  transform: translateY(0);
}

.has-motion [data-reveal-delay="1"] { transition-delay: 80ms; }
.has-motion [data-reveal-delay="2"] { transition-delay: 160ms; }
.has-motion [data-reveal-delay="3"] { transition-delay: 240ms; }

@keyframes sanctuary-rain {
  from { background-position: 0 0; }
  to { background-position: -210% 0; }
}

@keyframes sanctuary-arrive {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes sanctuary-card-in {
  from { opacity: 0; transform: translateX(30px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes sanctuary-ticker {
  to { transform: translateX(-50%); }
}

@keyframes sanctuary-pulse {
  50% { opacity: 0.45; transform: scale(0.82); }
}

@media (max-width: 1180px) {
  .hero-grid {
    grid-template-columns: minmax(0, 0.78fr) minmax(430px, 1.22fr);
    gap: 42px;
  }

  .series-hero-title,
  .hero h1 {
    font-size: clamp(3.8rem, 7vw, 6.2rem);
  }

  .list-card,
  .discovery-card {
    grid-column: span 6;
  }

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

@media (max-width: 900px) {
  .shell {
    width: min(100% - 36px, 760px);
  }

  .masthead .shell {
    min-height: 68px;
  }

  .nav-toggle {
    display: inline-grid;
    place-items: center;
  }

  .masthead nav {
    position: absolute;
    top: calc(100% + 1px);
    right: 18px;
    left: 18px;
    display: grid;
    gap: 0;
    padding: 10px;
    border: 1px solid rgba(239, 189, 97, 0.28);
    background: rgba(5, 16, 22, 0.98);
    box-shadow: var(--sanctuary-shadow);
    transform: translateY(-12px);
    visibility: hidden;
    opacity: 0;
    transition: opacity 160ms ease, transform 180ms ease, visibility 180ms;
  }

  .masthead.nav-open nav {
    transform: translateY(0);
    visibility: visible;
    opacity: 1;
  }

  .masthead nav a {
    padding: 14px 12px;
    border-bottom: 1px solid rgba(239, 189, 97, 0.11);
  }

  .masthead nav a::after {
    display: none;
  }

  .hero {
    min-height: auto;
    background-position: 61% center;
  }

  .hero-grid {
    grid-template-columns: 1fr;
    padding-block: 86px 70px;
  }

  .hero-copy {
    max-width: 680px;
  }

  .series-hero-title,
  .hero h1 {
    font-size: clamp(4rem, 15vw, 7rem);
  }

  .hero-book {
    width: min(340px, 80vw);
    min-width: min(340px, 80vw);
  }

  .diary-layout,
  .cta-grid {
    grid-template-columns: 1fr;
  }

  .diary-introduction {
    position: static;
  }

  .card {
    grid-column: span 12;
  }

  .cta-grid {
    min-height: 480px;
    align-content: center;
  }

  .cta::after {
    right: -30px;
    bottom: 8px;
  }
}

@media (max-width: 620px) {
  .shell {
    width: min(100% - 28px, 560px);
  }

  .masthead > .shell > a:first-child,
  .masthead > a:first-child {
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .section {
    padding-block: 72px;
  }

  .section h2,
  .cta h2 {
    font-size: clamp(2.8rem, 13vw, 4.5rem);
  }

  .series-hero-title,
  .hero h1 {
    font-size: clamp(3.65rem, 17vw, 5.7rem);
  }

  .hero .lede {
    font-size: 1.05rem;
  }

  .actions {
    display: grid;
  }

  .button {
    width: 100%;
  }

  .hero-book,
  .series-book {
    width: 84vw;
    min-width: 84vw;
  }

  .list-card,
  .discovery-card {
    grid-column: span 12;
  }

  .dossier {
    padding: 30px 22px;
  }

  .dossier blockquote {
    font-size: clamp(2.5rem, 12vw, 4rem);
  }

  .sanctuary-widget {
    right: 10px;
    bottom: 10px;
    left: 10px;
    width: auto;
  }

  .widget-bar {
    cursor: default;
  }

  .widget-body {
    padding: 12px;
  }

  .widget-grid {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.001ms !important;
  }
}

/* Refined archival treatment: physical case files rather than colour blocks */
.hero-grid {
  grid-template-columns: minmax(0, 0.94fr) minmax(430px, 1.06fr);
}

.hero .carousel-frame {
  max-width: 720px;
  justify-self: end;
}

.carousel-controls,
.series-section .carousel-controls {
  position: relative;
  order: -1;
  justify-content: center;
  gap: 12px;
  margin: 0 0 22px;
  padding: 9px;
  border-block: 1px solid rgba(201, 157, 79, 0.2);
  background: linear-gradient(90deg, transparent, rgba(7, 20, 27, 0.42), transparent);
}

.series-section .carousel-controls {
  background: linear-gradient(90deg, transparent, rgba(7, 20, 27, 0.07), transparent);
}

.carousel-control {
  width: auto;
  min-width: 112px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding-inline: 15px;
  font-size: 0.62rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.carousel-control span[aria-hidden="true"] {
  font-size: 1rem;
  line-height: 1;
}

.carousel-count {
  min-width: 74px;
  padding-inline: 9px;
}

.hero-books {
  padding: 26px 7px 30px;
}

.hero-book {
  width: clamp(218px, 18vw, 278px);
  min-width: clamp(218px, 18vw, 278px);
  margin-top: 15px;
  padding: 12px;
  overflow: visible;
  color: var(--sanctuary-ink);
  border-color: rgba(82, 65, 34, 0.52);
  background:
    linear-gradient(90deg, transparent 0 31px, rgba(158, 59, 53, 0.12) 31px 32px, transparent 32px),
    repeating-linear-gradient(0deg, transparent 0 29px, rgba(23, 59, 66, 0.075) 29px 30px),
    linear-gradient(145deg, #f6eedb, #e4d5b7);
  box-shadow: 11px 13px 0 rgba(4, 15, 21, 0.72), 0 28px 70px rgba(0, 0, 0, 0.38);
}

.hero-book::before {
  z-index: -1;
  inset: -24px auto auto -1px;
  width: 58%;
  height: 25px;
  border: 1px solid rgba(82, 65, 34, 0.52);
  border-bottom: 0;
  background: #e7d7b8;
  clip-path: polygon(0 0, 78% 0, 100% 100%, 0 100%);
}

.hero-book::after {
  position: absolute;
  top: -18px;
  left: 12px;
  content: "SANCTUARY CASE FILE";
  color: rgba(7, 20, 27, 0.68);
  font: 600 0.48rem var(--sanctuary-mono);
  letter-spacing: 0.08em;
}

.hero-book:hover {
  border-color: rgba(201, 157, 79, 0.82);
  box-shadow: 7px 9px 0 rgba(4, 15, 21, 0.82), 0 32px 80px rgba(0, 0, 0, 0.46);
}

.hero-book img {
  aspect-ratio: 0.675;
  border-color: rgba(7, 20, 27, 0.38);
}

.hero-book h2 {
  margin-top: 14px;
  color: var(--sanctuary-ink);
  font-size: clamp(1.55rem, 1.85vw, 2.1rem);
}

.hero-book > p:not(.hero-book-number) {
  color: rgba(7, 20, 27, 0.7);
  font-size: 0.78rem;
}

.hero-book-number {
  color: var(--sanctuary-red);
}

.hero-book .format-link {
  grid-template-columns: 80px 1fr;
  padding: 8px 9px;
  color: var(--sanctuary-ink);
  border-color: rgba(7, 20, 27, 0.19);
  background: rgba(255, 255, 255, 0.2);
  font-size: 0.52rem;
}

.hero-book .format-link strong {
  color: var(--sanctuary-red);
}

.hero-book .format-link span {
  color: rgba(7, 20, 27, 0.58);
}

.hero-book .format-link:hover {
  color: var(--sanctuary-paper-bright);
  border-color: var(--sanctuary-ink);
  background: var(--sanctuary-ink);
}

.hero-book .format-link:hover strong,
.hero-book .format-link:hover span {
  color: var(--sanctuary-paper-bright);
}

.card,
.list-card,
.discovery-card {
  margin-top: 25px;
  overflow: visible;
  color: var(--sanctuary-ink);
  border-color: rgba(82, 65, 34, 0.42);
  background:
    linear-gradient(90deg, transparent 0 42px, rgba(158, 59, 53, 0.1) 42px 43px, transparent 43px),
    repeating-linear-gradient(0deg, transparent 0 32px, rgba(23, 59, 66, 0.065) 32px 33px),
    linear-gradient(145deg, #f7efdc, #e7d9bc);
  box-shadow: 10px 12px 0 rgba(7, 20, 27, 0.15), 0 20px 55px rgba(7, 20, 27, 0.12);
}

.card::before,
.list-card::before,
.discovery-card::before {
  top: -25px;
  left: -1px;
  width: 52%;
  height: 26px;
  border: 1px solid rgba(82, 65, 34, 0.42);
  border-bottom: 0;
  background: #e7d8b9;
  clip-path: polygon(0 0, 80% 0, 100% 100%, 0 100%);
}

.card::after,
.list-card::after,
.discovery-card::after {
  position: absolute;
  top: -19px;
  left: 14px;
  content: "SANCTUARY / ACTIVE FILE";
  color: rgba(7, 20, 27, 0.64);
  font: 600 0.5rem var(--sanctuary-mono);
  letter-spacing: 0.08em;
}

.section-dark .card,
.section-dark .card h3 {
  color: var(--sanctuary-ink);
}

.section-dark .cards > .card {
  color: var(--sanctuary-ink) !important;
  border-color: rgba(82, 65, 34, 0.48) !important;
  background:
    linear-gradient(90deg, transparent 0 42px, rgba(158, 59, 53, 0.11) 42px 43px, transparent 43px),
    repeating-linear-gradient(0deg, transparent 0 32px, rgba(23, 59, 66, 0.075) 32px 33px),
    linear-gradient(145deg, #f7efdc, #e4d3b2) !important;
  box-shadow: 10px 12px 0 rgba(201, 157, 79, 0.16), 0 24px 64px rgba(0, 0, 0, 0.3) !important;
}

.section-dark .cards > .card h3 {
  color: #07141b !important;
}

.section-dark .card p,
.section-dark .card li {
  color: #25373b !important;
}

.discovery-card-acid {
  color: var(--sanctuary-ink);
  border-color: rgba(82, 65, 34, 0.42);
  background:
    linear-gradient(90deg, transparent 0 42px, rgba(158, 59, 53, 0.12) 42px 43px, transparent 43px),
    repeating-linear-gradient(0deg, transparent 0 32px, rgba(23, 59, 66, 0.075) 32px 33px),
    linear-gradient(145deg, #eee0bf, #d8c69f);
}

.discovery-card-acid::after {
  content: "SANCTUARY / INTAKE FILE";
}

.discovery-card-acid a {
  color: var(--sanctuary-red);
}

.series-book {
  width: clamp(245px, 23vw, 318px);
  min-width: clamp(245px, 23vw, 318px);
  position: relative;
  margin-top: 22px;
  overflow: visible;
  background:
    repeating-linear-gradient(0deg, transparent 0 31px, rgba(23, 59, 66, 0.06) 31px 32px),
    linear-gradient(145deg, #f8f0dd, #e5d6b8);
  box-shadow: 10px 11px 0 var(--sanctuary-deep), 0 22px 60px rgba(7, 20, 27, 0.13);
}

.series-book::before {
  position: absolute;
  z-index: -1;
  top: -22px;
  left: -1px;
  width: 54%;
  height: 23px;
  content: "";
  border: 1px solid rgba(82, 65, 34, 0.42);
  border-bottom: 0;
  background: #e6d6b6;
  clip-path: polygon(0 0, 80% 0, 100% 100%, 0 100%);
}

.series-book::after {
  position: absolute;
  top: -17px;
  left: 12px;
  content: "ARCHIVE COPY";
  color: rgba(7, 20, 27, 0.62);
  font: 600 0.48rem var(--sanctuary-mono);
  letter-spacing: 0.08em;
}

.series-book h3 {
  font-size: clamp(1.8rem, 2.35vw, 2.55rem);
}

/* Carry the Sanctuary atmosphere through every internal page */
body:not(:has(.hero)) main {
  position: relative;
  background:
    linear-gradient(rgba(7, 20, 27, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(7, 20, 27, 0.035) 1px, transparent 1px),
    radial-gradient(circle at 82% 8%, rgba(201, 157, 79, 0.12), transparent 24%),
    var(--sanctuary-paper);
  background-size: 34px 34px, 34px 34px, auto, auto;
}

body:not(:has(.hero)) main > section:first-child {
  min-height: 430px;
  display: grid;
  align-items: center;
  color: #fff5df;
  border-bottom: 1px solid rgba(201, 157, 79, 0.32);
  background:
    linear-gradient(90deg, rgba(4, 15, 21, 0.97), rgba(4, 15, 21, 0.67)),
    url("/assets/sanctuary-hero-v2.webp") center 34% / cover;
}

body:not(:has(.hero)) main > section:first-child h1,
body:not(:has(.hero)) main > section:first-child h2,
body:not(:has(.hero)) main > section:first-child h3 {
  color: #fff5df;
  text-shadow: 0 12px 40px rgba(0, 0, 0, 0.34);
}

body:not(:has(.hero)) main > section:first-child p,
body:not(:has(.hero)) main > section:first-child li {
  color: rgba(255, 248, 231, 0.76);
}

body:not(:has(.hero)) main > section:not(:first-child):not(.section-dark):not(.cta) {
  background-color: transparent;
}

body:not(:has(.hero)) main article,
body:not(:has(.hero)) main aside,
body:not(:has(.hero)) main .panel {
  border-color: rgba(82, 65, 34, 0.35);
  box-shadow: 8px 10px 0 rgba(7, 20, 27, 0.08);
}

@media (max-width: 1180px) {
  .hero-grid {
    grid-template-columns: minmax(0, 0.9fr) minmax(400px, 1.1fr);
  }

  .hero-book {
    width: clamp(210px, 22vw, 260px);
    min-width: clamp(210px, 22vw, 260px);
  }
}

@media (max-width: 900px) {
  .hero-grid {
    grid-template-columns: 1fr;
  }

  .hero .carousel-frame {
    width: 100%;
    max-width: none;
    justify-self: stretch;
  }

  .hero-book {
    width: min(248px, 64vw);
    min-width: min(248px, 64vw);
  }
}

@media (max-width: 620px) {
  .carousel-control {
    min-width: 92px;
    padding-inline: 11px;
  }

  .carousel-count {
    min-width: 56px;
    padding-inline: 3px;
  }

  .hero-book,
  .series-book {
    width: 68vw;
    min-width: 68vw;
  }

  body:not(:has(.hero)) main > section:first-child {
    min-height: 360px;
  }
}
