/* ===========================================================================
   Arosi — landing page styles
   Palette is brand-exact; a few interactive shades are darkened for WCAG AA
   (documented in README): --cta (button bg) and --slate-link (link text).
   =========================================================================== */

:root {
  --cream:       #F5EDDB;  /* background */
  --surface:     #FCF7ED;  /* cards / alt sections */
  --surface-2:   #F1E7D4;  /* nested soft fill */
  --ink:         #382E24;  /* primary text */
  --muted:       #736657;  /* secondary text (4.78:1 on cream) */
  --accent:      #D68545;  /* terracotta glow / decorative */
  --accent-soft: #E7B27E;  /* lighter warm wash */
  --cta:         #AD5E2B;  /* button bg — white text 4.76:1 (AA) */
  --cta-hover:   #944C20;
  --slate:       #578AB8;  /* decorative cool accent */
  --slate-link:  #3F6F9C;  /* interactive text — 4.55:1 on cream */
  --hairline:    rgba(56, 46, 36, 0.12);
  --shadow:      0 12px 40px -18px rgba(56, 46, 36, 0.30);
  --shadow-soft: 0 6px 22px -14px rgba(56, 46, 36, 0.28);

  --dusk-1: #2b2750;
  --dusk-2: #3a3560;
  --dusk-3: #6f6483;
  --on-dusk: #fbf3e6;
  --on-dusk-muted: #ddd1c2;

  --font-head: ui-rounded, "SF Pro Rounded", "Hiragino Maru Gothic ProN", "Segoe UI", system-ui, sans-serif;
  --font-body: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;

  --maxw: 1120px;
  --radius: 22px;
  --radius-sm: 14px;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --cream:       #1c1a30;
    --surface:     #25223f;
    --surface-2:   #2c2949;
    --ink:         #f1ead9;
    --muted:       #c3b8c9;  /* 8.9:1 on dark bg */
    --accent:      #E7B27E;
    --accent-soft: #d68545;
    --cta:         #C8703A;  /* dark mode: white text 4.5:1+ */
    --cta-hover:   #d98a4f;
    --slate:       #8fb4d8;
    --slate-link:  #9dc0e2;  /* light slate on dark */
    --hairline:    rgba(241, 234, 217, 0.14);
    --shadow:      0 12px 40px -18px rgba(0, 0, 0, 0.6);
    --shadow-soft: 0 6px 22px -14px rgba(0, 0, 0, 0.5);
  }
}

/* ---- reset / base ---- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: clamp(1.02rem, 0.55vw + 0.92rem, 1.18rem);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

h1, h2, h3, .brand-name, .btn, .trust-chips, .step-num, .section-sub, .price-label, .faq-item summary, .footer-h, nav {
  font-family: var(--font-head);
}

h2 { font-size: clamp(1.6rem, 2.2vw + 1rem, 2.5rem); line-height: 1.15; letter-spacing: -0.01em; margin: 0 0 0.5em; }
h3 { font-size: clamp(1.15rem, 0.8vw + 1rem, 1.4rem); line-height: 1.25; margin: 0 0 0.35em; }
p { margin: 0 0 1em; }
a { color: var(--slate-link); }

/* ---- layout ---- */
.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: clamp(20px, 5vw, 40px); }
.section { padding-block: clamp(56px, 8vw, 104px); }
.measure { max-width: 64ch; }
.measure-wide { max-width: 760px; margin-inline: auto; }
.measure-center { max-width: 60ch; margin-inline: auto; text-align: center; }
.section-head { max-width: 64ch; margin: 0 0 clamp(28px, 4vw, 48px); }
.section-sub { color: var(--muted); font-size: 1.05em; margin: 0; }
.measure-center.section-sub, .section-sub.measure-center { margin-inline: auto; }

/* ---- skip link ---- */
.skip-link {
  position: absolute; left: 16px; top: -60px; z-index: 100;
  background: var(--surface); color: var(--ink); text-decoration: none;
  padding: 10px 16px; border-radius: 10px; box-shadow: var(--shadow);
  transition: top 0.2s var(--ease);
}
.skip-link:focus { top: 16px; }

/* ---- header ---- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--cream) 86%, transparent);
  backdrop-filter: saturate(1.1) blur(10px);
  border-bottom: 1px solid var(--hairline);
}
.header-inner { display: flex; align-items: center; gap: 18px; min-height: 66px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.brand-mark { border-radius: 11px; box-shadow: var(--shadow-soft); }
.brand-name { font-size: 1.3rem; font-weight: 700; letter-spacing: 0.01em; }
.site-nav { display: none; margin-left: auto; gap: clamp(14px, 2vw, 30px); }
.site-nav a { color: var(--ink); text-decoration: none; font-size: 0.98rem; padding: 6px 2px; border-bottom: 2px solid transparent; }
.site-nav a:hover { border-bottom-color: var(--accent); }
.header-inner .btn-cta { margin-left: auto; }
.site-nav ~ .btn-cta { margin-left: 0; }

@media (min-width: 880px) {
  .site-nav { display: inline-flex; }
  .header-inner .btn-cta { margin-left: 6px; }
}

/* ---- buttons ---- */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  text-decoration: none; font-weight: 600; cursor: pointer;
  border: 0; border-radius: 999px; line-height: 1.1;
  transition: transform 0.18s var(--ease), background-color 0.18s var(--ease), box-shadow 0.18s var(--ease);
}
.btn-cta {
  background: var(--cta); color: #fff;
  box-shadow: 0 10px 26px -12px color-mix(in srgb, var(--accent) 70%, transparent);
}
.btn-cta:hover { background: var(--cta-hover); transform: translateY(-1px); }
.btn-cta:active { transform: translateY(0); }
.btn-cta .apple { color: #fff; }
.btn-sm { padding: 9px 16px; font-size: 0.92rem; }
.btn-lg { padding: 15px 26px; font-size: 1.05rem; }
.btn-stack { display: inline-flex; flex-direction: column; line-height: 1.05; text-align: left; }
.btn-stack small { font-size: 0.66em; opacity: 0.92; font-weight: 500; }
.btn-stack strong { font-size: 1.06em; font-weight: 700; }

/* ---- focus visibility (brand value) ---- */
:focus-visible {
  outline: 3px solid var(--slate-link);
  outline-offset: 3px;
  border-radius: 8px;
}
.btn-cta:focus-visible { outline-color: var(--ink); }

/* ---- hero ---- */
.hero {
  position: relative; isolation: isolate;
  min-height: min(86vh, 760px);
  display: flex; align-items: flex-end;
  padding-block: clamp(72px, 12vh, 150px) clamp(48px, 8vh, 96px);
  /* gradient fallback if the SVG fails to load */
  background: linear-gradient(180deg, #2b2750 0%, #3a3560 45%, #6f6483 78%, #8a7d92 100%);
  overflow: hidden;
}
.hero-art { position: absolute; inset: 0; z-index: -2; }
.hero-art img { width: 100%; height: 100%; object-fit: cover; object-position: center 35%; }
.hero::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    radial-gradient(120% 80% at 50% 120%, rgba(36, 31, 64, 0.65) 0%, rgba(36, 31, 64, 0) 60%),
    linear-gradient(180deg, rgba(28,25,48,0.18) 0%, rgba(28,25,48,0.05) 40%, rgba(28,25,48,0.4) 100%);
}
.hero-content { color: var(--on-dusk); text-align: center; }
.hero-eyebrow {
  font-family: var(--font-head); text-transform: uppercase; letter-spacing: 0.18em;
  font-size: 0.78rem; color: var(--on-dusk-muted); margin: 0 0 0.6em;
}
.hero-name {
  font-size: clamp(3rem, 8vw + 1rem, 5.6rem); margin: 0 0 0.12em;
  font-weight: 700; letter-spacing: 0.005em;
  text-shadow: 0 2px 30px rgba(20, 16, 40, 0.45);
}
.hero-tagline { font-size: clamp(1.2rem, 1.6vw + 0.9rem, 1.7rem); margin: 0 0 0.5em; color: var(--on-dusk); }
.hero-promise {
  font-family: var(--font-head); font-weight: 600;
  font-size: clamp(1.05rem, 1vw + 0.9rem, 1.3rem);
  color: #fff; margin: 0 auto 1.6em; max-width: 30ch;
  text-shadow: 0 1px 16px rgba(20, 16, 40, 0.5);
}
.hero-actions { display: flex; justify-content: center; margin-bottom: 1.8em; }
.trust-chips { list-style: none; display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; padding: 0; margin: 0; }
.trust-chips li {
  font-family: var(--font-head); font-size: 0.86rem; font-weight: 600;
  color: var(--on-dusk); padding: 7px 15px; border-radius: 999px;
  background: rgba(252, 247, 237, 0.14);
  border: 1px solid rgba(252, 247, 237, 0.28);
  backdrop-filter: blur(4px);
}

/* ---- promise ---- */
.promise { background: var(--cream); }
.promise h2 { max-width: 18ch; }
.promise p { font-size: 1.12em; }
.promise p:first-of-type { color: var(--ink); }

/* ---- worlds ---- */
.worlds { background: var(--surface); }
.world-grid {
  list-style: none; padding: 0; margin: 0;
  display: grid; gap: clamp(18px, 3vw, 28px);
  grid-template-columns: 1fr;
}
@media (min-width: 860px) { .world-grid { grid-template-columns: repeat(3, 1fr); } }
.world-card {
  background: var(--cream); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow-soft);
  border: 1px solid var(--hairline);
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
.world-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.world-art { aspect-ratio: 4 / 3; background: linear-gradient(160deg, #3a3560, #6f6483); }
.world-art img { width: 100%; height: 100%; object-fit: cover; }
.world-art[data-fallback="rainy"]    { background: linear-gradient(160deg, #534763, #8f86a8); }
.world-art[data-fallback="bedtime"]  { background: linear-gradient(160deg, #1f1c3c, #5a5072); }
.world-art[data-fallback="reef"]     { background: linear-gradient(160deg, #1b2452, #3a2f55); }
.world-text { padding: clamp(18px, 2.4vw, 26px); }
.world-text p { color: var(--muted); margin: 0; }

/* ---- how a session works ---- */
.how { background: var(--cream); }
.steps {
  list-style: none; padding: 0; margin: 0; counter-reset: step;
  display: grid; gap: clamp(20px, 3vw, 32px); grid-template-columns: 1fr;
}
@media (min-width: 720px) { .steps { grid-template-columns: repeat(3, 1fr); } }
.step {
  background: var(--surface); border: 1px solid var(--hairline);
  border-radius: var(--radius); padding: clamp(22px, 3vw, 30px);
  box-shadow: var(--shadow-soft);
}
.step-num {
  display: inline-grid; place-items: center; width: 44px; height: 44px;
  border-radius: 50%; margin-bottom: 14px; font-weight: 700; font-size: 1.15rem;
  color: #fff;
  background: radial-gradient(circle at 35% 30%, var(--accent-soft), var(--cta));
  box-shadow: 0 8px 20px -10px color-mix(in srgb, var(--accent) 75%, transparent);
}
.step p { color: var(--muted); margin: 0; }

/* ---- trust grid ---- */
.trust { background: var(--surface); }
.trust-grid {
  list-style: none; padding: 0; margin: 0;
  display: grid; gap: clamp(14px, 2vw, 20px);
  grid-template-columns: 1fr;
}
@media (min-width: 560px) { .trust-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 920px) { .trust-grid { grid-template-columns: repeat(4, 1fr); } }
.trust-item {
  background: var(--cream); border: 1px solid var(--hairline);
  border-radius: var(--radius-sm); padding: clamp(18px, 2.2vw, 24px);
}
.trust-item h3 { font-size: 1.08rem; }
.trust-item p { color: var(--muted); margin: 0; font-size: 0.98em; }
.trust-icon { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; margin-bottom: 12px; color: var(--cta); background: var(--surface-2); }
.trust-feature { grid-column: span 1; background: linear-gradient(165deg, var(--surface-2), var(--cream)); border-color: color-mix(in srgb, var(--accent) 35%, var(--hairline)); }
.trust-feature .trust-icon { color: #fff; background: radial-gradient(circle at 35% 30%, var(--accent-soft), var(--cta)); }
@media (min-width: 560px) { .trust-feature { grid-column: span 1; } }
@media (min-width: 920px) { .trust-feature { grid-column: span 2; } }

/* ---- accessibility ---- */
.accessibility { background: var(--cream); }
.accessibility .section-head { max-width: 760px; margin-inline: auto; text-align: center; }
.a11y-grid {
  list-style: none; padding: 0; margin: 0;
  display: grid; gap: clamp(14px, 2vw, 22px);
  grid-template-columns: 1fr;
}
@media (min-width: 560px) { .a11y-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 920px) { .a11y-grid { grid-template-columns: repeat(3, 1fr); } }
.a11y-item {
  background: var(--surface); border: 1px solid var(--hairline);
  border-left: 4px solid var(--slate);
  border-radius: var(--radius-sm); padding: clamp(18px, 2.2vw, 24px);
}
.a11y-item h3 { font-size: 1.05rem; }
.a11y-item p { color: var(--muted); margin: 0; font-size: 0.97em; }

/* ---- pricing ---- */
.pricing { background: var(--surface); }
.price-card {
  display: grid; gap: clamp(22px, 4vw, 44px);
  grid-template-columns: 1fr;
  background: var(--cream); border: 1px solid var(--hairline);
  border-radius: var(--radius); padding: clamp(26px, 4vw, 48px);
  box-shadow: var(--shadow-soft); max-width: 860px; margin-inline: auto;
}
@media (min-width: 720px) { .price-card { grid-template-columns: 1.1fr 1fr; align-items: center; } }
.price-label { font-weight: 600; color: var(--muted); margin: 0 0 0.2em; letter-spacing: 0.01em; }
.price-badge {
  display: inline-block; vertical-align: middle; margin-left: 8px;
  font-size: 0.72em; font-weight: 700; letter-spacing: 0.02em;
  color: var(--cta); background: color-mix(in srgb, var(--cta) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--cta) 30%, transparent);
  border-radius: 999px; padding: 3px 10px;
}
.price-amount { font-family: var(--font-head); font-weight: 700; font-size: clamp(2.6rem, 5vw, 3.4rem); line-height: 1; margin: 0 0 0.3em; }
.price-amount .currency { font-size: 0.55em; vertical-align: 0.55em; color: var(--muted); }
.price-amount .price-note { display: inline-block; font-size: 0.3em; vertical-align: middle; color: var(--muted); font-weight: 600; margin-left: 4px; }
.price-desc { color: var(--muted); }
.price-main .btn { margin-top: 0.6em; }
.price-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
.price-list li { position: relative; padding-left: 30px; color: var(--ink); }
.price-list li::before {
  content: ""; position: absolute; left: 0; top: 0.45em; width: 18px; height: 18px;
  border-radius: 50%; background: var(--cta);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='white' d='M9 16.2 4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4z'/%3E%3C/svg%3E") center/contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='white' d='M9 16.2 4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4z'/%3E%3C/svg%3E") center/contain no-repeat;
}

/* ---- legal / content page ---- */
.legal h1 { font-size: clamp(2rem, 2.4vw + 1.4rem, 2.9rem); line-height: 1.12; letter-spacing: -0.01em; margin: 0 0 0.4em; }
.legal h2 { font-size: clamp(1.3rem, 1.4vw + 0.9rem, 1.7rem); margin: 1.6em 0 0.4em; }
.legal .legal-meta { color: var(--muted); font-size: 0.95em; margin: 0 0 2em; }
.legal ul { margin: 0 0 1.4em; padding-left: 1.4em; display: grid; gap: 8px; }
.legal li { color: var(--ink); }
.legal .legal-back { margin-top: 2.4em; font-family: var(--font-head); }

/* ---- faq ---- */
.faq { background: var(--cream); }
.accordion { display: grid; gap: 12px; }
.faq-item {
  background: var(--surface); border: 1px solid var(--hairline);
  border-radius: var(--radius-sm); overflow: hidden;
}
.faq-item summary {
  list-style: none; cursor: pointer;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: clamp(16px, 2.2vw, 22px) clamp(18px, 2.4vw, 26px);
  font-weight: 600; font-size: 1.05rem; color: var(--ink);
}
.faq-item summary::-webkit-details-marker { display: none; }
.chevron { flex: none; width: 14px; height: 14px; border-right: 2.5px solid var(--cta); border-bottom: 2.5px solid var(--cta); transform: rotate(45deg); transition: transform 0.25s var(--ease); margin-top: -4px; }
.faq-item[open] .chevron { transform: rotate(-135deg); margin-top: 4px; }
.faq-body { padding: 0 clamp(18px, 2.4vw, 26px) clamp(18px, 2.4vw, 24px); }
.faq-body p { color: var(--muted); margin: 0; }

/* ---- ethos / why we made Arosi ---- */
.ethos { background: var(--surface); }
.ethos-inner { max-width: 62ch; margin-inline: auto; text-align: center; }
.ethos-eyebrow {
  font-family: var(--font-head); text-transform: uppercase; letter-spacing: 0.18em;
  font-size: 0.78rem; color: var(--muted); margin: 0 0 0.7em;
}
.ethos-inner h2 { max-width: 20ch; margin-inline: auto; }
.ethos-body { text-align: left; margin-top: clamp(20px, 3vw, 30px); }
.ethos-body p { color: var(--ink); font-size: 1.08em; }
.ethos-body p:last-child { margin-bottom: 0; color: var(--muted); }
.ethos-sign { margin-top: clamp(28px, 4vw, 44px); text-align: center; }
.ethos-signature { font-family: var(--font-head); font-weight: 700; color: var(--ink); margin: 0 0 clamp(18px, 2.6vw, 26px); }
.credits {
  list-style: none; padding: 0; margin: 0;
  display: grid; gap: 14px 32px; grid-template-columns: 1fr;
  max-width: 30rem; margin-inline: auto; text-align: left;
}
@media (min-width: 560px) { .credits { grid-template-columns: 1fr 1fr; } }
.credits li { display: flex; flex-direction: column; gap: 2px; }
.credit-role { font-family: var(--font-head); text-transform: uppercase; letter-spacing: 0.12em; font-size: 0.72rem; color: var(--muted); }
.credit-name { color: var(--ink); }

/* ---- final CTA ---- */
.final-cta {
  background:
    radial-gradient(120% 120% at 50% 0%, rgba(214,133,69,0.28) 0%, rgba(214,133,69,0) 55%),
    linear-gradient(180deg, var(--dusk-2) 0%, var(--dusk-1) 100%);
  color: var(--on-dusk);
}
.final-cta h2 { color: var(--on-dusk); }
.final-cta p { color: var(--on-dusk-muted); font-size: 1.1em; margin-bottom: 1.6em; }
.final-cta .hero-actions, .final-cta .btn { margin-inline: auto; }
.final-cta .btn { display: inline-flex; }

/* ---- footer ---- */
.site-footer { background: var(--surface); border-top: 1px solid var(--hairline); padding-block: clamp(40px, 6vw, 64px) 24px; }
.footer-inner { display: grid; gap: clamp(28px, 4vw, 56px); grid-template-columns: 1fr; }
@media (min-width: 760px) { .footer-inner { grid-template-columns: 1fr 1.4fr; } }
.footer-tagline { color: var(--muted); margin: 12px 0 0; }
.footer-cols { display: grid; gap: clamp(24px, 4vw, 48px); grid-template-columns: 1fr; }
@media (min-width: 560px) { .footer-cols { grid-template-columns: 1.4fr 1fr; } }
.footer-h { font-size: 1rem; font-weight: 700; margin: 0 0 0.6em; }
.footer-col p { color: var(--muted); margin: 0 0 1em; font-size: 0.98em; }
.footer-col ul { list-style: none; padding: 0; margin: 0 0 1em; display: grid; gap: 10px; }
.footer-col a { color: var(--slate-link); text-decoration: none; }
.footer-col a:hover { text-decoration: underline; }
.footer-note { font-size: 0.9em; color: var(--muted); }
.footer-base { margin-top: clamp(24px, 4vw, 40px); padding-top: 20px; border-top: 1px solid var(--hairline); }
.footer-base p { margin: 0; color: var(--muted); font-size: 0.9em; }

/* ---- broken-image fallback (JS adds .img-failed) ---- */
.img-failed img { display: none; }

/* ---- reduced motion: disable all motion (on-brand, not just compliance) ---- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .world-card:hover, .btn-cta:hover { transform: none; }
}
