/* Dream & Omen Decoder: site styles. Palette and type match the app (mobile/src/theme.js).
   Mobile-first: base rules target phones; wider screens only add room. */

@font-face {
  font-family: 'Cormorant Garamond';
  src: url('fonts/CormorantGaramond-Bold.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Cormorant Garamond';
  src: url('fonts/CormorantGaramond-MediumItalic.woff2') format('woff2');
  font-weight: 500;
  font-style: italic;
  font-display: swap;
}

:root {
  --bg: #14101f;
  --surface: #1f1830;
  --surface-raised: #2a2140;
  --border: #3d3159;
  --gold: #e8b54a;
  --gold-soft: #f3d38a;
  --amber: #d9892b;
  --text: #ece6f7;
  --muted: #a79cc0;
  --cream: #fcf9f2;
  --luck: #5fc98a;
  --caution: #e8a33d;
  --serif: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  --sans: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --radius: 18px;
  --gutter: clamp(16px, 5vw, 40px);
  --max: 1080px;
  color-scheme: dark;
}

*, *::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(--bg);
  background-image:
    radial-gradient(ellipse 120% 60% at 50% -10%, rgba(232, 181, 74, 0.10), transparent 60%),
    radial-gradient(ellipse 80% 50% at 100% 40%, rgba(121, 92, 190, 0.10), transparent 60%);
  background-repeat: no-repeat;
  color: var(--text);
  font-family: var(--sans);
  font-size: clamp(1rem, 0.96rem + 0.2vw, 1.0625rem);
  line-height: 1.6;
  overflow-wrap: break-word;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--gold-soft); text-underline-offset: 3px; }
a:hover { color: var(--gold); }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 6px; }

.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 10;
  background: var(--gold); color: var(--bg); padding: 10px 16px; border-radius: 10px; font-weight: 700;
}
.skip-link:focus { top: 12px; }

.wrap {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding-left: max(var(--gutter), env(safe-area-inset-left));
  padding-right: max(var(--gutter), env(safe-area-inset-right));
}

/* ---------- Header ---------- */
.site-header { border-bottom: 1px solid rgba(61, 49, 89, 0.6); }
.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  min-height: 64px;
}
.brand {
  display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--gold);
  font-family: var(--serif); font-weight: 700; font-size: 1.25rem; line-height: 1.1;
}
.brand img { width: 36px; height: 36px; border-radius: 9px; }
.lang-switch {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px;
  border: 1px solid var(--border); border-radius: 999px; text-decoration: none;
  color: var(--text); font-size: 0.9rem; white-space: nowrap;
}
.lang-switch:hover { border-color: var(--gold); color: var(--gold-soft); }

/* ---------- Type ---------- */
h1, h2, h3 { font-family: var(--serif); font-weight: 700; color: var(--gold); line-height: 1.12; margin: 0; }
h1 { font-size: clamp(2.6rem, 1.6rem + 5vw, 4.6rem); letter-spacing: -0.01em; }
h2 { font-size: clamp(2rem, 1.5rem + 2.4vw, 2.9rem); }
h3 { font-size: clamp(1.35rem, 1.2rem + 0.6vw, 1.6rem); color: var(--gold-soft); }
.tagline {
  font-family: var(--serif); font-style: italic; font-weight: 500;
  font-size: clamp(1.35rem, 1.15rem + 1vw, 1.9rem); color: var(--gold-soft); margin: 0;
}
.glyph { color: var(--gold); letter-spacing: 0.5em; font-size: 1.1rem; margin: 0 0 14px; padding-left: 0.5em; }
.lead { font-size: clamp(1.05rem, 1rem + 0.35vw, 1.25rem); color: var(--text); max-width: 38em; }
.muted { color: var(--muted); }
.small { font-size: 0.9rem; }

/* ---------- Sections ---------- */
section { padding: clamp(56px, 8vw, 104px) 0; }
section + section { border-top: 1px solid rgba(61, 49, 89, 0.5); }
.section-head { text-align: center; max-width: 40em; margin: 0 auto clamp(28px, 4vw, 48px); }
.section-head p { color: var(--muted); margin: 14px auto 0; }

/* ---------- Hero ---------- */
.hero { padding-top: clamp(40px, 7vw, 96px); text-align: center; }
.hero-grid { display: grid; gap: clamp(28px, 5vw, 56px); align-items: center; justify-items: center; }
.hero-emblem {
  width: clamp(150px, 36vw, 240px); aspect-ratio: 1; border-radius: 28%;
  box-shadow: 0 0 0 1px rgba(232, 181, 74, 0.35), 0 24px 70px rgba(232, 181, 74, 0.18);
}
.hero .tagline { margin-top: 14px; }
.hero .lead { margin: 20px auto 0; }
.hero-note { margin-top: 16px; color: var(--muted); font-size: 0.95rem; }

@media (min-width: 860px) {
  .hero { text-align: left; }
  .hero-grid { grid-template-columns: 1.4fr 1fr; justify-items: stretch; }
  .hero .lead { margin-left: 0; }
  .hero .stores { justify-content: flex-start; }
  .hero-emblem { justify-self: center; width: clamp(220px, 26vw, 300px); }
}

/* ---------- Store buttons ---------- */
.stores { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin-top: 28px; }
.store {
  display: inline-flex; align-items: center; gap: 12px;
  min-height: 56px; min-width: min(220px, 100%); padding: 10px 20px;
  border-radius: 14px; text-decoration: none; border: 1px solid var(--gold);
  background: var(--gold); color: var(--bg);
}
a.store:hover { background: var(--gold-soft); color: var(--bg); }
.store svg { width: 26px; height: 26px; flex: none; }
.store span { display: flex; flex-direction: column; line-height: 1.15; text-align: left; }
.store small { font-size: 0.72rem; letter-spacing: 0.02em; }
.store strong { font-size: 1.12rem; }
.store.soon { background: transparent; color: var(--gold-soft); border-style: dashed; cursor: default; }
@media (max-width: 420px) { .store { width: 100%; justify-content: center; } }

/* ---------- Cards / grids ---------- */
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr)); }
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: clamp(20px, 3vw, 28px);
}
.card h3 { margin-bottom: 8px; }
.card p { margin: 0; color: var(--muted); }
.card .examples { margin-top: 12px; color: var(--text); font-style: italic; }
.icon { font-size: 1.6rem; color: var(--gold); margin-bottom: 10px; line-height: 1; }

.steps { counter-reset: step; list-style: none; padding: 0; margin: 0; }
.steps li { counter-increment: step; }
.steps li::before {
  content: counter(step);
  display: inline-grid; place-items: center; width: 40px; height: 40px; margin-bottom: 12px;
  border-radius: 50%; background: var(--surface-raised); border: 1px solid var(--gold);
  color: var(--gold); font-family: var(--serif); font-weight: 700; font-size: 1.35rem;
}

/* ---------- Sample reading ---------- */
.reading-layout { display: grid; gap: clamp(24px, 4vw, 48px); align-items: start; }
@media (min-width: 900px) { .reading-layout { grid-template-columns: 1fr 1.15fr; } }
.parts { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
.parts li { padding-left: 28px; position: relative; }
.parts li::before { content: '✧'; position: absolute; left: 0; top: 0; color: var(--gold); }
.parts strong { color: var(--gold-soft); }

.reading {
  background: linear-gradient(180deg, var(--surface-raised), var(--surface));
  border: 1px solid var(--gold); border-radius: 22px; padding: clamp(22px, 4vw, 34px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}
.reading .you { color: var(--muted); font-style: italic; margin: 0 0 18px; }
.badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px;
  font-size: 0.85rem; font-weight: 700; border: 1px solid currentColor;
}
.badge.caution { color: var(--caution); }
.badge.luck { color: var(--luck); }
.tradition { color: var(--muted); font-size: 0.9rem; margin-left: 8px; }
.reading h3 { margin: 14px 0 12px; color: var(--gold); font-size: clamp(1.6rem, 1.3rem + 1vw, 2rem); }
.reading p { margin: 0 0 14px; }
.reading .label {
  display: block; margin-top: 18px; font-family: var(--serif); font-style: italic; font-weight: 500;
  color: var(--gold-soft); font-size: 1.2rem;
}
.reading .numbers { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.reading .numbers span {
  display: inline-grid; place-items: center; min-width: 40px; height: 40px; padding: 0 6px; border-radius: 50%;
  background: var(--bg); border: 1px solid var(--border); color: var(--gold); font-weight: 700;
}
.caption { margin-top: 12px; color: var(--muted); font-size: 0.85rem; text-align: center; }

/* ---------- Traditions ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; list-style: none; padding: 0; margin: 0; }
.chips li {
  padding: 10px 16px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border);
}
.chips.secondary li { border-style: dashed; color: var(--muted); }
.subhead { text-align: center; margin: 28px 0 14px; color: var(--muted); }
.respect { max-width: 42em; margin: 28px auto 0; text-align: center; color: var(--muted); font-style: italic; }

/* ---------- Pricing ---------- */
.plans { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); max-width: 820px; margin: 0 auto; }
.plan { text-align: center; }
.plan .price { font-family: var(--serif); font-weight: 700; color: var(--gold); font-size: clamp(2rem, 1.6rem + 1.6vw, 2.6rem); margin: 6px 0; }
.plan.featured { border-color: var(--gold); }
.plan ul { list-style: none; padding: 0; margin: 14px 0 0; display: grid; gap: 8px; color: var(--text); }

/* ---------- FAQ ---------- */
.faq { max-width: 760px; margin: 0 auto; display: grid; gap: 12px; }
.faq details { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; }
.faq summary {
  cursor: pointer; list-style: none; padding: 16px 52px 16px 20px; min-height: 56px; position: relative;
  font-weight: 600; display: flex; align-items: center;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: '+'; position: absolute; right: 20px; top: 50%; transform: translateY(-50%);
  color: var(--gold); font-size: 1.5rem; line-height: 1;
}
.faq details[open] summary::after { content: '−'; }
.faq details > div { padding: 0 20px 18px; color: var(--muted); }
.faq details > div p { margin: 0; }

/* ---------- Closing CTA ---------- */
.cta { text-align: center; }
.cta .tagline { margin-top: 12px; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--border); padding: 36px 0 calc(36px + env(safe-area-inset-bottom)); color: var(--muted); font-size: 0.92rem; }
.site-footer .wrap { display: grid; gap: 18px; }
.site-footer nav ul { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px 22px; }
.site-footer nav a { color: var(--text); display: inline-flex; align-items: center; min-height: 44px; }
.site-footer p { margin: 0; }
@media (min-width: 760px) { .site-footer .wrap { grid-template-columns: 1fr auto; align-items: center; } }

/* ---------- Legal pages ---------- */
.legal { padding: clamp(36px, 6vw, 72px) 0; }
.legal article { max-width: 760px; margin: 0 auto; }
.legal h1 { font-size: clamp(2.2rem, 1.6rem + 3vw, 3.2rem); }
.legal h2 { font-size: clamp(1.45rem, 1.25rem + 1vw, 1.8rem); margin: 40px 0 12px; color: var(--gold-soft); }
.legal h3 { font-size: 1.2rem; margin: 24px 0 8px; color: var(--text); font-family: var(--sans); }
.legal p, .legal li { color: var(--text); }
.legal ul { padding-left: 1.3em; }
.legal li + li { margin-top: 6px; }
.legal .meta { color: var(--muted); margin-top: 10px; }
.legal .summary { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 22px; margin-top: 24px; }
.legal .summary ul { margin: 8px 0 0; }
.legal table { width: 100%; border-collapse: collapse; margin: 12px 0; font-size: 0.95rem; }
.legal .table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.legal th, .legal td { text-align: left; vertical-align: top; padding: 10px 12px; border-bottom: 1px solid var(--border); }
.legal th { color: var(--gold-soft); font-weight: 600; }
.draft {
  background: rgba(232, 163, 61, 0.12); border: 1px solid var(--caution); color: var(--text);
  border-radius: 14px; padding: 14px 18px; margin-bottom: 28px; font-size: 0.95rem;
}
mark.todo { background: rgba(232, 163, 61, 0.22); color: var(--gold-soft); padding: 0 4px; border-radius: 4px; }

/* ---------- 404 ---------- */
.notfound { text-align: center; padding: clamp(80px, 14vw, 160px) 0; }
.notfound p { color: var(--muted); }
