/* ───────────────────────────────────────────────────────────────
   Pharos landing page — prototype
   Palette and motion built to read like e-ink: warm paper, near-black
   ink, 1-bit art, and a reveal that prints in discrete bands the way an
   e-ink panel refreshes. Everything is visible without JS or motion;
   the effects are progressive enhancement only.
   ─────────────────────────────────────────────────────────────── */

/* Self-hosted fonts (OFL) — no CDN, no third-party request, fits the privacy
   ethos. Literata is the reading serif; IBM Plex Mono is the instrument/label
   face (the open typeface iA Writer Mono is built on). */
@font-face { font-family: "Literata"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/literata-400.woff2") format("woff2"); }
@font-face { font-family: "Literata"; font-style: normal; font-weight: 500; font-display: swap; src: url("fonts/literata-500.woff2") format("woff2"); }
@font-face { font-family: "Literata"; font-style: normal; font-weight: 600; font-display: swap; src: url("fonts/literata-600.woff2") format("woff2"); }
@font-face { font-family: "Literata"; font-style: italic; font-weight: 400; font-display: swap; src: url("fonts/literata-400-italic.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/plexmono-400.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 500; font-display: swap; src: url("fonts/plexmono-500.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 700; font-display: swap; src: url("fonts/plexmono-700.woff2") format("woff2"); }
/* Cinzel — Trajan-grade inscriptional Roman capitals, for the display/wordmark tier */
@font-face { font-family: "Cinzel"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/cinzel-400.woff2") format("woff2"); }
@font-face { font-family: "Cinzel"; font-style: normal; font-weight: 600; font-display: swap; src: url("fonts/cinzel-600.woff2") format("woff2"); }
@font-face { font-family: "Cinzel"; font-style: normal; font-weight: 700; font-display: swap; src: url("fonts/cinzel-700.woff2") format("woff2"); }

:root {
  --paper:  #f4f1ea;   /* warm off-white, not glare-white */
  --scrim-rgb: 244, 241, 234;   /* paper as rgb, for the hero/cinematic fades */
  --ink:    #1a1a1a;   /* near-black, ~14:1 on paper */
  --ink-2:  #4a463e;   /* secondary ink */
  --muted:  #6f6a5e;   /* tertiary */
  --line:   #cdc7b8;   /* hairlines */
  --accent: #9b2d1f;   /* Pompeii red — the one classical accent, used sparingly */
  --measure: 64ch;     /* line length ceiling, ~research-backed */
  --serif: "Literata", "Iowan Old Style", Palatino, "Book Antiqua", Georgia, serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --display: "Cinzel", "Trajan Pro", "Times New Roman", serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: clamp(17px, 1.05vw + 14px, 21px);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* ── paper grain: an SVG turbulence layer, fixed behind everything ── */
.paper {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  opacity: 0.5; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.82' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.18'/%3E%3C/svg%3E");
}

/* keep content above the background layers */
.top, main, .foot { position: relative; z-index: 2; }

/* ───────────────────────── header ───────────────────────── */
.top {
  display: flex; align-items: center; gap: 12px;
  padding: 18px clamp(18px, 5vw, 64px);
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--paper) 86%, transparent);
  backdrop-filter: blur(2px);
  border-bottom: 1px solid var(--line);
}
.mark { color: var(--ink); display: inline-flex; }   /* ink tower; the flame carries the red */
.wordmark {
  font-family: var(--display); font-weight: 700; letter-spacing: .14em;
  font-size: 18px;
}
.nav { margin-left: auto; display: flex; gap: clamp(10px, 2vw, 26px); }
.nav a {
  font-family: var(--mono); font-size: 12.5px; letter-spacing: .08em;
  text-transform: uppercase; color: var(--ink-2); text-decoration: none;
  padding-bottom: 2px; border-bottom: 1px solid transparent;
}
.nav a:hover { color: var(--accent); border-bottom-color: var(--accent); }
@media (max-width: 620px) { .nav a { display: none; } }  /* keep the theme toggle reachable */

/* ───────────────────────── hero ───────────────────────── */
.hero {
  min-height: 92vh;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  grid-template-areas: "copy art";
  align-items: center;
  gap: clamp(24px, 5vw, 80px);
  max-width: 1180px;
  margin: 0 auto;
  padding: 6vh clamp(18px, 5vw, 64px) 8vh;
  position: relative;
}
.hero-copy { grid-area: copy; }
/* dithered 1-bit art plates — blend into the paper via multiply, dots kept hard */
.plate {
  display: block;
  width: min(100%, 460px);
  height: auto;
  image-rendering: pixelated;        /* keep the dither dots hard, never blurred */
  mix-blend-mode: multiply;          /* white dithers into paper, black into ink */
}
.accent  { width: min(100%, 440px); }
.monument { width: min(100%, 300px); margin: 0 auto 26px; }

/* ── wide cinematic hero: a full-bleed dithered scene behind the copy ── */
.cinematic-hero {
  display: flex; align-items: center;
  min-height: 92vh;
  max-width: none; margin: 0; padding: 0;
  position: relative; overflow: hidden;
}
.hero-bg {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; object-position: 56% 40%;
  image-rendering: pixelated; mix-blend-mode: multiply;
  opacity: 0.55;                     /* faded, so the scene reads as a ghost behind the page */
  z-index: 0;
}
/* paper scrim: solid under the whole copy column (so the title never crosses a
   hard seam), then a long smooth fade that reveals the classical scene on the
   right. Top and bottom fades melt the scene edges into the paper. */
.cinematic-hero::before {
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background:
    linear-gradient(90deg, var(--paper) 0%, var(--paper) 40%,
      rgba(var(--scrim-rgb),0.88) 50%, rgba(var(--scrim-rgb),0.42) 64%,
      rgba(var(--scrim-rgb),0.1) 80%, rgba(var(--scrim-rgb),0) 92%),
    linear-gradient(180deg, var(--paper), transparent 14%),
    linear-gradient(0deg, rgba(var(--scrim-rgb),0.4), transparent 18%);
}
.cinematic-hero .hero-copy {
  position: relative; z-index: 2;
  max-width: 560px;
  padding: 0 clamp(18px, 5vw, 64px);
}
.cinematic-hero .scroll-cue { z-index: 2; }
@media (max-width: 720px) {
  /* on narrow screens the copy spans wide: veil the scene enough to read over,
     but keep it visible so the hero stays cinematic */
  .hero-bg { object-position: 60% 38%; }
  .cinematic-hero::before {
    background: linear-gradient(180deg,
      rgba(var(--scrim-rgb),0.62), rgba(var(--scrim-rgb),0.80) 52%, rgba(var(--scrim-rgb),0.62));
  }
}

/* full-bleed cinematic dithered band; edges fade into the paper */
.cinematic {
  position: relative;
  height: clamp(220px, 40vh, 440px);
  overflow: hidden;
  background: var(--paper);
  border-block: 1px solid var(--line);
}
.cinematic img {
  width: 100%; height: 100%;
  object-fit: cover; object-position: center 42%;
  image-rendering: pixelated; mix-blend-mode: multiply; display: block;
  opacity: 0.8;
}
.cinematic::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(var(--paper), transparent 16%, transparent 84%, var(--paper));
}

/* text + accent-plate split (the library section) */
.split {
  display: grid; grid-template-columns: 1.1fr 0.9fr;
  gap: clamp(24px, 4vw, 56px); align-items: center;
}
@media (max-width: 760px) { .split { grid-template-columns: 1fr; } }

/* ── Two modes: a toggle between the e-reader (Read) and the terminal (Shell) ── */
.modes2 .wrap { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: clamp(28px,5vw,64px); align-items: center; max-width: 980px; }
.toggle { display: inline-flex; border: 1px solid var(--ink); border-radius: 3px; overflow: hidden; margin-top: 26px; }
.tg { font-family: var(--mono); font-size: 12px; letter-spacing: .06em; text-transform: uppercase; padding: 9px 16px; background: transparent; color: var(--ink); border: 0; cursor: pointer; }
.tg.active { background: var(--ink); color: var(--paper); }
.stage { display: flex; justify-content: center; }
.view[hidden] { display: none; }
.term { width: 100%; max-width: 560px; border: 1px solid #38352d; border-radius: 8px; overflow: hidden; background: #131210; box-shadow: 0 24px 60px rgba(0,0,0,.45); font-family: var(--mono); font-size: 13px; line-height: 1.7; }
.terminal-bar { display: flex; align-items: center; gap: 7px; padding: 10px 14px; background: #1d1b17; border-bottom: 1px solid #2b2820; }
.terminal-bar .dot { width: 10px; height: 10px; border-radius: 50%; background: #3a372f; }
.terminal-bar .ttl { margin-left: 10px; color: #8c8473; font-size: 12px; letter-spacing: .05em; }
.terminal-bar .ttl b { color: var(--accent); font-weight: 400; }
.t-prompt { color: var(--accent); }
.t-cmd { color: var(--paper); }
.t-comment { color: #756d5d; }
.term-out { padding: 16px 16px 4px; white-space: pre-wrap; color: #ded7c8; min-height: 230px; max-height: 300px; overflow-y: auto; }
.term-line { padding: 0 16px 16px; display: flex; gap: 8px; align-items: baseline; }
.term-input { flex: 1; background: transparent; border: 0; outline: 0; color: var(--paper); font: inherit; caret-color: var(--accent); }
@media (max-width: 760px) { .modes2 .wrap { grid-template-columns: 1fr; } }

/* inline open-source code chip (a small dark terminal on a light band) */
.code {
  margin: 24px 0 0; max-width: 54ch; white-space: pre-wrap;
  font-family: var(--mono); font-size: 13px; line-height: 1.7;
  background: #131210; color: #ded7c8;
  border: 1px solid #38352d; border-radius: 6px; padding: 14px 16px;
}

/* nav gains a soft shadow once scrolled (the printer's-rule lift) */
.top.scrolled { box-shadow: 0 1px 0 var(--line), 0 8px 22px rgba(26,26,26,0.05); }

/* ── the e-reader device mockup (the Read view of the toggle) ── */
.mode-h { font-family: var(--display); font-weight: 700; font-size: clamp(28px,3.4vw,46px); line-height: 1.02; margin: 0 0 18px; letter-spacing: .01em; }
.device-wrap { display: flex; justify-content: center; }
.device { width: 320px; background: #1a1a1a; border-radius: 20px; padding: 16px 16px 30px; box-shadow: 0 28px 70px rgba(0,0,0,.28); }
.device-screen { background: var(--paper); border-radius: 5px; padding: 14px 14px 16px; }
.device-top { display: flex; justify-content: space-between; align-items: center; font-family: var(--mono); font-size: 9px; letter-spacing: .16em; color: var(--muted); margin-bottom: 12px; }
.device-top .batt { width: 16px; height: 8px; border: 1px solid var(--muted); border-radius: 1px; position: relative; }
.device-top .batt::after { content: ""; position: absolute; left: 1px; top: 1px; bottom: 1px; width: 10px; background: var(--muted); }
.cover-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 9px; }
.cover img { width: 100%; aspect-ratio: 2/3; object-fit: cover; image-rendering: pixelated; mix-blend-mode: multiply; border: 1px solid var(--line); display: block; }
.cover .bar { display: block; height: 3px; background: #d8d2c4; margin-top: 5px; }
.cover .bar i { display: block; height: 100%; background: var(--ink); }
.continue { margin-top: 13px; background: var(--ink); color: var(--paper); font-family: var(--mono); font-size: 10px; letter-spacing: .04em; padding: 9px 11px; border-radius: 2px; }
.continue b { color: var(--accent); font-weight: 400; }

.eyebrow {
  font-family: var(--mono); font-size: 12.5px; letter-spacing: .14em;
  text-transform: uppercase; color: var(--muted); margin: 0 0 18px;
}
.title {
  font-family: var(--display); font-weight: 700;
  font-size: clamp(46px, 9.2vw, 100px); line-height: .98; letter-spacing: .015em;
  margin: 0; color: var(--ink);
}
.tagline {
  font-size: clamp(22px, 3vw, 30px); font-style: italic;
  margin: 14px 0 22px; color: var(--ink);
}
.lede { max-width: 46ch; color: var(--ink-2); margin: 0 0 30px; }

.cta { display: flex; gap: 14px; flex-wrap: wrap; margin: 0; }
.btn {
  font-family: var(--mono); font-size: 13px; letter-spacing: .06em;
  text-transform: uppercase; text-decoration: none;
  color: var(--paper); background: var(--ink);
  padding: 13px 22px; border: 1px solid var(--ink); cursor: pointer;
  transition: transform .12s ease, background .12s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn.ghost { background: transparent; color: var(--ink); }
.btn.ghost:hover { background: var(--ink); color: var(--paper); }

.scroll-cue {
  position: absolute; bottom: 22px; left: 50%; transform: translateX(-50%);
  font-family: var(--mono); font-size: 11px; letter-spacing: .28em;
  text-transform: uppercase; color: var(--muted);
}
@media (prefers-reduced-motion: no-preference) {
  .scroll-cue { animation: bob 2.4s ease-in-out infinite; }
}
@keyframes bob { 0%,100% { transform: translateX(-50%) translateY(0); } 50% { transform: translateX(-50%) translateY(6px); } }

@media (max-width: 820px) {
  .hero { grid-template-columns: 1fr; grid-template-areas: "art" "copy"; text-align: center; gap: 2vh; }
  .lede { margin-inline: auto; }
  .cta { justify-content: center; }
}

/* ──────────────────── the Greek meander divider ──────────────────── */
.meander {
  height: 24px; margin: 0; opacity: .85;
  background-repeat: repeat-x; background-position: center;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='24' viewBox='0 0 48 24'%3E%3Cpath d='M2 22 V6 H20 V18 H10 V12 H14' fill='none' stroke='%239b2d1f' stroke-width='2'/%3E%3Cpath d='M26 22 V6 H44 V18 H34 V12 H38' fill='none' stroke='%239b2d1f' stroke-width='2'/%3E%3C/svg%3E");
}

/* centered classical palmette ornament, used as a section flourish */
.ornament { display: flex; justify-content: center; color: var(--accent); padding: clamp(20px, 4vh, 40px) 0; }
.ornament svg { display: block; }

/* ───────────────────────── bands ───────────────────────── */
.band { padding: clamp(56px, 11vh, 130px) clamp(18px, 5vw, 64px); }
.band.alt { background: color-mix(in srgb, var(--ink) 4%, var(--paper)); border-block: 1px solid var(--line); }
.wrap { max-width: 980px; margin: 0 auto; }
.wrap.center { text-align: center; }

.kicker {
  font-family: var(--mono); font-size: 13px; letter-spacing: .12em;
  text-transform: uppercase; color: var(--muted);
  margin: 0 0 26px; padding-bottom: 10px; border-bottom: 1px solid var(--line);
}
.body { max-width: var(--measure); margin: 0 0 18px; color: var(--ink); }
.body.big { font-size: clamp(20px, 2.4vw, 27px); color: var(--ink); }
/* illuminated initial — a classical drop cap in Cinzel, Pompeii red */
.dropcap::first-letter {
  font-family: var(--display); font-weight: 700;
  font-size: 3.1em; line-height: 0.72;
  float: left; margin: 0.06em 0.1em 0 0; color: var(--accent);
}
.body.muted { color: var(--muted); }
.body.center, .wrap.center .body { margin-inline: auto; }

.epigraph {
  font-size: clamp(21px, 2.9vw, 31px); line-height: 1.4; font-style: italic;
  max-width: 30ch; margin: 0 0 48px; color: var(--ink);
  border-left: 3px solid var(--accent); padding-left: clamp(18px, 3vw, 34px);
}

/* two-column cards */
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(20px, 4vw, 48px); }
@media (max-width: 720px) { .cols { grid-template-columns: 1fr; } }
.card { border: 1px solid var(--line); padding: clamp(22px, 3vw, 36px); background: var(--paper); }
.card h2 { font-family: var(--mono); font-size: 22px; letter-spacing: .04em; margin: 0 0 6px; }
.card-sub { font-style: italic; color: var(--muted); margin: 0 0 16px; }
.card .body { margin-bottom: 0; }

/* format chips */
.formats {
  list-style: none; padding: 0; margin: 28px 0 0;
  display: flex; flex-wrap: wrap; gap: 10px;
}
.formats li {
  font-family: var(--mono); font-size: 13px; letter-spacing: .08em;
  border: 1px solid var(--ink); padding: 7px 13px;
}

/* close / mission */
.close { padding-block: clamp(70px, 14vh, 150px); }
.big-mark { display: inline-flex; color: var(--ink); margin-bottom: 22px; }
.lighthouse-line { max-width: 56ch; margin: 0 auto 36px; color: var(--ink-2); }
.notify { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.notify input {
  font-family: var(--serif); font-size: 16px; padding: 12px 16px;
  border: 1px solid var(--ink); background: var(--paper); color: var(--ink);
  min-width: 260px;
}
.notify input::placeholder { color: var(--muted); }
.fineprint { font-family: var(--mono); font-size: 12px; color: var(--muted); margin-top: 18px; }

/* footer */
.foot {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  padding: 34px; border-top: 1px solid var(--line);
  font-family: var(--mono); font-size: 12px; letter-spacing: .06em; color: var(--muted);
}
.foot .dot { opacity: .5; }
.foot .foot-tag { color: var(--accent); font-style: italic; font-family: var(--serif); font-size: 13px; letter-spacing: 0; }
.foot .proto { border: 1px solid var(--line); padding: 2px 8px; }

/* sr-only */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ────────────────────────────────────────────────────────────────
   THE REVEAL — content develops as it scrolls into view, like ink
   bleeding onto the page, and un-develops as it scrolls back out, so
   it re-generates every time it enters (scroll up, then down again).
   Pure CSS scroll-driven animation, no JS. Default — no support, no
   JS, or reduced motion — is fully visible: the bleed is enhancement.
   ──────────────────────────────────────────────────────────────── */
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .reveal {
      animation: ink-bleed linear both;
      animation-timeline: view();
      animation-range: entry 2% entry 72%;   /* bleeds in across the lower viewport */
      will-change: clip-path, opacity, filter;
    }
  }
}
@keyframes ink-bleed {
  0%   { opacity: 0; clip-path: inset(0 0 100% 0); filter: blur(3px) contrast(0.55); }
  62%  { opacity: 1; clip-path: inset(0 0 16% 0);  filter: blur(0.5px) contrast(0.92); }
  100% { opacity: 1; clip-path: inset(0 0 0 0);    filter: none; }
}
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1 !important; clip-path: none !important; filter: none !important; }
}

/* keyboard focus: a clear Pompeii-red ring for tab users, invisible to the mouse */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }
.term-input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* sync native UI (scrollbars, form controls) to the active theme */
:root { color-scheme: light; }
html.dark { color-scheme: dark; }

/* ───────────────────────── upgrades ───────────────────────── */

/* bento feature grid */
.bento { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.bento-cell { border: 1px solid var(--line); background: var(--paper); padding: clamp(18px, 2vw, 26px); display: flex; flex-direction: column; transition: box-shadow .2s ease, transform .2s ease; }
.bento-cell:hover { box-shadow: 0 12px 32px rgba(26,26,26,.07); transform: translateY(-2px); }
.bento-cell h3 { font-family: var(--display); font-weight: 700; font-size: 21px; margin: 0 0 8px; }
.bento-cell p { color: var(--ink-2); margin: 0; }
.b-tall { grid-row: span 2; }
.b-wide { grid-column: span 2; }
.bento-cell .formats { margin-top: auto; padding-top: 18px; }
.bento-strip { display: flex; gap: 8px; margin-top: auto; padding-top: 18px; }
.bento-strip img { width: 56px; aspect-ratio: 2/3; object-fit: cover; image-rendering: pixelated; mix-blend-mode: multiply; border: 1px solid var(--line); }
@media (max-width: 760px) { .bento { grid-template-columns: 1fr; } .b-tall, .b-wide { grid-row: auto; grid-column: auto; } }

/* comparison table */
.cmp-wrap { overflow-x: auto; }
.cmp { width: 100%; border-collapse: collapse; font-size: 15px; max-width: 780px; }
.cmp th, .cmp td { padding: 12px 14px; text-align: center; border-bottom: 1px solid var(--line); }
.cmp thead th { font-family: var(--mono); font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.cmp tbody th { text-align: left; font-weight: 400; color: var(--ink); }
.cmp .me { background: color-mix(in srgb, var(--accent) 8%, transparent); }
.cmp thead .me { color: var(--accent); font-weight: 700; }
.cmp .y { color: var(--accent); font-weight: 700; }
.cmp .n { color: var(--muted); }
.cmp .p { color: var(--ink-2); }
.cmp-note { font-size: 13px; color: var(--muted); margin-top: 14px; max-width: 60ch; }

/* GitHub strip */
.gh-strip { display: flex; align-items: center; gap: 16px; margin-top: 24px; flex-wrap: wrap; }
.gh-meta { font-family: var(--mono); font-size: 12px; color: var(--muted); letter-spacing: .04em; }

/* build log */
.log { list-style: none; padding: 0; margin: 0; max-width: 700px; }
.log li { display: flex; gap: 18px; padding: 11px 0; border-bottom: 1px solid var(--line); align-items: baseline; }
.log-date { font-family: var(--mono); font-size: 12px; color: var(--accent); flex: 0 0 92px; letter-spacing: .03em; }
.log-txt { color: var(--ink-2); }
@media (max-width: 560px) { .log li { flex-direction: column; gap: 2px; } }

/* email thank-you state */
.notify-done { font-family: var(--serif); font-style: italic; font-size: 18px; color: var(--accent); margin: 6px 0 0; }

/* nav button (theme toggle) */
.nav-btn { background: transparent; border: 0; color: var(--ink-2); font-size: 16px; cursor: pointer; line-height: 1; padding: 0 2px; }
.nav-btn:hover { color: var(--accent); }

/* boot sequence overlay */
.boot { position: fixed; inset: 0; z-index: 100; background: var(--paper); display: none; align-items: center; justify-content: center; }
html.booting { overflow: hidden; }
html.booting .boot { display: flex; }
.boot-log { font-family: var(--mono); font-size: clamp(12px, 2.1vw, 15px); line-height: 1.85; color: var(--ink); white-space: pre; margin: 0; max-width: 92vw; }
.boot-log .ok { color: var(--accent); }
.boot-skip { position: absolute; bottom: 28px; right: 28px; background: transparent; border: 1px solid var(--line); color: var(--muted); font-family: var(--mono); font-size: 11px; letter-spacing: .06em; padding: 6px 12px; cursor: pointer; }
.boot.done { animation: boot-out .45s ease forwards; }
@keyframes boot-out { to { opacity: 0; visibility: hidden; } }

/* keyboard shortcut sheet */
.sheet { position: fixed; inset: 0; z-index: 90; display: flex; align-items: center; justify-content: center; background: color-mix(in srgb, var(--ink) 34%, transparent); }
.sheet[hidden] { display: none; }
.sheet-card { background: var(--paper); border: 1px solid var(--ink); padding: 28px 34px; max-width: 360px; box-shadow: 0 30px 80px rgba(0,0,0,.25); }
.sheet-title { font-family: var(--mono); font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin: 0 0 16px; }
.sheet-keys { display: grid; grid-template-columns: auto 1fr; gap: 10px 18px; margin: 0; }
.sheet-keys dt { font-family: var(--mono); font-size: 13px; color: var(--accent); }
.sheet-keys dd { margin: 0; color: var(--ink-2); font-size: 14px; }

/* ── true 1-bit dark mode (dim lamplight on aged paper) ── */
html.dark {
  --paper: #15140f;
  --scrim-rgb: 21, 20, 15;
  --ink:   #efe9da;
  --ink-2: #c8c1af;
  --muted: #8d8675;
  --line:  #383428;
  --accent: #d4634f;
}
html.dark .hero-bg, html.dark .plate, html.dark .cover img,
html.dark .bento-strip img, html.dark .cinematic img { mix-blend-mode: screen; }
/* screen-blended dither reads as light grain on dark; keep it a faint ghost */
html.dark .hero-bg { opacity: .42; }
html.dark .cinematic img { opacity: .6; }
html.dark .paper { mix-blend-mode: screen; opacity: .22; }
html.dark .device { background: #0d0c0a; }
html.dark .bento-cell, html.dark .card { background: color-mix(in srgb, var(--ink) 4%, var(--paper)); }
/* e-ink refresh blip when the theme flips */
@media (prefers-reduced-motion: no-preference) {
  html.flipping body { animation: eink-refresh .26s steps(2, end); }
}
@keyframes eink-refresh { 0% { filter: invert(1); } 49% { filter: invert(1); } 50% { filter: none; } 100% { filter: none; } }
