/* ==========================================================================
   Next door (17 Nov 2026)

   The page for work by writers 499 reads and hosts. Loaded on next-door.html
   only, after style.css, so the same selectors win on source order and every
   component on the page takes the cold palette for free. Same type, same
   grid, same radii; only the colour moves, so a reader knows they have
   stepped out of the house without leaving the site. Bloom never appears
   here: it is the strongest 499 signal.

     dark    bg #0e1726 navy · fg #e3ebf3 frost · accent #8fc1e8 ice
     light   bg #e8eff6 sky  · fg #13233a ink   · accent #2f5d8a slate
   Text pairs clear 4.5:1 and borders 3:1 in both themes.
   ========================================================================== */
:root {
  color-scheme: dark;
  --bg: #0e1726;
  --bg-raised: #152238;
  --fg: #e3ebf3;
  --fg-muted: #9fb0c3;
  --accent: #8fc1e8;
  --accent-2: #c6dcf0;
  --moss: #8fc1e8;
  --river: #8fc1e8;
  --border: #5b6f8a;
  --focus: #8fe0d2;
  --scrim: rgba(14, 23, 38, 0.85);
  --tint-accent-2: rgba(143, 193, 232, 0.12);
  --tint-river: rgba(143, 193, 232, 0.10);
  --theme-color: #0e1726;
  --shadow-accent: 0 12px 28px -20px rgba(143, 193, 232, 0.45);
  --shadow-accent-2: 0 12px 28px -20px rgba(143, 193, 232, 0.4);
  --shadow-border: 0 12px 28px -20px rgba(0, 0, 0, 0.8);
  --shadow-lift: 0 18px 36px -18px rgba(0, 0, 0, 0.75), 0 4px 14px -8px rgba(143, 193, 232, 0.35);
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    color-scheme: light;
    --bg: #e8eff6;
    --bg-raised: #dbe6f1;
    --fg: #13233a;
    --fg-muted: #4a5c73;
    --accent: #2f5d8a;
    --accent-2: #1f4870;
    --moss: #2f5d8a;
    --river: #2f5d8a;
    --border: #7f93ab;
    --focus: #1f6f5c;
    --scrim: rgba(19, 35, 58, 0.6);
    --tint-accent-2: rgba(47, 93, 138, 0.10);
    --tint-river: rgba(47, 93, 138, 0.08);
    --theme-color: #e8eff6;
    --shadow-accent: 0 12px 28px -22px rgba(47, 93, 138, 0.45);
    --shadow-accent-2: 0 12px 28px -22px rgba(47, 93, 138, 0.4);
    --shadow-border: 0 12px 28px -22px rgba(19, 35, 58, 0.45);
    --shadow-lift: 0 18px 32px -20px rgba(19, 35, 58, 0.38), 0 4px 14px -10px rgba(47, 93, 138, 0.32);
  }
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #e8eff6;
  --bg-raised: #dbe6f1;
  --fg: #13233a;
  --fg-muted: #4a5c73;
  --accent: #2f5d8a;
  --accent-2: #1f4870;
  --moss: #2f5d8a;
  --river: #2f5d8a;
  --border: #7f93ab;
  --focus: #1f6f5c;
  --scrim: rgba(19, 35, 58, 0.6);
  --tint-accent-2: rgba(47, 93, 138, 0.10);
  --tint-river: rgba(47, 93, 138, 0.08);
  --theme-color: #e8eff6;
  --shadow-accent: 0 12px 28px -22px rgba(47, 93, 138, 0.45);
  --shadow-accent-2: 0 12px 28px -22px rgba(47, 93, 138, 0.4);
  --shadow-border: 0 12px 28px -22px rgba(19, 35, 58, 0.45);
  --shadow-lift: 0 18px 32px -20px rgba(19, 35, 58, 0.38), 0 4px 14px -10px rgba(47, 93, 138, 0.32);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0e1726;
  --bg-raised: #152238;
  --fg: #e3ebf3;
  --fg-muted: #9fb0c3;
  --accent: #8fc1e8;
  --accent-2: #c6dcf0;
  --moss: #8fc1e8;
  --river: #8fc1e8;
  --border: #5b6f8a;
  --focus: #8fe0d2;
  --scrim: rgba(14, 23, 38, 0.85);
  --tint-accent-2: rgba(143, 193, 232, 0.12);
  --tint-river: rgba(143, 193, 232, 0.10);
  --theme-color: #0e1726;
  --shadow-accent: 0 12px 28px -20px rgba(143, 193, 232, 0.45);
  --shadow-accent-2: 0 12px 28px -20px rgba(143, 193, 232, 0.4);
  --shadow-border: 0 12px 28px -20px rgba(0, 0, 0, 0.8);
  --shadow-lift: 0 18px 36px -18px rgba(0, 0, 0, 0.75), 0 4px 14px -8px rgba(143, 193, 232, 0.35);
}

/* ---- The threshold line under the title ---- */
.nd-kicker {
  font-family: var(--font-mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
  margin: 0 0 var(--space-1);
}
.nd-lead { font-size: 1.15rem; }
.nd-host {
  font-size: 0.9rem;
  color: var(--fg-muted);
  border-left: 2px solid var(--accent);
  padding-left: var(--space-2);
}

/* ---- One document: cover on the left, words on the right ---- */
.nd-doc {
  display: grid;
  gap: var(--space-4);
  margin: var(--space-8) 0;
  padding-top: var(--space-6);
  border-top: var(--border-w) solid var(--border);
}
@media (min-width: 720px) {
  .nd-doc { grid-template-columns: 280px 1fr; align-items: start; }
}

.nd-flip {
  position: relative;
  max-width: 280px;
  margin: 0 auto;
  width: 100%;
}
.nd-sheet {
  display: block;
  position: relative;
  aspect-ratio: 210 / 297;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #fbfaf6;
  /* Two paper edges peeking out underneath: the stack it pages through. */
  box-shadow:
    5px 5px 0 -1px var(--bg), 5px 5px 0 0 var(--border),
    10px 10px 0 -1px var(--bg), 10px 10px 0 0 var(--border),
    var(--shadow-lift);
  touch-action: pan-y;
}
.nd-sheet img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 0.18s ease;
}
.nd-sheet img.is-turning { opacity: 0.25; }
@media (prefers-reduced-motion: reduce) {
  .nd-sheet img { transition: none; }
}
.nd-sheet:focus-visible { outline: 2px solid var(--focus); outline-offset: 4px; }

/* The last preview page carries the way on to the whole document. */
.nd-more {
  position: absolute;
  inset: auto 0 0 0;
  padding: var(--space-3) var(--space-2) var(--space-2);
  background: linear-gradient(to top, rgba(14, 23, 38, 0.92), rgba(14, 23, 38, 0));
  color: #e3ebf3;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 14px;
  text-align: center;
  display: none;
}
.nd-flip.is-last .nd-more { display: block; }

/* Controls exist only with JavaScript; without it the cover is a link. */
.nd-controls { display: none; }
:root[data-js] .nd-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  margin-top: var(--space-3);
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--fg-muted);
}
.nd-turn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-pill);
  border: var(--border-w) solid var(--border);
  background: transparent;
  color: var(--fg);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}
.nd-turn:hover { border-color: var(--accent); color: var(--accent); }
.nd-turn:disabled { opacity: 0.35; cursor: default; border-color: var(--border); color: var(--fg); }
.nd-count { min-width: 5.5em; text-align: center; font-variant-numeric: tabular-nums; }

.nd-body h2 { margin-top: 0; }
.nd-sub { font-style: italic; color: var(--fg-muted); margin-top: calc(-1 * var(--space-1)); }
.nd-byline {
  font-family: var(--font-mono);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
}
.nd-facts { font-size: 0.9rem; color: var(--fg-muted); }
.nd-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1) var(--space-2);
  margin-top: var(--space-3);
}
.nd-actions a[href=""] { display: none; }

/* On this page the strip above the header points home again. */
.door-strip { background: var(--bg-raised); }
