/* ===========================================================================
   Mirari — landing site styles
   A warm, editorial "printed encyclopedia" system: cream paper, ink, a gold
   spark accent, and a night-blue counterpoint that echoes the app splash.
   Lora (self-hosted, variable) for display; the system sans for text.
   =========================================================================== */

/* ---- Fonts (self-hosted, latin subset, GDPR-clean) --------------------- */
@font-face {
  font-family: 'Lora';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('fonts/lora-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215,
    U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Lora';
  font-style: italic;
  font-weight: 400 700;
  font-display: swap;
  src: url('fonts/lora-latin-italic.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215,
    U+FEFF, U+FFFD;
}

/* ---- Design tokens ----------------------------------------------------- */
:root {
  --paper:    #F9F3EE;
  --paper-2:  #F1E7DB;
  --paper-3:  #EADFCF;
  --ink:      #1C1A17;
  --ink-2:    #5C564E;
  --ink-3:    #938B7E;

  --gold:      #C58A2E;
  --gold-hi:   #F0CE78;
  --gold-deep: #A66E1C;
  --gold-tint: rgba(197, 138, 46, .12);

  --night:     #141B41;
  --night-2:   #0A0E26;
  --night-lift:#2a2350;

  --line:      rgba(28, 26, 23, .14);
  --line-soft: rgba(28, 26, 23, .08);

  --serif: 'Lora', Georgia, 'Times New Roman', serif;
  --sans:  -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', Roboto,
           Helvetica, Arial, sans-serif;

  --shadow-cover: 0 2px 4px rgba(28,26,23,.08), 0 18px 40px -12px rgba(28,26,23,.34);
  --maxw: 1120px;
  --gutter: clamp(20px, 5vw, 64px);
}

/* ---- 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;
  font-family: var(--sans);
  color: var(--ink);
  background-color: var(--paper);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  /* faint radial warmth + a barely-there paper grain */
  background-image:
    radial-gradient(120% 90% at 50% -10%, rgba(240,206,120,.16), transparent 60%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.035'/%3E%3C/svg%3E");
  background-attachment: fixed, scroll;
}

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

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

/* ---- Typography -------------------------------------------------------- */
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.08; margin: 0; letter-spacing: -0.01em; }

.eyebrow {
  font-family: var(--sans);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold-deep);
  margin: 0 0 18px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.eyebrow::before {
  content: "";
  width: 22px; height: 1px;
  background: var(--gold);
  display: inline-block;
}

.lead { font-size: clamp(18px, 2.1vw, 21px); color: var(--ink-2); line-height: 1.6; }

/* ---- Layout helpers ---------------------------------------------------- */
.wrap { max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); }
.section { padding-block: clamp(64px, 9vw, 128px); }
.center { text-align: center; }

.spark-rule {
  display: flex; align-items: center; justify-content: center; gap: 16px;
  color: var(--gold);
}
.spark-rule::before, .spark-rule::after {
  content: ""; height: 1px; width: min(120px, 22vw);
  background: linear-gradient(90deg, transparent, var(--line));
}
.spark-rule::after { background: linear-gradient(90deg, var(--line), transparent); }
.spark-rule svg { width: 16px; height: 16px; }

/* ---- Buttons ----------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  font-family: var(--sans); font-size: 15px; font-weight: 600;
  padding: 14px 22px; border-radius: 12px; text-decoration: none;
  border: 1px solid transparent; cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease, background-color .18s ease, border-color .18s ease;
}
.btn-primary {
  background: var(--ink); color: var(--paper);
  box-shadow: 0 10px 26px -12px rgba(28,26,23,.6);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 16px 32px -12px rgba(28,26,23,.55); }
.btn-primary small { font-weight: 500; opacity: .62; font-size: 12px; letter-spacing: .02em; }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--ink); transform: translateY(-2px); }

.appstore {
  display: inline-flex; align-items: center; gap: 12px;
  background: var(--ink); color: var(--paper);
  padding: 11px 20px 11px 18px; border-radius: 13px; text-decoration: none;
  border: 1px solid transparent;
  box-shadow: 0 10px 26px -12px rgba(28,26,23,.6);
  transition: transform .18s ease, box-shadow .18s ease, border-color .3s ease;
}
.appstore:hover { transform: translateY(-2px); box-shadow: 0 16px 32px -12px rgba(28,26,23,.55); }
.appstore svg { width: 26px; height: 26px; flex: none; }
.appstore .as-txt { display: flex; flex-direction: column; line-height: 1.1; text-align: left; }
.appstore .as-txt small { font-size: 10.5px; letter-spacing: .07em; text-transform: uppercase; color: var(--gold-hi); }
.appstore .as-txt span { font-family: var(--serif); font-size: 18px; font-weight: 600; }

/* ---- Site header ------------------------------------------------------- */
.site-head {
  position: sticky; top: 0; z-index: 50;
  background: transparent;
  border-bottom: 1px solid transparent;
  transition: border-color .3s ease, background-color .3s ease;
}
.site-head.scrolled {
  backdrop-filter: saturate(140%) blur(10px);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  background: rgba(249,243,238,.82);
  border-bottom-color: var(--line);
}
/* At the top of the home page the header floats over the dark hero — light text.
   Legal pages hard-code `.scrolled`, so they keep the frosted-light treatment. */
.site-head:not(.scrolled) .brand .name { color: var(--paper); }
.site-head:not(.scrolled) .head-nav a:not(.appstore) { color: rgba(249,243,238,.82); }
.site-head:not(.scrolled) .head-nav a:not(.appstore):hover { color: var(--paper); }
.site-head:not(.scrolled) a.appstore { border-color: rgba(249,243,238,.2); }
.site-head .wrap { display: flex; align-items: center; justify-content: space-between; height: 64px; }

.brand { display: inline-flex; align-items: center; gap: 11px; text-decoration: none; color: var(--ink); }
.brand .mark { width: 30px; height: 30px; border-radius: 8px; display: block; box-shadow: 0 2px 8px -2px rgba(10,14,38,.5); }
.brand .name { font-family: var(--serif); font-size: 22px; font-weight: 600; letter-spacing: .01em; }

.head-nav { display: flex; align-items: center; gap: 28px; }
.head-nav a { text-decoration: none; color: var(--ink-2); font-size: 14.5px; font-weight: 500; transition: color .15s; }
.head-nav a:hover { color: var(--ink); }
/* the App Store button is dark-filled — keep its label light (beats .head-nav a) */
.head-nav a.appstore { color: var(--paper); }
.head-nav a.appstore:hover { color: var(--paper); }
.head-nav .nav-links { display: flex; gap: 26px; }
@media (max-width: 720px) { .head-nav .nav-links { display: none; } }

/* ---- Hero -------------------------------------------------------------- */
/* The hero slides up under the sticky (transparent) header so the header floats
   over the dark blue; extra top padding keeps hero content clear of the bar. */
.hero { position: relative; overflow: hidden; margin-top: -64px; padding-top: calc(64px + clamp(40px, 6vw, 76px)); padding-bottom: clamp(56px, 8vw, 104px); }
.hero .wrap { display: grid; grid-template-columns: 1.05fr 1fr; gap: clamp(32px, 5vw, 72px); align-items: center; }
.hero h1 { font-size: clamp(42px, 6.4vw, 76px); font-weight: 600; }
.hero h1 em { font-style: italic; color: var(--gold-deep); }
.hero .lead { margin: 24px 0 0; max-width: 33ch; }
.hero .cta-row { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 34px; align-items: center; }
.hero .note { margin-top: 18px; font-size: 13.5px; color: var(--ink-3); }

/* Hero on the branded night-blue (echoes the app's dark welcome screen) */
.hero.band-dark h1 em { color: var(--gold-hi); }
.hero.band-dark .lead { color: rgba(249,243,238,.76); }
.hero.band-dark .note { color: rgba(249,243,238,.5); }
.hero.band-dark .btn-ghost { color: var(--paper); border-color: rgba(249,243,238,.28); }
.hero.band-dark .btn-ghost:hover { border-color: var(--paper); }
.hero.band-dark .appstore { border-color: rgba(249,243,238,.16); }

/* Hero cover fan — mirrors the app onboarding: five fixed slots that never move,
   with a JS "face-riffle" flip cycling a 7-cover pool (see index.html script). */
.fan-wrap { display: flex; align-items: center; justify-content: center; min-height: clamp(340px, 42vw, 460px); }
.dfan {
  --fan-scale: 1.62;
  position: relative; width: 240px; height: 238px;
  transform: scale(var(--fan-scale)); transform-origin: center center;
  opacity: 0; animation: fadeIn .8s ease .1s both;
}
.dfan .cov {
  position: absolute; left: 50%; top: 34px; width: 118px; height: 158px; border-radius: 12px;
  transform: var(--tf); transform-origin: 50% 50%; perspective: 600px; opacity: 0;
}
/* The shadow lives on the image, not the card — so it rotates WITH the cover and
   collapses when the cover turns edge-on. A flipping book shows only itself; the
   slot behind it is fully transparent (no card, no background). */
.dfan .cov img {
  width: 100%; height: 100%; object-fit: cover; border-radius: 12px; display: block;
  backface-visibility: hidden;
  box-shadow: 0 18px 34px -12px rgba(0,0,0,.6), 0 0 0 1px rgba(255,255,255,.1);
}

@media (max-width: 860px) {
  .hero .wrap { grid-template-columns: 1fr; text-align: center; }
  .hero .lead { margin-inline: auto; }
  .hero .cta-row { justify-content: center; }
  .fan-wrap { order: -1; min-height: clamp(300px, 78vw, 380px); }
  .dfan { --fan-scale: 1.28; }
}

/* ---- Dark "statement" band (echoes the app splash) --------------------- */
.band-dark {
  position: relative; color: var(--paper);
  background: radial-gradient(120% 90% at 50% 22%, var(--night-lift), var(--night) 45%, var(--night-2));
  overflow: hidden;
}
.band-dark::before { /* stardust */
  content: ""; position: absolute; inset: 0; opacity: .5; pointer-events: none;
  background-image:
    radial-gradient(1.5px 1.5px at 20% 30%, rgba(255,246,217,.8), transparent),
    radial-gradient(1.5px 1.5px at 70% 20%, rgba(255,246,217,.6), transparent),
    radial-gradient(1px 1px at 45% 65%, rgba(255,246,217,.7), transparent),
    radial-gradient(1.5px 1.5px at 85% 70%, rgba(255,246,217,.55), transparent),
    radial-gradient(1px 1px at 12% 78%, rgba(255,246,217,.6), transparent);
}
.band-dark .eyebrow { color: var(--gold-hi); }
.band-dark .eyebrow::before { background: var(--gold-hi); }
.statement { position: relative; max-width: 640px; margin-inline: auto; text-align: center; }
.statement h2 {
  font-size: clamp(30px, 4.6vw, 52px); font-weight: 500; line-height: 1.18;
  letter-spacing: -0.015em;
}
.statement h2 em { font-style: italic; color: var(--gold-hi); }
.statement p { max-width: 44ch; margin: 26px auto 0; color: rgba(249,243,238,.74); font-size: 18px; }

/* ---- Feature grid ("what's inside") ------------------------------------ */
.section-head { max-width: 40ch; margin-bottom: clamp(40px, 5vw, 64px); }
.section-head.center { margin-inline: auto; }
.section-head h2 { font-size: clamp(30px, 4.2vw, 46px); }
.section-head p { color: var(--ink-2); margin: 18px 0 0; font-size: 18px; }

.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line-soft);
  border: 1px solid var(--line-soft); border-radius: 16px; overflow: hidden; }
.feature { background: var(--paper); padding: 30px 28px; }
.feature .fx {
  width: 42px; height: 42px; border-radius: 11px; display: grid; place-items: center;
  background: var(--gold-tint); color: var(--gold-deep); margin-bottom: 18px;
}
.feature .fx svg { width: 22px; height: 22px; }
.feature h3 { font-size: 20px; font-weight: 600; }
.feature p { margin: 8px 0 0; color: var(--ink-2); font-size: 15.5px; line-height: 1.55; }
@media (max-width: 860px) { .features { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 540px) { .features { grid-template-columns: 1fr; } }

/* ---- Audience / two-up ------------------------------------------------- */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(32px, 5vw, 72px); align-items: start; }
@media (max-width: 780px) { .split { grid-template-columns: 1fr; } }
.checklist { list-style: none; margin: 0; padding: 0; }
.checklist li { position: relative; padding: 13px 0 13px 34px; border-bottom: 1px solid var(--line-soft); font-size: 16.5px; color: var(--ink); }
.checklist li:last-child { border-bottom: 0; }
.checklist li::before {
  content: ""; position: absolute; left: 0; top: 18px; width: 18px; height: 18px;
  background: var(--gold-tint); border-radius: 50%;
}
.checklist li::after {
  content: ""; position: absolute; left: 6px; top: 22px; width: 6px; height: 10px;
  border-right: 2px solid var(--gold-deep); border-bottom: 2px solid var(--gold-deep);
  transform: rotate(42deg);
}

.isnt { list-style: none; margin: 0; padding: 0; }
.isnt li { padding: 13px 0 13px 30px; border-bottom: 1px solid var(--line-soft); color: var(--ink-2); font-size: 16px; position: relative; }
.isnt li:last-child { border-bottom: 0; }
.isnt li::before { content: "—"; position: absolute; left: 0; color: var(--ink-3); }

/* ---- CTA closer -------------------------------------------------------- */
.closer { text-align: center; }
.closer h2 { font-size: clamp(32px, 5vw, 58px); }
.closer h2 em { font-style: italic; color: var(--gold-deep); }
.closer .lead { margin: 20px auto 32px; max-width: 40ch; }

/* ---- Footer ------------------------------------------------------------ */
.site-foot {
  background: radial-gradient(120% 120% at 50% 0%, var(--night-lift), var(--night) 42%, var(--night-2));
  color: rgba(249,243,238,.72);
  padding-block: clamp(56px, 7vw, 88px) 40px;
}
.site-foot a { color: rgba(249,243,238,.8); text-decoration: none; transition: color .15s; }
.site-foot a:hover { color: var(--gold-hi); }
.foot-top { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 40px; }
@media (max-width: 720px) { .foot-top { grid-template-columns: 1fr; gap: 32px; } }
.foot-brand .brand .name { color: var(--paper); }
.foot-brand p { margin: 16px 0 0; max-width: 34ch; color: rgba(249,243,238,.6); font-size: 15px; }
.foot-col h4 { font-family: var(--sans); font-size: 12px; letter-spacing: .18em; text-transform: uppercase; color: var(--gold-hi); margin: 6px 0 16px; font-weight: 600; }
.foot-col ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 11px; }
.foot-col ul a { font-size: 15px; }
.foot-bottom {
  margin-top: 48px; padding-top: 24px; border-top: 1px solid rgba(249,243,238,.14);
  display: flex; flex-wrap: wrap; gap: 12px 28px; align-items: center; justify-content: space-between;
  font-size: 13px; color: rgba(249,243,238,.5);
}
.foot-bottom .attribution { max-width: 62ch; }

/* ===========================================================================
   Legal / content pages (terms, privacy, delete-account)
   =========================================================================== */
.doc { max-width: 760px; margin-inline: auto; padding-inline: var(--gutter); }
.doc-head { padding-block: clamp(48px, 7vw, 80px) 8px; border-bottom: 1px solid var(--line); margin-bottom: clamp(32px, 4vw, 48px); }
.doc-head h1 { font-size: clamp(34px, 5vw, 52px); }
.doc-head .updated { margin-top: 16px; font-size: 14px; color: var(--ink-3); }
.doc-body { padding-bottom: clamp(64px, 8vw, 104px); font-size: 16.5px; }
.doc-body h2 { font-size: clamp(22px, 3vw, 28px); margin: 44px 0 14px; }
.doc-body h3 { font-size: 19px; margin: 28px 0 8px; font-weight: 600; }
.doc-body p, .doc-body li { color: var(--ink-2); }
.doc-body p { margin: 0 0 16px; }
.doc-body ul, .doc-body ol { margin: 0 0 18px; padding-left: 22px; }
.doc-body li { margin-bottom: 8px; }
.doc-body a { color: var(--gold-deep); text-decoration: underline; text-underline-offset: 2px; }
.doc-body strong { color: var(--ink); }
.doc-body .callout {
  background: var(--gold-tint); border: 1px solid rgba(197,138,46,.28);
  border-radius: 14px; padding: 20px 22px; margin: 24px 0;
}
.doc-body .callout p:last-child { margin-bottom: 0; }
.doc-body ol.steps { counter-reset: step; list-style: none; padding-left: 0; }
.doc-body ol.steps > li {
  position: relative; padding: 4px 0 20px 52px; margin-bottom: 0;
}
.doc-body ol.steps > li::before {
  counter-increment: step; content: counter(step);
  position: absolute; left: 0; top: 0; width: 34px; height: 34px;
  display: grid; place-items: center; border-radius: 50%;
  background: var(--ink); color: var(--paper); font-weight: 700; font-size: 15px;
  font-family: var(--sans);
}
.back-link { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--ink-2); text-decoration: none; margin-top: 8px; }
.back-link:hover { color: var(--ink); }

/* ---- Entrance animation ------------------------------------------------ */
@keyframes riseIn { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.reveal { opacity: 0; animation: riseIn .7s cubic-bezier(.2,.7,.2,1) forwards; }
.reveal.d1 { animation-delay: .06s; } .reveal.d2 { animation-delay: .14s; }
.reveal.d3 { animation-delay: .22s; } .reveal.d4 { animation-delay: .3s; }

@media (prefers-reduced-motion: reduce) {
  .reveal { animation: none; opacity: 1; }
  .dfan { animation: none; opacity: 1; }
}
