/* Ariadne landing — mirrors the mobile app's visual language.
   Palette pulled straight from the app:
     bg          #0B0E17   (app container background)
     surface     rgba(255,255,255,0.04) + 0.08 borders (app cards/rows)
     gold thread #E8C77E   (accent) with #B8703F warm ends (threadGradient)
     text        #EDEAE0   (warm off-white, rowLabel)
     muted       #8B93A8   (slate, secondary text)
     deep glow   #2b3557 -> #181f36 (radial baseGradient at top) */

:root {
  --bg: #0B0E17;
  --bg-glow-1: #2b3557;
  --bg-glow-2: #181f36;
  --surface: rgba(255, 255, 255, 0.04);
  --surface-hover: rgba(255, 255, 255, 0.07);
  --border: rgba(255, 255, 255, 0.08);
  --gold: #E8C77E;
  --gold-warm: #B8703F;
  --gold-soft: rgba(232, 199, 126, 0.14);
  --gold-border: rgba(232, 199, 126, 0.5);
  --text: #EDEAE0;
  --muted: #8B93A8;
  --maze: #28304a;

  --maxw: 1080px;
  --radius: 20px;
  --radius-pill: 999px;

  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  overflow-x: hidden;
  /* The app's radial top-glow + the faint maze tile, layered behind
     everything. The maze SVG is inlined as a data URI (see .maze-layer). */
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ---- Background layers (fixed, non-interactive) ---- */
.bg-layers {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}

.bg-glow {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(70% 55% at 50% -8%, var(--bg-glow-1) 0%, var(--bg-glow-2) 45%, var(--bg) 80%);
}

.bg-maze {
  position: absolute;
  inset: 0;
  opacity: 0.5;
  /* One maze tile from LabyrinthBackground.js, 60x60, stroke #28304a. */
  background-image: url("data:image/svg+xml;utf8,\
<svg xmlns='http://www.w3.org/2000/svg' width='60' height='60' viewBox='0 0 60 60'>\
<g fill='none' stroke='%2328304a' stroke-width='1'>\
<path d='M0 20 H24 V0'/>\
<path d='M60 40 H36 V60'/>\
<path d='M0 45 H16 V60'/>\
<path d='M40 0 V18 H60'/>\
<path d='M20 30 H45'/>\
<path d='M0 0 V10'/>\
</g></svg>");
  background-repeat: repeat;
  /* fade the maze toward the bottom so footer stays clean */
  -webkit-mask-image: linear-gradient(180deg, #000 0%, #000 60%, transparent 100%);
  mask-image: linear-gradient(180deg, #000 0%, #000 60%, transparent 100%);
}

/* ---- Layout primitives ---- */
.container {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
}

section {
  position: relative;
}

.eyebrow {
  font-size: 13px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 600;
  margin: 0 0 16px;
}

h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin: 0;
}

p {
  margin: 0;
}

a {
  color: var(--gold);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

/* ---- Header / nav ---- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  background: rgba(11, 14, 23, 0.72);
  border-bottom: 1px solid var(--border);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--serif);
  font-size: 20px;
  letter-spacing: 0.02em;
  color: var(--text);
}
.brand:hover {
  text-decoration: none;
}
.brand svg {
  display: block;
}
.brand-mark {
  display: block;
  border-radius: 7px;
  border: 1px solid var(--border);
  object-fit: cover;
}

.nav-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  border-radius: var(--radius-pill);
  background: var(--gold-soft);
  border: 1px solid var(--gold-border);
  color: var(--gold);
  font-size: 14px;
  font-weight: 600;
}
.nav-cta:hover {
  text-decoration: none;
  background: rgba(232, 199, 126, 0.2);
}

/* ---- Hero ---- */
.hero {
  padding: clamp(64px, 12vw, 128px) 0 clamp(48px, 8vw, 96px);
  text-align: center;
}

.hero-thread {
  display: block;
  margin: 0 auto 40px;
  width: clamp(120px, 30vw, 180px);
  height: auto;
}

.hero h1 {
  font-size: clamp(34px, 6.5vw, 60px);
  max-width: 16ch;
  margin: 0 auto;
}

.hero .lede {
  color: var(--muted);
  font-size: clamp(17px, 2.4vw, 21px);
  max-width: 46ch;
  margin: 24px auto 0;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: center;
  margin-top: 40px;
}

/* App store buttons (placeholder — swap the hrefs when listings are live) */
.store-badge {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 13px 22px;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  min-width: 200px;
}
.store-badge:hover {
  text-decoration: none;
  background: var(--surface-hover);
  border-color: rgba(255, 255, 255, 0.16);
}
.store-badge svg {
  flex: none;
}
.store-badge .store-badge-text {
  text-align: left;
  line-height: 1.15;
}
.store-badge .store-badge-small {
  display: block;
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.04em;
}
.store-badge .store-badge-large {
  display: block;
  font-size: 18px;
  font-family: var(--serif);
}
.store-badge[aria-disabled="true"] {
  opacity: 0.55;
  cursor: default;
}
.store-badge[aria-disabled="true"]:hover {
  background: var(--surface);
  border-color: var(--border);
}

.hero-note {
  margin-top: 22px;
  font-size: 13px;
  color: var(--muted);
}

/* ---- Generic section spacing ---- */
.band {
  padding: clamp(56px, 9vw, 104px) 0;
}
.band-sep {
  border-top: 1px solid var(--border);
}

.section-head {
  max-width: 40ch;
  margin: 0 auto 56px;
  text-align: center;
}
.section-head h2 {
  font-size: clamp(28px, 4.5vw, 42px);
}
.section-head p {
  color: var(--muted);
  margin-top: 18px;
  font-size: clamp(16px, 2.2vw, 19px);
}

/* ---- "How it works" steps ---- */
.steps {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(3, 1fr);
}

.step {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 28px;
}

.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--gold-soft);
  border: 1px solid var(--gold-border);
  color: var(--gold);
  font-family: var(--serif);
  font-size: 18px;
  margin-bottom: 20px;
}

.step h3 {
  font-size: 21px;
  margin-bottom: 10px;
}

.step p {
  color: var(--muted);
  font-size: 15.5px;
}

/* ---- Feature / trust rows ---- */
.features {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(2, 1fr);
}

.feature {
  display: flex;
  gap: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px 24px;
}
.feature .feature-icon {
  flex: none;
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
}
.feature h3 {
  font-size: 18px;
  margin-bottom: 6px;
}
.feature p {
  color: var(--muted);
  font-size: 15px;
}

/* ---- Origin story (expandable) ---- */
.origin-card {
  max-width: 720px;
  margin: 0 auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: clamp(28px, 5vw, 44px);
}

.origin-lede {
  font-family: var(--serif);
  font-size: clamp(19px, 2.6vw, 23px);
  line-height: 1.5;
  color: var(--text);
}

/* Collapsed by default; animates open via .open (added by JS). */
.origin-more {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.55s ease, opacity 0.4s ease, margin-top 0.4s ease;
}
.origin-more.open {
  max-height: 1600px;
  opacity: 1;
  margin-top: 20px;
}
.origin-more p {
  color: #cdd2df;
  font-size: 16.5px;
  margin-top: 18px;
}
.origin-more p:first-child {
  margin-top: 0;
}

.origin-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 24px;
  padding: 10px 20px;
  border-radius: var(--radius-pill);
  background: var(--gold-soft);
  border: 1px solid var(--gold-border);
  color: var(--gold);
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease;
}
.origin-toggle:hover {
  background: rgba(232, 199, 126, 0.2);
}
.origin-chevron {
  transition: transform 0.3s ease;
}
.origin-toggle[aria-expanded="true"] .origin-chevron {
  transform: rotate(180deg);
}

/* ---- Quote / story band ---- */
.story {
  text-align: center;
}
.story blockquote {
  margin: 0 auto;
  max-width: 34ch;
  font-family: var(--serif);
  font-size: clamp(22px, 3.6vw, 32px);
  line-height: 1.35;
  color: var(--text);
}
.story .story-body {
  color: var(--muted);
  max-width: 52ch;
  margin: 28px auto 0;
  font-size: clamp(16px, 2.2vw, 18px);
}

/* ---- Final CTA ---- */
.cta {
  text-align: center;
}
.cta h2 {
  font-size: clamp(28px, 4.5vw, 44px);
  max-width: 18ch;
  margin: 0 auto;
}
.cta p {
  color: var(--muted);
  margin: 20px auto 36px;
  max-width: 44ch;
}

/* ---- Footer ---- */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 48px 0 56px;
}
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 24px 40px;
  align-items: center;
  justify-content: space-between;
}
.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 20px 28px;
}
.footer-links a {
  color: var(--muted);
  font-size: 14px;
}
.footer-links a:hover {
  color: var(--text);
}
.footer-fine {
  color: var(--muted);
  font-size: 13px;
  margin-top: 20px;
  max-width: 70ch;
}
.disclaimer {
  color: var(--muted);
  font-size: 12.5px;
  opacity: 0.85;
  margin-top: 10px;
}

/* ---- Legal pages (privacy / terms) ---- */
.legal {
  padding: clamp(48px, 8vw, 88px) 0 96px;
}
.legal .container {
  max-width: 760px;
}
.legal h1 {
  font-size: clamp(30px, 5vw, 44px);
  margin-bottom: 12px;
}
.legal .updated {
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 40px;
}
.legal h2 {
  font-size: 22px;
  margin: 40px 0 12px;
}
.legal p,
.legal li {
  color: #cdd2df;
  font-size: 16px;
}
.legal ul {
  padding-left: 22px;
}
.legal li {
  margin: 8px 0;
}
.back-home {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 32px;
}

/* ---- Responsive ---- */
@media (max-width: 860px) {
  .steps {
    grid-template-columns: 1fr;
  }
  .features {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  body {
    font-size: 16px;
  }
  .container {
    padding: 0 20px;
  }
  .nav-cta {
    padding: 8px 14px;
  }
  .store-badge {
    width: 100%;
    justify-content: center;
  }
  .hero-actions {
    flex-direction: column;
  }
  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* Respect reduced-motion */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}
