/* Affirmation Lock — matches src/theme/palettes.ts */

:root {
  color-scheme: light dark;

  --paper: #f3f7fb;
  --paper-muted: #dde7f2;
  --surface: #ffffff;
  --surface-strong: #e9f4ff;
  --text: #16202a;
  --text-muted: #6d7d90;
  --accent: #2f80ed;
  --accent-soft: rgba(47, 128, 237, 0.12);
  --border: #d8e2ec;
  --shadow: rgba(18, 39, 71, 0.1);
  --glow: rgba(47, 128, 237, 0.08);

  /*
    Width system (Prayer Lock–style: one editorial column, not full-bleed type).
    - shell: outer column cap on large screens
    - display: stacked headline measure (tight)
    - prose: comfortable reading length (~65–75 chars)
  */
  --landing-shell-max: 90rem;
  --landing-pad-x: clamp(1rem, 5vw, 3.5rem);
  --w-display-line: min(100%, 52ch);
  --w-display-emphasis: min(100%, 44ch);
  --w-prose: min(100%, 52ch);
  --w-list: min(100%, 48ch);
  --w-badges: min(100%, 36rem);
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0f1620;
    --paper-muted: #1d2938;
    --surface: #172231;
    --surface-strong: #203249;
    --text: #f2f7fd;
    --text-muted: #b5c2d2;
    --accent: #49a3ff;
    --accent-soft: rgba(73, 163, 255, 0.14);
    --border: #314459;
    --shadow: rgba(0, 0, 0, 0.34);
    --glow: rgba(73, 163, 255, 0.06);
  }
}

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

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

body {
  margin: 0;
  min-height: 100vh;
  font-family:
    ui-sans-serif,
    system-ui,
    -apple-system,
    "Segoe UI",
    Roboto,
    "Helvetica Neue",
    Arial,
    sans-serif;
  color: var(--text);
  background: var(--paper);
  background-image: radial-gradient(ellipse 120% 90% at 50% -25%, var(--glow), transparent 50%);
  line-height: 1.45;
}

a {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 0.12em;
}

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

/* ——— Landing: split hero (Prayer Lock–style) + massive type ——— */

.landing-hero-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.75rem;
  align-items: center;
}

@media (min-width: 960px) {
  .landing-hero-grid {
    grid-template-columns: minmax(0, 1.12fr) minmax(0, 0.88fr);
    gap: clamp(1.5rem, 4vw, 4rem);
    align-items: center;
  }
}

.landing-hero-copy {
  min-width: 0;
  text-align: left;
}

.landing-hero-visual {
  min-width: 0;
  display: flex;
  justify-content: center;
}

.phone-mockup-card {
  width: 100%;
  max-width: 420px;
  margin-inline: auto;
  padding: clamp(1.25rem, 3.5vw, 2rem);
  border-radius: 28px;
  background: var(--accent-soft);
  box-shadow: 0 24px 48px var(--shadow);
}

/* Marketing JPGs are 1242×2688; frame matches that aspect so the box tracks the image */
.marketing-carousel-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 1242 / 2688;
  overflow: hidden;
  border-radius: 12px;
}

.marketing-carousel-img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 12px;
}

.landing-top {
  display: flex;
  justify-content: flex-start;
  margin-bottom: 1.5rem;
}

/* Icon + name read as one brand unit (like an app row on the store) */
.brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  max-width: 100%;
}

/* Decorative lock between hero and subcopy (foreground “ink”, not accent) */
.lock-mark-wrap {
  display: flex;
  justify-content: flex-start;
  margin: 0.25rem 0 1.35rem;
}

.lock-mark {
  width: 2rem;
  height: 2rem;
  color: #0a0a0a;
  display: block;
}

@media (prefers-color-scheme: dark) {
  .lock-mark {
    color: #e8edf3;
  }
}

.app-icon--hero {
  flex-shrink: 0;
  width: 56px;
  height: 56px;
  border-radius: 14px;
  box-shadow: 0 6px 22px var(--shadow);
  display: block;
}

.eyebrow {
  margin: 0;
  padding: 0;
  font-size: clamp(1.15rem, 3vw, 1.45rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.05;
  color: var(--text);
}

.hero {
  margin: 0 0 1rem;
  text-align: left;
  letter-spacing: -0.045em;
  line-height: 0.98;
}

.hero-line {
  display: block;
  font-size: clamp(2.1rem, 7.5vw, 4.5rem);
  font-weight: 800;
  color: var(--text);
  margin: 0 0 0.28em;
  margin-right: auto;
  text-wrap: balance;
  padding: 0;
  max-width: var(--w-display-line);
}

.hero-emphasis {
  display: block;
  font-size: clamp(3.2rem, 14vw, 7.5rem);
  font-weight: 800;
  color: var(--accent);
  line-height: 0.92;
  text-wrap: balance;
  margin-left: 0;
  margin-right: auto;
  max-width: var(--w-display-emphasis);
}

.hero-sub {
  margin: 0 0 1.75rem;
  max-width: var(--w-prose);
  text-align: left;
}

.hero-sub-line {
  display: block;
  font-size: clamp(1.2rem, 2.8vw, 1.55rem);
  font-weight: 500;
  color: var(--text-muted);
  line-height: 1.4;
  letter-spacing: -0.02em;
}

.hooks--large {
  list-style: none;
  padding: 0;
  margin: 0 0 2.25rem;
  max-width: var(--w-list);
}

.hooks--large li {
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 0.65rem;
  font-size: clamp(1.05rem, 2.8vw, 1.35rem);
  font-weight: 600;
  color: var(--text);
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--border);
  line-height: 1.35;
  letter-spacing: -0.02em;
  text-align: left;
}

.hooks--large li::before {
  content: none;
  display: none;
}

.hooks--large li:last-child {
  border-bottom: none;
}

.hook-check {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 0.14em;
  color: var(--accent);
}

.hook-check svg {
  width: 1.35em;
  height: 1.35em;
  display: block;
}

.landing-store-block {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  margin: 0 0 2.5rem;
  max-width: var(--w-badges);
}

.landing-store-hint {
  margin: 0;
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1.45;
  letter-spacing: -0.01em;
  color: var(--text-muted);
  max-width: 36rem;
}

.landing-store-hint-name {
  font-weight: 700;
  color: var(--text);
}

/* Chained .store-row.store-row--large beats later .store-row img rules (same file). */
/* Grid: caption only in Play column row 1; both badges in row 2 — same alignment as pre-caption flex row. */
.store-row.store-row--large {
  display: grid;
  grid-template-columns: auto auto;
  grid-template-rows: auto auto;
  column-gap: 1rem;
  row-gap: 0.12rem;
  justify-content: start;
  align-items: center;
  margin: 0;
  max-width: none;
  overflow-x: auto;
  overflow-y: visible;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 0;
}

.store-row.store-row--large .badge-app-store {
  grid-column: 1;
  grid-row: 2;
}

.store-row.store-row--large .store-android-soon-caption {
  grid-column: 2;
  grid-row: 1;
  justify-self: center;
  text-align: center;
}

.store-row.store-row--large .store-android-soon {
  grid-column: 2;
  grid-row: 2;
  justify-self: center;
}

.store-row.store-row--large a {
  display: inline-block;
  line-height: 0;
  text-decoration: none;
}

.store-row.store-row--large img {
  height: clamp(50px, 11.5vw, 70px);
  width: auto;
}

.store-row.store-row--large .store-android-soon-badge-img {
  height: clamp(72px, 15.5vw, 100px);
  width: auto;
}

.store-android-soon-badge-wrap {
  display: inline-block;
  line-height: 0;
  opacity: 0.42;
  filter: grayscale(0.15);
  transition: opacity 0.2s ease;
}

@media (prefers-color-scheme: dark) {
  .store-android-soon-badge-wrap {
    opacity: 0.38;
    filter: grayscale(0.2) brightness(1.05);
  }
}

.store-android-soon-caption {
  margin: 0;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.2;
  color: var(--text-muted);
  max-width: 12rem;
}

.site-footer {
  text-align: center;
  padding-top: 0.5rem;
  width: 100%;
  max-width: min(100%, 64rem);
  margin-inline: auto;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.35rem 0.5rem;
  font-size: clamp(0.8rem, 2vw, 0.9rem);
  margin-bottom: 1rem;
}

.footer-links a {
  color: var(--text-muted);
  font-weight: 500;
  text-decoration: none;
}

.footer-dot {
  color: var(--border);
  user-select: none;
}

.footer-note {
  margin: 0;
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Landing: legal strip pinned to viewport bottom; main fills and centers hero */
body.page-landing {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding-bottom: calc(8.75rem + env(safe-area-inset-bottom, 0px));
}

.site-footer--pinned {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 100;
  margin: 0;
  max-width: none;
  padding: 0.65rem var(--landing-pad-x) calc(0.75rem + env(safe-area-inset-bottom, 0px));
  background: var(--paper);
  border-top: 1px solid var(--border);
  box-shadow: 0 -6px 28px var(--shadow);
}

.site-footer--pinned .footer-links,
.site-footer--pinned .footer-note {
  max-width: 64rem;
  margin-left: auto;
  margin-right: auto;
}

.site-footer--pinned .footer-links {
  margin-bottom: 0.4rem;
}

/* ——— Generic / small pages ——— */

.wrap {
  max-width: 22rem;
  margin: 0 auto;
  padding: 2.25rem 1.25rem 3rem;
}

/* Landing: full-bleed band; real layout lives in .landing-shell */
.wrap.wrap--landing {
  max-width: none;
  width: 100%;
  margin: 0;
  padding: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 0;
}

.landing-shell {
  width: 100%;
  max-width: var(--landing-shell-max);
  margin-inline: auto;
  padding: 2rem var(--landing-pad-x) 3rem;
  box-sizing: border-box;
}

.wrap--center {
  text-align: center;
}

.page-hero {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0 0 0.5rem;
  color: var(--text);
}

.brand {
  text-align: center;
  margin-bottom: 1.75rem;
}

.app-icon {
  width: 88px;
  height: 88px;
  border-radius: 20px;
  box-shadow: 0 8px 28px var(--shadow);
  display: block;
  margin: 0 auto 1.25rem;
}

h1.brand-name {
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0 0 1rem;
  color: var(--text);
}

.tagline {
  font-size: 1.0625rem;
  font-weight: 400;
  color: var(--text-muted);
  margin: 0 0 1.5rem;
  line-height: 1.45;
}

.hooks {
  list-style: none;
  padding: 0;
  margin: 0 0 2rem;
  text-align: left;
}

.hooks li {
  position: relative;
  padding: 0.5rem 0 0.5rem 1rem;
  color: var(--text-muted);
  font-size: 0.9375rem;
  line-height: 1.4;
  border-bottom: 1px solid var(--border);
}

.hooks li:last-child {
  border-bottom: none;
}

.hooks li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.85em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
}

.store-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
  align-items: center;
  margin-bottom: 1.75rem;
}

.store-row a {
  display: inline-block;
  line-height: 0;
  text-decoration: none;
}

.store-row img {
  height: 40px;
  width: auto;
}

.store-row .badge-play img {
  height: 58px;
}

.nav-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 0.2rem 0;
  margin-bottom: 1.5rem;
  box-shadow: 0 1px 0 var(--shadow);
}

.nav-card a {
  display: block;
  padding: 0.7rem 1rem;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  font-size: 0.9rem;
}

.nav-card a:last-child {
  border-bottom: none;
}

/* Terms + 404 */
.prose {
  max-width: 40rem;
  margin: 0 auto;
  padding: 2rem 1.25rem 3rem;
}

.prose h1 {
  font-size: 1.5rem;
  margin-bottom: 0.25rem;
}

.prose .meta {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-bottom: 1.5rem;
}

.prose h2 {
  font-size: 1rem;
  margin: 1.5rem 0 0.5rem;
  font-weight: 600;
  color: var(--text);
}

.prose p,
.prose ul {
  margin: 0 0 0.85rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.prose a {
  color: var(--text-muted);
}

.prose ul {
  padding-left: 1.15rem;
}

.prose li {
  margin-bottom: 0.3rem;
}

.back-link {
  display: inline-block;
  margin-bottom: 1.25rem;
  font-size: 0.875rem;
}

/* ——— Prose tables (Privacy Policy, etc.) ——— */
.prose table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
  margin: 0 0 1.1rem;
  background: var(--surface);
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.prose thead {
  background: var(--surface-strong);
}

.prose th {
  text-align: left;
  font-weight: 600;
  font-size: 0.78rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 0.6rem 0.9rem;
  border-bottom: 1px solid var(--border);
}

.prose td {
  padding: 0.6rem 0.9rem;
  color: var(--text-muted);
  vertical-align: top;
  border-bottom: 1px solid var(--border);
  line-height: 1.5;
}

.prose tbody tr:last-child td {
  border-bottom: none;
}

.prose td:first-child {
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  width: 1%;
}

.prose h3 {
  font-size: 0.925rem;
  font-weight: 600;
  margin: 1.25rem 0 0.4rem;
  color: var(--text);
}
