/* ==========================================================================
   Soriel — promotional site
   Aesthetic: "Celestial editorial" — cream/parchment ground, full-spectrum
   zodiac wheel motif, Fraunces display serif + Public Sans body.
   Palette mirrors the app (Soriel/AstroTheme.swift).
   All self-hosted: no CDN, no external requests — matches the app's
   offline / no-tracking ethos.
   ========================================================================== */

/* ----- Self-hosted variable fonts (SIL OFL 1.1) -------------------------- */
@font-face {
  font-family: "Fraunces";
  src: url("../fonts/Fraunces-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: normal;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Fraunces";
  src: url("../fonts/Fraunces-Italic-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: normal;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Public Sans";
  src: url("../fonts/PublicSans-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: normal;
  font-style: normal;
  font-display: swap;
}

/* ----- Design tokens ----------------------------------------------------- */
:root {
  /* Ground & ink (warm parchment, from the app icon background) */
  --cream:      #F7F4EC;
  --cream-deep: #EFEADD;
  --paper:      #FBF9F3;
  --ink:        #2B2A28;
  --ink-soft:   #6B665C;
  --ink-faint:  #9A9384;
  --hairline:   rgba(43, 42, 40, 0.12);
  --hairline-2: rgba(43, 42, 40, 0.07);

  /* Classical element accents (AstroTheme.swift) */
  --fire:  #DA4D3D;
  --earth: #5C8C4D;
  --air:   #E5B333;
  --water: #4084CC;

  /* Aspect semantics */
  --asp-harmon: #409E8C;
  --asp-blue:   #4084CC;
  --asp-tense:  #DA4D3D;
  --asp-minor:  #8C66BE;

  /* Type */
  --display: "Fraunces", Georgia, "Times New Roman", serif;
  --body: "Public Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  /* Optical sizing helpers for Fraunces */
  --fr-soft: 60;   /* SOFT axis: softer terminals */
  --fr-wonk: 0;    /* WONK axis: keep upright/refined */

  --radius: 18px;
  --radius-sm: 12px;
  --maxw: 1140px;
  --gutter: clamp(20px, 5vw, 64px);
}

/* ----- Reset & base ------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }
img { max-width: 100%; height: auto; } /* preserve aspect ratio even with width/height attrs */
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  font-family: var(--body);
  font-weight: 400;
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--ink);
  background-color: var(--cream);
  /* Faint paper grain + a soft celestial wash, layered. */
  background-image:
    radial-gradient(120% 80% at 85% -10%, rgba(64,132,204,0.07), transparent 60%),
    radial-gradient(90% 70% at -10% 110%, rgba(218,77,61,0.05), transparent 55%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* Grain overlay (SVG noise, inlined — no extra request) */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  mix-blend-mode: multiply;
}
body > * { position: relative; z-index: 1; }

/* ----- Typography -------------------------------------------------------- */
h1, h2, h3, h4 {
  font-family: var(--display);
  font-weight: 460;
  font-variation-settings: "opsz" 144, "SOFT" var(--fr-soft), "WONK" var(--fr-wonk);
  line-height: 1.06;
  letter-spacing: -0.012em;
  margin: 0 0 0.5em;
  color: var(--ink);
}
h1 { font-size: clamp(2.4rem, 6.5vw, 5rem); font-weight: 420; overflow-wrap: break-word; }
h2 { font-size: clamp(2rem, 4vw, 3rem); }
h3 { font-size: clamp(1.3rem, 2.2vw, 1.7rem); font-weight: 540; }
p { margin: 0 0 1.1em; }
a { color: var(--water); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: #2f6bb0; }

.eyebrow {
  font-family: var(--body);
  font-weight: 650;
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin: 0 0 1rem;
}
.lead { font-size: clamp(1.1rem, 1.8vw, 1.35rem); color: var(--ink-soft); line-height: 1.6; }
.serif-accent { font-family: var(--display); font-style: italic; font-variation-settings: "opsz" 30, "SOFT" 80; }

/* ----- Layout helpers ---------------------------------------------------- */
.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); }
.section { padding-block: clamp(56px, 9vw, 130px); }
.section--tight { padding-block: clamp(40px, 6vw, 80px); }
.center { text-align: center; }
.mx-auto { margin-inline: auto; }
.measure { max-width: 62ch; }
.measure-tight { max-width: 48ch; }

/* ----- Top bar ----------------------------------------------------------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: saturate(140%) blur(10px);
  background: rgba(247, 244, 236, 0.72);
  border-bottom: 1px solid var(--hairline-2);
}
.topbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 64px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--display);
  font-weight: 560;
  font-variation-settings: "opsz" 40, "SOFT" 40;
  font-size: 1.18rem;
  letter-spacing: -0.01em;
  color: var(--ink);
  text-decoration: none;
}
/* App-icon-style brand mark: ~22% radius approximates Apple's squircle at this size */
.brand__mark { width: 28px; height: 28px; display: block; border-radius: 22%; object-fit: cover; box-shadow: 0 1px 2px rgba(43, 42, 40, 0.18); }

.nav-links { display: flex; align-items: center; gap: clamp(14px, 2vw, 28px); }
.nav-links a {
  color: var(--ink-soft);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
}
.nav-links a:hover { color: var(--ink); }
@media (max-width: 720px) { .nav-links .nav-hide-sm { display: none; } }

/* ----- Language toggle --------------------------------------------------- */
.lang {
  display: inline-flex;
  padding: 3px;
  border: 1px solid var(--hairline);
  border-radius: 999px;
  background: var(--paper);
}
.lang button {
  appearance: none;
  border: 0;
  background: transparent;
  cursor: pointer;
  font-family: var(--body);
  font-weight: 600;
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  color: var(--ink-soft);
  padding: 5px 12px;
  border-radius: 999px;
  transition: background-color 0.2s, color 0.2s;
}
.lang button[aria-pressed="true"] { background: var(--ink); color: var(--cream); }

/* ----- Buttons ----------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--body);
  font-weight: 620;
  font-size: 1rem;
  text-decoration: none;
  padding: 14px 24px;
  border-radius: 999px;
  border: 1px solid transparent;
  transition: transform 0.15s ease, box-shadow 0.2s ease, background-color 0.2s;
}
.btn--primary { background: var(--ink); color: var(--cream); }
.btn--primary:hover { color: var(--cream); transform: translateY(-2px); box-shadow: 0 10px 26px rgba(43,42,40,0.18); }
.btn--ghost { border-color: var(--hairline); color: var(--ink); background: transparent; }
.btn--ghost:hover { color: var(--ink); border-color: var(--ink); transform: translateY(-2px); }
.btn[aria-disabled="true"] { pointer-events: none; opacity: 0.62; }

/* App Store "coming soon" badge */
.appstore-badge {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 12px 22px;
  border-radius: 14px;
  background: var(--ink);
  color: var(--cream);
  text-decoration: none;
  border: 1px solid var(--ink);
}
.appstore-badge[aria-disabled="true"] { opacity: 0.92; cursor: default; }
.appstore-badge svg { width: 26px; height: 26px; fill: var(--cream); }
.appstore-badge__txt { display: flex; flex-direction: column; line-height: 1.15; text-align: left; }
.appstore-badge__small { font-size: 0.66rem; letter-spacing: 0.06em; text-transform: uppercase; opacity: 0.8; }
.appstore-badge__big { font-family: var(--display); font-weight: 560; font-size: 1.18rem; font-variation-settings: "opsz" 40; }

/* TestFlight = the primary, live CTA while the app is pre-App-Store.
   Reuses .appstore-badge layout; tinted with the water accent to read as "go". */
.testflight-badge { background: var(--water); border-color: var(--water); color: #fff; }
.testflight-badge:hover { color: #fff; transform: translateY(-2px); box-shadow: 0 10px 26px rgba(64,132,204,0.32); }
.testflight-badge svg { fill: #fff; }

/* "Coming soon" App Store badge: muted outline so it reads as future, not actionable. */
.appstore-badge--soon { background: transparent; color: var(--ink-soft); border-color: var(--hairline); }
.appstore-badge--soon svg { fill: var(--ink-soft); }
.appstore-badge--soon[aria-disabled="true"] { opacity: 1; }

/* ----- Hero -------------------------------------------------------------- */
.hero { padding-top: clamp(40px, 7vw, 96px); padding-bottom: clamp(48px, 8vw, 110px); overflow: hidden; }
.hero__grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: clamp(28px, 5vw, 72px);
  align-items: center;
}
/* grid/flex children default to min-width:auto, which prevents shrinking
   below content size and causes long words to overflow — reset it. */
.hero__copy, .hero__art, .band__grid > *, .shots > * { min-width: 0; }
@media (max-width: 880px) {
  .hero__grid { grid-template-columns: 1fr; text-align: center; }
  .hero__art { order: -1; }
  .hero__cta { justify-content: center; }
  .measure, .measure-tight { margin-inline: auto; }
}
.hero h1 .row { display: block; }
.hero__cta { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 2rem; align-items: center; }
.hero__note { margin-top: 1.1rem; font-size: 0.9rem; color: var(--ink-faint); }

/* staggered entrance */
.reveal { opacity: 0; transform: translateY(14px); animation: rise 0.9s cubic-bezier(0.2,0.7,0.2,1) forwards; }
.reveal.d1 { animation-delay: 0.05s; }
.reveal.d2 { animation-delay: 0.16s; }
.reveal.d3 { animation-delay: 0.27s; }
.reveal.d4 { animation-delay: 0.38s; }
@keyframes rise { to { opacity: 1; transform: none; } }

/* ----- Zodiac wheel (hero art) ------------------------------------------ */
.wheel { width: min(100%, 460px); height: auto; margin-inline: auto; display: block; filter: drop-shadow(0 18px 40px rgba(43,42,40,0.10)); }
.wheel .ring-rotate { transform-origin: 250px 250px; animation: spin 140s linear infinite; }
.wheel .ring-counter { transform-origin: 250px 250px; animation: spin 200s linear infinite reverse; }
.wheel .aspect-lines { animation: pulse 7s ease-in-out infinite; transform-origin: 250px 250px; }
.wheel .glyph { font-family: var(--display); font-size: 22px; fill: var(--ink); font-variation-settings: "opsz" 30;
  /* Counter-rotate each glyph about its own centre so it orbits with the ring but keeps its upright
     orientation. Same 200s period as .ring-counter but forward (the ring spins in reverse), so the two
     rotations cancel for orientation while the orbital position still follows the ring. */
  transform-box: fill-box; transform-origin: center; animation: spin 200s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 0%, 100% { opacity: 0.55; } 50% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .wheel .ring-rotate, .wheel .ring-counter, .wheel .glyph, .wheel .aspect-lines, .brand__mark .ring { animation: none; }
  .reveal { animation: none; opacity: 1; transform: none; }
}

/* ----- Feature grid ------------------------------------------------------ */
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
@media (max-width: 860px) { .features { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .features { grid-template-columns: 1fr; } }
.card {
  background: var(--paper);
  border: 1px solid var(--hairline-2);
  border-radius: var(--radius);
  padding: 26px 24px;
  position: relative;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.25s ease, border-color 0.2s;
}
.card:hover { transform: translateY(-3px); box-shadow: 0 14px 34px rgba(43,42,40,0.08); border-color: var(--hairline); }
.card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--accent, var(--ink)); opacity: 0.9; }
.card .icon { font-size: 1.5rem; line-height: 1; margin-bottom: 14px; display: block; color: var(--accent, var(--ink)); }
.card h3 { font-size: 1.18rem; margin-bottom: 0.35em; }
.card p { font-size: 0.97rem; color: var(--ink-soft); margin: 0; }
.a-fire  { --accent: var(--fire); }
.a-earth { --accent: var(--earth); }
.a-air   { --accent: var(--air); }
.a-water { --accent: var(--water); }
.a-harmon{ --accent: var(--asp-harmon); }
.a-minor { --accent: var(--asp-minor); }

/* ----- Section heading block -------------------------------------------- */
.sec-head { max-width: 56ch; margin-bottom: clamp(32px, 5vw, 56px); }
.sec-head.center { margin-inline: auto; }

/* ----- Screenshots / device mockups ------------------------------------- */
.shots { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: clamp(24px, 4vw, 56px); align-items: center; }
@media (max-width: 820px) { .shots { grid-template-columns: 1fr; } }

.device { margin: 0; }
.device figcaption { margin-top: 14px; font-size: 0.88rem; color: var(--ink-faint); text-align: center; }

.phone {
  width: min(100%, 300px);
  margin-inline: auto;
  padding: 10px;
  background: #1b1a18;
  border-radius: 44px;
  box-shadow: 0 24px 60px rgba(43,42,40,0.22), inset 0 0 0 2px rgba(255,255,255,0.06);
}
.phone img { width: 100%; height: auto; display: block; border-radius: 34px; }

.tablet {
  width: 100%;
  padding: 14px;
  background: #1b1a18;
  border-radius: 26px;
  box-shadow: 0 24px 60px rgba(43,42,40,0.22), inset 0 0 0 2px rgba(255,255,255,0.06);
}
.tablet img { width: 100%; height: auto; display: block; border-radius: 12px; }

/* ----- Privacy band ------------------------------------------------------ */
.band {
  background: var(--ink);
  color: var(--cream);
  border-radius: clamp(20px, 3vw, 30px);
}
.band .eyebrow { color: rgba(247,244,236,0.55); }
.band h2 { color: var(--cream); }
.band p { color: rgba(247,244,236,0.82); }
.band a { color: var(--air); }
.band a:hover { color: #f0c75c; }
.band__grid { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: clamp(28px, 5vw, 64px); align-items: center; }
@media (max-width: 820px) { .band__grid { grid-template-columns: 1fr; } }
.proof { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.proof li { display: flex; gap: 12px; align-items: flex-start; color: rgba(247,244,236,0.9); }
.proof li::before { content: "✦"; color: var(--air); flex: none; line-height: 1.6; }

/* ----- Panels list ------------------------------------------------------- */
.panels { display: flex; flex-wrap: wrap; gap: 12px; }
.panel-chip {
  border: 1px solid var(--hairline);
  border-radius: 999px;
  padding: 9px 18px;
  font-weight: 560;
  font-size: 0.95rem;
  background: var(--paper);
}
.panel-chip span { color: var(--ink-faint); font-weight: 400; }

/* ----- Tiers (free core + paid layers) ----------------------------------- */
.tiers { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; align-items: stretch; }
@media (max-width: 820px) { .tiers { grid-template-columns: 1fr; } }
.tier {
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--paper);
  border: 1px solid var(--hairline-2);
  border-radius: var(--radius);
  padding: 26px 24px;
  position: relative;
}
/* the free core is the anchor — give it a quiet emphasis */
.tier--free { border-color: var(--ink); box-shadow: 0 10px 30px rgba(43,42,40,0.07); }
.tier__head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.tier__name { font-size: 1.5rem; margin: 0; }
.tier__badge {
  flex: none;
  font-family: var(--body);
  font-weight: 650;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-soft);
  border: 1px solid var(--hairline);
  border-radius: 999px;
  padding: 4px 11px;
  white-space: nowrap;
}
.tier--free .tier__badge { background: var(--ink); color: var(--cream); border-color: var(--ink); }
/* status pill: available vs coming */
.tier__tag {
  align-self: flex-start;
  font-family: var(--body);
  font-weight: 600;
  font-size: 0.74rem;
  letter-spacing: 0.04em;
  padding: 4px 12px;
  border-radius: 999px;
}
.tier__tag--live { background: rgba(64,158,140,0.16); color: #2c7567; }
.tier__tag--soon { background: rgba(229,179,51,0.18); color: #8a6b18; }
.tier p { color: var(--ink-soft); font-size: 0.97rem; margin: 0; }
.tiers__note {
  margin: 22px auto 0;
  max-width: 60ch;
  text-align: center;
  font-size: 0.9rem;
  color: var(--ink-faint);
}

/* ----- FAQ --------------------------------------------------------------- */
.faq { max-width: 760px; margin-inline: auto; }
.faq details {
  border-bottom: 1px solid var(--hairline);
  padding: 6px 0;
}
.faq summary {
  cursor: pointer;
  list-style: none;
  padding: 16px 40px 16px 4px;
  position: relative;
  font-family: var(--display);
  font-weight: 540;
  font-size: 1.15rem;
  font-variation-settings: "opsz" 40, "SOFT" 50;
  color: var(--ink);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  position: absolute;
  right: 6px; top: 50%;
  transform: translateY(-50%);
  font-family: var(--body);
  font-size: 1.5rem;
  color: var(--ink-faint);
  transition: transform 0.2s;
}
.faq details[open] summary::after { content: "−"; }
.faq details p { padding: 0 4px 18px; color: var(--ink-soft); margin: 0; }

/* ----- Final CTA --------------------------------------------------------- */
.finale { text-align: center; }
.finale .wheel { width: min(64%, 240px); margin-bottom: 18px; opacity: 0.96; }

/* ----- Footer ------------------------------------------------------------ */
.site-foot {
  border-top: 1px solid var(--hairline);
  padding-block: 48px 40px;
  background: var(--cream-deep);
}
.foot-grid { display: flex; flex-wrap: wrap; gap: 28px 48px; justify-content: space-between; align-items: flex-start; }
.foot-brand { max-width: 30ch; }
.foot-brand p { font-size: 0.9rem; color: var(--ink-soft); margin: 0.6em 0 0; }
.foot-cols { display: flex; flex-wrap: wrap; gap: 40px; }
.foot-col h4 { font-family: var(--body); font-weight: 680; font-size: 0.74rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-faint); margin: 0 0 12px; }
.foot-col a { display: block; color: var(--ink-soft); text-decoration: none; font-size: 0.95rem; margin-bottom: 8px; }
.foot-col a:hover { color: var(--ink); }
.foot-bottom { margin-top: 36px; padding-top: 20px; border-top: 1px solid var(--hairline-2); display: flex; flex-wrap: wrap; gap: 12px 24px; justify-content: space-between; align-items: center; font-size: 0.82rem; color: var(--ink-faint); }

/* ----- Generic content pages (privacy / support / impressum) ------------- */
.doc { max-width: 760px; }
.doc h1 { font-size: clamp(2.2rem, 4.5vw, 3.4rem); }
.doc h2 { font-size: clamp(1.4rem, 2.6vw, 1.9rem); margin-top: 1.6em; }
.doc h3 { font-size: 1.2rem; margin-top: 1.4em; }
.doc ul { padding-left: 1.2em; }
.doc li { margin-bottom: 0.5em; }
.doc .meta-note { font-size: 0.9rem; color: var(--ink-faint); border-left: 3px solid var(--hairline); padding-left: 14px; }
.doc dl { display: grid; grid-template-columns: max-content 1fr; gap: 8px 22px; margin: 1.2em 0; }
.doc dt { font-weight: 650; color: var(--ink-soft); }
.doc dd { margin: 0; }
@media (max-width: 520px) { .doc dl { grid-template-columns: 1fr; gap: 2px; } .doc dd { margin-bottom: 10px; } }

.pagehead { padding-top: clamp(40px, 6vw, 72px); }
.pagehead .eyebrow { margin-bottom: 0.6rem; }
.back-link { font-size: 0.9rem; font-weight: 560; text-decoration: none; }

/* Visually-hidden (a11y) */
.vh { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

/* only show one language's inline twin where we hard-code both (rare) */
[hidden] { display: none !important; }
