/* Scroll Med Gud: scrollmedgud.app
   Site palette: black, white and the app's amber. The phone inside uses the app's own tokens
   (design/impeccable/DESIGN.md) so the demo looks exactly like the app. */

@font-face {
  font-family: "Source Serif 4";
  src: url("/assets/source-serif-4.woff2") format("woff2");
  font-weight: 200 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Source Serif 4";
  src: url("/assets/source-serif-4-italic.woff2") format("woff2");
  font-weight: 200 900;
  font-style: italic;
  font-display: swap;
}

:root {
  color-scheme: light;
  --bg: #FFFFFF;
  --ink: #0D0D0F;
  --ink-2: rgba(13, 13, 15, 0.64);
  --line: rgba(13, 13, 15, 0.12);
  --hover: rgba(13, 13, 15, 0.06);
  --amber: #E8A33D;
  --on-amber: #1A1205;
  --pill-bg: #0D0D0F;
  --pill-ink: #FFFFFF;
  --device-ring: transparent;

  /* App tokens for the phone (light). */
  --a-ground: #F4F4F6;
  --a-surface: #FFFFFF;
  --a-raised: #ECECEF;
  --a-separator: #E0E0E5;
  --a-field: #F0F0F3;
  --a-ink: #111114;
  --a-ink2: #5E5E66;
  --a-ink3: #6E6E76;
  --a-amber-ink: #94590A;
  --a-amber-tint: rgba(232, 163, 61, 0.18);
  --a-like: #D93A42;
  --a-pill-bg: #111114;
  --a-pill-ink: #FFFFFF;
  --a-bar: rgba(255, 255, 255, 0.86);
  --a-bar-line: rgba(0, 0, 0, 0.06);
  --a-dimmer: rgba(0, 0, 0, 0.32);
  --a-chrome-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
  --a-chrome-border: 1px solid var(--a-separator);

  --serif: "Source Serif 4", "New York", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-sheet: cubic-bezier(0.32, 0.72, 0, 1);
  --gutter: clamp(16px, 3vw, 40px);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0D0D0F;
  --ink: #F5F5F7;
  --ink-2: rgba(245, 245, 247, 0.66);
  --line: rgba(245, 245, 247, 0.14);
  --hover: rgba(245, 245, 247, 0.08);
  --pill-bg: #F5F5F7;
  --pill-ink: #0D0D0F;
  --device-ring: rgba(255, 255, 255, 0.12);

  --a-ground: #0D0D0F;
  --a-surface: #1C1C20;
  --a-raised: #26262B;
  --a-separator: #2E2E34;
  --a-field: #26262B;
  --a-ink: #F5F5F7;
  --a-ink2: #A1A1A8;
  --a-ink3: #8A8A92;
  --a-amber-ink: #F0B85E;
  --a-amber-tint: rgba(232, 163, 61, 0.16);
  --a-like: #F2545B;
  --a-pill-bg: #F5F5F7;
  --a-pill-ink: #0D0D0F;
  --a-bar: rgba(30, 30, 34, 0.82);
  --a-bar-line: rgba(255, 255, 255, 0.08);
  --a-dimmer: rgba(0, 0, 0, 0.55);
  --a-chrome-shadow: none;
  --a-chrome-border: 0 solid transparent;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0D0D0F;
    --ink: #F5F5F7;
    --ink-2: rgba(245, 245, 247, 0.66);
    --line: rgba(245, 245, 247, 0.14);
    --hover: rgba(245, 245, 247, 0.08);
    --pill-bg: #F5F5F7;
    --pill-ink: #0D0D0F;
    --device-ring: rgba(255, 255, 255, 0.12);

    --a-ground: #0D0D0F;
    --a-surface: #1C1C20;
    --a-raised: #26262B;
    --a-separator: #2E2E34;
    --a-field: #26262B;
    --a-ink: #F5F5F7;
    --a-ink2: #A1A1A8;
    --a-ink3: #8A8A92;
    --a-amber-ink: #F0B85E;
    --a-amber-tint: rgba(232, 163, 61, 0.16);
    --a-like: #F2545B;
    --a-pill-bg: #F5F5F7;
    --a-pill-ink: #0D0D0F;
    --a-bar: rgba(30, 30, 34, 0.82);
    --a-bar-line: rgba(255, 255, 255, 0.08);
    --a-dimmer: rgba(0, 0, 0, 0.55);
    --a-chrome-shadow: none;
    --a-chrome-border: 0 solid transparent;
  }
}

/* ---------- Base ---------- */

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
  transition: background-color 0.3s ease, color 0.3s ease;
}

::selection { background: var(--amber); color: var(--on-amber); }

a { color: inherit; }

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

svg { display: block; }

:root .only-dark { display: none; }
:root[data-theme="dark"] .only-dark { display: block; }
:root[data-theme="dark"] .only-light { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .only-dark { display: block; }
  :root:not([data-theme="light"]) .only-light { display: none; }
}

/* ---------- Header ---------- */

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px var(--gutter);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  font-weight: 600;
  font-size: 17px;
  letter-spacing: -0.01em;
  border-radius: 10px;
}
.brand-mark { width: 32px; height: 32px; border-radius: 8px; box-shadow: 0 0 0 1px var(--line), 0 1px 3px rgba(13, 13, 15, 0.12); }

.header-actions { display: flex; align-items: center; gap: 12px; }

.theme-toggle {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  transition: background-color 0.2s ease;
}
.theme-toggle:hover { background: var(--hover); }
.theme-toggle svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.theme-toggle .icon-moon { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
:root[data-theme="light"] .theme-toggle .icon-sun { display: none; }
:root[data-theme="light"] .theme-toggle .icon-moon { display: block; }
:root:not([data-theme]) .theme-toggle .icon-sun { display: none; }
:root:not([data-theme]) .theme-toggle .icon-moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) .theme-toggle .icon-sun { display: block; }
  :root:not([data-theme]) .theme-toggle .icon-moon { display: none; }
}

/* ---------- Pills ---------- */

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  padding: 0 20px 0 17px;
  border-radius: 999px;
  background: var(--pill-bg);
  color: var(--pill-ink);
  font-weight: 600;
  font-size: 17px;
  letter-spacing: -0.01em;
  text-decoration: none;
  white-space: nowrap;
  transition: transform 0.2s var(--ease-out), opacity 0.2s ease;
}
.pill:hover { opacity: 0.88; }
.pill:active { transform: scale(0.97); }
.pill .apple { width: 19px; height: 19px; fill: currentColor; margin-top: -2px; }

.pill-store { height: 54px; padding: 0 26px 0 22px; font-size: 18px; }
.pill-store .apple { width: 21px; height: 21px; }

/* ---------- Hero ---------- */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 34rem) auto;
  justify-content: center;
  column-gap: clamp(48px, 8vw, 136px);
  align-items: stretch;
  padding: 0 var(--gutter);
  min-height: 0;
}

.hero-copy {
  align-self: center;
  padding: 48px 0 64px;
}

h1 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(3.25rem, 1.6rem + 4.6vw, 6.5rem);
  line-height: 0.96;
  letter-spacing: -0.025em;
  text-wrap: balance;
}

.subtitle {
  margin: 24px 0 0;
  font-family: var(--serif);
  font-size: clamp(1.375rem, 1rem + 0.9vw, 1.875rem);
  line-height: 1.25;
  color: var(--ink-2);
  text-wrap: balance;
}

.get {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-top: clamp(40px, 6vh, 64px);
}

.qr {
  flex: none;
  display: block;
  padding: 10px;
  border-radius: 20px;
  background: #FFFFFF;
  box-shadow: 0 0 0 1px var(--line);
  transition: transform 0.25s var(--ease-out);
}
.qr:hover { transform: scale(1.03); }
.qr-code { display: block; width: 116px; height: 116px; }
.qr-code svg { width: 100%; height: 100%; }

.get-text { display: flex; flex-direction: column; align-items: flex-start; gap: 14px; }
.get-hint { margin: 0; max-width: 17em; color: var(--ink-2); font-size: 15px; line-height: 1.4; }

/* ---------- Stage + device ---------- */

.stage {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 0;
  padding: 32px 0;
}

.device-slot { position: relative; }

.device {
  --device-scale: 1;
  position: absolute;
  top: 0;
  left: 0;
  width: 417px;
  height: 876px;
  padding: 12px;
  border-radius: 68px;
  background: #050506;
  box-shadow:
    inset 0 0 0 1.5px rgba(255, 255, 255, 0.16),
    inset 0 0 0 5px #050506,
    inset 0 0 0 6px rgba(255, 255, 255, 0.05),
    0 0 0 1px var(--device-ring),
    0 40px 80px -24px rgba(0, 0, 0, 0.32),
    0 18px 36px -18px rgba(0, 0, 0, 0.24);
  transform-origin: 0 0;
  transform: scale(var(--device-scale));
}

.device-btn { position: absolute; width: 4px; border-radius: 2px; background: #050506; }
.btn-action { left: -3px; top: 168px; height: 34px; }
.btn-vol-up { left: -3px; top: 228px; height: 62px; }
.btn-vol-down { left: -3px; top: 304px; height: 62px; }
.btn-power { right: -3px; top: 252px; height: 96px; }

.screen {
  position: relative;
  width: 393px;
  height: 852px;
  border-radius: 56px;
  overflow: hidden;
  background: var(--a-ground);
  color: var(--a-ink);
  font-family: var(--sans);
  isolation: isolate;
  transition: background-color 0.3s ease;
  user-select: none;
  -webkit-user-select: none;
}

/* Status bar */
.statusbar {
  position: absolute;
  inset: 0 0 auto 0;
  height: 54px;
  z-index: 5;
  pointer-events: none;
  color: var(--a-ink);
}
.clock {
  position: absolute;
  left: 50px;
  top: 19px;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
}
.island {
  position: absolute;
  top: 11px;
  left: 50%;
  width: 124px;
  height: 36px;
  margin-left: -62px;
  border-radius: 20px;
  background: #000;
}
.status-icons {
  position: absolute;
  right: 30px;
  top: 22px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.status-icons svg { fill: currentColor; }
.status-icons .sig { width: 18px; height: 12px; }
.status-icons .wifi { width: 16px; height: 12px; }
.status-icons .battery { width: 27px; height: 13px; }

.home-indicator {
  position: absolute;
  left: 50%;
  bottom: 8px;
  width: 134px;
  height: 5px;
  margin-left: -67px;
  border-radius: 3px;
  background: var(--a-ink);
  z-index: 9;
  pointer-events: none;
}

/* Feed pager */
.feed {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  overflow-x: hidden;
  scroll-snap-type: y mandatory;
  overscroll-behavior: contain;
  scrollbar-width: none;
  touch-action: pan-y;
  border-radius: inherit;
}
.feed::-webkit-scrollbar { display: none; }
.feed.dragging { scroll-snap-type: none; cursor: grabbing; }
.feed:focus-visible { outline: none; }
.screen:has(.feed:focus-visible) { box-shadow: inset 0 0 0 3px var(--amber); }

.page {
  position: relative;
  height: 852px;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  overflow: hidden;
}

/* Verse stage: top = safe area 59 + 66, bottom 150, as in VersePage. */
.vstage {
  position: absolute;
  top: 125px;
  bottom: 150px;
  left: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 150px 36px;
}
.vstage.raised { justify-content: flex-end; padding: 0 36px 150px; }
.vstage.beside { padding: 0 64px 0 36px; }
.vstage.scroll { justify-content: flex-start; padding: 8px 64px 8px 36px; overflow-y: auto; scrollbar-width: none; }

.block { display: flex; flex-direction: column; align-items: center; text-align: center; }

.vtext {
  margin: 0;
  font-family: var(--serif);
  font-size: var(--vsize, 28px);
  line-height: var(--vlead, 1.36);
  font-weight: 400;
  color: var(--a-ink);
  text-wrap: pretty;
  hyphens: manual;
}
.vref {
  margin: var(--vgap, 22px) 0 0;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--a-ink2);
}

.ask {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  margin-top: 30px;
  padding: 6px 18px 6px 14px;
  border: var(--a-chrome-border);
  border-radius: 999px;
  background: var(--a-surface);
  box-shadow: var(--a-chrome-shadow);
  color: var(--a-ink);
  font: 600 15px/1.2 var(--sans);
  cursor: pointer;
}
.ask .salomo { width: 22px; height: 22px; background: currentColor; -webkit-mask: url("/assets/salomo.svg") center / contain no-repeat; mask: url("/assets/salomo.svg") center / contain no-repeat; }

/* Arrival: rise and fade when a page settles. */
.page .vtext, .page .vref, .page .ask, .page .opener-body {
  opacity: 0.6;
  transform: translateY(6px);
  transition: opacity 0.2s ease-out, transform 0.2s ease-out;
}
.page.shown .vtext, .page.shown .vref, .page.shown .ask, .page.shown .opener-body { opacity: 1; transform: none; }
.page.shown .vref { transition-delay: 0.03s; }
.page.shown .ask { transition-delay: 0.06s; }

/* Rail: like, note, share. 52 pt buttons, 28 pt icons, right 8, bottom 112. */
.rail {
  position: absolute;
  right: 8px;
  bottom: 112px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 2;
}
.rail button {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--a-ink);
  cursor: pointer;
  border-radius: 14px;
  transition: opacity 0.12s ease;
}
.rail button:active { opacity: 0.6; }
.rail svg {
  width: 28px;
  height: 28px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.like svg { transition: fill 0.15s ease, stroke 0.15s ease; }
.like[aria-pressed="true"] { color: var(--a-like); }
.like[aria-pressed="true"] svg { fill: currentColor; }
.like.pop svg { animation: pop 0.44s cubic-bezier(0.34, 1.56, 0.64, 1); }
@keyframes pop {
  0% { transform: scale(1); }
  35% { transform: scale(1.25); }
  100% { transform: scale(1); }
}

/* Heart that blooms where you double-tap. */
.burst {
  position: absolute;
  width: 96px;
  height: 96px;
  margin: -48px 0 0 -48px;
  color: var(--a-like);
  pointer-events: none;
  z-index: 3;
  animation: burst 0.7s var(--ease-out) forwards;
}
.burst svg { width: 100%; height: 100%; fill: currentColor; }
@keyframes burst {
  0% { opacity: 0; transform: scale(0.4); }
  25% { opacity: 1; transform: scale(1.08); }
  45% { transform: scale(0.96); }
  70% { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(1) translateY(-24px); }
}

/* Chapter opener */
.opener {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 28px;
  text-align: center;
}
.opener-done {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 155px;
  font-size: 15px;
  color: var(--a-ink);
}
.check-circle {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--amber);
  color: var(--on-amber);
}
.check-circle svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 3.2; stroke-linecap: round; stroke-linejoin: round; }
.opener-spacer { flex: 1 1 24px; max-height: 48px; min-height: 24px; }
.opener.first .opener-spacer { max-height: none; }
.opener-body { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.numeral {
  font-family: var(--serif);
  font-size: 150px;
  line-height: 1;
  letter-spacing: -3px;
  font-weight: 400;
}
.book-name {
  margin: 0;
  font-family: var(--serif);
  font-size: 30px;
  font-weight: 600;
  line-height: 1.12;
}
.opener-meta { margin: 4px 0 0; font-size: 15px; color: var(--a-ink2); }
.opener-summary {
  margin: 18px 0 0;
  padding: 0 12px;
  font-family: var(--serif);
  font-style: italic;
  font-size: 16px;
  line-height: 1.4;
  color: var(--a-ink2);
  display: -webkit-box;
  -webkit-line-clamp: 5;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.opener-grow { flex: 1 1 16px; }
.opener-hint {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-bottom: 150px;
  font-size: 13px;
  color: var(--a-ink2);
}
.opener-hint svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.opener.first .opener-hint svg { animation: nudge 2.4s var(--ease-out) 1.2s infinite; }
@keyframes nudge {
  0%, 60%, 100% { transform: none; }
  20% { transform: translateY(-6px); }
  40% { transform: translateY(0); }
}

.end-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 54px;
  margin-top: 28px;
  padding: 0 26px 0 22px;
  border-radius: 999px;
  background: var(--a-pill-bg);
  color: var(--a-pill-ink);
  font: 600 17px/1 var(--sans);
  text-decoration: none;
}
.end-cta .apple { width: 19px; height: 19px; fill: currentColor; margin-top: -2px; }

/* Top bar */
.topbar {
  position: absolute;
  top: 61px;
  left: 0;
  right: 0;
  z-index: 4;
  pointer-events: none;
}
.topbar-row { display: flex; justify-content: space-between; align-items: center; padding: 0 16px; }
.chrome-pill, .chrome-circle {
  pointer-events: auto;
  border: var(--a-chrome-border);
  background: var(--a-surface);
  box-shadow: var(--a-chrome-shadow);
  color: var(--a-ink);
  font-family: var(--sans);
}
.chrome-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 44px;
  padding: 0 14px 0 18px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 600;
  cursor: default;
}
.chrome-pill svg { width: 16px; height: 16px; fill: none; stroke: var(--a-ink2); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.chrome-circle {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 50%;
  cursor: pointer;
}
.chrome-circle svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; }
.counter {
  margin: 6px 0 0;
  text-align: center;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  color: var(--a-ink2);
}

/* Verse progress along the leading edge: top 59 + 84, bottom 104. */
.progress {
  position: absolute;
  left: 0;
  top: 143px;
  bottom: 104px;
  width: 28px;
  z-index: 3;
  cursor: ns-resize;
  touch-action: none;
  transition: opacity 0.2s ease-out;
}
.progress.hidden { opacity: 0; pointer-events: none; }
.progress-track { position: absolute; inset: 0; }
.progress-track i {
  position: absolute;
  left: 7px;
  width: 2px;
  border-radius: 1px;
  background: color-mix(in srgb, var(--a-ink) 18%, transparent);
}
.progress-thumb {
  position: absolute;
  left: 6px;
  width: 4px;
  border-radius: 2px;
  background: var(--a-ink);
  transition: top 0.25s var(--ease-out), width 0.15s ease, left 0.15s ease;
}
.progress.scrubbing .progress-thumb { width: 6px; left: 5px; transition: width 0.15s ease, left 0.15s ease; }
.progress-label {
  position: absolute;
  left: 16px;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  transform: translateY(-50%);
  white-space: nowrap;
}
.progress-label.current { font-weight: 700; color: var(--a-ink); transition: top 0.25s var(--ease-out); }
.progress.scrubbing .progress-label.current { transition: none; }
.progress-label.total { color: var(--a-ink3); }

/* Tab bar */
.tabbar {
  position: absolute;
  left: 22px;
  right: 22px;
  bottom: 26px;
  height: 64px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  align-items: center;
  padding: 0 6px;
  border-radius: 32px;
  background: var(--a-bar);
  box-shadow: 0 0 0 1px var(--a-bar-line), 0 8px 24px rgba(0, 0, 0, 0.08);
  -webkit-backdrop-filter: blur(20px) saturate(1.6);
  backdrop-filter: blur(20px) saturate(1.6);
  z-index: 4;
}
.tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  height: 54px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  color: var(--a-ink2);
}
.tab svg { width: 25px; height: 25px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.tab.selected { background: var(--a-amber-tint); color: var(--a-amber-ink); }

/* Toast */
.toast {
  position: absolute;
  top: 118px;
  left: 50%;
  z-index: 8;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  background: var(--a-pill-bg);
  color: var(--a-pill-ink);
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
  opacity: 0;
  transform: translate(-50%, -8px) scale(0.96);
  transition: opacity 0.2s ease, transform 0.3s var(--ease-out);
  pointer-events: none;
}
.toast.on { opacity: 1; transform: translate(-50%, 0) scale(1); }
.toast svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }

/* Sheets */
.sheet-scrim {
  position: absolute;
  inset: 0;
  z-index: 6;
  background: var(--a-dimmer);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
}
.sheet-scrim.on { opacity: 1; pointer-events: auto; }
.sheet {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 7;
  max-height: calc(100% - 64px);
  display: flex;
  flex-direction: column;
  border-radius: 34px 34px 0 0;
  background: var(--a-surface);
  color: var(--a-ink);
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.12);
  transform: translateY(100%);
  transition: transform 0.45s var(--ease-sheet);
  user-select: text;
  -webkit-user-select: text;
}
.sheet.on { transform: translateY(0); }
.sheet.dragging { transition: none; }
.sheet-grabber {
  flex: none;
  position: relative;
  height: 20px;
  cursor: grab;
  touch-action: none;
}
.sheet-grabber::after {
  content: "";
  position: absolute;
  top: 6px;
  left: 50%;
  width: 36px;
  height: 5px;
  margin-left: -18px;
  border-radius: 3px;
  background: color-mix(in srgb, var(--a-ink) 22%, transparent);
}
.sheet-body { overflow-y: auto; padding: 0 20px 40px; scrollbar-width: none; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; min-height: 44px; }
.sheet-head h2 { margin: 0; font-size: 17px; font-weight: 600; }
.sheet-done {
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--a-amber-ink);
  font: 600 17px/1 var(--sans);
  cursor: pointer;
}
.quote { margin: 10px 0 0; font-family: var(--serif); font-size: 17px; line-height: 1.4; color: var(--a-ink2); }
.quote-ref { margin: 6px 0 0; font-size: 12px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--a-ink2); }
.note-field {
  display: block;
  width: 100%;
  min-height: 170px;
  margin-top: 16px;
  padding: 16px;
  border: 0;
  border-radius: 16px;
  background: var(--a-field);
  color: var(--a-ink);
  font: 17px/1.5 var(--sans);
  caret-color: var(--amber);
  resize: none;
}
.note-field::placeholder { color: var(--a-ink3); }
.note-field:focus-visible { outline: none; box-shadow: inset 0 0 0 1.5px var(--amber); }
.note-saved { display: flex; align-items: center; gap: 6px; margin: 10px 0 0; font-size: 13px; color: var(--a-ink2); min-height: 18px; }
.note-saved svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.lib-label { margin: 18px 0 7px; font-size: 13px; font-weight: 600; color: var(--a-ink2); }
.lib-list { margin: 0; padding: 4px 16px; list-style: none; border-radius: 20px; background: var(--a-raised); }
.lib-list li { display: flex; gap: 12px; padding: 12px 0; }
.lib-list li + li { border-top: 1px solid var(--a-separator); }
.lib-list .ico { flex: none; width: 18px; height: 18px; margin-top: 3px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.lib-list .ico.heart { color: var(--a-like); fill: currentColor; }
.lib-ref { margin: 0; font-size: 12px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--a-ink2); }
.lib-text { margin: 3px 0 0; font-family: var(--serif); font-size: 17px; line-height: 1.32; }
.lib-note { margin: 4px 0 0; font-size: 15px; line-height: 1.35; color: var(--a-ink2); }
.lib-empty { margin: 24px 0 8px; font-size: 15px; line-height: 1.4; color: var(--a-ink2); text-align: center; }

.ask-sheet { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 8px 8px 0; }
.ask-sheet .salomo-big { width: 44px; height: 44px; background: var(--a-ink); -webkit-mask: url("/assets/salomo.svg") center / contain no-repeat; mask: url("/assets/salomo.svg") center / contain no-repeat; }
.ask-sheet h2 { margin: 16px 0 0; font-family: var(--serif); font-size: 26px; font-weight: 600; line-height: 1.15; }
.ask-sheet p { margin: 10px 0 0; max-width: 18em; font-size: 15px; line-height: 1.45; color: var(--a-ink2); }

/* ---------- Footer ---------- */

.site-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 24px;
  padding: 20px var(--gutter) 24px;
  font-size: 14px;
  color: var(--ink-2);
}
.site-footer p { margin: 0; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 8px 24px; }
.site-footer a {
  color: var(--ink-2);
  text-decoration: none;
  border-radius: 4px;
  transition: color 0.15s ease;
}
.site-footer a:hover { color: var(--ink); text-decoration: underline; text-decoration-color: var(--amber); text-decoration-thickness: 2px; text-underline-offset: 4px; }

/* ---------- Desktop: the hero fills the viewport ---------- */

@media (min-width: 900px) {
  body { height: 100vh; height: 100svh; min-height: 640px; }
  .hero { min-height: 0; }
  .stage { height: 100%; }
}

/* ---------- Narrow ---------- */

@media (max-width: 899px) {
  .hero { grid-template-columns: minmax(0, 1fr); gap: 32px; padding-bottom: 8px; }
  .hero-copy { padding: 24px 0 0; text-align: left; }
  .subtitle { margin-top: 16px; }
  .get { margin-top: 32px; }
  .stage { padding: 16px 0 24px; }
  .site-footer { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 520px) {
  .brand span { font-size: 16px; }
  .header-actions { gap: 4px; }
  .pill-download { padding: 0 16px 0 14px; font-size: 16px; }
  /* Side lanes beside the phone stay free, so a thumb can scroll the page past it. */
  .stage { padding: 8px 40px 24px; }
  /* A window this narrow is a phone: the store link replaces the QR code. */
  .qr, .only-pointer { display: none; }
}

/* Touch-first devices: they are the phone, so the QR code gives way to the store link. */
@media (hover: none) and (pointer: coarse) {
  .qr, .only-pointer { display: none; }
  /* At the first and last page a swipe carries on to the page, so the footer stays reachable. */
  .feed { overscroll-behavior-y: auto; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; }
  .page .vtext, .page .vref, .page .ask, .page .opener-body { transform: none; }
  .sheet { transition-duration: 0.2s; }
}

/* ---------- Text pages (privatliv, 404) ---------- */

body.text-page { height: auto; }
.doc {
  width: 100%;
  max-width: 44rem;
  margin: 0 auto;
  padding: 40px var(--gutter) 96px;
}
.doc h1 { font-size: clamp(2.5rem, 1.8rem + 3vw, 4rem); }
.doc .lede { margin: 20px 0 0; font-family: var(--serif); font-size: 1.25rem; line-height: 1.45; color: var(--ink-2); }
.doc h2 { margin: 48px 0 0; font-family: var(--serif); font-size: 1.5rem; font-weight: 600; line-height: 1.2; }
.doc p, .doc li { font-size: 17px; line-height: 1.6; }
.doc p { margin: 14px 0 0; }
.doc ul { margin: 14px 0 0; padding-left: 1.2em; }
.doc li + li { margin-top: 6px; }
.doc a { text-decoration-color: var(--amber); text-decoration-thickness: 2px; text-underline-offset: 3px; }
.doc .meta { margin-top: 12px; font-size: 14px; color: var(--ink-2); }
.draft-note {
  margin: 28px 0 0;
  padding: 14px 18px;
  border-radius: 16px;
  background: var(--amber);
  color: var(--on-amber);
  font-size: 15px;
  line-height: 1.45;
}
