/* ============================================================
   Halftone website — dark-first, comic-inspired.
   ============================================================ */

:root {
  --bg: #0b0d13;
  --bg-raise: #121522;
  --bg-card: #151928;
  --ink: #ece9e1;
  --muted: #a5a2b0;
  --faint: #6d6a7a;
  --accent: #ff5c47;
  --accent-soft: rgba(255, 92, 71, 0.14);
  --amber: #ffc65c;
  --teal: #4fd8c4;
  --paper: #f4ead6;
  --paper-ink: #262019;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.14);
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
  --radius: 18px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI",
    Roboto, Helvetica, Arial, sans-serif;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #faf6ee;
    --bg-raise: #ffffff;
    --bg-card: #ffffff;
    --ink: #1c1a22;
    --muted: #5d5a68;
    --faint: #8b8896;
    --accent: #e8432e;
    --accent-soft: rgba(232, 67, 46, 0.1);
    --line: rgba(20, 16, 32, 0.1);
    --line-strong: rgba(20, 16, 32, 0.18);
    --shadow: 0 24px 60px rgba(40, 30, 20, 0.16);
  }
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img, svg { display: block; max-width: 100%; }

a { color: inherit; }

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 24px; }

/* ---------- header ---------- */

.site-header {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  border-bottom: 1px solid var(--line);
}

.site-header .wrap {
  display: flex; align-items: center; gap: 28px;
  height: 62px;
}

.brand {
  display: flex; align-items: center; gap: 10px;
  font-weight: 800; font-size: 17px; letter-spacing: -0.02em;
  text-decoration: none;
}

.brand-mark {
  width: 30px; height: 30px; border-radius: 8px;
  background: url("app-icon-64.png") center / cover no-repeat;
  flex: none;
}

.site-nav { display: flex; gap: 22px; margin-left: auto; }
.site-nav a {
  text-decoration: none; color: var(--muted);
  font-size: 14.5px; font-weight: 500;
  transition: color .15s ease;
}
.site-nav a:hover { color: var(--ink); }

.nav-cta {
  margin-left: 6px;
  background: var(--accent); color: #fff !important;
  padding: 8px 16px; border-radius: 999px;
  font-weight: 650 !important; font-size: 14px !important;
}
.nav-cta:hover { filter: brightness(1.08); }

@media (max-width: 760px) {
  .site-nav a:not(.nav-cta) { display: none; }
}

/* ---------- hero ---------- */

.hero {
  position: relative;
  padding: 88px 0 40px;
  overflow: hidden;
}

/* halftone burst */
.hero::before {
  content: ""; position: absolute; inset: -20% -10% auto;
  height: 130%;
  background-image: radial-gradient(circle, var(--accent) 1.3px, transparent 1.4px);
  background-size: 22px 22px;
  opacity: 0.14;
  -webkit-mask-image: radial-gradient(ellipse 60% 55% at 70% 20%, #000 0%, transparent 68%);
  mask-image: radial-gradient(ellipse 60% 55% at 70% 20%, #000 0%, transparent 68%);
  pointer-events: none;
}

.hero .wrap { position: relative; }

.hero-kicker {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 650; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--amber);
  margin-bottom: 22px;
}
.hero-kicker::before {
  content: ""; width: 22px; height: 2px; background: var(--amber);
}

h1 {
  font-size: clamp(40px, 7vw, 72px);
  line-height: 1.02;
  letter-spacing: -0.035em;
  font-weight: 800;
  max-width: 13ch;
}
h1 em {
  font-style: normal; color: var(--accent);
  position: relative; white-space: nowrap;
}

.hero-sub {
  margin-top: 24px; max-width: 56ch;
  font-size: clamp(16px, 2vw, 19px); color: var(--muted);
}
.hero-sub strong { color: var(--ink); font-weight: 600; }

.hero-ctas {
  display: flex; flex-wrap: wrap; gap: 14px; align-items: center;
  margin-top: 34px;
}

.btn {
  display: inline-flex; align-items: center; gap: 9px;
  border: 0; cursor: pointer; text-decoration: none;
  font-family: inherit; font-size: 15px; font-weight: 700;
  padding: 13px 22px; border-radius: 12px;
  transition: transform .12s ease, filter .12s ease;
}
.btn:hover { transform: translateY(-1px); filter: brightness(1.07); }
.btn-ico { width: 18px; height: 18px; flex: none; margin-top: -2px; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-ghost {
  background: transparent; color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--line-strong);
  font-weight: 600;
}

.hero-payline {
  margin-top: 18px; font-size: 14px; color: var(--faint);
}
.hero-payline b { color: var(--amber); font-weight: 650; }

/* hero device */
.hero-stage {
  margin-top: 64px;
  display: flex; justify-content: center;
  perspective: 1400px;
}

/* ---------- devices ---------- */

.ipad {
  width: min(760px, 92vw);
  aspect-ratio: 4 / 3;
  background: #1a1c24;
  border-radius: 26px;
  padding: 16px;
  box-shadow: var(--shadow), inset 0 0 0 1.5px rgba(255,255,255,.09);
  transform: rotateX(6deg);
}
.ipad-screen {
  width: 100%; height: 100%;
  background: #000; border-radius: 12px;
  overflow: hidden; position: relative;
  display: flex; align-items: center; justify-content: center;
}

.iphone {
  width: 180px; aspect-ratio: 9 / 19.2;
  background: #1a1c24; border-radius: 30px; padding: 8px;
  box-shadow: var(--shadow), inset 0 0 0 1.5px rgba(255,255,255,.09);
  flex: none;
}
.iphone-screen {
  width: 100%; height: 100%;
  background: #000; border-radius: 23px;
  overflow: hidden; position: relative;
}
.iphone-screen::before {
  content: ""; position: absolute; top: 7px; left: 50%;
  transform: translateX(-50%);
  width: 52px; height: 14px; border-radius: 999px;
  background: #16181f; z-index: 6;
}

/* ---------- drawn comic pages ---------- */

.comic-page {
  background: var(--paper);
  position: relative;
  overflow: hidden;
}
.comic-page .panels {
  position: absolute; inset: 5%;
  display: grid; gap: 4%;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1.25fr 1fr 0.8fr;
}
.comic-page .panel {
  border: 2px solid var(--paper-ink);
  border-radius: 2px;
  background: #fffaf0;
  position: relative; overflow: hidden;
}
.panel.wide { grid-column: span 2; }
.panel.halftone {
  background-image: radial-gradient(circle, rgba(38,32,25,.5) 1px, transparent 1.15px);
  background-size: 7px 7px; background-color: #f7e7c9;
}
.panel.speed {
  background: repeating-linear-gradient(105deg,
    #fffaf0 0 5px, rgba(38,32,25,.55) 5px 6.5px);
}
.panel.splash { background: linear-gradient(135deg, #ff8d68, #e8432e 70%); }
.panel.night { background: linear-gradient(160deg, #2a3352, #141a30 70%); }
.panel.sky   { background: linear-gradient(180deg, #9fd8e8, #e8f2d8 80%); }
.panel .blob {
  position: absolute; border-radius: 50%;
  background: rgba(38,32,25,.78);
}
.panel .bubble {
  position: absolute; background: #fff; border: 1.5px solid var(--paper-ink);
  border-radius: 50%; width: 38%; height: 30%;
}
.panel .burst {
  position: absolute; inset: 22% 18%;
  background: var(--amber);
  clip-path: polygon(50% 0, 61% 33%, 98% 25%, 72% 55%, 90% 89%, 55% 70%, 32% 98%, 33% 62%, 2% 60%, 30% 40%);
}

/* ---------- section scaffolding ---------- */

section { padding: 92px 0; position: relative; }
section.alt { background: var(--bg-raise); border-block: 1px solid var(--line); }

.sec-kicker {
  font-size: 13px; font-weight: 700; letter-spacing: .1em;
  text-transform: uppercase; color: var(--accent); margin-bottom: 14px;
}
/* three halftone dots before every section kicker — the name, as punctuation */
.sec-kicker::before {
  content: ""; display: inline-block; width: 22px; height: 8px;
  margin-right: 9px;
  background: radial-gradient(circle, var(--accent) 2.1px, transparent 2.5px) 0 50% / 8px 8px repeat-x;
  vertical-align: middle;
}

/* reusable halftone dot texture — colors come from the existing palette only */
.dot-field { position: relative; }
.dot-field > .wrap { position: relative; }
.dot-field::before {
  content: ""; position: absolute; inset: 0;
  background-image: radial-gradient(circle, var(--accent) 1.3px, transparent 1.45px);
  background-size: 22px 22px;
  opacity: 0.10;
  -webkit-mask-image: radial-gradient(ellipse 55% 70% at 88% 100%, #000 0%, transparent 70%);
  mask-image: radial-gradient(ellipse 55% 70% at 88% 100%, #000 0%, transparent 70%);
  pointer-events: none;
}
h2 {
  font-size: clamp(28px, 4.4vw, 44px);
  letter-spacing: -0.03em; line-height: 1.08; font-weight: 800;
  max-width: 22ch;
}
.sec-sub { margin-top: 16px; color: var(--muted); max-width: 60ch; font-size: 17px; }

/* reveal on scroll */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* ---------- sources grid ---------- */

.source-grid {
  margin-top: 44px;
  display: grid; gap: 14px;
  grid-template-columns: repeat(4, 1fr);
}
@media (max-width: 860px) { .source-grid { grid-template-columns: repeat(2, 1fr); } }

.source-tile {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 20px;
  transition: transform .18s ease, border-color .18s ease;
}
.source-tile:hover { transform: translateY(-3px); border-color: var(--line-strong); }
.source-tile .ico {
  width: 40px; height: 40px; border-radius: 11px;
  display: grid; place-items: center;
  margin-bottom: 14px;
}
/* Branded sources show the same logo assets the app bundles (Website/assets/logos/,
   copied from the app's Assets.xcassets — see FileSourceType.brandAssetName). */
.source-tile .ico.brand { background: transparent; }
.source-tile .ico.brand img { width: 36px; height: 36px; object-fit: contain; }
/* Unbranded sources mirror the app's SourceTypeIcon: white SF-Symbol-style glyph
   on the type's fixed color (SMB indigo, WebDAV teal, OPDS orange, Files blue). */
.source-tile .ico.glyph { color: #fff; }
.source-tile .ico.glyph-smb { background: #5856d6; }
.source-tile .ico.glyph-webdav { background: #30b0c7; }
.source-tile .ico.glyph-opds { background: #ff9500; }
.source-tile .ico.glyph-files { background: #007aff; }
.source-tile .ico.glyph-abs { background: #a2845e; }
.source-tile .ico.glyph-onedrive { background: #007aff; }
.source-tile h3 { font-size: 16px; font-weight: 700; letter-spacing: -0.01em; }
.source-tile p { font-size: 13.5px; color: var(--muted); margin-top: 5px; line-height: 1.5; }

.source-notes {
  margin-top: 34px; display: grid; gap: 14px;
  grid-template-columns: repeat(3, 1fr);
}
@media (max-width: 860px) { .source-notes { grid-template-columns: 1fr; } }
.source-note {
  display: flex; gap: 13px; align-items: flex-start;
  font-size: 14.5px; color: var(--muted);
  padding: 16px 18px; border-radius: 14px;
  background: color-mix(in srgb, var(--bg-card) 60%, transparent);
  border: 1px dashed var(--line-strong);
}
.source-note b { color: var(--ink); }
.source-note .dot {
  flex: none; width: 9px; height: 9px; border-radius: 50%;
  margin-top: 7px; background: var(--accent);
}
.source-note:nth-child(2) .dot { background: var(--teal); }
.source-note:nth-child(3) .dot { background: var(--amber); }

/* ---------- feature rows ---------- */

.feature-row {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: clamp(32px, 6vw, 84px); align-items: center;
  padding: 58px 0;
}
.feature-row + .feature-row { border-top: 1px solid var(--line); }
.feature-row:nth-child(even) .feature-copy { order: 2; }
@media (max-width: 820px) {
  .feature-row { grid-template-columns: 1fr; gap: 30px; }
  .feature-row:nth-child(even) .feature-copy { order: 0; }
}

.feature-copy .tag {
  display: inline-block; font-size: 12px; font-weight: 700;
  letter-spacing: .09em; text-transform: uppercase;
  color: var(--accent); background: var(--accent-soft);
  padding: 5px 11px; border-radius: 999px; margin-bottom: 16px;
}
.feature-copy h3 {
  font-size: clamp(24px, 3vw, 32px); font-weight: 800;
  letter-spacing: -0.025em; line-height: 1.12;
}
.feature-copy p { margin-top: 14px; color: var(--muted); font-size: 16px; max-width: 46ch; }
.feature-copy p b { color: var(--ink); font-weight: 600; }

.demo {
  display: flex; justify-content: center; align-items: center;
  min-height: 340px;
  background:
    radial-gradient(circle at 50% 40%, var(--accent-soft), transparent 70%),
    var(--bg-card);
  border: 1px solid var(--line); border-radius: 24px;
  padding: 34px 20px; overflow: hidden; position: relative;
}
.demo.teal { background: radial-gradient(circle at 50% 40%, rgba(79,216,196,.1), transparent 70%), var(--bg-card); }
.demo.amber { background: radial-gradient(circle at 50% 40%, rgba(255,198,92,.09), transparent 70%), var(--bg-card); }

/* ============================================================
   ANIMATED DEMOS  (CSS stand-ins for the feature loops —
   replaced by real capture videos per WEBSITE.md §6)
   ============================================================ */

@media (prefers-reduced-motion: reduce) {
  .demo * { animation: none !important; }
}

/* --- 1. Hold Zoom --- */
.hz-page {
  position: absolute; inset: 0;
  animation: hz-pan 7s ease-in-out infinite;
}
@keyframes hz-pan {
  0%, 14%   { transform: scale(1) translate(0, 0); }
  26%, 40%  { transform: scale(1.7) translate(-9%, -7%); }
  54%, 68%  { transform: scale(1.7) translate(9%, 9%); }
  82%, 100% { transform: scale(1) translate(0, 0); }
}
.hz-touch {
  position: absolute; z-index: 5;
  width: 34px; height: 34px; border-radius: 50%;
  left: 58%; top: 62%;
  background: rgba(255,92,71,.4);
  box-shadow: 0 0 0 3px rgba(255,92,71,.65), 0 2px 14px rgba(0,0,0,.4);
  animation: hz-touch 7s ease-in-out infinite;
}
@keyframes hz-touch {
  0%, 8%    { opacity: 0; transform: scale(.4); }
  14%       { opacity: 1; transform: scale(1); }
  26%, 40%  { opacity: 1; transform: scale(.85) translate(26px, 20px); }
  54%, 68%  { opacity: 1; transform: scale(.85) translate(-26px, -26px); }
  76%       { opacity: 1; transform: scale(1); }
  82%, 100% { opacity: 0; transform: scale(.4); }
}

/* --- 2. Page Curl --- */
.curl-stage { position: absolute; inset: 0; perspective: 900px; }
.curl-under { position: absolute; inset: 0; }
.curl-leaf {
  position: absolute; inset: 0;
  transform-origin: left center;
  transform-style: preserve-3d;
  animation: curl-turn 6s cubic-bezier(.5, .05, .35, 1) infinite;
}
.curl-leaf .face { position: absolute; inset: 0; backface-visibility: hidden; }
.curl-leaf .face.back {
  transform: rotateY(180deg);
  background: linear-gradient(90deg, #d9cdb4, var(--paper) 30%);
}
.curl-leaf::after { /* moving fold shadow */
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(100deg, transparent 55%, rgba(0,0,0,.28));
  animation: curl-shade 6s cubic-bezier(.5, .05, .35, 1) infinite;
}
@keyframes curl-turn {
  0%, 22%  { transform: rotateY(0deg); }
  58%, 88% { transform: rotateY(-178deg); }
  100%     { transform: rotateY(-178deg); }
}
@keyframes curl-shade {
  0%, 22% { opacity: 0; } 34% { opacity: 1; } 58%, 100% { opacity: 0; }
}
.curl-stage .spine-shadow {
  position: absolute; inset: 0 auto 0 0; width: 8%;
  background: linear-gradient(90deg, rgba(0,0,0,.32), transparent);
  z-index: 4; pointer-events: none;
}

/* --- 3. Double-page spreads --- */
.spread-stage {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: #000;
}
.spread-page {
  width: 37%; height: 86%;
  animation: spread-join 7s ease-in-out infinite;
}
.spread-page.left  { transform-origin: right center; }
.spread-page.right { transform-origin: left center; }
.spread-page.left  { animation-name: spread-join-l; }
.spread-page.right { animation-name: spread-join-r; }
@keyframes spread-join-l {
  0%, 18%   { transform: translateX(-46%); opacity: .35; }
  34%, 82%  { transform: translateX(0); opacity: 1; }
  96%, 100% { transform: translateX(-46%); opacity: .35; }
}
@keyframes spread-join-r {
  0%, 18%   { transform: translateX(46%); opacity: .35; }
  34%, 82%  { transform: translateX(0); opacity: 1; }
  96%, 100% { transform: translateX(46%); opacity: .35; }
}
.spread-spine {
  width: 3px; height: 86%;
  background: linear-gradient(180deg, rgba(0,0,0,.0), rgba(0,0,0,.55), rgba(0,0,0,0));
  z-index: 3;
}
.spread-badge {
  position: absolute; bottom: 10px; right: 12px; z-index: 5;
  font-size: 10.5px; font-weight: 700; letter-spacing: .06em;
  color: #fff; background: rgba(255,92,71,.9);
  padding: 4px 9px; border-radius: 999px;
  animation: spread-badge 7s ease-in-out infinite;
}
@keyframes spread-badge {
  0%, 30% { opacity: 0; transform: translateY(6px); }
  40%, 82% { opacity: 1; transform: none; }
  92%, 100% { opacity: 0; }
}

/* --- 4. Match Page background --- */
.mp-stage {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  animation: mp-bg 9s ease-in-out infinite;
}
@keyframes mp-bg {
  0%, 26%  { background: #f4ead6; }
  33%, 59% { background: #141a30; }
  66%, 93% { background: #0a0a0a; }
  100%     { background: #f4ead6; }
}
.mp-page { width: 62%; height: 74%; border-radius: 3px; position: relative; overflow: hidden; }
.mp-page .leaf2 { position: absolute; inset: 0; }
.mp-page .leaf2.a { animation: mp-swap-a 9s ease-in-out infinite; }
.mp-page .leaf2.b { animation: mp-swap-b 9s ease-in-out infinite; }
.mp-page .leaf2.c { animation: mp-swap-c 9s ease-in-out infinite; }
@keyframes mp-swap-a { 0%, 26% { opacity: 1; } 33%, 93% { opacity: 0; } 100% { opacity: 1; } }
@keyframes mp-swap-b { 0%, 26% { opacity: 0; } 33%, 59% { opacity: 1; } 66%, 100% { opacity: 0; } }
@keyframes mp-swap-c { 0%, 59% { opacity: 0; } 66%, 93% { opacity: 1; } 100% { opacity: 0; } }
.mp-label {
  position: absolute; top: 12px; left: 50%; transform: translateX(-50%);
  font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: #888; background: rgba(0,0,0,.45); padding: 4px 10px; border-radius: 999px;
  backdrop-filter: blur(4px); z-index: 5; white-space: nowrap;
}

/* --- 5. Vertical / long-strip --- */
.vs-strip {
  position: absolute; inset: 0 8%;
  animation: vs-scroll 9s linear infinite;
}
.vs-strip .cell {
  height: 130px; margin: 8px 0; border-radius: 4px;
  border: 2px solid var(--paper-ink); background: #fffaf0;
}
@keyframes vs-scroll {
  from { transform: translateY(0); }
  to   { transform: translateY(-50%); }
}

/* --- 6. Fit modes --- */
.fit-stage {
  position: absolute; inset: 0; background: #000;
  display: flex; align-items: center; justify-content: center;
}
.fit-page {
  width: 46%; height: 62%;
  animation: fit-cycle 8s ease-in-out infinite;
}
@keyframes fit-cycle {
  0%, 24%   { width: 46%; height: 62%; }   /* screen */
  33%, 57%  { width: 84%; height: 113%; }  /* width  */
  66%, 90%  { width: 66%; height: 88%; }   /* height-ish */
  100%      { width: 46%; height: 62%; }
}
.fit-label {
  position: absolute; bottom: 12px; left: 50%; transform: translateX(-50%);
  z-index: 5; display: flex; gap: 6px;
}
.fit-label span {
  font-size: 10px; font-weight: 700; letter-spacing: .05em;
  color: var(--faint); background: rgba(255,255,255,.07);
  padding: 3px 9px; border-radius: 999px;
}
.fit-label span:nth-child(1) { animation: fit-l1 8s infinite; }
.fit-label span:nth-child(2) { animation: fit-l2 8s infinite; }
.fit-label span:nth-child(3) { animation: fit-l3 8s infinite; }
@keyframes fit-l1 {
  0%, 24% { color: #fff; background: var(--accent); }
  28%, 100% { color: var(--faint); background: rgba(255,255,255,.07); }
}
@keyframes fit-l2 {
  0%, 28% { color: var(--faint); background: rgba(255,255,255,.07); }
  33%, 57% { color: #fff; background: var(--accent); }
  61%, 100% { color: var(--faint); background: rgba(255,255,255,.07); }
}
@keyframes fit-l3 {
  0%, 61% { color: var(--faint); background: rgba(255,255,255,.07); }
  66%, 90% { color: #fff; background: var(--accent); }
  94%, 100% { color: var(--faint); background: rgba(255,255,255,.07); }
}

/* --- 7. Swipe down to close --- */
.sd-library {
  position: absolute; inset: 0; padding: 12% 9% 8%;
  display: grid; grid-template-columns: repeat(3, 1fr);
  grid-auto-rows: 22%; gap: 6% 9%;
  background: #101018;
}
.sd-library .cover:nth-child(7) { background: linear-gradient(150deg, #6e4a29, #382413); }
.sd-library .cover:nth-child(8) { background: linear-gradient(150deg, #294f6e, #14283a); }
.sd-library .cover:nth-child(9) { background: linear-gradient(150deg, #555, #2a2a2a); }
.sd-library .cover {
  border-radius: 4px;
  background: linear-gradient(150deg, #3a4a72, #22293f);
}
.sd-library .cover:nth-child(2) { background: linear-gradient(150deg, #7a3b58, #3d2033); }
.sd-library .cover:nth-child(3) { background: linear-gradient(150deg, #3b6b57, #1f3a2f); }
.sd-library .cover:nth-child(4) { background: linear-gradient(150deg, #8a6a2f, #4a3818); }
.sd-library .cover:nth-child(5) { background: linear-gradient(150deg, #5b3b7a, #2c1e3d); }
.sd-library .cover:nth-child(6) { background: linear-gradient(150deg, #29556e, #14293a); }
.sd-reader {
  position: absolute; inset: 0; z-index: 4;
  border-radius: 0; overflow: hidden;
  animation: sd-drop 6.5s cubic-bezier(.4, 0, .3, 1) infinite;
  box-shadow: 0 10px 40px rgba(0,0,0,.6);
}
@keyframes sd-drop {
  0%, 26%   { transform: none; border-radius: 0; opacity: 1; }
  46%       { transform: translateY(26%) scale(.72); border-radius: 18px; opacity: 1; }
  60%, 88%  { transform: translateY(120%) scale(.5); border-radius: 22px; opacity: 0; }
  92%, 100% { transform: none; border-radius: 0; opacity: 1; }
}
.sd-touch {
  position: absolute; z-index: 6;
  width: 30px; height: 30px; border-radius: 50%;
  left: 50%; top: 30%; margin-left: -15px;
  background: rgba(255,92,71,.42);
  box-shadow: 0 0 0 3px rgba(255,92,71,.6);
  animation: sd-touch 6.5s cubic-bezier(.4, 0, .3, 1) infinite;
}
@keyframes sd-touch {
  0%, 18%   { opacity: 0; transform: none; }
  26%       { opacity: 1; transform: none; }
  46%       { opacity: 1; transform: translateY(150%); }
  56%, 100% { opacity: 0; transform: translateY(190%); }
}

/* --- 8. Right-to-left --- */
.rtl-stage {
  position: absolute; inset: 0; background: #000; overflow: hidden;
}
.rtl-rail {
  position: absolute; inset: 10% auto 10% 0;
  display: flex; gap: 6%; width: 220%;
  animation: rtl-flow 9s ease-in-out infinite;
}
.rtl-rail .comic-page { width: 21%; flex: none; border-radius: 3px; }
@keyframes rtl-flow {
  0%, 20%   { transform: translateX(-56%); }
  32%, 52%  { transform: translateX(-28%); }
  64%, 88%  { transform: translateX(0%); }
  100%      { transform: translateX(0%); }
}
.rtl-arrow {
  position: absolute; top: 34px; right: 10px; z-index: 5;
  font-size: 11px; font-weight: 800; letter-spacing: .12em;
  color: var(--amber);
}

/* ---------- streaming ring (used in sources) ---------- */
.ring {
  width: 15px; height: 15px; border-radius: 50%; flex: none; margin-top: 4px;
  background: conic-gradient(var(--teal) 0 70%, rgba(255,255,255,.14) 70% 100%);
  -webkit-mask: radial-gradient(circle, transparent 44%, #000 46%);
  mask: radial-gradient(circle, transparent 44%, #000 46%);
}

/* ---------- library section ---------- */

.library-stage {
  margin-top: 48px;
  display: grid; grid-template-columns: 1.15fr 1fr; gap: 40px; align-items: center;
}
@media (max-width: 820px) { .library-stage { grid-template-columns: 1fr; } }

.lib-mock {
  background: #101018; border: 1px solid var(--line-strong);
  border-radius: 20px; padding: 18px; box-shadow: var(--shadow);
}
.lib-mock .lib-bar {
  display: flex; align-items: center; gap: 10px; margin-bottom: 14px;
}
.lib-mock .lib-search {
  flex: 1; height: 30px; border-radius: 8px;
  background: rgba(255,255,255,.06);
  display: flex; align-items: center; padding: 0 10px;
  color: #71718a; font-size: 12px; gap: 6px;
}
.lib-mock .lib-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px;
}
.lib-mock .lib-item .cov {
  aspect-ratio: 2 / 3; border-radius: 6px;
  background: linear-gradient(150deg, #3a4a72, #22293f);
  position: relative;
}
.lib-mock .lib-item:nth-child(2) .cov { background: linear-gradient(150deg, #7a3b58, #3d2033); }
.lib-mock .lib-item:nth-child(3) .cov { background: linear-gradient(150deg, #3b6b57, #1f3a2f); }
.lib-mock .lib-item:nth-child(4) .cov { background: linear-gradient(150deg, #8a6a2f, #4a3818); }
.lib-mock .lib-item:nth-child(5) .cov { background: linear-gradient(150deg, #5b3b7a, #2c1e3d); }
.lib-mock .lib-item:nth-child(6) .cov { background: linear-gradient(150deg, #29556e, #14293a); }
.lib-mock .lib-item:nth-child(7) .cov { background: linear-gradient(150deg, #6e4a29, #382413); }
.lib-mock .lib-item:nth-child(8) .cov { background: linear-gradient(150deg, #444, #222); }
.lib-mock .cov .src {
  position: absolute; bottom: 5px; right: 5px;
  font-size: 8px; font-weight: 800; color: #fff;
  background: rgba(0,0,0,.55); padding: 2px 5px; border-radius: 4px;
  letter-spacing: .04em;
}
.lib-mock .cov .bar {
  position: absolute; bottom: 0; left: 0; height: 3px;
  background: var(--accent); border-radius: 0 2px 2px 0;
}
.lib-mock .lib-item .t {
  margin-top: 7px; height: 7px; border-radius: 3px; width: 80%;
  background: rgba(255,255,255,.14);
}

.lib-points { display: grid; gap: 6px; }
.lib-point { padding: 16px 0; border-bottom: 1px solid var(--line); }
.lib-point:last-child { border-bottom: 0; }
.lib-point h4 { font-size: 16.5px; font-weight: 700; letter-spacing: -0.01em; }
.lib-point p { font-size: 14.5px; color: var(--muted); margin-top: 4px; }

/* ---------- formats strip ---------- */

.formats {
  padding: 44px 0;
  border-block: 1px solid var(--line);
  background: var(--bg-raise);
}
.formats .wrap {
  display: flex; flex-wrap: wrap; gap: 12px 14px; align-items: center; justify-content: center;
}
.formats .lead {
  font-size: 14px; font-weight: 650; color: var(--faint);
  letter-spacing: .06em; text-transform: uppercase; margin-right: 8px;
}
.fmt {
  font-size: 14px; font-weight: 800; letter-spacing: .03em;
  padding: 9px 18px; border-radius: 10px;
  background: var(--bg-card); border: 1px solid var(--line-strong);
}
.fmt small { display: block; font-size: 10.5px; font-weight: 500; color: var(--faint); letter-spacing: 0; }

/* ---------- pricing ---------- */

.price-cards {
  margin-top: 46px;
  display: grid; grid-template-columns: 1fr 1fr 1.15fr; gap: 18px; align-items: stretch;
}
@media (max-width: 900px) { .price-cards { grid-template-columns: 1fr; max-width: 560px; } }

.price-card {
  background: var(--bg-card); border: 1px solid var(--line);
  border-radius: 22px; padding: 34px 30px;
  display: flex; flex-direction: column;
}
.price-card.featured {
  border: 1.5px solid var(--accent);
  background:
    radial-gradient(circle at 80% 0%, var(--accent-soft), transparent 60%),
    var(--bg-card);
  position: relative;
}
.price-card.featured::before {
  content: "Pay once"; position: absolute; top: -13px; left: 28px;
  background: var(--accent); color: #fff;
  font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase;
  padding: 4px 12px; border-radius: 999px;
}
.price-card h3 { font-size: 20px; font-weight: 800; letter-spacing: -0.01em; }
.price-num { font-size: 42px; font-weight: 800; letter-spacing: -0.04em; margin-top: 10px; }
.price-num small { display: block; font-size: 15px; font-weight: 600; color: var(--muted); letter-spacing: 0; margin-top: 6px; }
/* Dual-price variant (subscription card): both prices at full weight, neither hidden. */
.price-num.dual {
  font-size: 30px;
  display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap;
}
.price-num.dual .opt small {
  display: inline; font-size: 14px; margin: 0 0 0 2px; font-weight: 600; color: var(--muted);
}
.price-num.dual .or {
  font-size: 14px; font-weight: 600; color: var(--faint); letter-spacing: 0;
}
.price-card > p { color: var(--muted); font-size: 14.5px; margin-top: 6px; }
.price-card ul { list-style: none; margin-top: 22px; display: grid; gap: 11px; }
.price-card li {
  font-size: 14.5px; color: var(--muted);
  position: relative; padding-left: 24px;
}
.price-card li::before {
  content: "✓"; color: var(--teal); font-weight: 800;
  position: absolute; left: 0; top: 0;
}
.price-card li b { color: var(--ink); font-weight: 600; }

.price-promise {
  margin-top: 26px; max-width: 820px;
  font-size: 14.5px; color: var(--faint);
  border-left: 3px solid var(--amber); padding-left: 16px;
}
.price-promise b { color: var(--amber); }

/* ---------- privacy ---------- */

.privacy-band { text-align: center; }
.privacy-band h2 { margin: 0 auto; }
.privacy-band .sec-sub { margin: 16px auto 0; }

/* ---------- beta signup ---------- */

.beta-band { border-top: 1px solid var(--line); background: var(--bg-raise); }

.beta-form {
  margin-top: 30px; max-width: 660px;
  display: flex; flex-direction: column; gap: 12px;
}
.beta-row { display: flex; gap: 12px; flex-wrap: wrap; }
.beta-form input:not(.hp-field),
.beta-form select {
  flex: 1; min-width: 220px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--line-strong);
  background: var(--bg-card); color: var(--ink);
  font: inherit; font-size: 15px;
}
.beta-form input:focus, .beta-form select:focus {
  outline: none; border-color: var(--accent);
}
.beta-form select { appearance: none; -webkit-appearance: none; }
.beta-form .btn { flex: none; }

/* honeypot — invisible to people, tempting to bots */
.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

.beta-note { font-size: 13px; color: var(--faint); }
.beta-note a { color: var(--muted); }
.beta-done { color: var(--teal); font-weight: 650; font-size: 17px; }
.beta-err { color: var(--accent); font-size: 14px; font-weight: 600; }
.privacy-claims {
  margin-top: 40px;
  display: flex; flex-wrap: wrap; gap: 12px; justify-content: center;
}
.claim {
  font-size: 14.5px; font-weight: 600;
  border: 1px solid var(--line-strong); border-radius: 999px;
  padding: 11px 20px; color: var(--muted);
}
.claim b { color: var(--ink); }
.privacy-band .pol-link {
  display: inline-block; margin-top: 30px;
  color: var(--accent); font-weight: 650; font-size: 15px;
}

/* ---------- FAQ ---------- */

.faq-list { margin-top: 40px; max-width: 760px; }
.faq-list details {
  border-bottom: 1px solid var(--line);
}
.faq-list summary {
  cursor: pointer; list-style: none;
  padding: 22px 34px 22px 0;
  font-size: 17px; font-weight: 650; letter-spacing: -0.01em;
  position: relative;
}
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary::after {
  content: "+"; position: absolute; right: 4px; top: 50%;
  transform: translateY(-50%);
  font-size: 22px; font-weight: 400; color: var(--accent);
  transition: transform .2s ease;
}
.faq-list details[open] summary::after { transform: translateY(-50%) rotate(45deg); }
.faq-list details p {
  padding: 0 0 24px; color: var(--muted); font-size: 15.5px; max-width: 64ch;
}
.faq-list details p b { color: var(--ink); font-weight: 600; }

/* ---------- final CTA ---------- */

.cta-final {
  text-align: center;
  background:
    radial-gradient(ellipse 70% 90% at 50% 110%, var(--accent-soft), transparent 70%),
    var(--bg-raise);
  border-top: 1px solid var(--line);
}
.cta-final h2 { margin: 0 auto; }
.cta-final .hero-ctas { justify-content: center; }
.cta-final .hero-payline { margin-top: 22px; }

/* ---------- footer ---------- */

.site-footer {
  border-top: 1px solid var(--line);
  padding: 56px 0 40px;
  font-size: 14px; color: var(--muted);
}
.footer-cols {
  display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 32px;
}
@media (max-width: 760px) { .footer-cols { grid-template-columns: 1fr 1fr; } }
.footer-cols h5 {
  font-size: 12px; font-weight: 700; letter-spacing: .09em;
  text-transform: uppercase; color: var(--faint); margin-bottom: 14px;
}
.footer-cols ul { list-style: none; display: grid; gap: 9px; }
.footer-cols a { text-decoration: none; color: var(--muted); }
.footer-cols a:hover { color: var(--ink); }
.footer-brand p { margin-top: 12px; max-width: 30ch; font-size: 13.5px; color: var(--faint); }
.footer-brand .footer-note { margin-top: 8px; font-size: 12.5px; font-style: italic; opacity: .85; }
.footer-legal {
  margin-top: 44px; padding-top: 22px; border-top: 1px solid var(--line);
  display: flex; flex-wrap: wrap; gap: 14px; justify-content: space-between;
  font-size: 13px; color: var(--faint);
}

/* ---------- legal pages ---------- */

.legal-page { padding: 72px 0 96px; }
.legal-page .wrap { max-width: 760px; }
.legal-page h1 { font-size: clamp(32px, 5vw, 44px); max-width: none; }
.legal-page .updated { color: var(--faint); font-size: 14px; margin-top: 12px; }
.legal-page h2 {
  font-size: 22px; margin-top: 44px; max-width: none;
}
.legal-page p, .legal-page li { color: var(--muted); font-size: 15.5px; margin-top: 14px; }
.legal-page ul { padding-left: 22px; }
.legal-page li { margin-top: 8px; }
.legal-page b, .legal-page strong { color: var(--ink); }
.legal-page a { color: var(--accent); }
.legal-callout {
  margin-top: 28px; padding: 20px 22px;
  background: var(--bg-card); border: 1px solid var(--line-strong);
  border-left: 3px solid var(--teal); border-radius: 12px;
  font-size: 15.5px; color: var(--ink);
}

/* ---------- SEO landing pages ----------
   Standalone pages at the root (kavita-ios-app.html, komga-ios-app.html,
   audiobookshelf-comic-reader.html, komga-vs-kavita.html,
   chunky-replacement.html) per WEBSITE.md §5. New classes only —
   nothing here changes the homepage. */

.seo-hero { padding: 76px 0 10px; }
.seo-hero h1 { font-size: clamp(34px, 5.5vw, 54px); max-width: 22ch; }
.seo-hero .lede {
  margin-top: 20px; max-width: 62ch;
  font-size: 17.5px; color: var(--muted);
}
.seo-hero .lede b { color: var(--ink); font-weight: 600; }

.seo-article { padding: 30px 0 80px; }
.seo-article .wrap { max-width: 780px; }
.seo-article h2 { font-size: clamp(23px, 3.2vw, 30px); margin-top: 56px; max-width: none; }
.seo-article h3 { font-size: 18px; font-weight: 700; margin-top: 30px; }
.seo-article p { color: var(--muted); font-size: 16px; margin-top: 14px; }
.seo-article p b, .seo-article li b { color: var(--ink); font-weight: 600; }
.seo-article ul.checks { list-style: none; margin-top: 18px; display: grid; gap: 11px; }
.seo-article ul.checks li {
  font-size: 15.5px; color: var(--muted);
  position: relative; padding-left: 26px;
}
.seo-article ul.checks li::before {
  content: "✓"; color: var(--teal); font-weight: 800;
  position: absolute; left: 0; top: 0;
}
.seo-article .faq-list { margin-top: 26px; }

.cta-band {
  margin: 46px 0 8px; padding: 26px 28px;
  background: var(--bg-card); border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  display: flex; flex-wrap: wrap; gap: 18px;
  align-items: center; justify-content: space-between;
}
.cta-band p { margin: 0; color: var(--muted); font-size: 15px; max-width: 46ch; }
.cta-band p b { color: var(--ink); }

.compare-scroll { overflow-x: auto; margin-top: 26px; }
.compare-table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.compare-table th, .compare-table td {
  text-align: left; padding: 12px 14px;
  border-bottom: 1px solid var(--line); vertical-align: top;
}
.compare-table th {
  color: var(--ink); font-size: 12.5px;
  letter-spacing: .05em; text-transform: uppercase;
}
.compare-table td { color: var(--muted); }
.compare-table td:first-child { color: var(--ink); font-weight: 600; white-space: nowrap; }
