/* Ark — arknotes.app
   Warm paper, serif type, thin rules. Colors come straight from the app's asset catalog
   (BibleNotes/Assets.xcassets) and accent palettes (BibleNotes/App/AccentPalette.swift). */

:root {
  --paper: #F5EFE3;
  --paper-raised: #FBF7EE;
  --paper-deep: #EDE5D5;
  --ink: #2A241F;
  --ink-2: #6F6457;
  --rule: #DCD1BE;
  --scripture: #4A4036;
  --accent: #A84D34;
  --accent-ink: #FFFFFF;
  --accent-wash: color-mix(in srgb, var(--accent) 10%, var(--paper));
  --hl-gold: #E8C25C;
  --hl-rose: #E599A3;
  --hl-sage: #9EC28F;
  --hl-sky: #8FBDDE;
  --shadow: 0 1px 2px rgb(42 36 31 / .06), 0 12px 32px -12px rgb(42 36 31 / .18);
  --shadow-lg: 0 1px 2px rgb(42 36 31 / .06), 0 8px 16px -6px rgb(42 36 31 / .08), 0 24px 40px -16px rgb(42 36 31 / .12), 0 48px 72px -32px rgb(42 36 31 / .16);

  --serif: ui-serif, "New York", "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", system-ui, sans-serif;
  --read: var(--serif);

  --wrap: 1180px;
  --gutter: clamp(20px, 5vw, 48px);
  --radius: 22px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  color-scheme: light;
}

:root[data-theme="dark"] {
  --paper: #1B1916;
  --paper-raised: #24211D;
  --paper-deep: #15130F;
  --ink: #ECE4D5;
  --ink-2: #A99E8E;
  --rule: #3A342D;
  --scripture: #C9BFAE;
  --accent: #D97757;
  --accent-ink: #1B1916;
  --hl-gold: #8A6F2A;
  --hl-rose: #7E4A52;
  --hl-sage: #4F6645;
  --hl-sky: #3F5E74;
  --shadow: 0 1px 2px rgb(0 0 0 / .25), 0 6px 12px -4px rgb(0 0 0 / .18), 0 16px 32px -12px rgb(0 0 0 / .24);
  --shadow-lg: 0 1px 2px rgb(0 0 0 / .25), 0 8px 16px -6px rgb(0 0 0 / .18), 0 24px 40px -16px rgb(0 0 0 / .2), 0 48px 72px -32px rgb(0 0 0 / .22);
  color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #1B1916; --paper-raised: #24211D; --paper-deep: #15130F;
    --ink: #ECE4D5; --ink-2: #A99E8E; --rule: #3A342D; --scripture: #C9BFAE;
    --accent: #D97757; --accent-ink: #1B1916;
    --hl-gold: #8A6F2A; --hl-rose: #7E4A52; --hl-sage: #4F6645; --hl-sky: #3F5E74;
    --shadow: 0 1px 2px rgb(0 0 0 / .25), 0 6px 12px -4px rgb(0 0 0 / .18), 0 16px 32px -12px rgb(0 0 0 / .24);
    --shadow-lg: 0 1px 2px rgb(0 0 0 / .25), 0 8px 16px -6px rgb(0 0 0 / .18), 0 24px 40px -16px rgb(0 0 0 / .2), 0 48px 72px -32px rgb(0 0 0 / .22);
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; scroll-padding-top: 84px; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 clamp(17px, 1.05vw + 12px, 19px)/1.6 var(--serif);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; height: auto; }
a { color: inherit; }
::selection { background: color-mix(in srgb, var(--accent) 25%, transparent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

.skip { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--ink); color: var(--paper);
  padding: 10px 16px; border-radius: 10px; text-decoration: none; }
.skip:focus { top: 12px; }

.wrap { width: min(var(--wrap), 100% - 2 * var(--gutter)); margin-inline: auto; }

/* ---------- Type ---------- */
h1, h2, h3 { font-weight: 400; letter-spacing: -0.015em; margin: 0; text-wrap: balance; }
h1 { font-size: clamp(44px, 6.4vw, 86px); line-height: 1.02; letter-spacing: -0.03em; }
h2 { font-size: clamp(34px, 4.2vw, 58px); line-height: 1.06; letter-spacing: -0.025em; }
h3 { font-size: clamp(22px, 1.6vw + 12px, 28px); line-height: 1.2; }
p { margin: 0; text-wrap: pretty; }
.lede { font-size: clamp(19px, 1vw + 14px, 23px); line-height: 1.5; color: var(--ink-2); max-width: 34em; }
.label {
  font-variant: small-caps; text-transform: lowercase; letter-spacing: .08em;
  font-size: 18px; color: var(--ink-2);
}
.label.accent { color: var(--accent); }
em.ital, .scripture { font-style: italic; color: var(--scripture); }
.accent-text { color: var(--accent); }
.rule { height: 1px; background: var(--rule); border: 0; margin: 0; }

/* ---------- Buttons ---------- */
.btn {
  --h: 52px;
  display: inline-flex; align-items: center; gap: 10px; height: var(--h); padding: 0 22px;
  border-radius: 999px; font: 500 16px/1 var(--serif); text-decoration: none; white-space: nowrap;
  transition: transform .25s var(--ease), background-color .3s, box-shadow .3s, color .3s;
  border: 1px solid transparent; cursor: pointer;
}
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--accent); color: var(--accent-ink); box-shadow: 0 1px 2px rgb(42 36 31 / .12); }
.btn-primary:hover { background: color-mix(in srgb, var(--accent) 88%, var(--ink)); }
/* Hero button: cream with dark text in dark mode, the accent color with light text in light mode. */
.btn-light { background: #ECE4D5; color: #2A241F; border-color: #ECE4D5; box-shadow: 0 1px 2px rgb(0 0 0 / .12); }
.btn-light:hover { background: #F5EFE3; border-color: #F5EFE3; }
:root[data-theme="light"] .btn-light { background: var(--accent); border-color: var(--accent); color: #FFFFFF; box-shadow: 0 1px 2px rgb(42 36 31 / .12); }
:root[data-theme="light"] .btn-light:hover { background: color-mix(in srgb, var(--accent) 88%, var(--ink)); }
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .btn-light { background: var(--accent); border-color: var(--accent); color: #FFFFFF; }
}
.btn-quiet { color: var(--ink); border-color: var(--rule); background: color-mix(in srgb, var(--paper-raised) 70%, transparent); }
.btn-quiet:hover { border-color: color-mix(in srgb, var(--ink) 30%, var(--rule)); }

/* App Store badge, drawn in CSS so it matches both themes. Reads "Coming soon" until the app is live. */
.store {
  display: inline-flex; align-items: center; gap: 12px; height: 58px; padding: 0 28px 0 22px;
  border-radius: 999px; background: var(--ink); color: var(--paper); text-decoration: none;
  transition: transform .25s var(--ease), box-shadow .3s; box-shadow: var(--shadow);
}
@media (hover: hover) { .store:hover { transform: translateY(-1px); } }
.store svg { width: 26px; height: 26px; flex: none; }
.store span { display: grid; line-height: 1.12; font-family: var(--serif); }
.store small { font-size: 12.5px; letter-spacing: .01em; }
.store b { font-size: 18px; font-weight: 600; letter-spacing: -.005em; }
/* Buttons that sit beside the App Store pill match its height and shape. */
.hero-cta .btn { --h: 58px; padding: 0 28px; font-size: 17px; }
.store[aria-disabled="true"] { cursor: default; }
.soon {
  display: inline-block; font: 600 12px/1 var(--sans); letter-spacing: .06em; text-transform: uppercase;
  color: var(--accent); border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent);
  padding: 6px 9px; border-radius: 999px; vertical-align: middle;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--paper) 82%, transparent);
  backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid transparent; transition: border-color .3s, background-color .5s;
}
.site-header.scrolled { border-bottom-color: var(--rule); }
.nav { display: flex; align-items: center; justify-content: space-between; height: 72px; gap: 20px; }
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; }
.brand-mark { width: 34px; height: 34px; border-radius: 9px; border: 1px solid var(--rule); position: relative;
  background: var(--paper-raised); overflow: hidden; flex: none; }
.brand-mark::after { content: ""; position: absolute; left: 57.5%; top: 0; width: 18.5%; height: 64%;
  background: var(--accent); clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 86%, 0 100%); transition: background-color .4s; }
.brand-name { font-size: 28px; letter-spacing: -.02em; line-height: 1; }
.nav-links { display: flex; align-items: center; gap: 28px; list-style: none; margin: 0; padding: 0; }
.nav-links a { text-decoration: none; color: var(--ink-2); font-size: 16px; transition: color .2s; }
.nav-links a:hover { color: var(--ink); }
.nav-tools { display: flex; align-items: center; gap: 10px; }
.icon-btn { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; border: 1px solid var(--rule);
  background: transparent; color: var(--ink); cursor: pointer; transition: border-color .2s, transform .2s var(--ease); }
.icon-btn:hover { border-color: color-mix(in srgb, var(--ink) 30%, var(--rule)); }
.icon-btn svg { width: 19px; height: 19px; }
.theme-toggle .moon { display: none; }
:root[data-theme="dark"] .theme-toggle .sun { display: none; }
:root[data-theme="dark"] .theme-toggle .moon { display: block; }
.nav .btn { --h: 42px; padding: 0 18px; font-size: 15px; }
@media (max-width: 860px) { .nav-links { display: none; } }
@media (max-width: 480px) { .nav .btn { display: none; } }

/* ---------- Phone frame ---------- */
.phone {
  --w: 300px;
  width: var(--w); aspect-ratio: 1206 / 2622; border-radius: calc(var(--w) * .155);
  padding: calc(var(--w) * .028); background: #121110; position: relative;
  box-shadow: var(--shadow-lg), inset 0 0 0 1.5px #3b3733, inset 0 0 0 3px #0d0c0b;
  flex: none;
}
.phone img, .phone .screen {
  width: 100%; height: 100%; object-fit: cover; border-radius: calc(var(--w) * .128); background: var(--paper);
}
.phone.sm { --w: 250px; }
.phone.xs { --w: 210px; }

/* ---------- Hero ---------- */
.hero { padding: clamp(40px, 8vw, 96px) 0 clamp(64px, 9vw, 120px); position: relative; }
.hero-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: clamp(32px, 6vw, 80px); align-items: center; }
.hero .label { margin-bottom: 22px; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.hero h1 em { font-style: italic; color: var(--accent); }
.hero .lede { margin-top: 26px; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; margin-top: 38px; }
.hero-note { margin-top: 18px; font-size: 15px; color: var(--ink-2); }
.hero-visual { position: relative; display: grid; place-items: center; min-height: 640px; }
.hero-visual .phone { --w: clamp(260px, 24vw, 310px); transform: rotate(2deg); }
.hero-visual .glow {
  position: absolute; inset: 8% 6%; border-radius: 50%;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--accent) 16%, transparent), transparent);
  filter: blur(10px); z-index: -1;
}
.spoken {
  position: absolute; left: -12%; top: auto; bottom: 40%; width: min(300px, 70vw);
  background: var(--paper-raised); border: 1px solid var(--rule); border-radius: 18px; padding: 16px 18px;
  box-shadow: var(--shadow); font-size: 16px; line-height: 1.45; transform: rotate(-2deg);
}
.spoken .who { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.wave { display: inline-flex; align-items: center; gap: 2px; height: 16px; }
.wave i { width: 3px; border-radius: 3px; background: var(--accent); height: 30%; animation: wave 1s ease-in-out infinite; }
.wave i:nth-child(2) { animation-delay: .12s } .wave i:nth-child(3) { animation-delay: .24s }
.wave i:nth-child(4) { animation-delay: .36s } .wave i:nth-child(5) { animation-delay: .48s }
@keyframes wave { 0%, 100% { height: 25% } 50% { height: 100% } }
.filed {
  position: absolute; right: -6%; bottom: 10%; background: var(--paper-raised); border: 1px solid var(--rule);
  border-radius: 16px; padding: 12px 16px; box-shadow: var(--shadow); display: flex; gap: 12px; align-items: center;
  font-size: 15px; transform: rotate(1.5deg);
}
.filed .tick { width: 30px; height: 30px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; flex: none; }
.filed .tick svg { width: 16px; height: 16px; }
.filed b { font-weight: 600; display: block; font-variant: small-caps; letter-spacing: .03em; }
.filed span { color: var(--ink-2); font-size: 14px; }

@media (max-width: 960px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-visual { min-height: 0; padding: 40px 0 10px; }
  .spoken { left: 0; bottom: 44%; }
  .filed { right: 0; }
}
/* ---------- Facts strip ---------- */
.facts { border-block: 1px solid var(--rule); }
.facts ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); }
.facts li { padding: 26px 22px; display: grid; gap: 4px; border-left: 1px solid var(--rule); }
.facts li:first-child { border-left: 0; padding-left: 0; }
.facts b { font-weight: 400; font-size: clamp(22px, 1.4vw + 10px, 28px); letter-spacing: -.01em; }
.facts span { font-size: 15px; color: var(--ink-2); line-height: 1.4; }
@media (max-width: 860px) {
  .facts ul { grid-template-columns: 1fr 1fr; }
  .facts li:nth-child(3) { border-left: 0; padding-left: 0; }
  .facts li:nth-child(n+3) { border-top: 1px solid var(--rule); }
}

/* ---------- Sections ---------- */
section { position: relative; }
.section { padding: clamp(72px, 10vw, 136px) 0; }
.section + .section { border-top: 1px solid var(--rule); }
.sec-head { max-width: 780px; margin-bottom: clamp(40px, 6vw, 72px); }
.sec-head .label { display: block; margin-bottom: 18px; }
.sec-head .lede { margin-top: 22px; }
.chapter-no { font-style: italic; color: var(--accent); margin-right: .35em; }

.split { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(40px, 7vw, 110px); align-items: center; }
.split.flip > :first-child { order: 2; }
@media (max-width: 900px) { .split { grid-template-columns: 1fr; } .split.flip > :first-child { order: 0; } }

.points { list-style: none; padding: 0; margin: 32px 0 0; display: grid; gap: 0; }
.points li { padding: 18px 0; border-top: 1px solid var(--rule); display: grid; grid-template-columns: 28px 1fr; gap: 14px; }
.points li:last-child { border-bottom: 1px solid var(--rule); }
.points svg { width: 20px; height: 20px; color: var(--accent); margin-top: 4px; }
.points b { font-weight: 600; }
.points p { color: var(--ink-2); font-size: .95em; }
.points p b { color: var(--ink); }

.phones { display: flex; justify-content: center; align-items: flex-end; gap: clamp(14px, 2.5vw, 28px); }
.phones .phone:nth-child(2) { transform: translateY(-36px); }
@media (max-width: 560px) {
  .phones .phone { --w: 44vw; }
  .phones .phone:nth-child(2) { transform: translateY(-20px); }
}

/* ---------- Demo: speak → filed ---------- */
.demo {
  background: var(--paper-raised); border: 1px solid var(--rule); border-radius: 28px; box-shadow: var(--shadow);
  padding: clamp(22px, 3vw, 36px); position: relative; overflow: hidden;
}
.demo-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 22px; }
.demo-top .label { display: flex; gap: 10px; align-items: center; }
.demo-steps { display: flex; gap: 6px; }
.demo-steps button { width: 8px; height: 8px; border-radius: 50%; border: 0; padding: 0; background: var(--rule); cursor: pointer; transition: background-color .3s, width .3s var(--ease); }
.demo-steps button[aria-current="true"] { background: var(--accent); width: 22px; border-radius: 4px; }
.said { min-height: 5.2em; font-size: clamp(20px, 1.2vw + 12px, 25px); line-height: 1.4; }
.said .q { color: var(--ink-2); }
.caret { display: inline-block; width: 2px; height: 1em; background: var(--accent); vertical-align: -0.12em; margin-left: 2px; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0 } }
.arrow { display: flex; align-items: center; gap: 12px; color: var(--ink-2); font-size: 14px; margin: 18px 0; }
.arrow::before, .arrow::after { content: ""; height: 1px; background: var(--rule); flex: 1; }
.result { border-left: 2px solid var(--accent); padding: 4px 0 4px 18px; min-height: 9.5em; transition: opacity .5s var(--ease), transform .5s var(--ease); }
.result.hidden { opacity: 0; transform: translateY(8px); }
.result .ref { font-variant: small-caps; color: var(--accent); font-weight: 600; letter-spacing: .03em; font-size: 18px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.result .kind { font: 600 12px/1 var(--sans); letter-spacing: .08em; text-transform: uppercase; color: var(--accent);
  border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent); border-radius: 999px; padding: 5px 8px; font-variant: normal; }
.result .verse { font-style: italic; color: var(--scripture); margin: 8px 0 10px; font-size: 17px; }
.result .note { font-size: 18px; }
.result .how { margin-top: 10px; font-size: 14px; color: var(--ink-2); font-family: var(--sans); letter-spacing: .02em; }

/* ---------- Capture tiles ---------- */
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.tile { background: var(--paper-raised); border: 1px solid var(--rule); border-radius: var(--radius); padding: 28px; display: grid; grid-template-columns: auto 1fr; column-gap: 12px; row-gap: 10px; align-items: center; align-content: start;
  transition: transform .4s var(--ease), box-shadow .4s var(--ease); }
@media (hover: hover) { .tile:hover { transform: translateY(-3px); box-shadow: var(--shadow); } }
.tile .ico { display: grid; place-items: center; color: var(--accent); }
.tile .ico svg { width: 24px; height: 24px; }
.tile p { grid-column: 1 / -1; color: var(--ink-2); font-size: .95em; }
.tile code { font: italic 1em var(--serif); color: var(--ink); }
@media (max-width: 860px) { .tiles { grid-template-columns: 1fr; } }

/* ---------- Two-up cards ---------- */
.duo { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
@media (max-width: 860px) { .duo { grid-template-columns: 1fr; } }
.card { background: var(--paper-raised); border: 1px solid var(--rule); border-radius: 28px; padding: clamp(26px, 3vw, 40px); overflow: hidden; }
.card h3 { margin-bottom: 12px; }
.card > p { color: var(--ink-2); }
.card .phone { margin: 32px auto -120px; }

/* ---------- Search mock ---------- */
.searchbox { display: flex; align-items: center; gap: 12px; border: 1px solid var(--rule); background: var(--paper); border-radius: 999px; padding: 14px 20px; font-size: 20px; }
.searchbox svg { width: 20px; height: 20px; color: var(--ink-2); flex: none; }
.search-hits { list-style: none; padding: 0; margin: 20px 0 0; display: grid; }
.search-hits li { padding: 14px 14px; margin: 0 -14px; border-top: 1px solid var(--rule); display: grid; gap: 2px; border-radius: 12px; transition: background-color .4s var(--ease); }
.search-hits li.on { background: var(--accent-wash); border-top-color: transparent; }
.search-hits li.on + li { border-top-color: transparent; }
.search-hits .t { color: var(--accent); font-size: 20px; }
.search-hits .d { color: var(--ink-2); font-size: 15px; }
mark { background: color-mix(in srgb, var(--hl-gold) 55%, transparent); color: var(--ink); border-radius: 3px; padding: 0 2px; }

/* ---------- Scanner mock ---------- */
.scan { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: stretch; }
.page {
  background: #FBF8F0; color: #2c3550; border-radius: 6px; padding: 26px 24px; position: relative;
  font: 22px/1.55 "Bradley Hand", "Segoe Print", "Comic Sans MS", cursive;
  box-shadow: var(--shadow); transform: rotate(-1.5deg);
  background-image: repeating-linear-gradient(transparent 0 33px, #cfd9e6 33px 34px);
  background-position: 0 14px;
}
.page .ref-hit { background: color-mix(in srgb, var(--hl-gold) 60%, transparent); border-radius: 4px; padding: 0 3px; }
.page .scanline { position: absolute; left: 0; right: 0; height: 2px; background: var(--accent); top: 0; box-shadow: none; opacity: .8; animation: scan 4.5s var(--ease) infinite; }
@keyframes scan { 0% { top: 4% } 60% { top: 94% } 100% { top: 94%; opacity: 0 } }
.drafts { display: grid; gap: 10px; align-content: center; }
.draft { background: var(--paper-raised); border: 1px solid var(--rule); border-radius: 14px; padding: 12px 14px; font-size: 16px; }
.draft b { font-variant: small-caps; color: var(--accent); letter-spacing: .03em; display: block; font-size: 15px; }
@media (max-width: 560px) { .scan { grid-template-columns: 1fr; } }

/* ---------- Small features grid ---------- */
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--rule); }
.grid3 > div { padding: 30px 28px 34px 0; border-bottom: 1px solid var(--rule); }
.grid3 > div:not(:nth-child(3n+1)) { padding-left: 28px; border-left: 1px solid var(--rule); }
.grid3 h3 { font-size: 22px; margin: 14px 0 8px; }
.grid3 p { color: var(--ink-2); font-size: .95em; }
.grid3 svg { width: 24px; height: 24px; color: var(--accent); }
@media (max-width: 860px) {
  .grid3 { grid-template-columns: 1fr; }
  .grid3 > div, .grid3 > div:not(:nth-child(3n+1)) { padding: 26px 0; border-left: 0; }
}

/* ---------- Make it yours ---------- */
/* The chosen reading font restyles the whole preview card, as it restyles the whole app. */
.preview { font-family: var(--read); }
.studio { display: grid; grid-template-columns: 1.1fr .9fr; gap: clamp(32px, 6vw, 80px); align-items: center; }
@media (max-width: 900px) { .studio { grid-template-columns: 1fr; } }
.controls { display: grid; gap: 30px; margin-top: 36px; }
.ctrl-title { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 14px; gap: 12px; }
.ctrl-title output { color: var(--ink-2); font-size: 15px; font-style: italic; text-align: right; }
.swatches { display: flex; flex-wrap: wrap; gap: 12px; }
.swatch { width: 44px; height: 44px; border-radius: 50%; border: 0; cursor: pointer; background: var(--c); position: relative;
  transition: transform .25s var(--ease); }
@media (hover: hover) { .swatch:hover { transform: scale(1.07); } }
.swatch[aria-pressed="true"]::after { content: ""; position: absolute; inset: -5px; border-radius: 50%; border: 2px solid var(--c); }
.seg { display: inline-flex; border: 1px solid var(--rule); border-radius: 999px; padding: 4px; background: var(--paper-raised); }
.seg button { border: 0; background: transparent; color: var(--ink-2); font-size: 16px; font-family: inherit; padding: 9px 18px; border-radius: 999px; cursor: pointer; transition: background-color .3s, color .3s; }
.seg button[aria-pressed="true"] { background: var(--accent-wash); color: var(--accent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 30%, transparent); }
.fonts { display: flex; flex-wrap: wrap; gap: 8px; }
.fonts button { border: 1px solid var(--rule); background: var(--paper-raised); color: var(--ink); border-radius: 12px; padding: 8px 14px; font-size: 17px; cursor: pointer; transition: border-color .2s, color .2s; }
.fonts button[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); }
.preview {
  background: var(--paper-raised); border: 1px solid var(--rule); border-radius: 28px; padding: clamp(26px, 3vw, 40px); box-shadow: var(--shadow-lg);
}
.preview .label { display: block; }
.preview .ref { font-variant: small-caps; color: var(--accent); font-weight: 600; font-size: 18px; letter-spacing: .03em; margin-top: 18px; }
.preview .v { font-family: var(--read); font-size: clamp(21px, 1vw + 14px, 25px); line-height: 1.55; margin-top: 8px; }
.preview .v .hl { background: color-mix(in srgb, var(--hl-gold) 70%, transparent); border-radius: 3px; padding: 1px 0; box-decoration-break: clone; -webkit-box-decoration-break: clone; }
.preview .mynote { font-family: var(--read); border-left: 2px solid var(--accent); padding-left: 16px; margin-top: 22px; font-size: 18px; }
.preview .mynote small { display: block; color: var(--ink-2); font-size: 13px; margin-top: 4px; }
/* The app's note mark: SF Symbol text.bubble.fill in the accent color, sitting after the verse. */
.preview .bubble { display: inline-block; color: var(--accent); vertical-align: -0.15em; margin-left: 6px; }
.preview .bubble svg { width: 1.05em; height: 1.05em; display: block; }
.preview .speak { margin: 26px auto 0; width: 64px; height: 64px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; box-shadow: var(--shadow); }
.preview .speak svg { width: 26px; height: 26px; }
.meaning { font-size: 15px; color: var(--ink-2); margin-top: 10px; font-style: italic; min-height: 1.5em; }

/* ---------- Privacy ---------- */
.privacy { background: var(--paper-deep); }
.privacy-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; border-top: 1px solid var(--rule); }
.privacy-grid div { padding: 28px 26px 6px 0; }
.privacy-grid div + div { padding-left: 26px; border-left: 1px solid var(--rule); }
.privacy-grid h3 { font-size: 21px; margin-bottom: 8px; }
.privacy-grid p { color: var(--ink-2); font-size: .93em; }
@media (max-width: 860px) {
  .privacy-grid { grid-template-columns: 1fr 1fr; }
  .privacy-grid div:nth-child(3) { padding-left: 0; border-left: 0; }
}
@media (max-width: 520px) {
  .privacy-grid { grid-template-columns: 1fr; }
  .privacy-grid div, .privacy-grid div + div { padding: 22px 0; border-left: 0; border-bottom: 1px solid var(--rule); }
}

/* ---------- Words (testimonial placeholders) ---------- */
.words { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.word { margin: 0; border: 1.5px dashed var(--rule); border-radius: var(--radius); padding: 28px; display: grid; gap: 18px; align-content: space-between; min-height: 220px; }
.word blockquote { margin: 0; font-size: 21px; line-height: 1.45; color: var(--ink-2); font-style: italic; }
.word footer { font: 13px/1.4 var(--sans); letter-spacing: .06em; text-transform: uppercase; color: var(--accent); }
@media (max-width: 860px) { .words { grid-template-columns: 1fr; } .word { min-height: 0; } }

/* ---------- Final CTA ---------- */
.final { text-align: center; padding: clamp(100px, 14vw, 180px) 0; }
.js .final .ribbon.reveal { transform: scaleY(0); opacity: 1; transition: transform 1.4s var(--ease); }
.js .final .ribbon.reveal.in { transform: none; }
.final .ribbon {
  width: 46px; height: 120px; margin: 0 auto 36px; background: var(--accent);
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 84%, 0 100%); transform-origin: top;
}
.final h2 { font-size: clamp(44px, 6vw, 84px); }
.final .lede { margin: 24px auto 0; }
.final .hero-cta { justify-content: center; }
.verse-foot { margin-top: 56px; font-style: italic; color: var(--ink-2); font-size: 17px; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--rule); padding: 40px 0 56px; font-size: 15px; color: var(--ink-2); }
.foot { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; align-items: center; }
.foot nav { display: flex; gap: 22px; flex-wrap: wrap; }
.foot a { text-decoration: none; }
.foot a:hover { color: var(--ink); }

/* ---------- Doc pages (Privacy, Support) ---------- */
.doc { padding: clamp(48px, 8vw, 100px) 0 120px; }
.doc .wrap { max-width: 760px; }
.doc h1 { font-size: clamp(42px, 5vw, 64px); margin-bottom: 18px; }
.doc h2 { font-size: clamp(26px, 2vw + 14px, 34px); margin: 56px 0 14px; }
.doc h3 { font-size: 22px; margin: 32px 0 8px; }
.doc p, .doc li { color: var(--ink); }
.doc p + p { margin-top: 1em; }
.doc ul { padding-left: 1.2em; display: grid; gap: .5em; }
.doc li::marker { color: var(--accent); }
.doc .muted { color: var(--ink-2); }
.draft-banner { border: 1.5px dashed color-mix(in srgb, var(--accent) 60%, var(--rule)); background: var(--accent-wash); border-radius: 16px; padding: 16px 20px; font-size: 16px; margin: 26px 0 8px; }
.draft-banner b { color: var(--accent); }
details { border-top: 1px solid var(--rule); padding: 18px 0; }
details:last-of-type { border-bottom: 1px solid var(--rule); }
summary { cursor: pointer; font-size: 20px; list-style: none; display: flex; justify-content: space-between; gap: 20px; }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; color: var(--accent); font-size: 26px; line-height: 1; transition: transform .3s var(--ease); }
details[open] summary::after { transform: rotate(45deg); }
details p { margin-top: 12px; color: var(--ink-2); }

/* ---------- Motion ---------- */
.js .reveal { opacity: 0; transform: translateY(26px); transition: opacity 1s var(--ease), transform 1s var(--ease); transition-delay: var(--d, 0s); }
.js .reveal.in { opacity: 1; transform: none; }
.parallax { will-change: transform; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .js .reveal { opacity: 1; transform: none; }
  .page .scanline { display: none; }
  .parallax { transform: none !important; }
}

/* Hero screenshot follows the page theme */
.hero-visual .shot-dark { display: none; }
:root[data-theme="dark"] .hero-visual .shot-light { display: none; }
:root[data-theme="dark"] .hero-visual .shot-dark { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .hero-visual .shot-light { display: none; }
  :root:not([data-theme="light"]) .hero-visual .shot-dark { display: block; }
}

/* ---------- Lenis smooth scroll (vendor/lenis.min.js, MIT) ---------- */
html.lenis, html.lenis body { height: auto; }
html.lenis { scroll-behavior: auto; }
.lenis:not(.lenis-autoToggle).lenis-stopped { overflow: clip; }
.lenis [data-lenis-prevent] { overscroll-behavior: contain; }
.lenis.lenis-smooth iframe { pointer-events: none; }

/* Fine paper grain over the whole page. It also dithers soft shadows and glows,
   which would otherwise show visible steps (banding) on dark backgrounds. */
body::after {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 60; opacity: .05;
  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='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .5  0 0 0 0 .5  0 0 0 0 .5  0 0 0 1 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
}
:root[data-theme="dark"] body::after { opacity: .07; }

/* ================= iPhone / small screens ================= */
html { -webkit-tap-highlight-color: transparent; }
body { padding-left: env(safe-area-inset-left); padding-right: env(safe-area-inset-right); }

/* The sticky bar covers everything above it too, so nothing peeks out between it and the
   status bar when Safari's toolbars move. */
.site-header { padding-top: env(safe-area-inset-top); }
.site-header::before {
  content: ""; position: absolute; left: 0; right: 0; bottom: 100%; height: 100vh;
  background: var(--paper); pointer-events: none;
}

@media (max-width: 700px) {
  .nav { height: 60px; }
  .brand-name { font-size: 25px; }
  .brand-mark { width: 30px; height: 30px; }

  .hero { padding: 22px 0 48px; }
  .hero .label { margin-bottom: 16px; font-size: 16px; }
  h1 { font-size: clamp(40px, 11.5vw, 54px); }
  .hero .lede { margin-top: 18px; }
  .hero-cta { margin-top: 28px; gap: 12px; }
  .hero-cta .btn, .hero-cta .store { flex: 1 1 auto; justify-content: center; }
  .hero-visual { display: flex; justify-content: center; padding: 8px 0 0; min-height: 0; }
  .hero-grid { gap: 28px; }
  .hero-visual .phone { --w: min(74vw, 300px); transform: none !important; }
  .hero-visual .glow { inset: 10% 0; }
  /* The floating "You said" / "Filed" cards belong to the wide layout; on a phone the
     demo right below tells the same story. */
  .spoken, .filed { display: none; }

  .facts li { padding: 20px 12px 20px 16px; }
  .facts li:nth-child(odd) { padding-left: 0; }
  .facts b { font-size: 20px; }
  .facts span { font-size: 14px; }

  .section { padding: 64px 0; }
  .sec-head { margin-bottom: 32px; }
  h2 { font-size: clamp(32px, 9vw, 42px); }
  .lede { font-size: 18px; }
  .points li { grid-template-columns: 24px 1fr; gap: 12px; }

  .split { gap: 36px; }
  .phones { gap: 12px; }
  .phones .phone { --w: 43vw; }
  .phones .phone:only-child { --w: min(68vw, 280px); }
  .phones .phone:nth-child(2) { transform: translateY(-16px); }

  .demo { padding: 20px; border-radius: 22px; }
  .said { font-size: 20px; min-height: 6.2em; }
  .result { min-height: 11em; }

  .tile { padding: 22px; }
  .card { padding: 24px; border-radius: 22px; }
  .card .phone, .card .phones { margin-bottom: -110px !important; }
  .card .phones .phone { --w: 38vw; }

  .searchbox { font-size: 18px; padding: 12px 16px; }
  .search-hits .t { font-size: 18px; }

  .scan .page { transform: none; font-size: 20px; }

  .grid3 h3 { margin-top: 10px; }

  .controls { gap: 24px; margin-top: 28px; }
  .swatches { gap: 8px; flex-wrap: nowrap; }
  .swatch { width: 38px; height: 38px; flex: none; }
  .preview { padding: 22px; border-radius: 22px; }

  .words { gap: 12px; }
  .word { padding: 22px; }

  .final { padding: 88px 0 72px; }
  .final .ribbon { height: 90px; width: 38px; margin-bottom: 28px; }
  .final .hero-cta .store { flex: 0 0 auto; }
  .verse-foot { margin-top: 36px; }

  .foot { flex-direction: column; align-items: flex-start; gap: 16px; }

  /* Lighter work for phones: no fixed grain layer, no scroll-linked transforms. */
  body::after { display: none; }
}

/* ---------- Phone menu ---------- */
.menu-toggle { display: none; }
.menu-toggle .close { display: none; }
.menu-toggle[aria-expanded="true"] .open { display: none; }
.menu-toggle[aria-expanded="true"] .close { display: block; }
.mobile-menu { display: none; }
@media (max-width: 860px) {
  .menu-toggle { display: grid; }
  .site-header.menu-open { background: var(--paper); border-bottom-color: var(--rule); }
  .mobile-menu:not([hidden]) { display: block; position: absolute; left: 0; right: 0; top: 100%; border-block: 1px solid var(--rule); background: var(--paper); box-shadow: var(--shadow); max-height: calc(100dvh - 70px); overflow-y: auto; }
  .mobile-menu .wrap { display: grid; padding-block: 6px 22px; }
  .mobile-menu a:not(.btn) { display: flex; align-items: center; min-height: 54px; font-size: 21px; text-decoration: none; color: var(--ink); border-bottom: 1px solid var(--rule); }
  .mobile-menu .btn { margin-top: 20px; justify-content: center; }
}
