/* =========================================================================
   Синодал: landing site styles.
   Light, warm, bookish. Single stylesheet, no build step. See DESIGN_SPEC.md.
   ========================================================================= */

:root {
  color-scheme: light;

  /* ---- from the app ---- */
  --bg:          #FAF8F5;
  --card:        #FFFFFF;
  --text:        #2C2418;
  --muted:       #6E6454;
  --accent:      #8B6914;
  --border:      #EDE8E0;
  --fast-bg:     #F0EBE3;
  --fast-text:   #785E2E;
  --today:       #F5F0E6;
  --gold-1:      #D3B37D;
  --gold-2:      #E5C795;
  --gold-ink:    #F7F4EF;

  /* ---- derived, site only ---- */
  --text-75:     rgba(44, 36, 24, 0.75);
  --accent-soft: rgba(139, 105, 20, 0.10);
  --accent-line: rgba(139, 105, 20, 0.28);
  --scrim:       rgba(44, 36, 24, 0.06);

  --shadow-card:  0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-float: 0 10px 30px rgba(44, 36, 24, 0.10),
                  0 2px 6px rgba(44, 36, 24, 0.05);

  --radius-card: 16px;
  --radius-sm:   10px;
  --radius-xs:   8px;
  --radius-pill: 999px;
  --radius-phone-outer: 40px;
  --radius-phone-inner: 30px;

  --page-max:  1080px;
  --prose-max: 62ch;
  --phone-w:   320px;
  --gutter:    24px;
  --section-y: clamp(64px, 9vw, 120px);

  --serif: "Cormorant Garamond", "Iowan Old Style", Georgia, "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto,
          "Helvetica Neue", Arial, sans-serif;

  --fs-hero:   clamp(2.75rem, 7vw, 4.5rem);
  --fs-h2:     clamp(1.75rem, 3.4vw, 2.5rem);
  --fs-h3:     1.3125rem;
  --fs-lede:   clamp(1.125rem, 1.6vw, 1.3125rem);
  --fs-body:   1.0625rem;
  --fs-num:    clamp(2rem, 4vw, 2.75rem);
  --fs-ui:     0.9375rem;
  --fs-small:  0.8125rem;
  --fs-kicker: 0.75rem;

  --ph-title:    22px;
  --ph-body:     15px;
  --ph-callout:  15px;
  --ph-footnote: 13px;
  --ph-caption:  12px;
  --ph-micro:  10.5px;
}

/* ---------- reset / base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--serif);
  font-size: var(--fs-body);
  line-height: 1.68;
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3, h4 {
  font-family: var(--serif);
  color: var(--text);
  margin: 0;
  font-weight: 500;
  overflow-wrap: break-word;
}

p { margin: 0 0 1em; overflow-wrap: break-word; }
p:last-child { margin-bottom: 0; }

a { color: inherit; }

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

button {
  font-family: inherit;
  color: inherit;
}

/* ---------- accessibility ---------- */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.sr-only:focus {
  position: fixed;
  top: 12px; left: 12px;
  width: auto; height: auto;
  margin: 0;
  padding: 10px 16px;
  background: var(--text);
  color: var(--bg);
  border-radius: var(--radius-sm);
  clip: auto;
  white-space: normal;
  z-index: 100;
  font-family: var(--sans);
  font-size: var(--fs-ui);
}

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

/* ---------- layout ---------- */
.wrap {
  max-width: var(--page-max);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
@media (max-width: 559px) {
  :root { --gutter: 20px; }
}

.kicker {
  display: block;
  font-family: var(--sans);
  font-size: var(--fs-kicker);
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 10px;
}

.section-head {
  max-width: var(--prose-max);
  margin-bottom: clamp(28px, 4vw, 44px);
}
.section-head h2 { font-size: var(--fs-h2); line-height: 1.15; }

.section { padding-block: var(--section-y); border-top: 1px solid var(--border); }
.hero { border-top: none; }
.numbers-section { padding-block: var(--section-y); border-top: none; }

.section-prose, .section-lede {
  max-width: var(--prose-max);
}
.section-prose p, .section-lede {
  font-size: var(--fs-lede);
  line-height: 1.55;
  color: var(--text);
}
.section-lede { color: var(--muted); margin-bottom: clamp(28px, 4vw, 40px); }
.section-prose p:not(:last-child) { margin-bottom: 1em; }

/* ---------- nav ---------- */
nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 0;
  gap: 16px;
}
.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.15rem;
  color: var(--text);
  text-decoration: none;
}
.nav-mark {
  width: 26px; height: 26px;
  flex-shrink: 0;
  border-radius: 8px;
  background: linear-gradient(180deg, var(--gold-2), var(--gold-1));
  display: flex; align-items: center; justify-content: center;
}
.nav-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.nav-lang, .nav-link {
  font-family: var(--sans);
  font-size: var(--fs-small);
  color: var(--muted);
  text-decoration: none;
  padding: 6px 8px;
  border-radius: var(--radius-xs);
  transition: color 0.15s ease;
}
.nav-lang {
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 6px 14px;
}
.nav-lang:hover, .nav-link:hover { color: var(--text); }
.nav-link { display: none; }

/* ---------- appstore button ---------- */
.appstore-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-family: var(--sans);
}
.appstore-btn svg { width: 20px; height: 20px; flex-shrink: 0; }
.appstore-btn .ab-text { display: flex; flex-direction: column; line-height: 1.1; text-align: left; }
.appstore-btn .ab-top { font-size: 0.66rem; font-weight: 500; letter-spacing: 0.01em; opacity: 0.85; }
.appstore-btn .ab-bottom { font-size: 0.95rem; font-weight: 700; }
.appstore-btn.is-soon {
  background: var(--fast-bg);
  color: var(--fast-text);
  border: 1px solid var(--border);
  cursor: default;
}
nav .appstore-btn { padding: 8px 12px; }
nav .appstore-btn svg { width: 17px; height: 17px; }
nav .appstore-btn .ab-bottom { font-size: 0.82rem; }
nav .appstore-btn .ab-top { font-size: 0.6rem; }
.cta-note {
  display: block;
  margin-top: 10px;
  font-family: var(--sans);
  font-size: var(--fs-small);
  color: var(--muted);
}

/* ---------- hero ---------- */
.hero {
  display: grid;
  grid-template-columns: 1fr;
  gap: 48px;
  padding-block: clamp(32px, 6vw, 64px) var(--section-y);
  align-items: start;
}
.eyebrow {
  display: inline-block;
  font-family: var(--sans);
  font-size: var(--fs-small);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 18px;
}
.hero h1 {
  font-size: var(--fs-hero);
  line-height: 1.02;
  font-weight: 500;
}
.hero h1 .latin {
  display: block;
  font-family: var(--sans);
  font-weight: 500;
  font-size: 1rem;
  color: var(--muted);
  margin-top: 14px;
  letter-spacing: 0.01em;
}
.lede {
  margin-top: 22px;
  font-size: var(--fs-lede);
  line-height: 1.55;
  color: var(--text);
  max-width: 52ch;
}
.pill-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 26px; }
.pill {
  font-family: var(--sans);
  font-size: var(--fs-small);
  color: var(--muted);
  border: 1px solid var(--border);
  background: var(--card);
  padding: 6px 13px;
  border-radius: var(--radius-pill);
}
.hero-actions { margin-top: 30px; }
.hero-github-link {
  display: inline-block;
  margin-top: 18px;
  font-family: var(--sans);
  font-size: var(--fs-ui);
  color: var(--accent);
  text-decoration: none;
}
.hero-github-link:hover { text-decoration: underline; }

.phone-col { display: flex; flex-direction: column; align-items: center; gap: 14px; }

/* ---------- phone shell ---------- */
.phone {
  width: min(var(--phone-w), 100%);
  padding: 10px;
  border-radius: var(--radius-phone-outer);
  background: linear-gradient(180deg, #EFE9E0, #E2DACD);
  box-shadow: var(--shadow-float), inset 0 0 0 1px rgba(255, 255, 255, 0.6);
}
.phone-screen {
  border-radius: var(--radius-phone-inner);
  overflow: hidden;
  background: var(--bg);
  padding: 14px 14px 0;
  display: flex;
  flex-direction: column;
  min-height: 620px;
}
.phone-status {
  height: 22px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--sans);
  font-size: var(--ph-caption);
  color: var(--muted);
}
.status-glyphs { display: flex; align-items: center; gap: 5px; }
.status-signal {
  width: 14px; height: 9px;
  background: linear-gradient(90deg, var(--muted) 0 20%, transparent 20% 30%,
    var(--muted) 30% 50%, transparent 50% 60%, var(--muted) 60% 80%, transparent 80% 90%, var(--muted) 90%);
  border-radius: 1px;
}
.status-battery {
  width: 20px; height: 10px;
  border: 1px solid var(--muted);
  border-radius: 2px;
  position: relative;
}
.status-battery::before {
  content: "";
  position: absolute;
  inset: 1.5px;
  right: 4px;
  background: var(--muted);
}
.status-battery::after {
  content: "";
  position: absolute;
  right: -3px; top: 3px;
  width: 2px; height: 4px;
  background: var(--muted);
  border-radius: 0 1px 1px 0;
}

.phone-body {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px 0;
}

.ph-card {
  background: var(--card);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  padding: 14px 16px;
}
.ph-micro-label {
  font-family: var(--sans);
  font-size: var(--ph-micro);
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-75);
  margin-bottom: 6px;
}
.ph-header { padding: 0 2px; }
.ph-date { font-family: var(--serif); font-size: var(--ph-title); font-weight: 500; color: var(--text); }
.ph-badges { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.fast-badge, .cache-badge {
  font-family: var(--sans);
  font-size: var(--ph-caption);
  padding: 3px 10px;
  border-radius: var(--radius-pill);
}
.fast-badge { background: var(--fast-bg); color: var(--fast-text); }
.cache-badge { background: var(--scrim); color: var(--muted); }

.ph-scan-title { font-family: var(--serif); font-size: var(--ph-callout); font-weight: 500; color: var(--accent); }
.ph-scan-sub { font-family: var(--sans); font-size: var(--ph-footnote); color: var(--muted); margin-top: 4px; }

.ph-readings { display: flex; flex-direction: column; gap: 8px; }
.ph-reading-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  font-size: var(--ph-body);
}
.ph-reading-label { color: var(--muted); font-family: var(--sans); font-size: var(--ph-footnote); }
.ph-reading-label::after { content: "→"; color: var(--accent); margin: 0 8px; }
.ph-reading-ref { font-family: var(--serif); color: var(--text); }

.ph-memory-text { font-size: var(--ph-body); color: var(--text); line-height: 1.5; margin-top: 2px; }
.ph-tone { display: flex; align-items: baseline; justify-content: space-between; }
.ph-tone-val { font-family: var(--serif); font-size: var(--ph-title); color: var(--accent); }

.phone-tabbar {
  margin-inline: -14px;
  border-top: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(6px);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  padding: 8px 4px 10px;
  flex-shrink: 0;
}
.tab-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  color: var(--muted);
}
.tab-item.is-active { color: var(--accent); }
.tab-item .tab-icon { color: inherit; }
.tab-label {
  font-family: var(--sans);
  font-size: 9.5px;
  font-weight: 500;
}
.tab-item.is-active .tab-label { font-weight: 600; }

.demo-replay {
  display: none;
  align-items: center;
  gap: 6px;
  appearance: none;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--muted);
  font-family: var(--sans);
  font-size: var(--fs-small);
  padding: 7px 16px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease;
}
html.js .demo-replay { display: inline-flex; }
.demo-replay:hover { color: var(--text); border-color: var(--muted); }

.mockup-caption {
  font-family: var(--sans);
  font-size: var(--fs-small);
  color: var(--muted);
  max-width: 52ch;
  text-align: center;
}
.section-split .mockup-caption,
.icon-recog-layout .mockup-caption { text-align: left; }

/* ---------- numbers strip ---------- */
.numbers-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  margin-top: 8px;
}
.number-item { padding-top: 16px; border-top: 1px solid var(--border); }
.number-n { font-size: var(--fs-num); color: var(--accent); font-weight: 500; line-height: 1.1; font-variant-numeric: tabular-nums; white-space: nowrap; }
.number-label { font-family: var(--sans); font-size: var(--fs-ui); color: var(--muted); margin-top: 6px; }
.numbers-footnote {
  font-family: var(--sans);
  font-size: var(--fs-small);
  color: var(--muted);
  margin-top: clamp(24px, 3vw, 36px);
  max-width: var(--prose-max);
}

/* ---------- feature grids ---------- */
.feature-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  margin-top: clamp(32px, 4vw, 48px);
}
.feature-card { padding-top: 18px; border-top: 1px solid var(--border); }
.icon-badge { display: inline-flex; color: var(--accent); margin-bottom: 12px; }
.feature-card h3 { font-size: var(--fs-h3); font-weight: 600; margin-bottom: 8px; }
.feature-card p { font-size: var(--fs-body); color: var(--muted); }

.section-split {
  display: grid;
  grid-template-columns: 1fr;
  gap: 36px;
  align-items: start;
}
.icon-recog-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 36px;
  align-items: start;
}

/* ---------- demo shared card ---------- */
.demo-figure { margin: 0; display: flex; flex-direction: column; gap: 14px; align-items: flex-start; }
.demo-icons, .demo-verse, .demo-pomyannik {
  width: 100%;
  background: var(--card);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  padding: 24px;
}
.demo-verse { position: relative; }

/* ---------- D2: icon recognition ---------- */
.stage-nav { display: none; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; }
html.js .stage-nav { display: flex; }
.stage-nav-btn {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--muted);
  font-family: var(--sans);
  font-size: var(--fs-small);
  padding: 7px 14px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}
.stage-nav-btn[aria-pressed="true"] { color: var(--accent); border-color: var(--accent-line); background: var(--accent-soft); font-weight: 600; }

.stage-label { font-size: var(--fs-h3); margin-bottom: 16px; }
html.js .stage-label { display: none; }

html.js .demo-icons .stage { display: none; opacity: 0; }
html.js .demo-icons .stage.is-active {
  display: block;
  animation: stage-in 220ms cubic-bezier(.22, .61, .36, 1) forwards;
}
@keyframes stage-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}
.demo-icons .stage:not(:last-of-type) { margin-bottom: 32px; padding-bottom: 32px; border-bottom: 1px solid var(--border); }
html.js .demo-icons .stage { margin-bottom: 0; padding-bottom: 0; border-bottom: none; }

.icon-frame {
  position: relative;
  width: 148px;
  margin: 0 auto 20px;
}
.icon-figure {
  position: relative;
  aspect-ratio: 3 / 4;
  border-radius: 4px;
  border: 3px solid;
  border-image: linear-gradient(180deg, var(--gold-2), var(--gold-1)) 1;
  background: #F5EFE4;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.icon-figure.is-small { width: 88px; margin: 0 auto; }
.icon-halo {
  position: absolute;
  top: 18%;
  width: 46%;
  aspect-ratio: 1;
  border: 2px solid var(--gold-1);
  border-radius: 50%;
}
.icon-head {
  position: absolute;
  top: 24%;
  width: 26%;
  aspect-ratio: 3 / 4;
  border-radius: 40% 40% 45% 45%;
  background: #E7DECC;
}
.icon-shoulders {
  position: absolute;
  bottom: 8%;
  width: 62%;
  height: 32%;
  background: #E7DECC;
  clip-path: polygon(18% 100%, 30% 0, 70% 0, 82% 100%);
}
.icon-corner {
  position: absolute;
  width: 12px; height: 12px;
  border: 2px solid var(--accent);
  opacity: 0.55;
}
.corner-tl { top: -2px; left: -2px; border-right: none; border-bottom: none; }
.corner-tr { top: -2px; right: -2px; border-left: none; border-bottom: none; }
.corner-bl { bottom: -2px; left: -2px; border-right: none; border-top: none; }
.corner-br { bottom: -2px; right: -2px; border-left: none; border-top: none; }
html.js .icon-frame.is-scanning .icon-corner { animation: corner-pulse 1.2s ease-in-out 2; }
@keyframes corner-pulse { 0%, 100% { opacity: 0.55; } 50% { opacity: 1; } }

.icon-frame::after {
  content: "";
  position: absolute;
  left: 0; right: 0;
  top: 33%;
  height: 34%;
  background: linear-gradient(180deg, transparent, var(--accent-soft), rgba(139, 105, 20, 0.22), var(--accent-soft), transparent);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-45%);
}
html.js .icon-frame.is-scanning::after {
  opacity: 1;
  animation: scan-shimmer 1.2s ease-in-out 2;
}
@keyframes scan-shimmer {
  from { transform: translateY(-45%); }
  to { transform: translateY(300%); }
}

.scan-panel { text-align: center; }
.scan-hint { font-size: var(--fs-ui); font-family: var(--sans); color: var(--muted); max-width: 42ch; margin: 0 auto 12px; }
.scan-progress {
  font-family: var(--sans);
  font-size: var(--fs-small);
  color: var(--accent);
  opacity: 0;
  height: 0;
  overflow: hidden;
  transition: opacity 0.3s ease;
}
.scan-panel:has(.icon-frame.is-scanning) .scan-progress {
  opacity: 1;
  height: auto;
}
.scan-actions { display: flex; gap: 10px; justify-content: center; margin-top: 18px; flex-wrap: wrap; }
.scan-btn {
  font-family: var(--sans);
  font-size: var(--fs-small);
  padding: 9px 16px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  color: var(--muted);
  background: var(--bg);
}
.scan-btn.is-primary { background: var(--text); color: var(--bg); border-color: var(--text); }

.match-photos { display: flex; gap: 16px; justify-content: center; margin-bottom: 20px; }
.match-photo { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.photo-caption { font-family: var(--sans); font-size: var(--ph-caption); color: var(--muted); }

.match-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.match-name { font-size: var(--fs-h3); font-weight: 600; }
.match-score { font-family: var(--sans); font-size: var(--fs-small); color: var(--accent); font-weight: 600; white-space: nowrap; }
.match-category, .match-feasts { font-family: var(--sans); font-size: var(--fs-small); color: var(--muted); margin-top: 4px; }

.match-details {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.match-details summary {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-family: var(--serif);
  font-weight: 600;
  font-size: var(--fs-body);
  list-style: none;
}
.match-details summary::-webkit-details-marker { display: none; }
.match-details summary::before {
  content: "";
  width: 8px; height: 8px;
  border-right: 2px solid var(--accent);
  border-bottom: 2px solid var(--accent);
  transform: rotate(-45deg);
  transition: transform 0.2s ease;
  flex-shrink: 0;
}
.match-details[open] summary::before { transform: rotate(45deg); }
.more-hint {
  margin-left: auto;
  font-family: var(--sans);
  font-size: var(--fs-small);
  font-weight: 400;
  color: var(--muted);
}
.match-details[open] .more-hint { display: none; }
.match-details-body { margin-top: 12px; }
.match-details-body p { font-size: var(--fs-body); color: var(--text); line-height: 1.6; }
.prayer-title { font-family: var(--serif); font-weight: 500; color: var(--accent); margin-bottom: 4px !important; }
.source-line { font-family: var(--sans); font-size: var(--fs-small); color: var(--muted); margin-top: 8px !important; }

.match-alts {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.alts-label { font-family: var(--sans); font-size: var(--fs-small); color: var(--muted); }
.alt-chip {
  font-family: var(--sans);
  font-size: var(--fs-small);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 4px 12px;
}

.suggest-heading { font-size: var(--fs-h3); margin-bottom: 18px; }
.suggest-item {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid var(--border);
}
.suggest-item:first-of-type { border-top: none; }
.suggest-name { font-size: var(--fs-body); }
.meter { display: inline-flex; gap: 3px; }
.meter .bar { width: 18px; height: 5px; border-radius: 3px; background: var(--border); }
.meter .bar.on { background: var(--accent); }
.level-label { font-family: var(--sans); font-size: var(--fs-small); color: var(--muted); min-width: 4.5em; }
.suggest-note, .suggest-unknown {
  font-family: var(--sans);
  font-size: var(--fs-small);
  color: var(--muted);
  margin-top: 14px;
}
.suggest-panel .scan-btn { margin-top: 14px; }

/* The replay pill is site chrome, not part of the mockup: keep clear space
   above it so stage content (and its 8px entry slide) never touches it. */
.demo-icons .demo-replay { margin-top: 24px; }

/* ---------- D3: dictionary popover ---------- */
.verse-ref { font-family: var(--sans); font-size: var(--fs-small); color: var(--muted); }
.verse {
  font-size: 1.25rem;
  line-height: 1.7;
  margin-top: 10px;
}
.dict-word {
  color: var(--accent);
  text-decoration: underline dotted var(--accent-line);
  text-underline-offset: 4px;
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  cursor: pointer;
}
html.js .dict-word.is-tapped { background: var(--accent-soft); border-radius: 3px; transition: background 0.24s ease; }
.verse-hint { font-family: var(--sans); font-size: var(--fs-small); color: var(--muted); margin-top: 12px; }
html.js .verse-hint { display: none; }

.dict-pop {
  position: static;
  display: block;
  margin-top: 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 18px 20px;
  width: min(320px, 100%);
}
/* With JS the entry expands in place below the verse (same spot as the
   no-JS state) instead of floating over surrounding content. An absolute
   popover overflowed the card and covered the replay button and the text
   below the demo. */
html.js .dict-pop {
  display: none;
  background: var(--card);
  box-shadow: var(--shadow-card);
}
html.js .dict-pop.open {
  display: block;
  animation: dict-pop-in 200ms ease;
}
@keyframes dict-pop-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}
.dict-pop-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.dict-nav-title { font-family: var(--sans); font-size: var(--fs-small); font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; }
.dict-close {
  appearance: none;
  border: none;
  background: none;
  color: var(--accent);
  font-family: var(--sans);
  font-size: var(--fs-small);
  font-weight: 600;
  cursor: pointer;
  padding: 2px;
}
html.js .dict-close { display: inline-block; }
.dict-close { display: none; }
.dict-form-line { font-family: var(--sans); font-size: var(--fs-small); color: var(--muted); margin-bottom: 6px !important; }
.dict-headword { font-size: var(--fs-h3); font-weight: 600; color: var(--text); margin-bottom: 6px !important; }
.dict-definition { font-size: var(--fs-body); color: var(--text); }
.dict-source { font-family: var(--sans); font-size: var(--fs-small); color: var(--muted); margin-top: 8px !important; }


/* ---------- D4: pomyannik ---------- */
.pm-card-title { font-size: var(--fs-h3); font-weight: 600; margin-bottom: 20px; }
.pm-list-label {
  font-family: var(--sans);
  font-size: var(--ph-micro);
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-75);
  margin-bottom: 10px;
}
.pm-field { margin-bottom: 24px; }
.pm-field-label { display: block; font-family: var(--sans); font-size: var(--fs-small); color: var(--muted); margin-bottom: 6px; }
.pm-input-fake {
  position: relative;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: var(--fs-body);
  min-height: 1.6em;
}
.pm-placeholder { display: none; color: var(--muted); }
.pm-input-fake:has(.pm-typed:empty) .pm-placeholder { display: inline; }
.caret {
  display: inline-block;
  width: 1px; height: 1.1em;
  vertical-align: text-bottom;
  margin-left: 2px;
  background: var(--accent);
}
html.js .caret { animation: caret-blink 1s steps(1) infinite; }
@keyframes caret-blink { 50% { opacity: 0; } }

.pm-prayer-title { font-weight: 500; color: var(--accent); margin-bottom: 8px !important; }
.pm-prayer { font-size: 1.15rem; line-height: 1.6; margin-bottom: 6px !important; }
.slot {
  color: var(--accent);
  box-shadow: inset 0 -0.35em 0 var(--accent-soft);
  border-radius: 2px;
}
html.js .slot.pop { animation: slot-pop 320ms cubic-bezier(.2, .9, .3, 1.2); }
@keyframes slot-pop { from { transform: scale(.94); } to { transform: scale(1); } }
.pm-case {
  font-family: var(--sans);
  font-size: var(--fs-small);
  color: var(--muted);
  text-align: right;
  margin-bottom: 20px !important;
}
.pm-note-label {
  font-family: var(--sans);
  font-size: var(--ph-micro);
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-75);
  margin-bottom: 8px;
}
.pm-note { font-size: 1.05rem; margin-bottom: 4px !important; }
.pm-note-case { font-family: var(--sans); font-size: var(--fs-small); color: var(--muted); text-align: right; }
.pm-hint {
  font-family: var(--sans);
  font-size: var(--fs-small);
  color: var(--muted);
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}
html.js .pm-hint { opacity: 0; transition: opacity 200ms ease; }
html.js .pm-hint.show { opacity: 1; }

.pm-static-list {
  list-style: none;
  margin: 18px 0 0;
  padding: 14px 0 0;
  border-top: 1px solid var(--border);
  font-family: var(--sans);
  font-size: var(--fs-small);
  color: var(--muted);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
html.js .pm-static-list { display: none; }

/* ---------- calendar ---------- */
.calendar-col { display: flex; flex-direction: column; gap: 14px; }
.calendar-card {
  background: var(--card);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  padding: 20px;
}
.calendar-month { font-size: var(--fs-h3); font-weight: 600; margin-bottom: 16px; }
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}
.cal-weekday {
  font-family: var(--sans);
  font-size: var(--fs-small);
  color: var(--muted);
  text-align: center;
  padding-bottom: 6px;
}
.cal-cell {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--serif);
  font-size: var(--ph-body);
  border-radius: var(--radius-xs);
  color: var(--text);
}
.cal-cell.is-out { color: var(--border); }
.cal-cell.is-fast { background: var(--fast-bg); color: var(--fast-text); }
.cal-cell.is-today { background: var(--today); box-shadow: inset 0 0 0 1.5px var(--accent); color: var(--accent); font-weight: 600; }
.calendar-legend {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}
.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--sans);
  font-size: var(--fs-small);
  color: var(--muted);
}
.legend-swatch { width: 12px; height: 12px; border-radius: 3px; }
.legend-swatch.is-fast { background: var(--fast-bg); }
.legend-swatch.is-today { background: var(--today); box-shadow: inset 0 0 0 1.5px var(--accent); }

/* ---------- craft ---------- */
.craft-grid .feature-card p { max-width: 46ch; }

/* ---------- privacy (index section) ---------- */
.privacy-points {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  margin-top: 8px;
}
.privacy-point { padding-top: 16px; border-top: 1px solid var(--border); }
.privacy-point h3 { font-size: var(--fs-h3); font-weight: 600; margin-bottom: 8px; }
.privacy-point p { color: var(--muted); }
.privacy-link {
  display: inline-block;
  margin-top: clamp(28px, 4vw, 40px);
  font-family: var(--sans);
  font-size: var(--fs-ui);
  color: var(--accent);
  text-decoration: none;
}
.privacy-link:hover { text-decoration: underline; }

/* ---------- sources ---------- */
.sources-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 22px;
  margin-top: 8px;
}
.source-item { padding-top: 14px; border-top: 1px solid var(--border); }
.source-item h3 { font-size: var(--fs-h3); font-weight: 600; margin-bottom: 6px; }
.source-item p { color: var(--muted); font-size: var(--fs-ui); }
.open-source-block {
  margin-top: clamp(28px, 4vw, 40px);
  padding: 24px;
  background: var(--card);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  max-width: var(--prose-max);
}
.open-source-block h3 { font-size: var(--fs-h3); font-weight: 600; margin-bottom: 8px; }
.open-source-block p { color: var(--muted); margin-bottom: 14px !important; }
.open-source-block a { color: var(--accent); font-family: var(--sans); font-size: var(--fs-ui); text-decoration: none; overflow-wrap: break-word; word-break: break-word; }
.open-source-block a:hover { text-decoration: underline; }

/* ---------- launch / closing CTA ---------- */
.launch-section { text-align: center; }
.launch-card {
  background: var(--card);
  border-radius: 24px;
  box-shadow: var(--shadow-card);
  padding: clamp(36px, 6vw, 64px) clamp(24px, 5vw, 56px);
  max-width: 640px;
  margin: 0 auto;
}
.launch-card h2 { font-size: var(--fs-h2); margin-bottom: 14px; }
.launch-card p { color: var(--muted); font-size: var(--fs-lede); max-width: 48ch; margin: 0 auto 28px; }
.launch-actions { display: flex; justify-content: center; }
.launch-links {
  margin-top: 22px;
  display: flex;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
}
.launch-links a {
  font-family: var(--sans);
  font-size: var(--fs-ui);
  color: var(--accent);
  text-decoration: none;
}
.launch-links a:hover { text-decoration: underline; }

/* ---------- footer ---------- */
footer {
  border-top: 1px solid var(--border);
  padding: 28px 0 44px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  font-family: var(--sans);
  font-size: var(--fs-small);
  color: var(--muted);
}
.footer-links { display: flex; flex-wrap: wrap; gap: 18px; }
.footer-links a { color: var(--muted); text-decoration: none; }
.footer-links a:hover { color: var(--text); }

/* ---------- legal / privacy page ---------- */
main.legal { padding: clamp(48px, 8vw, 88px) 0 90px; max-width: var(--prose-max); }
.page-title { font-size: clamp(2.2rem, 5vw, 3rem); line-height: 1.1; margin: 16px 0 20px; }
.legal-intro { font-size: var(--fs-lede); color: var(--text); margin-bottom: 12px; }
.legal-updated { font-family: var(--sans); font-size: var(--fs-small); color: var(--muted); margin-bottom: clamp(32px, 5vw, 52px); }
.legal-block { padding-top: 24px; margin-top: 24px; border-top: 1px solid var(--border); }
.legal-block:first-of-type { border-top: none; margin-top: 0; }
.legal-block h2 { font-size: var(--fs-h3); font-weight: 600; margin-bottom: 12px; }
.legal-block p { color: var(--text); }
.legal-block p:not(:last-child) { margin-bottom: 1em; }
.legal-back {
  display: inline-block;
  margin-top: 40px;
  font-family: var(--sans);
  font-size: var(--fs-ui);
  color: var(--accent);
  text-decoration: none;
}
.legal-back:hover { text-decoration: underline; }

/* =========================================================================
   Progressive enhancement: reveal system
   ========================================================================= */
html.js .reveal { opacity: 0; transform: translateY(10px); }
html.js .reveal.inview {
  opacity: 1;
  transform: none;
  transition: opacity 500ms cubic-bezier(.22, .61, .36, 1), transform 500ms cubic-bezier(.22, .61, .36, 1);
}

/* ---------- D1 hero step reveal ---------- */
html.js .phone .step { opacity: 0; transform: translateY(8px); }
html.js .phone.inview .step {
  opacity: 1;
  transform: none;
  transition: opacity 420ms, transform 420ms;
  transition-delay: calc(var(--i) * 70ms);
  transition-timing-function: cubic-bezier(.22, .61, .36, 1);
}

/* =========================================================================
   Responsive breakpoints
   ========================================================================= */
@media (min-width: 560px) {
  .numbers-grid { grid-template-columns: repeat(2, 1fr); }
  .calendar-grid { gap: 6px; }
  .cal-cell { font-size: 1rem; }
}

@media (min-width: 760px) {
  .feature-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .numbers-grid { grid-template-columns: repeat(3, 1fr); }
  .section-split { grid-template-columns: 1fr 1fr; }
  .privacy-points { grid-template-columns: repeat(2, 1fr); }
  .sources-grid { grid-template-columns: repeat(2, 1fr); }
  .nav-link { display: inline-block; }
}

@media (min-width: 980px) {
  /* Center the copy against the taller phone column so the hero has no
     dead band under the CTA. */
  .hero { grid-template-columns: 1fr auto; gap: 64px; align-items: center; }
  .phone-col { width: var(--phone-w); }
  .feature-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .icon-recog-layout { grid-template-columns: 1fr auto; align-items: start; }
  .icon-recog-layout .demo-figure { width: 380px; }
  .icon-recog-layout .icon-recog-copy .feature-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* =========================================================================
   Reduced motion
   ========================================================================= */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
}
