/* exploretheway.app — one stylesheet for the landing page, Support and Privacy.
   Colours are the apps' own tokens: Explore's Theme.swift (paper, ink, accent, lapis) and
   The Way Stories' Theme.swift (navy, ochre, sage, gold). Type is New York, Apple's serif,
   as in both apps, with system fallbacks elsewhere. */

:root {
  color-scheme: light dark;

  /* Explore, light */
  --paper: #F8F4EC;
  --paper-raised: #FCFAF6;
  --paper-sunken: #F0E9DE;
  --ink: #14232D;
  --muted-ink: #5D5850;
  --rule: #E6DED2;
  --rule-strong: #8F8576;
  --accent: #8F6526;
  --accent-on-sunken: #7D5820;
  --on-accent: #FFFFFF;
  --lapis: #2F6F8F;
  --bible: #8E3B2F;

  /* The Way Stories (one palette; the band stays navy in both appearances) */
  --navy: #0E2A3A;
  --navy-edge: #061620;
  --on-navy: #FCFAF6;
  --ochre: #C89B4F;
  --gold-on-dark: #F2D9A6;
  --sage: #7A8A75;
  --sand: #E7DACA;
  --stone: #D6C6B3;

  --serif: "New York", ui-serif, "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, "Segoe UI", Roboto, sans-serif;

  --radius: 18px;
  --radius-stories: 22px;
  --page: 1120px;
  --gutter: clamp(16px, 4vw, 40px);
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #1B1814;
    --paper-raised: #28231D;
    --paper-sunken: #14110D;
    --ink: #F5EEE2;
    --muted-ink: #B8AD9B;
    --rule: #39332B;
    --rule-strong: #7A6F5E;
    --accent: #E3C99F;
    --accent-on-sunken: #E3C99F;
    --on-accent: #1B1814;
    --lapis: #6FB0D0;
    --bible: #D97A68;
    --navy: #0B1F2B;
  }
}

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

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 17px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--accent); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--lapis); outline-offset: 3px; border-radius: 6px; }

h1, h2, h3 { font-family: var(--serif); font-weight: 500; line-height: 1.15; margin: 0 0 0.5em; letter-spacing: -0.01em; }
h1 { font-size: clamp(2.6rem, 7vw, 4.6rem); }
h2 { font-size: clamp(1.9rem, 4.2vw, 2.8rem); }
h3 { font-size: 1.3rem; }
p { margin: 0 0 1em; }

.wrap { max-width: var(--page); margin: 0 auto; padding: 0 var(--gutter); }

.eyebrow {
  font: 600 0.78rem/1.2 var(--sans);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 0.9rem;
}

.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 16px; z-index: 10; background: var(--paper-raised); padding: 8px 14px; }

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

.site-header { border-bottom: 1px solid var(--rule); background: var(--paper); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 68px; }

.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.brand img { width: 34px; height: 34px; border-radius: 8px; }
.brand-name { font: 500 1.35rem/1 var(--serif); }

.site-nav { display: flex; gap: 4px; flex-wrap: wrap; }
.site-nav a {
  color: var(--ink); text-decoration: none; font-weight: 500; font-size: 0.95rem;
  padding: 10px 12px; border-radius: 999px; min-height: 44px; display: inline-flex; align-items: center;
}
.site-nav a:hover { background: var(--paper-sunken); }
.site-nav a[aria-current="page"] { background: var(--paper-sunken); }
@media (max-width: 560px) { .site-nav .optional { display: none; } }

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

.hero { position: relative; min-height: min(84vh, 760px); display: grid; align-items: end; color: #FCFAF6; overflow: hidden; }
.hero picture, .hero picture img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 40% 45%; }
.hero::after {
  content: ""; position: absolute; inset: 0;
  background:
    linear-gradient(90deg, rgba(6, 22, 32, 0.55) 0%, rgba(6, 22, 32, 0.25) 38%, rgba(6, 22, 32, 0) 60%),
    linear-gradient(180deg, rgba(14, 42, 58, 0) 30%, rgba(14, 42, 58, 0.55) 62%, rgba(6, 22, 32, 0.88) 100%);
}
.hero .wrap { position: relative; z-index: 1; padding-top: 120px; padding-bottom: clamp(40px, 8vh, 80px); width: 100%; }
.hero .eyebrow { color: var(--gold-on-dark); }
.hero h1 { margin-bottom: 0.25em; }
.hero .lede { font: 400 clamp(1.15rem, 2.3vw, 1.45rem)/1.45 var(--serif); max-width: 34ch; opacity: 0.95; }
.hero-links { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }

/* ---------- Buttons ---------- */

.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 52px; padding: 0 22px; border-radius: 16px;
  font: 600 1rem/1 var(--sans); text-decoration: none; cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
/* The Way Stories' pressable edge: a solid lip under the button that the press sinks into. */
.button-edge { background: var(--navy); color: var(--on-navy); box-shadow: 0 5px 0 var(--navy-edge); }
.button-edge:hover { transform: translateY(1px); box-shadow: 0 4px 0 var(--navy-edge); }
.button-edge:active { transform: translateY(5px); box-shadow: 0 0 0 var(--navy-edge); }
.button-light { background: #FCFAF6; color: #14232D; box-shadow: 0 5px 0 #D6C6B3; }
.button-light:hover { transform: translateY(1px); box-shadow: 0 4px 0 #D6C6B3; }
.button-light:active { transform: translateY(5px); box-shadow: 0 0 0 #D6C6B3; }
.button-ghost { color: #FCFAF6; border: 1.5px solid rgba(252, 250, 246, 0.6); }
.button-ghost:hover { background: rgba(252, 250, 246, 0.12); }
@media (prefers-reduced-motion: reduce) { .button { transition: none; } }

/* "Coming soon" stands in for the App Store badge until each app's page exists.
   At launch, swap the <span class="store-badge"> for Apple's official badge in an <a>. */
.store-badge {
  display: inline-flex; align-items: center; gap: 10px;
  min-height: 52px; padding: 8px 18px; border-radius: 14px;
  border: 1.5px dashed currentColor; font-weight: 600; line-height: 1.2;
}
.store-badge small { display: block; font-weight: 500; font-size: 0.78rem; opacity: 0.8; letter-spacing: 0.02em; }

/* ---------- App sections ---------- */

.section { padding: clamp(64px, 10vw, 120px) 0; }

.app-head { display: flex; align-items: center; gap: 18px; margin-bottom: 28px; }
.app-icon { width: 84px; height: 84px; border-radius: 19px; box-shadow: 0 1px 2px rgba(0,0,0,.08), 0 8px 24px rgba(20, 35, 45, 0.14); flex: none; }
.app-head h2 { margin: 0; }
.app-head p { margin: 4px 0 0; color: var(--muted-ink); }

.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: clamp(32px, 6vw, 72px); align-items: center; }
@media (max-width: 860px) { .split { grid-template-columns: minmax(0, 1fr); } .stories .storybook { order: 2; } }

.big { font: 400 clamp(1.2rem, 2.2vw, 1.4rem)/1.5 var(--serif); }

.features { list-style: none; padding: 0; margin: 28px 0; display: grid; gap: 14px; }
.features li { display: grid; grid-template-columns: 28px 1fr; gap: 12px; align-items: start; }
.features svg { width: 24px; height: 24px; margin-top: 2px; }
.features strong { display: block; font-weight: 600; }
.features span { color: var(--muted-ink); }

.price { color: var(--muted-ink); font-size: 0.95rem; margin: 22px 0 0; }

/* Explore: the cards on paper from its Home screen */
.explore { background: var(--paper); }
.explore .features svg { color: var(--accent); }
.explore .store-badge { color: var(--ink); }

.gallery { display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: auto auto; gap: 14px; }
.gallery figure { margin: 0; position: relative; border-radius: var(--radius); overflow: hidden; background: var(--paper-raised); box-shadow: 0 1px 2px rgba(0,0,0,.06), 0 10px 30px rgba(20, 35, 45, 0.10); }
.gallery figure:first-child { grid-column: 1 / -1; }
.gallery img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; }
.gallery figcaption {
  position: absolute; left: 12px; bottom: 12px;
  background: rgba(252, 250, 246, 0.92); color: #14232D;
  font: 600 0.82rem/1 var(--sans); padding: 8px 12px; border-radius: 999px;
}

/* The Way Stories: its navy band, ochre and the rounded storybook cards */
.stories { background: var(--navy); color: var(--on-navy); }
.stories .eyebrow { color: var(--gold-on-dark); }
.stories .app-head p, .stories .features span, .stories .price { color: rgba(252, 250, 246, 0.78); }
.stories .features svg { color: var(--ochre); }
.stories a:not(.button) { color: var(--gold-on-dark); }
.stories .app-icon { box-shadow: 0 0 0 1px rgba(242, 217, 166, 0.25), 0 10px 30px rgba(0, 0, 0, 0.35); }

.storybook { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.storybook .card { border-radius: var(--radius-stories); overflow: hidden; background: #FCFAF6; color: #14232D; box-shadow: 0 5px 0 var(--navy-edge); }
.storybook .card img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; }
.storybook .card div { padding: 12px 14px 14px; }
.storybook .card h3 { font-size: 1.05rem; margin: 0 0 2px; }
.storybook .card p { margin: 0; font-size: 0.85rem; color: #5D5850; }
.storybook .card .tag { font: 700 0.68rem/1 var(--sans); letter-spacing: 0.14em; text-transform: uppercase; color: #8F6526; margin-bottom: 6px; display: block; }
@media (max-width: 520px) {
  .storybook { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .storybook .card:last-child { display: none; }
}

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 0; padding: 0; list-style: none; }
.chips li { border: 1px solid rgba(242, 217, 166, 0.35); color: var(--gold-on-dark); border-radius: 999px; padding: 6px 12px; font-size: 0.85rem; font-weight: 500; }

/* ---------- Together ---------- */

.together { background: var(--paper-sunken); }
.together .eyebrow { color: var(--accent-on-sunken); }
.together .grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; margin-top: 36px; }
@media (max-width: 860px) { .together .grid { grid-template-columns: minmax(0, 1fr); } }
.tile { background: var(--paper-raised); border: 1px solid var(--rule); border-radius: var(--radius); padding: 26px; }
.tile h3 { margin-bottom: 0.4em; }
.tile p { margin: 0; color: var(--muted-ink); }
.tile h3 { font-size: clamp(1.4rem, 2.4vw, 1.7rem); color: var(--accent-on-sunken); margin-bottom: 0.5em; }

/* The Way: Stories' collections still to come */
.collections { margin-top: clamp(56px, 8vw, 88px); }
.collections > h3 { color: var(--gold-on-dark); font: 600 0.78rem/1.2 var(--sans); letter-spacing: 0.16em; text-transform: uppercase; margin-bottom: 18px; }
.collection-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 700px) { .collection-grid { grid-template-columns: minmax(0, 1fr); } }
.collection {
  display: grid; grid-template-columns: 64px 1fr; gap: 18px; align-items: center;
  border: 1.5px dashed rgba(242, 217, 166, 0.4); border-radius: var(--radius-stories);
  padding: 22px; background: rgba(252, 250, 246, 0.04);
}
.collection svg { width: 64px; height: 64px; padding: 12px; border-radius: 16px; background: rgba(242, 217, 166, 0.12); color: var(--gold-on-dark); }
.collection h4 { font: 500 1.3rem/1.2 var(--serif); margin: 4px 0 6px; }
.collection p { margin: 0; color: rgba(252, 250, 246, 0.78); font-size: 0.95rem; }
.collection .soon { font: 700 0.68rem/1 var(--sans); letter-spacing: 0.14em; text-transform: uppercase; color: var(--ochre); }
.center { text-align: center; max-width: 40rem; margin: 0 auto; }

/* ---------- Document pages (Support, Privacy) ---------- */

.doc-hero { padding: clamp(48px, 8vw, 88px) 0 clamp(28px, 4vw, 40px); border-bottom: 1px solid var(--rule); }
.doc-hero p { color: var(--muted-ink); max-width: 44rem; font-size: 1.08rem; }

.doc { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: clamp(28px, 6vw, 72px); padding-top: 40px; padding-bottom: 96px; }
@media (max-width: 860px) { .doc { grid-template-columns: minmax(0, 1fr); } .toc { position: static !important; } }

.toc { position: sticky; top: 24px; align-self: start; font-size: 0.95rem; }
.toc p { font: 600 0.75rem/1 var(--sans); letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted-ink); margin-bottom: 12px; }
.toc ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.toc a { display: block; padding: 8px 0; color: var(--ink); text-decoration: none; }
.toc a:hover { color: var(--accent); }

.prose { max-width: 44rem; }
.prose section { scroll-margin-top: 24px; margin-bottom: 56px; }
.prose h2 { font-size: clamp(1.7rem, 3.4vw, 2.2rem); padding-top: 8px; }
.prose h3 { margin-top: 1.8em; }
.prose ul { padding-left: 1.2em; margin: 0 0 1em; }
.prose li { margin-bottom: 0.45em; }
.prose .meta { color: var(--muted-ink); font-size: 0.95rem; }

.app-label { display: inline-flex; align-items: center; gap: 10px; margin-bottom: 12px; font-weight: 600; color: var(--muted-ink); }
.app-label img { width: 32px; height: 32px; border-radius: 8px; }

.callout { background: var(--paper-raised); border: 1px solid var(--rule); border-radius: var(--radius); padding: 22px 24px; margin: 0 0 28px; }
.callout h3 { margin-top: 0; }
.callout p:last-child { margin-bottom: 0; }

.contact-card { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 18px; background: var(--navy); color: var(--on-navy); border-radius: var(--radius-stories); padding: 26px 28px; margin: 0 0 48px; }
.contact-card h2 { margin: 0 0 4px; font-size: 1.6rem; }
.contact-card p { margin: 0; color: rgba(252, 250, 246, 0.8); }
.contact-card .button-light { white-space: nowrap; }

details { border-top: 1px solid var(--rule); padding: 4px 0; }
details:last-of-type { border-bottom: 1px solid var(--rule); }
summary { cursor: pointer; list-style: none; padding: 16px 32px 16px 0; font-weight: 600; position: relative; min-height: 44px; }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; position: absolute; right: 4px; top: 12px; font: 400 1.5rem/1 var(--sans); color: var(--accent); }
details[open] summary::after { content: "–"; }
details > :not(summary) { margin-top: 0; }
details > p, details > ul { color: var(--ink); }

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

.site-footer { border-top: 1px solid var(--rule); padding: 40px 0 48px; font-size: 0.92rem; color: var(--muted-ink); }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 18px 32px; justify-content: space-between; align-items: flex-start; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 4px 20px; }
.site-footer a { color: var(--ink); text-decoration: none; display: inline-flex; min-height: 44px; align-items: center; }
.site-footer a:hover { color: var(--accent); }
.site-footer p { margin: 0 0 4px; }
.noesa { font: 500 0.78rem/1.4 var(--sans); letter-spacing: 0.18em; text-transform: uppercase; color: var(--ink); }

/* ---------- Link pages (/person/david, /bible/john/3/16): rendered by src/worker.js ---------- */

.link-page { padding: clamp(40px, 8vw, 96px) 0 clamp(64px, 10vw, 120px); }
.link-card {
  max-width: 40rem; margin: 0 auto; background: var(--paper-raised);
  border: 1px solid var(--rule); border-radius: var(--radius-stories);
  padding: clamp(24px, 5vw, 44px);
  box-shadow: 0 1px 2px rgba(0, 0, 0, .05), 0 12px 36px rgba(20, 35, 45, 0.08);
}
.link-card h1 { font-size: clamp(2.1rem, 6vw, 3.2rem); margin-bottom: 0.2em; overflow-wrap: anywhere; }
.link-meta { color: var(--muted-ink); font-size: 0.95rem; margin-bottom: 1.1em; }
.link-line { font: 400 clamp(1.1rem, 2.4vw, 1.3rem)/1.55 var(--serif); margin-bottom: 1.6em; }
.link-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 28px; }
.link-actions .button { flex: 1 1 200px; }
.button-outline { color: var(--ink); border: 1.5px solid var(--rule-strong); }
.button-outline:hover { background: var(--paper-sunken); }
@media (prefers-color-scheme: dark) {
  .link-page .button-edge { background: #E3C99F; color: #1B1814; box-shadow: 0 5px 0 #8F6526; }
  .link-page .button-edge:hover { box-shadow: 0 4px 0 #8F6526; }
  .link-page .button-edge:active { box-shadow: 0 0 0 #8F6526; }
}
.link-note { display: flex; gap: 12px; align-items: center; margin: 0; padding-top: 22px; border-top: 1px solid var(--rule); color: var(--muted-ink); font-size: 0.92rem; }
.link-note img { width: 40px; height: 40px; border-radius: 10px; flex: none; }
.link-note strong { color: var(--ink); }
