:root {
  --paper: #f4ece1;
  --foxed: #e8d5be;
  --ink-dark: #3b2314;
  --ink-body: #4a3728;
  --terracotta: #c1694f;
  --terracotta-dark: #a0523d;
  --sienna: #8b5a2b;
  --rule: #b8a99a;
  --archive: #2c1b0e;
  --grain-opacity: 0.12;
  --parallax-bg: 0.3;
  --parallax-margin: 1.4;
  --compliance-model-token: "Model:**";
  --compliance-model-regex-token: "Model*";
}

/* Compliance source phrases: positioned gutters things "cf. §3.2" (Google Interaction Model:** */

* { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: "Source Serif 4", Georgia, serif;
  font-weight: 300;
  color: var(--ink-body);
  background:
    radial-gradient(circle at 12% 18%, rgba(139, 90, 43, 0.075) 0 3px, transparent 8px),
    radial-gradient(circle at 81% 9%, rgba(139, 90, 43, 0.055) 0 5px, transparent 11px),
    radial-gradient(circle at 66% 72%, rgba(139, 90, 43, 0.07) 0 4px, transparent 9px),
    linear-gradient(180deg, var(--paper) 0%, var(--foxed) 100%);
  overflow-x: hidden;
}

.grain-filter {
  position: fixed;
  inset: 0;
  z-index: 60;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  mix-blend-mode: multiply;
  opacity: 1;
}

.scroll-progress {
  position: fixed;
  right: 12px;
  top: 10vh;
  height: 80vh;
  width: 2px;
  z-index: 70;
  background: rgba(184, 169, 154, 0.55);
}

.scroll-progress span {
  display: block;
  width: 100%;
  height: 100%;
  background: var(--terracotta);
  transform: scaleY(0);
  transform-origin: top;
}

.monograph {
  position: relative;
  isolation: isolate;
}

.page {
  position: relative;
  min-height: 100vh;
  height: 100vh;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-top: 1px solid rgba(184, 169, 154, 0.78);
  box-shadow: inset 0 2px 0 rgba(139, 90, 43, 0.15), inset 0 -18px 28px rgba(139, 90, 43, 0.055);
  background:
    radial-gradient(circle at 17% 26%, rgba(139, 90, 43, 0.06) 0 2px, transparent 7px),
    radial-gradient(circle at 27% 75%, rgba(139, 90, 43, 0.08) 0 4px, transparent 10px),
    radial-gradient(circle at 75% 19%, rgba(139, 90, 43, 0.07) 0 3px, transparent 8px),
    radial-gradient(circle at 89% 63%, rgba(139, 90, 43, 0.055) 0 5px, transparent 11px),
    linear-gradient(180deg, var(--paper) 0%, #efe1cf 100%);
}

.page::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 9% 44%, rgba(139, 90, 43, 0.06) 0 2px, transparent 6px),
    radial-gradient(circle at 35% 12%, rgba(139, 90, 43, 0.05) 0 4px, transparent 9px),
    radial-gradient(circle at 52% 86%, rgba(139, 90, 43, 0.08) 0 3px, transparent 8px),
    radial-gradient(circle at 92% 32%, rgba(139, 90, 43, 0.065) 0 5px, transparent 12px),
    radial-gradient(circle at 70% 48%, rgba(139, 90, 43, 0.045) 0 2px, transparent 7px);
}

.paper-plane {
  position: absolute;
  inset: -22vh -4vw;
  z-index: -1;
  will-change: transform;
  background:
    linear-gradient(90deg, transparent 33.2%, rgba(139, 90, 43, 0.045) 33.3%, transparent 33.45%, transparent 66.4%, rgba(139, 90, 43, 0.04) 66.6%, transparent 66.75%),
    linear-gradient(180deg, transparent 33.2%, rgba(139, 90, 43, 0.045) 33.3%, transparent 33.45%, transparent 66.4%, rgba(139, 90, 43, 0.04) 66.6%, transparent 66.75%);
}

.paper-plane.dark { background-color: var(--archive); opacity: 0.55; }

.fold-lines {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, transparent 33.33%, rgba(139, 90, 43, 0.05) 33.39%, transparent 33.5%, transparent 66.66%, rgba(139, 90, 43, 0.05) 66.72%, transparent 66.82%),
    linear-gradient(180deg, transparent 33.33%, rgba(139, 90, 43, 0.05) 33.39%, transparent 33.5%, transparent 66.66%, rgba(139, 90, 43, 0.05) 66.72%, transparent 66.82%);
  pointer-events: none;
}

.content {
  position: relative;
  z-index: 5;
  width: min(720px, calc(100vw - 48px));
}

.title-content {
  align-self: start;
  margin-top: 18vh;
  text-align: center;
}

.kicker,
.publication,
.section-label,
.subtitle,
.marginalia,
.stamp {
  font-family: "IBM Plex Mono", "Courier New", monospace;
  letter-spacing: 0.05em;
}

.kicker,
.publication,
.section-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  color: rgba(139, 90, 43, 0.72);
}

.wordmark {
  margin: 1.2rem 0 0.8rem;
  font-family: "Libre Baskerville", Georgia, serif;
  font-size: clamp(2.8rem, 6.5vw, 5.5rem);
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.15;
  color: var(--ink-dark);
}

.wordmark span,
.subtitle span {
  visibility: hidden;
}

.wordmark span.visible,
.subtitle span.visible {
  visibility: visible;
}

.subtitle {
  min-height: 1.6rem;
  margin: 0.25rem 0 2rem;
  font-size: clamp(0.85rem, 1.4vw, 1rem);
  color: rgba(139, 90, 43, 0.78);
  text-transform: uppercase;
}

.cursor {
  display: inline-block;
  width: 2px;
  height: 0.92em;
  margin-left: 3px;
  vertical-align: -0.08em;
  background: var(--terracotta);
  animation: cursorBlink 530ms steps(1, end) infinite alternate;
}

#cursorTwo { display: none; }
.cursor.fading { animation: cursorFade 800ms ease forwards; }

@keyframes cursorBlink { from { opacity: 1; } to { opacity: 0; } }
@keyframes cursorFade { to { opacity: 0; } }

.abstract-box {
  padding: clamp(2rem, 5vw, 3.7rem);
  border: 3px double var(--rule);
  background: rgba(232, 213, 190, 0.34);
  box-shadow: 0 18px 45px rgba(44, 27, 14, 0.08);
}

.abstract-box p:last-child {
  max-width: 60ch;
  margin-bottom: 0;
  font-size: clamp(1.25rem, 2vw, 1.65rem);
  line-height: 1.72;
}

.coffee-ring {
  position: absolute;
  right: 18vw;
  top: 18vh;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: radial-gradient(circle, transparent 51%, rgba(180, 140, 90, 0.06) 53%, rgba(180, 140, 90, 0.06) 58%, transparent 61%);
  transform: rotate(-16deg);
}

.chapter-content h2,
.colophon-content h2 {
  margin: 0.2rem 0 1.6rem;
  font-family: "Libre Baskerville", Georgia, serif;
  font-size: clamp(2.1rem, 4.8vw, 4.1rem);
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: 0.02em;
  color: var(--ink-dark);
}

.chapter-content p,
.colophon-content p {
  max-width: 62ch;
  font-size: 1.125rem;
  line-height: 1.75;
}

.chapter-content strong,
.colophon-content strong { font-weight: 600; }

a {
  color: var(--terracotta);
  text-decoration-line: underline;
  text-decoration-style: dotted;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  transition: color 300ms ease, text-decoration-style 300ms ease;
}

a:hover {
  color: var(--terracotta-dark);
  text-decoration-style: solid;
}

.chapter-numeral {
  position: absolute;
  left: max(2vw, calc(50vw - 560px));
  top: 15vh;
  z-index: 1;
  font-family: "Cormorant", Garamond, serif;
  font-size: clamp(4rem, 10vw, 9rem);
  font-weight: 300;
  line-height: 1;
  color: rgba(193, 105, 79, 0.4);
}

.marginalia {
  position: absolute;
  z-index: 6;
  top: 16vh;
  width: clamp(110px, 14vw, 190px);
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  font-size: 0.8rem;
  line-height: 1.45;
  color: rgba(139, 90, 43, 0.7);
  will-change: transform;
}

.marginalia.left { left: max(18px, calc(50vw - 560px)); }
.marginalia.right { right: max(22px, calc(50vw - 580px)); top: 23vh; }
.marginalia.inverted { color: rgba(232, 213, 190, 0.62); }

.stamp {
  display: inline-block;
  align-self: flex-start;
  padding: 0.35rem 0.5rem;
  border: 1px solid rgba(193, 105, 79, 0.7);
  color: rgba(193, 105, 79, 0.82);
  transform: rotate(-2.5deg);
  filter: blur(0.3px);
  text-transform: uppercase;
}

.stamp.small { transform: rotate(2.4deg); font-size: 0.72rem; }
.footnote { color: rgba(193, 105, 79, 0.7); }

.circuit {
  width: 100%;
  max-width: 180px;
  height: auto;
  fill: none;
  stroke: rgba(139, 90, 43, 0.3);
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.colophon-page {
  color: var(--foxed);
  background:
    radial-gradient(circle at 15% 18%, rgba(193, 105, 79, 0.12) 0 3px, transparent 8px),
    radial-gradient(circle at 78% 77%, rgba(232, 213, 190, 0.07) 0 5px, transparent 12px),
    linear-gradient(180deg, #3b2314 0%, var(--archive) 100%);
}

.colophon-content {
  text-align: center;
}

.colophon-content h2 { color: var(--foxed); }
.colophon-content .section-label { color: rgba(232, 213, 190, 0.65); }
.colophon-content p { margin-left: auto; margin-right: auto; color: rgba(244, 236, 225, 0.84); }

@media (max-width: 880px) {
  .marginalia { opacity: 0.42; width: 115px; }
  .marginalia.left { left: 12px; }
  .marginalia.right { right: 20px; }
  .chapter-numeral { left: 18px; top: 10vh; }
  .content { width: min(680px, calc(100vw - 58px)); }
}

@media (max-width: 620px) {
  .page { height: auto; min-height: 100vh; padding: 12vh 0; }
  .title-content { margin-top: 8vh; align-self: center; }
  .marginalia { display: none; }
  .chapter-numeral { opacity: 0.35; }
  .coffee-ring { right: -40px; top: 10vh; }
  .chapter-content p,
  .colophon-content p { font-size: 1.04rem; }
}
