/* ============================================================
   MyDeen — website design system
   Matches the app: warm ivory, single gold accent, espresso ink,
   refined serif for editorial/scripture + clean geometric sans.

   Responsive strategy (see README):
   - Fluid type via clamp() in rem, so it scales smoothly from
     ~320px phones to 2560px+ monitors and respects browser zoom.
   - Content capped at a readable max width with viewport-relative
     gutters that grow on large screens (content stays centered and
     intentional, never a tiny lost box, never edge-to-edge text).
   - Layout adapts with CSS Grid + a few breakpoints.
   ============================================================ */

:root {
  /* Surfaces */
  --ivory:        #F4F0E4;   /* page */
  --ivory-raised: #FBF8F0;   /* cards */
  --ivory-sunk:   #ECE6D6;   /* wells */
  --ivory-warm:   #F1E9D6;   /* tinted bands */

  /* Ink */
  --ink:        #382B1C;     /* primary text */
  --ink-soft:   #6E5C46;     /* secondary */
  --ink-faint:  #9C8B72;     /* tertiary / captions */

  /* Gold */
  --gold:       #C9A866;
  --gold-deep:  #B08F45;
  --gold-soft:  #E2CE9F;
  --gold-glow:  rgba(201,168,102,0.35);

  /* Lines & shadow */
  --line:       rgba(56,43,28,0.10);
  --line-soft:  rgba(56,43,28,0.06);
  --shadow-card: 0 2px 24px -8px rgba(56,43,28,0.10);
  --shadow-phone: 0 40px 90px -30px rgba(56,43,28,0.40), 0 12px 30px -12px rgba(56,43,28,0.22);
  --shadow-pill: 0 8px 24px -8px var(--gold-glow);

  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --sans:  "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  /* Layout */
  --container: 1280px;
  --gutter:    clamp(20px, 4vw, 56px);   /* viewport-relative side margins */
  --nav-h:     84px;
  --section-pad: clamp(4.5rem, 8vw, 9rem);
  --radius:    22px;

  /* Fluid type scale (rem-based; bounds tested 320 -> 2560).
     Preferred value carries a rem term so it partly tracks zoom. */
  --fs-body:    clamp(1rem, 0.95rem + 0.2vw, 1.125rem);   /* 16 -> 18 */
  --fs-lede:    clamp(1rem, 0.85rem + 0.5vw, 1.375rem);   /* 16 -> 22 */
  --fs-h3:      clamp(1.4rem, 1.1rem + 1vw, 2.125rem);    /* 22 -> 34 */
  --fs-h2:      clamp(1.9rem, 1.2rem + 2.6vw, 3.875rem);  /* 30 -> 62 */
  --fs-h1:      clamp(2rem, 1.1rem + 3.4vw, 3.9rem);      /* 32 -> 62, fits one line on desktop */
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;   /* stop iOS Safari inflating text */
  text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--sans);
  font-size: var(--fs-body);
  background: var(--ivory);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  line-height: 1.6;
  overflow-x: hidden;               /* guard against accidental h-scroll */
}

::selection { background: var(--gold-soft); color: var(--ink); }

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

a { color: inherit; text-decoration: none; }

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* ---------- Typographic primitives ---------- */
.eyebrow {
  font-family: var(--sans);
  font-weight: 600;
  font-size: 0.78rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold-deep);
  margin: 0;
}

.display {
  font-family: var(--serif);
  font-weight: 400;
  letter-spacing: -0.01em;
  line-height: 1.05;
  color: var(--ink);
  margin: 0;
  text-wrap: balance;
}

h1.display { font-size: var(--fs-h1); line-height: 1.04; }
h2.display { font-size: var(--fs-h2); }
h3.display { font-size: var(--fs-h3); }

.lede {
  font-size: var(--fs-lede);
  color: var(--ink-soft);
  line-height: 1.62;
  max-width: 46ch;                  /* readable line length */
  margin: 0;
  text-wrap: pretty;
}

.scripture {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  color: var(--ink-soft);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--sans);
  font-weight: 600;
  font-size: 0.95rem;
  border: 0;
  cursor: pointer;
  border-radius: 999px;
  padding: 14px 24px;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }

.btn-gold {
  background: linear-gradient(177deg, #DBBC7E 0%, var(--gold) 48%, #B8923F 100%);
  color: #4A3414;
  box-shadow: var(--shadow-pill), inset 0 1px 0 rgba(255,255,255,0.45);
}
.btn-gold:hover { box-shadow: 0 12px 30px -8px var(--gold-glow), inset 0 1px 0 rgba(255,255,255,0.45); transform: translateY(-1px); }

/* App store buttons */
.store-row { display: flex; flex-wrap: wrap; gap: 14px; }
.store-btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  background: var(--ink);
  color: var(--ivory-raised);
  border-radius: 14px;
  padding: 11px 20px 11px 18px;
  transition: transform .18s ease, box-shadow .18s ease;
  box-shadow: 0 10px 26px -14px rgba(56,43,28,0.55);
}
.store-btn:hover { transform: translateY(-2px); box-shadow: 0 16px 32px -14px rgba(56,43,28,0.6); }
.store-btn svg { flex: none; }
.store-btn .store-text { display: flex; flex-direction: column; line-height: 1.15; text-align: left; }
.store-btn .store-text small { font-size: 0.66rem; letter-spacing: 0.04em; opacity: 0.78; font-weight: 500; white-space: nowrap; }
.store-btn .store-text strong { font-size: 1rem; font-weight: 700; letter-spacing: 0.01em; white-space: nowrap; }

/* Social proof */
.proof { display: flex; align-items: center; gap: 12px; color: var(--ink-soft); font-size: 0.875rem; }
.stars { display: inline-flex; gap: 3px; color: var(--gold); }
.proof strong { color: var(--ink); font-weight: 700; }

/* ---------- Nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(244, 240, 228, 0.82);                         /* fallback */
  background: color-mix(in srgb, var(--ivory) 82%, transparent); /* progressive */
  -webkit-backdrop-filter: saturate(1.2) blur(14px);
  backdrop-filter: saturate(1.2) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .25s ease, background .25s ease;
}
.nav.scrolled { border-bottom-color: var(--line); }
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: var(--nav-h); }
.brand { display: flex; align-items: center; gap: 12px; font-family: var(--serif); font-size: 1.7rem; font-weight: 600; letter-spacing: -0.01em; color: var(--ink); }
.brand .mark { width: 60px; height: 60px; display: grid; place-items: center; flex: none; }
.brand .mark img { width: 100%; height: 100%; object-fit: contain; }
.nav-links { display: flex; align-items: center; gap: clamp(24px, 2.4vw, 38px); }
.nav-links a { font-size: 0.95rem; font-weight: 500; color: var(--ink-soft); transition: color .15s ease; }
.nav-links a:hover { color: var(--ink); }
.nav-cta { display: flex; align-items: center; gap: 14px; }
.nav-toggle {
  display: none;
  align-items: center; justify-content: center;
  width: 44px; height: 44px;
  border: 1px solid var(--line); border-radius: 12px;
  background: transparent; color: var(--ink); cursor: pointer;
  transition: background .15s ease;
}
.nav-toggle:hover { background: var(--ivory-raised); }

/* ---------- Section scaffolding ---------- */
section { position: relative; }
.section-pad { padding-block: var(--section-pad); }
.section-head { max-width: none; }
.section-head .eyebrow { margin-bottom: 18px; }
.section-head .lede { margin-top: 20px; }
.center { text-align: center; margin-inline: auto; }
.center .lede { margin-inline: auto; }

/* ---------- HERO (editorial split) ---------- */
.hero { overflow: hidden; }
.hero-bg {
  position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(60% 50% at 78% 18%, rgba(201,168,102,0.20), transparent 70%),
    radial-gradient(50% 40% at 12% 90%, rgba(201,168,102,0.10), transparent 70%);
}
.hero > .container { position: relative; z-index: 1; }

.heroA-grid {
  display: grid;
  grid-template-columns: 1.25fr 0.75fr;   /* text + phone, kept side-by-side at every size */
  gap: clamp(12px, 3vw, 80px);
  align-items: center;
  padding-block: clamp(40px, 7vw, 96px);
}
.heroA-copy { max-width: 40rem; min-width: 0; }
.heroA-copy > * + * { margin-top: clamp(14px, 2vw, 28px); }
.heroA-copy .store-row { margin-top: clamp(20px, 3vw, 34px); }
.heroA-copy .proof { margin-top: clamp(16px, 2vw, 26px); }
/* The phone column is a sizing container: the mockup fills it and all of
   its internals are expressed in container units (cqw) + em, so the whole
   thing scales as one crisp unit from ~120px wide up to 340px. */
.heroA-art {
  justify-self: center;
  width: 100%;
  max-width: clamp(130px, 30vw, 340px);
  container-type: inline-size;
  min-width: 0;
}

/* On laptops/desktops the hero fills the fold so the centered column
   reads as a deliberate, full layout rather than floating up top. */
@media (min-width: 981px) {
  .hero { display: flex; align-items: center; min-height: calc(100vh - var(--nav-h)); min-height: calc(100dvh - var(--nav-h)); }
  .hero > .container { width: 100%; }
}

/* ---------- Phone mockup (scales as one unit via container units) ----------
   font-size on .phone is cqw-based (cqw = 1% of the .heroA-art container,
   which the phone fills). Every internal dimension is in em off that base,
   so the entire mockup scales proportionally at any phone size. */
.phone {
  width: 100%;
  aspect-ratio: 9 / 19.3;
  background: #261D12;
  border-radius: 3.38em;
  padding: 0.85em;
  box-shadow: var(--shadow-phone);
  font-size: min(4.55cqw, 15px);
}
.phone-screen {
  width: 100%; height: 100%;
  background: var(--ivory);
  border-radius: 2.62em;
  overflow: hidden;
  position: relative;
  display: flex; flex-direction: column;
}
.phone-notch {
  position: absolute; top: 0.69em; left: 50%; transform: translateX(-50%);
  width: 7.08em; height: 0.54em; border-radius: 0.31em; background: rgba(38,29,18,0.18); z-index: 5;
}
/* app screen pieces */
.ph-continue {
  margin: 2.31em 1.23em 0;
  background: var(--ivory-sunk);
  border: 1px solid var(--line-soft);
  border-radius: 1.23em;
  padding: 0.92em 1.08em;
  display: flex; align-items: center; gap: 0.92em;
}
.ph-play {
  width: 2.92em; height: 2.92em; border-radius: 50%;
  background: var(--gold-soft);
  display: grid; place-items: center; flex: none;
}
.ph-play::after { content: ""; width: 0; height: 0; border-left: 0.85em solid var(--gold-deep); border-top: 0.54em solid transparent; border-bottom: 0.54em solid transparent; margin-left: 0.23em; }
.ph-continue .meta { flex: 1; min-width: 0; }
.ph-continue .meta small { display: block; font-size: 0.69em; letter-spacing: 0.16em; color: var(--ink-faint); font-weight: 700; }
.ph-continue .meta strong { display: block; font-size: 1.08em; color: var(--ink); font-weight: 700; line-height: 1.2; margin-top: 0.15em; }
.ph-chevron { color: var(--ink-faint); flex: none; display: flex; }
.ph-chevron svg { width: 1.23em; height: 1.23em; }
.ph-stage { margin: 2.85em 1.23em 0; }
.ph-stage .label { font-family: var(--serif); font-size: 1.38em; color: var(--gold-deep); font-weight: 600; }
.ph-stage .sub { font-size: 0.73em; letter-spacing: 0.14em; color: var(--ink-faint); font-weight: 700; margin-top: 0.15em; }
.ph-path { flex: 1; position: relative; margin-top: 0.46em; }
.ph-godsays { position: absolute; left: 1.23em; max-width: 11.5em; }
.ph-godsays.gs-top { top: 0.46em; }
.ph-godsays.gs-bottom { bottom: 0.62em; left: 1.23em; }
.ph-godsays small { font-size: 0.69em; letter-spacing: 0.16em; color: var(--ink-faint); font-weight: 700; }
.ph-godsays p { font-family: var(--serif); font-style: italic; font-size: 1.15em; line-height: 1.3; color: var(--ink-soft); margin: 0.31em 0 0; }
.ph-node {
  position: absolute; left: 4.15em; top: 9.54em;
  width: 2.31em; height: 2.31em; border-radius: 50%;
  background: var(--gold-soft); display: grid; place-items: center;
  box-shadow: 0 4px 14px -4px var(--gold-glow);
}
.ph-node::after { content: ""; width: 0.69em; height: 1em; border-radius: 0 50% 50% 50%; background: linear-gradient(180deg, #F0D27C, var(--gold)); transform: rotate(45deg); }
.ph-tabbar {
  height: 4.46em; border-top: 1px solid var(--line-soft);
  display: flex; align-items: center; justify-content: space-around;
  color: var(--ink); padding: 0 1.08em 0.46em;
}
.ph-tabbar svg { width: 1.7em; height: 1.7em; opacity: 0.85; }
.ph-tabbar .active-tab { color: var(--ink); opacity: 1; }
.ph-tabbar .dim { opacity: 0.4; }

/* ---------- Features ---------- */
.features-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: clamp(16px, 1.6vw, 24px);
  margin-top: clamp(40px, 5vw, 60px);
}
.feature-card {
  background: var(--ivory-raised);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: clamp(24px, 2.4vw, 32px) clamp(22px, 2vw, 28px);
  box-shadow: var(--shadow-card);
  transition: transform .22s ease, box-shadow .22s ease;
}
.feature-card:hover { transform: translateY(-4px); box-shadow: 0 18px 40px -18px rgba(56,43,28,0.18); }
.feature-ic {
  width: 50px; height: 50px; border-radius: 14px;
  background: var(--ivory-warm);
  border: 1px solid rgba(201,168,102,0.30);
  display: grid; place-items: center; color: var(--gold-deep);
  margin-bottom: 22px;
}
.feature-card h3 { font-family: var(--serif); font-size: 1.375rem; font-weight: 500; margin: 0 0 8px; color: var(--ink); }
.feature-card p { margin: 0; font-size: 0.9rem; color: var(--ink-soft); line-height: 1.55; }

/* ---------- Scripture band ---------- */
.scripture-band {
  background: var(--ivory-warm);
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
  text-align: center;
}
.scripture-band .container { max-width: 920px; }
.scripture-band small { font-size: 0.75rem; letter-spacing: 0.22em; color: var(--gold-deep); font-weight: 600; text-transform: uppercase; }
.scripture-band blockquote {
  font-family: var(--serif); font-style: italic; font-weight: 400;
  font-size: clamp(1.75rem, 1rem + 2.6vw, 2.875rem); line-height: 1.28; color: var(--ink);
  margin: 22px auto 0; max-width: 18ch; text-wrap: balance;
}
.scripture-band cite { display: block; margin-top: 22px; font-style: normal; font-size: 0.875rem; letter-spacing: 0.08em; color: var(--ink-faint); }

/* ---------- About / scholars ---------- */
.about-simple { max-width: 860px; margin-inline: auto; text-align: center; }
.about-simple h2 { margin-bottom: clamp(28px, 4vw, 44px); }
.trust-list { display: flex; flex-wrap: wrap; justify-content: center; gap: 16px 30px; }
.trust-item { display: inline-flex; align-items: center; gap: 12px; }
.trust-item .tick {
  width: 26px; height: 26px; border-radius: 50%; flex: none;
  background: var(--ivory-warm); border: 1px solid rgba(201,168,102,0.35);
  display: grid; place-items: center; color: var(--gold-deep);
}
.trust-item span { font-size: 0.97rem; color: var(--ink); text-align: left; }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--line); padding-block: 56px; }
.footer-top { display: flex; justify-content: space-between; gap: 40px; flex-wrap: wrap; align-items: flex-start; }
.footer-col h4 { font-size: 0.75rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--ink-faint); margin: 0 0 16px; font-weight: 700; }
.footer-col a, .footer-col p { display: block; color: var(--ink-soft); font-size: 0.9rem; margin: 0 0 10px; transition: color .15s; }
.footer-col a:hover { color: var(--ink); }
.footer-cols { display: flex; gap: clamp(40px, 5vw, 72px); flex-wrap: wrap; }
.footer-bottom { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-top: 44px; padding-top: 26px; border-top: 1px solid var(--line-soft); color: var(--ink-faint); font-size: 0.81rem; }
.footer-bottom .scripture { color: var(--ink-faint); }

/* ---------- Contact ---------- */
.contact-head { max-width: 600px; margin-inline: auto; text-align: center; }
.contact-head .eyebrow { margin-bottom: 16px; }
.contact-head .lede { margin: 16px auto 0; }
.contact-card {
  max-width: 560px; margin: clamp(30px, 4vw, 44px) auto 0;
  background: var(--ivory-raised); border: 1px solid var(--line-soft);
  border-radius: 22px; padding: clamp(20px, 3vw, 32px) clamp(22px, 3vw, 36px);
  box-shadow: var(--shadow-card);
}
.contact-row { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.contact-row:first-child { padding-top: 4px; }
.contact-row:last-child { border-bottom: none; padding-bottom: 4px; }
.contact-row > span { color: var(--ink-faint); font-size: 0.9rem; }
.contact-row a { color: var(--gold-deep); font-weight: 600; word-break: break-word; text-align: right; }
.contact-row a:hover { color: var(--ink); }

/* ============================================================
   Responsive breakpoints
   (mobile-first defaults above; these adapt up and down)
   ============================================================ */

/* Tablet landscape / small laptop: ease the 4-up feature grid */
@media (max-width: 1100px) {
  .features-grid { grid-template-columns: repeat(2, 1fr); }
}

/* Tablet portrait and below: nav links collapse into a tap-to-open menu,
   footer centers. The hero intentionally stays two-column at all sizes. */
@media (max-width: 900px) {
  .heroA-copy { max-width: none; }

  .nav-toggle { display: inline-flex; }
  .nav-links {
    position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--ivory-raised);
    border-top: 1px solid var(--line-soft);
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow-card);
    padding: 6px 0;
    display: none;
  }
  .nav.open .nav-links { display: flex; }
  .nav-links a { padding: 13px var(--gutter); font-size: 1rem; }
  .nav-links a:hover { background: var(--ivory-warm); }

  .footer-top { flex-direction: column; align-items: center; text-align: center; }
  .footer-cols { width: 100%; justify-content: center; }
  .footer-col { text-align: center; }
}

/* Very small phones: drop the nav wordmark so the logo + CTA + menu still fit
   (the tree mark stays as the brand). Footer keeps the full wordmark. */
@media (max-width: 384px) {
  .nav .brand-name { display: none; }
}

/* Large phone / small tablet */
@media (max-width: 620px) {
  .features-grid { grid-template-columns: 1fr; }
  .store-row { flex-direction: column; align-items: stretch; }
  .store-btn { justify-content: center; }
  .footer-bottom { flex-direction: column; gap: 8px; }
}

/* Honor reduced-motion preference */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition-duration: .01ms !important; }
}
