/* ===========================================================================
   Heartmorrow site: an extension of the in-game "Nocturne" identity:
   a lamplit almanac kept after dark. Deep indigo ink; brass lamplight, rose,
   and moonlight; Fraunces over Hanken with a Spline Sans Mono ledger face.
   Signature: each answer is a record that "lights its lamp" when opened.
   =========================================================================== */
:root {
  --ink: #0e1120;
  --panel: #1a2038;
  --panel-2: #222a48;
  --border: #313a5e;
  --border-soft: #262d4a;
  --border-bright: #41507c;

  --text: #f3ecdd;
  --text-dim: #b7b2c8;
  --text-mute: #7e7a95;

  --brass: #e6b15e;
  --rose: #e88aa6;
  --moon: #9db8de;
  --sage: #8fcf9f;
  --ember: #e07a82;
  --vellum: #ece1c6;

  --halo-1: rgba(230, 177, 94, 0.17);
  --halo-2: rgba(232, 138, 166, 0.12);

  --shadow: 0 22px 50px rgba(4, 6, 16, 0.6);
  --shadow-sm: 0 10px 26px rgba(4, 6, 16, 0.45);
  --glow-warm: 0 0 26px rgba(230, 177, 94, 0.28);

  --font-display: 'Fraunces', Georgia, 'Times New Roman', serif;
  --font-body: 'Hanken Grotesk', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'Spline Sans Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  /* per-section accent (the "light" assigned to each chapter of the almanac) */
  --cat: var(--brass);

  color-scheme: dark;
  scroll-padding-top: 132px;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  color: var(--text);
  background:
    radial-gradient(960px 620px at 88% -10%, color-mix(in oklab, var(--brass) 16%, transparent), transparent 60%),
    radial-gradient(880px 600px at 6% 108%, color-mix(in oklab, var(--rose) 12%, transparent), transparent 60%),
    radial-gradient(820px 520px at 100% -8%, var(--halo-1), transparent 60%),
    radial-gradient(760px 520px at -8% 112%, var(--halo-2), transparent 58%),
    var(--ink);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  line-height: 1.6;
}

a { color: var(--moon); text-decoration: none; }
a:hover { color: #c2d6f1; }

h1, h2, h3 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 560;
  line-height: 1.08;
  letter-spacing: -0.012em;
  color: var(--text);
  font-variation-settings: 'opsz' 40, 'SOFT' 40;
}

code {
  font-family: var(--font-mono);
  font-size: 0.86em;
  color: var(--moon);
  background: rgba(157, 184, 222, 0.08);
  border: 1px solid var(--border-soft);
  border-radius: 5px;
  padding: 0.06em 0.38em;
  white-space: nowrap;
}

:focus-visible { outline: 2px solid var(--moon); outline-offset: 3px; border-radius: 3px; }

.wrap { width: min(940px, 92vw); margin-inline: auto; }

/* small monospace eyebrow: the almanac's hand ----------------------------- */
.kicker {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--cat);
}

/* ============================ top bar ===================================== */
.top {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in oklab, var(--ink) 82%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-soft);
}
.top .wrap {
  display: flex;
  align-items: center;
  gap: 16px;
  height: 60px;
}
.brandmark {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.18rem;
  letter-spacing: -0.01em;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  gap: 9px;
}
.brandmark-icon { width: 26px; height: 26px; border-radius: 6px; display: block; flex: 0 0 auto; }
.top nav { margin-left: auto; display: flex; align-items: center; gap: 22px; }
.top nav a {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.top nav a:hover { color: var(--text); }
.top nav a.cta {
  color: var(--ink);
  background: linear-gradient(180deg, #f0c479, var(--brass));
  padding: 8px 14px;
  border-radius: 7px;
  box-shadow: var(--glow-warm);
}
.top nav a.cta:hover { color: #1a1208; filter: brightness(1.05); }
@media (max-width: 680px) {
  .top nav a.ghost { display: none; }
}

/* ============================== hero ====================================== */
.hero { padding: 64px 0 30px; }
.hero h1 {
  font-size: clamp(2.5rem, 6.4vw, 3.9rem);
  font-weight: 600;
  margin: 16px 0 0;
  font-variation-settings: 'opsz' 144, 'SOFT' 30;
}
.hero h1 em { font-style: italic; color: var(--brass); font-variation-settings: 'opsz' 144, 'SOFT' 60; }
.hero .lede {
  margin: 18px 0 0;
  max-width: 60ch;
  font-size: 1.12rem;
  color: var(--text-dim);
}
.hero .lede b { color: var(--text); font-weight: 600; }

/* search ledger ------------------------------------------------------------ */
.search-row { margin-top: 30px; display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.search {
  position: relative;
  flex: 1 1 320px;
  min-width: 240px;
}
.search input {
  width: 100%;
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--text);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 13px 16px 13px 44px;
  box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(243,236,221,0.04);
}
.search input::placeholder { color: var(--text-mute); }
.search input:focus { outline: none; border-color: var(--brass); box-shadow: var(--glow-warm); }
.search .icon {
  position: absolute; left: 15px; top: 50%; transform: translateY(-50%);
  color: var(--text-mute); pointer-events: none; font-size: 1.05rem;
}
.toolbtn {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 11px 14px;
  cursor: pointer;
}
.toolbtn:hover { color: var(--text); border-color: var(--border-bright); }

/* =========================== sticky chapter nav =========================== */
.chapters {
  position: sticky;
  top: 60px;
  z-index: 40;
  background: color-mix(in oklab, var(--ink) 80%, transparent);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--border-soft);
  border-bottom: 1px solid var(--border-soft);
}
.chapters .wrap {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 10px 0;
  scrollbar-width: none;
}
.chapters .wrap::-webkit-scrollbar { display: none; }
.chip {
  flex: 0 0 auto;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  color: var(--text-dim);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 7px 14px;
  white-space: nowrap;
  transition: color .2s, border-color .2s, background .2s;
}
.chip:hover { color: var(--text); border-color: var(--border-bright); }
.chip.active { color: var(--ink); background: var(--cat-chip, var(--brass)); border-color: transparent; }

/* ============================== chapters ================================== */
main { padding: 18px 0 40px; }
.chapter { padding: 34px 0 6px; scroll-margin-top: 124px; }

.chapter-head { display: flex; align-items: center; gap: 16px; margin-bottom: 22px; }
.chapter-head .marker {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--cat);
  border: 1px solid color-mix(in oklab, var(--cat) 40%, var(--border));
  border-radius: 7px;
  padding: 5px 9px;
  flex: 0 0 auto;
}
.chapter-head .titles { min-width: 0; }
.chapter-head h2 { font-size: 1.5rem; }
.chapter-head .sub { font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-mute); margin-top: 3px; }
/* brass rule trailing to a star: the signature seam from the game UI */
.chapter-head .seam { flex: 1; height: 1px; min-width: 24px; background: linear-gradient(90deg, color-mix(in oklab, var(--cat) 55%, transparent), transparent); }
.chapter-head .seam-star { color: var(--cat); font-size: 0.8rem; opacity: 0.8; flex: 0 0 auto; }

/* a Q&A record ------------------------------------------------------------- */
.qa {
  border: 1px solid var(--border);
  border-left: 2px solid var(--border);
  border-radius: 10px;
  background: color-mix(in oklab, var(--panel) 90%, transparent);
  margin-bottom: 10px;
  transition: border-color .25s, background .25s, box-shadow .35s;
  scroll-margin-top: 128px;
}
.qa:hover { border-color: var(--border-bright); }
.qa[open] {
  border-left-color: var(--cat);
  background: var(--panel);
  box-shadow: var(--shadow-sm), 0 0 0 1px color-mix(in oklab, var(--cat) 22%, transparent);
}
.qa summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 17px 18px;
  font-weight: 600;
  font-size: 1.04rem;
  color: var(--text);
}
.qa summary::-webkit-details-marker { display: none; }
.qa summary:hover { color: #fff; }
/* the lamp: a + that becomes a lit star when the record is open */
.qa .lamp {
  flex: 0 0 auto;
  width: 24px; height: 24px;
  margin-top: 1px;
  display: grid; place-items: center;
  font-family: var(--font-mono);
  color: var(--cat);
  border: 1px solid color-mix(in oklab, var(--cat) 38%, var(--border));
  border-radius: 6px;
  font-size: 0.95rem; line-height: 1;
  transition: background .25s, box-shadow .25s, color .2s;
}
.qa .lamp::before { content: '+'; }
.qa[open] .lamp { background: color-mix(in oklab, var(--cat) 16%, transparent); box-shadow: var(--glow-warm); color: var(--text); }
.qa[open] .lamp::before { content: '\2726'; } /* ✦ */
.qa .answer { padding: 0 18px 4px 56px; }
.qa .answer > * { margin: 0 0 0.9em; }
.qa .answer p { color: var(--text-dim); line-height: 1.72; }
.qa .answer p:last-child { margin-bottom: 18px; }
.qa .answer b, .qa .answer strong { color: var(--text); font-weight: 600; }
.qa .answer ul { margin: 0 0 18px; padding-left: 18px; color: var(--text-dim); }
.qa .answer li { margin: 0.4em 0; line-height: 1.6; }
.qa .answer li::marker { color: var(--cat); }
.qa .answer .tag { /* an inline 'light' name like Affection */ color: var(--vellum); font-weight: 500; }

@media (max-width: 560px) {
  .qa summary { font-size: 0.98rem; padding: 15px 14px; }
  .qa .answer { padding-left: 14px; padding-right: 14px; }
}

/* steps inline code block (install) --------------------------------------- */
.codeblock {
  font-family: var(--font-mono);
  font-size: 0.84rem;
  color: var(--text);
  background: #0b0e1c;
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 14px 16px;
  overflow-x: auto;
  line-height: 1.7;
  margin: 0 0 18px;
}
.codeblock .c { color: var(--text-mute); } /* comment */

/* troubleshooting ledger --------------------------------------------------- */
.ledger { display: grid; gap: 1px; background: var(--border-soft); border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.ledger .row { display: grid; grid-template-columns: minmax(180px, 0.9fr) 1.6fr; gap: 0; background: var(--panel); }
.ledger .row:nth-child(odd) { background: color-mix(in oklab, var(--panel) 88%, transparent); }
.ledger .cell { padding: 14px 16px; }
.ledger .prob { font-weight: 600; color: var(--text); border-right: 1px solid var(--border-soft); }
.ledger .fix { color: var(--text-dim); }
.ledger .fix code { white-space: normal; }
@media (max-width: 620px) {
  .ledger .row { grid-template-columns: 1fr; }
  .ledger .prob { border-right: none; border-bottom: 1px solid var(--border-soft); padding-bottom: 8px; }
  .ledger .fix { padding-top: 8px; }
}

/* no results --------------------------------------------------------------- */
.noresults { display: none; text-align: center; padding: 50px 0; color: var(--text-mute); font-family: var(--font-mono); letter-spacing: 0.04em; }
.noresults.show { display: block; }

/* footer ------------------------------------------------------------------- */
footer { border-top: 1px solid var(--border-soft); margin-top: 30px; padding: 40px 0 60px; }
footer .wrap { display: flex; flex-wrap: wrap; gap: 24px 40px; align-items: baseline; }
footer .lamps { font-family: var(--font-display); font-style: italic; font-size: 1.15rem; color: var(--text-dim); }
footer .lamps .flame { color: var(--brass); font-style: normal; }
footer .flinks { margin-left: auto; display: flex; gap: 24px; flex-wrap: wrap; }
footer .flinks a { font-family: var(--font-mono); font-size: 0.74rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-dim); }
footer .flinks a:hover { color: var(--text); }
footer .fine { width: 100%; color: var(--text-mute); font-size: 0.82rem; margin-top: 6px; }

/* ============================== splash / home ============================ */
.home-main { padding: 0; }
.splash {
  min-height: calc(100dvh - 61px); /* viewport minus the sticky top bar */
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 48px 0 72px;
}
.splash-inner { width: min(720px, 92vw); display: flex; flex-direction: column; align-items: center; }
.splash-logo {
  width: min(560px, 86vw);
  height: auto;
  border-radius: 16px;
  border: 1px solid var(--border-soft);
  box-shadow: var(--shadow), 0 0 64px color-mix(in oklab, var(--brass) 13%, transparent);
}
.splash-tagline { margin-top: 28px; }
.splash-blurb {
  margin: 16px 0 0;
  max-width: 56ch;
  font-size: 1.13rem;
  line-height: 1.72;
  color: var(--text-dim);
}
.splash-blurb b { color: var(--text); font-weight: 600; }
.splash-actions { margin-top: 30px; display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; align-items: center; }
.btn {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 12px 20px;
  border-radius: 9px;
  border: 1px solid transparent;
  transition: color .2s, background .2s, border-color .2s, filter .2s;
}
.btn-primary { color: var(--ink); background: linear-gradient(180deg, #f0c479, var(--brass)); box-shadow: var(--glow-warm); }
.btn-primary:hover { color: #1a1208; filter: brightness(1.05); }
.btn-ghost { color: var(--text); background: var(--panel); border-color: var(--border); }
.btn-ghost:hover { color: #fff; border-color: var(--border-bright); }
.btn-text { font-family: var(--font-body); text-transform: none; font-size: 0.95rem; letter-spacing: 0; color: var(--moon); padding: 12px 10px; }
.btn-text:hover { color: #c2d6f1; }
.splash-points {
  margin: 34px 0 0; padding: 0; list-style: none;
  display: flex; flex-wrap: wrap; gap: 10px 26px; justify-content: center;
  font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.04em; color: var(--text-mute);
}
.splash-points li { display: inline-flex; align-items: center; gap: 8px; }
.splash-points li::before { content: '\2726'; color: var(--brass); font-size: 0.72em; }
@media (max-width: 560px) {
  .splash { min-height: 0; padding: 36px 0 52px; }
  .splash-blurb { font-size: 1.04rem; }
  .btn { font-size: 0.72rem; padding: 11px 16px; }
}

/* ========================= screenshot showcase ========================== */
.showcase {
  position: relative;
  overflow: hidden;
  padding: 82px 0 96px;
  border-top: 1px solid var(--border-soft);
  background:
    radial-gradient(620px 340px at 72% 38%, color-mix(in oklab, var(--brass) 8%, transparent), transparent 68%),
    color-mix(in oklab, var(--panel) 22%, transparent);
}
.showcase::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.38;
  background-image: linear-gradient(90deg, transparent 49.9%, color-mix(in oklab, var(--border) 26%, transparent) 50%, transparent 50.1%);
  background-size: 82px 100%;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 20%, #000 80%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 20%, #000 80%, transparent);
}
.showcase-wrap { position: relative; width: min(1180px, 94vw); margin-inline: auto; }
.showcase-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 430px);
  align-items: end;
  gap: 36px;
  width: min(980px, 100%);
  margin-inline: auto;
}
.showcase-kicker { --cat: var(--brass); margin: 0 0 13px; }
.showcase h2 {
  font-size: clamp(2rem, 4.2vw, 3.25rem);
  font-variation-settings: 'opsz' 90, 'SOFT' 40;
}
.showcase-copy { margin: 0 0 4px; color: var(--text-dim); line-height: 1.72; }
.screenshot-carousel { margin-top: 34px; }
.carousel-frame {
  position: relative;
  padding: 9px;
  border: 1px solid var(--border-bright);
  border-radius: 16px;
  background: linear-gradient(145deg, color-mix(in oklab, var(--panel-2) 86%, #fff 2%), #0a0d19);
  box-shadow: var(--shadow), 0 0 54px color-mix(in oklab, var(--brass) 9%, transparent);
}
.carousel-frame::after {
  content: '';
  position: absolute;
  z-index: 2;
  inset: 9px;
  pointer-events: none;
  border-radius: 9px;
  box-shadow: inset 0 0 0 1px rgba(243, 236, 221, 0.08), inset 0 -34px 70px rgba(4, 6, 16, 0.12);
}
.carousel-viewport {
  position: relative;
  z-index: 1;
  overflow-x: auto;
  border-radius: 9px;
  background: #090c18;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  overscroll-behavior-x: contain;
}
.carousel-viewport::-webkit-scrollbar { display: none; }
.carousel-track { display: flex; }
.carousel-slide {
  flex: 0 0 100%;
  min-width: 0;
  margin: 0;
  scroll-snap-align: start;
  scroll-snap-stop: always;
}
.carousel-slide picture { display: block; }
.carousel-slide img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: contain;
  background: #090c18;
}
.carousel-control {
  display: none;
  position: absolute;
  z-index: 4;
  top: 50%;
  width: 46px;
  height: 46px;
  place-items: center;
  transform: translateY(-50%);
  border: 1px solid color-mix(in oklab, var(--brass) 42%, var(--border));
  border-radius: 50%;
  color: var(--text);
  background: color-mix(in oklab, var(--ink) 84%, transparent);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(10px);
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 1.1rem;
  transition: color .2s, border-color .2s, background .2s, opacity .2s, transform .2s;
}
.screenshot-carousel.is-enhanced .carousel-control { display: grid; }
.carousel-control:hover:not(:disabled) {
  color: var(--ink);
  border-color: var(--brass);
  background: var(--brass);
  transform: translateY(-50%) scale(1.04);
}
.carousel-control:disabled { opacity: 0.28; cursor: default; }
.carousel-prev { left: 24px; }
.carousel-next { right: 24px; }
.carousel-ledger {
  display: flex;
  align-items: center;
  gap: 24px;
  min-height: 42px;
  padding: 14px 12px 0;
}
.carousel-caption {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin: 0;
  color: var(--text-dim);
  font-family: var(--font-display);
  font-size: 1.05rem;
}
.carousel-count {
  color: var(--brass);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.12em;
}
.carousel-dots {
  display: none;
  align-items: center;
  justify-content: flex-end;
  margin-left: auto;
}
.screenshot-carousel.is-enhanced .carousel-dots { display: flex; }
.carousel-dot {
  position: relative;
  width: 18px;
  height: 24px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}
.carousel-dot::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 5px;
  height: 5px;
  border-radius: 999px;
  background: var(--text-mute);
  transform: translate(-50%, -50%);
  transition: width .2s, background .2s, box-shadow .2s;
}
.carousel-dot:hover::before { background: var(--text-dim); }
.carousel-dot[aria-current="true"]::before {
  width: 13px;
  background: var(--brass);
  box-shadow: 0 0 12px rgba(230, 177, 94, 0.5);
}

@media (max-width: 760px) {
  .showcase { padding: 62px 0 72px; }
  .showcase-head { grid-template-columns: 1fr; gap: 14px; }
  .showcase-copy { max-width: 58ch; }
  .screenshot-carousel { margin-top: 26px; }
  .carousel-control { width: 40px; height: 40px; }
  .carousel-prev { left: 16px; }
  .carousel-next { right: 16px; }
  .carousel-ledger { align-items: flex-start; flex-direction: column; gap: 4px; padding-inline: 4px; }
  .carousel-dots { justify-content: flex-start; margin-left: -4px; max-width: 100%; overflow-x: auto; }
}

@media (max-width: 480px) {
  .showcase-wrap { width: min(100% - 20px, 1180px); }
  .carousel-frame { padding: 5px; border-radius: 11px; }
  .carousel-frame::after { inset: 5px; border-radius: 6px; }
  .carousel-viewport { border-radius: 6px; }
  .carousel-control { width: 36px; height: 36px; font-size: 0.95rem; }
  .carousel-prev { left: 10px; }
  .carousel-next { right: 10px; }
}

/* ====================== what makes it different ========================= */
.difference {
  position: relative;
  padding: 92px 0;
  border-top: 1px solid var(--border-soft);
  background: color-mix(in oklab, var(--panel) 16%, transparent);
}
.difference-spread {
  display: grid;
  grid-template-columns: minmax(0, 0.88fr) minmax(0, 1.12fr);
  gap: clamp(52px, 8vw, 96px);
  align-items: start;
}
.difference-intro { position: sticky; top: 94px; }
.difference-intro .kicker { --cat: var(--moon); margin: 0 0 15px; }
.difference-intro h2 {
  max-width: 13ch;
  font-size: clamp(2rem, 4vw, 3.1rem);
  font-variation-settings: 'opsz' 90, 'SOFT' 45;
}
.difference-intro > p:not(.kicker) {
  max-width: 48ch;
  margin: 22px 0 0;
  color: var(--text-dim);
  line-height: 1.75;
}
.text-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 24px;
  color: var(--moon);
  font-family: var(--font-mono);
  font-size: 0.73rem;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}
.text-link span { transition: transform .2s; }
.text-link:hover span { transform: translateX(3px); }
.memory-ledger {
  position: relative;
  padding-left: 34px;
}
.memory-ledger::before {
  content: '';
  position: absolute;
  left: 6px;
  top: 10px;
  bottom: 12px;
  width: 1px;
  background: linear-gradient(var(--moon), var(--rose) 48%, var(--brass));
  opacity: 0.52;
}
.memory-record {
  position: relative;
  padding: 0 0 36px 20px;
  margin-bottom: 34px;
  border-bottom: 1px solid var(--border-soft);
}
.memory-record:last-child { padding-bottom: 0; margin-bottom: 0; border-bottom: 0; }
.memory-pip {
  position: absolute;
  left: -34px;
  top: 7px;
  width: 12px;
  height: 12px;
  border: 2px solid var(--record-light);
  background: var(--ink);
  box-shadow: 0 0 18px color-mix(in oklab, var(--record-light) 48%, transparent);
  transform: rotate(45deg);
}
.memory-label,
.platform-label,
.privacy-label,
.page-updated {
  margin: 0;
  color: var(--record-light, var(--platform-light, var(--brass)));
  font-family: var(--font-mono);
  font-size: 0.67rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}
.memory-record h3 { margin-top: 9px; font-size: clamp(1.45rem, 2.5vw, 2rem); }
.memory-record > p:last-child { margin: 12px 0 0; color: var(--text-dim); line-height: 1.72; }

/* ======================= guide and content pages ========================= */
.guide-page { padding: 0; }
.page-hero {
  position: relative;
  overflow: hidden;
  padding: clamp(72px, 10vw, 112px) 0 clamp(66px, 9vw, 96px);
  border-bottom: 1px solid var(--border-soft);
}
.page-hero::after {
  content: '';
  position: absolute;
  width: 680px;
  height: 680px;
  right: -220px;
  top: -330px;
  border: 1px solid color-mix(in oklab, var(--page-light, var(--brass)) 18%, transparent);
  border-radius: 50%;
  box-shadow:
    0 0 0 70px color-mix(in oklab, var(--page-light, var(--brass)) 5%, transparent),
    0 0 0 150px color-mix(in oklab, var(--page-light, var(--brass)) 3%, transparent);
  pointer-events: none;
}
.page-hero-install { --page-light: var(--brass); }
.page-hero-privacy { --page-light: var(--sage); }
.page-hero-contact { --page-light: var(--rose); }
.page-hero-inner { position: relative; z-index: 1; }
.page-hero .kicker { --cat: var(--page-light); margin: 0 0 16px; }
.page-hero h1 {
  max-width: 13ch;
  font-size: clamp(3rem, 7.4vw, 5.4rem);
  font-variation-settings: 'opsz' 144, 'SOFT' 38;
}
.page-hero .lede {
  max-width: 63ch;
  margin: 22px 0 0;
  color: var(--text-dim);
  font-size: 1.12rem;
  line-height: 1.76;
}
.page-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 30px; }
.page-updated { --record-light: var(--text-mute); margin-top: 26px; }
.guide-section { padding: 82px 0; }
.guide-section-soft {
  border-top: 1px solid var(--border-soft);
  border-bottom: 1px solid var(--border-soft);
  background: color-mix(in oklab, var(--panel) 34%, transparent);
}
.section-intro {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(280px, 0.65fr);
  gap: 34px 72px;
  align-items: end;
  margin-bottom: 38px;
}
.section-intro .kicker { --cat: var(--brass); grid-column: 1 / -1; margin: 0 0 -20px; }
.section-intro h2 { font-size: clamp(2rem, 4vw, 3rem); }
.section-intro > p:last-child { margin: 0 0 3px; color: var(--text-dim); line-height: 1.72; }
.install-steps { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--border); }
.install-step {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 24px;
  padding: 40px 0 44px;
  border-bottom: 1px solid var(--border);
}
.step-marker {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  color: var(--brass);
  border: 1px solid color-mix(in oklab, var(--brass) 45%, var(--border));
  background: color-mix(in oklab, var(--panel) 74%, transparent);
  clip-path: polygon(12px 0, 100% 0, 100% calc(100% - 12px), calc(100% - 12px) 100%, 0 100%, 0 12px);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
}
.step-body h3 { font-size: clamp(1.55rem, 3vw, 2.15rem); }
.step-body > p { max-width: 68ch; margin: 12px 0 18px; color: var(--text-dim); line-height: 1.72; }
.step-body > p b { color: var(--text); }
.step-body > .codeblock { max-width: 700px; }
.platform-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  margin-top: 24px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--border-soft);
}
.platform-record {
  position: relative;
  min-width: 0;
  padding: 24px 20px 20px;
  background: var(--panel);
}
.platform-record::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 2px;
  background: var(--platform-light);
  box-shadow: 0 0 16px color-mix(in oklab, var(--platform-light) 45%, transparent);
}
.platform-record h4 { margin: 7px 0 14px; color: var(--text); font-family: var(--font-display); font-size: 1.25rem; }
.platform-record .codeblock { margin-bottom: 0; padding: 12px; font-size: 0.73rem; }
.platform-record > p:last-child { margin: 14px 0 0; color: var(--text-dim); font-size: 0.88rem; line-height: 1.6; }
.launch-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 22px; }
.launch-grid .platform-label { --platform-light: var(--moon); margin-bottom: 8px; }
.launch-grid .codeblock { margin: 0; }
.manual-path { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 0.8fr); gap: 56px; align-items: center; }
.manual-path .kicker { --cat: var(--moon); margin: 0 0 12px; }
.manual-path h2 { font-size: clamp(1.9rem, 4vw, 2.8rem); }
.manual-path p:not(.kicker) { max-width: 52ch; margin: 15px 0 0; color: var(--text-dim); }
.manual-path .codeblock { margin: 0; }
.compatibility-note { padding: 30px 0 4px; }
.compatibility-note p { margin: 0; color: var(--text-mute); font-size: 0.88rem; }
.compatibility-note b { color: var(--text-dim); }

/* ============================== privacy ================================== */
.privacy-section { padding: 54px 0 84px; }
.privacy-ledger { border-top: 1px solid var(--border); }
.privacy-record {
  display: grid;
  grid-template-columns: minmax(250px, 0.78fr) minmax(0, 1.22fr);
  gap: clamp(36px, 7vw, 86px);
  padding: 42px 0;
  border-bottom: 1px solid var(--border);
}
.privacy-heading { display: flex; align-items: flex-start; gap: 16px; }
.privacy-mark {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  color: var(--record-light);
  border: 1px solid color-mix(in oklab, var(--record-light) 42%, var(--border));
  border-radius: 8px;
  background: color-mix(in oklab, var(--record-light) 7%, transparent);
  box-shadow: 0 0 18px color-mix(in oklab, var(--record-light) 16%, transparent);
}
.privacy-label { color: var(--record-light); }
.privacy-heading h2 { margin-top: 7px; font-size: clamp(1.45rem, 3vw, 2rem); }
.privacy-copy p { margin: 0 0 14px; color: var(--text-dim); line-height: 1.75; }
.privacy-copy p:last-child { margin-bottom: 0; }
.privacy-copy a { text-decoration: underline; text-decoration-color: color-mix(in oklab, var(--moon) 45%, transparent); text-underline-offset: 3px; }
.privacy-contact {
  padding: 60px 0;
  border-top: 1px solid var(--border-soft);
  background: color-mix(in oklab, var(--panel) 32%, transparent);
}
.privacy-contact-inner {
  display: grid;
  grid-template-columns: minmax(210px, 0.75fr) minmax(280px, 1fr) auto;
  gap: 34px 54px;
  align-items: center;
}
.privacy-contact .kicker { --cat: var(--rose); margin: 0 0 8px; }
.privacy-contact h2 { font-size: 1.7rem; }
.privacy-contact p { margin: 0; color: var(--text-dim); }

/* ============================== contact ================================= */
.contact-section { padding: 72px 0 92px; }
.contact-intro { max-width: 650px; margin-bottom: 34px; }
.contact-intro .kicker { --cat: var(--rose); margin: 0 0 12px; }
.contact-intro h2 { font-size: clamp(2rem, 4vw, 3rem); }
.contact-routes {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}
.contact-record {
  position: relative;
  display: flex;
  min-height: 390px;
  flex-direction: column;
  padding: clamp(26px, 4vw, 38px);
  overflow: hidden;
  border: 1px solid var(--border);
  border-top-color: color-mix(in oklab, var(--contact-light) 58%, var(--border));
  border-radius: 12px;
  background:
    linear-gradient(145deg, color-mix(in oklab, var(--contact-light) 8%, transparent), transparent 42%),
    var(--panel);
  box-shadow: var(--shadow-sm);
}
.contact-record::after {
  content: '';
  position: absolute;
  width: 150px;
  height: 150px;
  right: -76px;
  bottom: -76px;
  border: 1px solid color-mix(in oklab, var(--contact-light) 24%, transparent);
  transform: rotate(45deg);
  box-shadow: 0 0 34px color-mix(in oklab, var(--contact-light) 8%, transparent);
  pointer-events: none;
}
.contact-record-head { display: flex; align-items: center; gap: 12px; }
.contact-mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  color: var(--contact-light);
  border: 1px solid color-mix(in oklab, var(--contact-light) 44%, var(--border));
  border-radius: 8px;
  background: color-mix(in oklab, var(--contact-light) 8%, transparent);
  box-shadow: 0 0 18px color-mix(in oklab, var(--contact-light) 16%, transparent);
}
.contact-label {
  margin: 0;
  color: var(--contact-light);
  font-family: var(--font-mono);
  font-size: 0.67rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}
.contact-record h2 { margin-top: 24px; font-size: clamp(1.7rem, 3vw, 2.25rem); }
.contact-record > p {
  margin: 15px 0 28px;
  color: var(--text-dim);
  line-height: 1.75;
}
.contact-record .btn { align-self: flex-start; margin-top: auto; }
.contact-email {
  color: var(--text);
  text-decoration: underline;
  text-decoration-color: color-mix(in oklab, var(--moon) 54%, transparent);
  text-underline-offset: 3px;
}

/* ============================== journal ================================= */
.journal-page,
.journal-post { --cat: var(--brass); }
.journal-hero {
  position: relative;
  overflow: hidden;
  padding: clamp(76px, 11vw, 124px) 0 clamp(68px, 9vw, 104px);
  border-bottom: 1px solid var(--border-soft);
  background:
    linear-gradient(90deg, transparent 49.9%, color-mix(in oklab, var(--border) 22%, transparent) 50%, transparent 50.1%),
    radial-gradient(620px 420px at 78% 40%, color-mix(in oklab, var(--brass) 10%, transparent), transparent 70%);
  background-size: 94px 100%, auto;
}
.journal-hero::after {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  right: max(4vw, calc((100vw - 940px) / 2));
  top: 42px;
  border: 1px solid var(--brass);
  box-shadow: 0 0 22px color-mix(in oklab, var(--brass) 44%, transparent);
  transform: rotate(45deg);
}
.journal-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(240px, 0.55fr);
  gap: clamp(36px, 5vw, 58px);
  align-items: end;
}
.journal-hero .kicker { margin: 0 0 16px; }
.journal-hero h1 {
  font-size: clamp(2.85rem, 7.2vw, 5.1rem);
  font-variation-settings: 'opsz' 144, 'SOFT' 38;
}
.journal-hero h1 em { color: var(--brass); font-weight: 500; }
.journal-intro { padding-bottom: 8px; }
.journal-intro > p {
  margin: 0;
  color: var(--text-dim);
  font-size: 1.08rem;
  line-height: 1.78;
}
.journal-feed-link,
.journal-read {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--moon);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}
.journal-feed-link { margin-top: 24px; }
.journal-feed-link span,
.journal-read span { transition: transform .2s; }
.journal-feed-link:hover span,
.journal-read:hover span { transform: translateX(3px); }
.journal-archive { padding: clamp(64px, 9vw, 96px) 0 102px; }
.journal-archive-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px 30px;
  align-items: end;
  padding-bottom: 26px;
  border-bottom: 1px solid var(--border-bright);
}
.journal-archive-head .kicker { grid-column: 1 / -1; margin: 0; }
.journal-archive-head h2 { font-size: clamp(2rem, 4vw, 3rem); }
.journal-archive-head > p:last-child {
  margin: 0 0 5px;
  color: var(--text-mute);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.journal-ledger { position: relative; }
.journal-card {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: clamp(28px, 6vw, 68px);
  padding: clamp(38px, 6vw, 58px) 0;
  border-bottom: 1px solid var(--border);
}
.journal-card-date,
.post-date-seal {
  display: flex;
  flex-direction: column;
  align-items: center;
  align-self: start;
  color: var(--brass);
  border: 1px solid color-mix(in oklab, var(--brass) 38%, var(--border));
  background: color-mix(in oklab, var(--panel) 74%, transparent);
  box-shadow: 0 0 28px color-mix(in oklab, var(--brass) 8%, transparent);
  clip-path: polygon(13px 0, 100% 0, 100% calc(100% - 13px), calc(100% - 13px) 100%, 0 100%, 0 13px);
}
.journal-card-date { width: 78px; padding: 13px 8px 15px; }
.journal-card-date span,
.post-date-seal span {
  font-family: var(--font-mono);
  font-size: 0.61rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}
.journal-card-date strong,
.post-date-seal strong {
  margin: 1px 0 2px;
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 500;
  line-height: 1;
}
.journal-card-category {
  margin: 0 0 10px;
  color: var(--rose);
  font-family: var(--font-mono);
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.journal-card h3 { max-width: 24ch; font-size: clamp(1.65rem, 3.4vw, 2.35rem); }
.journal-card h3 a { color: var(--text); }
.journal-card h3 a:hover { color: var(--brass); }
.journal-card-copy > p:not(.journal-card-category) {
  max-width: 64ch;
  margin: 15px 0 18px;
  color: var(--text-dim);
  line-height: 1.75;
}
.journal-empty {
  padding: 58px 0;
  color: var(--text-mute);
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.2rem;
}

/* individual journal entry ------------------------------------------------ */
.post-hero {
  padding: clamp(72px, 10vw, 112px) 0 clamp(62px, 8vw, 92px);
  border-bottom: 1px solid var(--border-soft);
  background: radial-gradient(640px 420px at 22% 22%, color-mix(in oklab, var(--rose) 9%, transparent), transparent 72%);
}
.post-hero-grid {
  display: grid;
  grid-template-columns: 118px minmax(0, 1fr);
  gap: clamp(34px, 7vw, 82px);
  align-items: start;
}
.post-date-seal { width: 102px; padding: 18px 10px 21px; }
.post-date-seal strong { font-size: 2.8rem; }
.post-heading .kicker { --cat: var(--rose); margin: 4px 0 15px; }
.post-heading h1 {
  max-width: 18ch;
  font-size: clamp(2.7rem, 6.4vw, 4.8rem);
  font-variation-settings: 'opsz' 144, 'SOFT' 38;
}
.post-deck {
  max-width: 62ch;
  margin: 22px 0 0;
  color: var(--text-dim);
  font-size: 1.12rem;
  line-height: 1.76;
}
.post-byline {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 24px;
  color: var(--text-mute);
  font-family: var(--font-mono);
  font-size: 0.67rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.post-body {
  width: min(720px, 88vw);
  padding: clamp(58px, 8vw, 88px) 0 82px;
  color: var(--text-dim);
  font-size: 1.06rem;
  line-height: 1.82;
}
.post-body > :first-child { margin-top: 0; }
.post-body > :last-child { margin-bottom: 0; }
.post-body p { margin: 0 0 1.35em; }
.post-body h2,
.post-body h3 { color: var(--text); scroll-margin-top: 90px; }
.post-body h2 { margin: 2.1em 0 0.72em; font-size: clamp(1.75rem, 3.6vw, 2.35rem); }
.post-body h3 { margin: 1.8em 0 0.65em; font-size: 1.4rem; }
.post-body strong { color: var(--text); }
.post-body a {
  text-decoration: underline;
  text-decoration-color: color-mix(in oklab, var(--moon) 48%, transparent);
  text-underline-offset: 3px;
}
.post-body ul,
.post-body ol { margin: 0 0 1.5em; padding-left: 1.3em; }
.post-body li { margin: 0.42em 0; padding-left: 0.25em; }
.post-body li::marker { color: var(--brass); }
.post-body blockquote {
  margin: 2em 0;
  padding: 5px 0 5px 24px;
  border-left: 2px solid var(--brass);
  color: var(--text);
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-style: italic;
}
.post-body img { display: block; max-width: 100%; height: auto; margin: 2.2em auto; border-radius: 10px; box-shadow: var(--shadow-sm); }
.post-after {
  width: min(720px, 88vw);
  padding: 38px 0 72px;
  border-top: 1px solid var(--border-bright);
}
.post-after .kicker { --cat: var(--moon); margin: 0 0 9px; }
.post-after h2 { font-size: clamp(1.65rem, 3vw, 2.2rem); }
.post-after-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }

/* ============================== 404 ====================================== */
.not-found {
  position: relative;
  min-height: calc(100dvh - 61px);
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: 72px 20px;
  text-align: center;
  background:
    radial-gradient(580px 360px at 50% 43%, color-mix(in oklab, var(--rose) 10%, transparent), transparent 70%),
    radial-gradient(440px 300px at 50% 43%, color-mix(in oklab, var(--brass) 8%, transparent), transparent 65%);
}
.not-found-inner { position: relative; z-index: 1; max-width: 670px; }
.not-found-number {
  position: absolute;
  z-index: -1;
  left: 50%;
  top: 42%;
  color: transparent;
  -webkit-text-stroke: 1px color-mix(in oklab, var(--brass) 20%, transparent);
  font-family: var(--font-display);
  font-size: clamp(12rem, 34vw, 23rem);
  font-weight: 600;
  line-height: 0.7;
  transform: translate(-50%, -50%);
  opacity: 0.7;
}
.not-found .kicker { --cat: var(--brass); margin: 0 0 16px; }
.not-found h1 { font-size: clamp(2.7rem, 7vw, 4.8rem); }
.not-found p:not(.kicker) { max-width: 52ch; margin: 22px auto 0; color: var(--text-dim); font-size: 1.08rem; }
.not-found .page-actions { justify-content: center; }

@media (max-width: 820px) {
  .difference-spread { grid-template-columns: 1fr; gap: 52px; }
  .difference-intro { position: static; }
  .difference-intro h2 { max-width: 16ch; }
  .platform-grid { grid-template-columns: 1fr; }
  .section-intro { grid-template-columns: 1fr; gap: 14px; }
  .section-intro .kicker { grid-column: auto; margin-bottom: 0; }
  .privacy-record { grid-template-columns: 1fr; gap: 24px; }
  .privacy-contact-inner { grid-template-columns: 1fr; }
  .privacy-contact .btn { justify-self: start; }
  .contact-routes { grid-template-columns: 1fr; }
  .contact-record { min-height: 330px; }
  .journal-hero-grid { grid-template-columns: 1fr; gap: 32px; }
  .journal-hero h1 { font-size: clamp(2.5rem, 10.4vw, 3.4rem); }
  .journal-intro { max-width: 60ch; }
}

@media (max-width: 620px) {
  .difference { padding: 66px 0; }
  .memory-ledger { padding-left: 24px; }
  .memory-record { padding-left: 16px; }
  .memory-pip { left: -24px; }
  .page-hero { padding-top: 62px; }
  .page-hero .lede { font-size: 1.03rem; }
  .guide-section { padding: 62px 0; }
  .install-step { grid-template-columns: 1fr; gap: 18px; }
  .step-marker { width: 46px; height: 46px; }
  .launch-grid,
  .manual-path { grid-template-columns: 1fr; }
  .manual-path { gap: 30px; }
  .privacy-section { padding-top: 34px; }
  .privacy-record { padding: 34px 0; }
  .contact-section { padding: 54px 0 68px; }
  .journal-hero { background-size: 68px 100%, auto; }
  .journal-archive-head { grid-template-columns: 1fr; }
  .journal-archive-head .kicker { grid-column: auto; }
  .journal-archive-head > p:last-child { margin-top: 5px; }
  .journal-card { grid-template-columns: 68px minmax(0, 1fr); gap: 22px; }
  .journal-card-date { width: 60px; padding-inline: 4px; }
  .journal-card-date strong { font-size: 1.65rem; }
  .post-hero-grid { grid-template-columns: 1fr; gap: 28px; }
  .post-date-seal { width: 86px; padding: 13px 8px 16px; }
  .post-date-seal strong { font-size: 2.2rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
