/* ============================================================
   Aperture Protocol — marketing & legal site
   Palette lifted directly from the app (src/constants/theme.ts)
   Dark indigo backdrop, golden "coherence" accent, indigo glow.
   ============================================================ */

:root {
  --bg: #0a0a1a;
  --bg-2: #08081a;
  --surface: #12122a;
  --card: #16162e;
  --elevated: #1a1a3a;

  --gold: #ffd700;
  --gold-dim: #b8960a;
  --gold-soft: rgba(255, 215, 0, 0.12);

  --accent: #6b4ce6;
  --accent-light: #8b6ff0;
  --accent-soft: rgba(107, 76, 230, 0.14);

  --text: #e8e8f0;
  --text-2: #9090b0;
  --muted: #606080;

  --border: #2a2a4a;
  --border-light: #3a3a5a;
  --hairline: rgba(255, 255, 255, 0.06);

  --success: #00e088;
  --danger: #ff3b5c;

  --radius-sm: 8px;
  --radius: 16px;
  --radius-lg: 24px;
  --maxw: 1080px;

  --serif: "Fraunces", ui-serif, Georgia, "Times New Roman", serif;
  --sans: "Inter", -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.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* Subtle full-page atmosphere */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(60% 50% at 50% -8%, rgba(107, 76, 230, 0.20), transparent 60%),
    radial-gradient(45% 35% at 88% 8%, rgba(255, 215, 0, 0.06), transparent 60%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 100%);
}

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

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

h1, h2, h3, h4 {
  font-family: var(--serif);
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -0.01em;
  color: var(--text);
  margin: 0 0 0.5em;
}

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.narrow { max-width: 760px; }

.eyebrow {
  font-family: var(--sans);
  text-transform: uppercase;
  letter-spacing: 0.22em;
  font-size: 12px;
  font-weight: 600;
  color: var(--gold);
  margin-bottom: 14px;
}

.muted { color: var(--text-2); }
.center { text-align: center; }

/* ----------------------------- NAV ----------------------------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: saturate(140%) blur(14px);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  background: rgba(8, 8, 20, 0.72);
  border-bottom: 1px solid var(--hairline);
}
.nav-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.brand { display: flex; align-items: center; gap: 12px; font-weight: 600; }
.brand img {
  width: 34px; height: 34px; border-radius: 9px;
  box-shadow: 0 0 18px rgba(255, 215, 0, 0.25);
}
.brand .wordmark { font-family: var(--serif); font-size: 18px; letter-spacing: -0.01em; color: var(--text); }

.nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Non-traditional aperture menu trigger */
.aperture-trigger {
  width: 38px;
  height: 38px;
  border-radius: 999px;
  border: 1px solid var(--gold);
  background: transparent;
  color: var(--gold);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.15s ease, border-color 0.2s ease;
  padding: 0;
}
.aperture-trigger:hover {
  background: var(--gold-soft);
  border-color: var(--gold);
  transform: scale(1.04);
}
.aperture-trigger:active {
  transform: scale(0.96);
}
.aperture-trigger svg {
  width: 18px;
  height: 18px;
  transition: transform 0.3s ease;
}
.aperture-trigger[aria-expanded="true"] svg {
  transform: rotate(45deg);
}

/* Elegant aperture overlay menu (the non-traditional part) */
.nav-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(8, 8, 20, 0.94);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
}
.nav-overlay.open {
  opacity: 1;
  pointer-events: auto;
}
.nav-overlay-inner {
  position: relative;
  width: 100%;
  max-width: 520px;
  background: linear-gradient(180deg, #12122a 0%, #0a0a1a 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 52px 36px 42px;
  box-shadow: 0 30px 90px rgba(0,0,0,0.6);
}
.nav-close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  border: 1px solid var(--border-light);
  background: transparent;
  color: var(--text-2);
  display: grid;
  place-items: center;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}
.nav-close:hover {
  color: var(--gold);
  border-color: var(--gold);
}
.nav-close:active { transform: scale(0.95); }

.nav-overlay-content {
  text-align: center;
}
.nav-overlay-content .eyebrow {
  margin-bottom: 6px;
  font-size: 11px;
}
.nav-overlay-content h2 {
  font-size: clamp(26px, 6vw, 38px);
  margin: 0 0 28px;
  color: var(--text);
  letter-spacing: -0.01em;
}

.nav-menu {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 0 0 32px;
}
.nav-menu a {
  display: block;
  font-family: var(--serif);
  font-size: clamp(22px, 4.8vw, 30px);
  font-weight: 500;
  color: var(--text);
  padding: 13px 8px;
  border-bottom: 1px solid var(--hairline);
  text-decoration: none;
  transition: color 0.15s ease, padding-left 0.2s ease;
}
.nav-menu a:hover {
  color: var(--gold);
  padding-left: 16px;
}
.nav-menu a:last-child {
  border-bottom: none;
  padding-bottom: 4px;
}

.nav-cta {
  font-size: 15px;
  padding: 14px 28px;
}

/* Decorative aperture lines inside the overlay for theme */
.nav-overlay-inner::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 220px;
  height: 220px;
  border: 1px solid rgba(255, 215, 0, 0.08);
  border-radius: 999px;
  pointer-events: none;
  z-index: 0;
}
.nav-overlay-inner::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 140px;
  height: 140px;
  border: 1px solid rgba(255, 215, 0, 0.06);
  border-radius: 999px;
  pointer-events: none;
  z-index: 0;
}

/* ---------------------------- BUTTONS -------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: var(--sans);
  font-weight: 600;
  font-size: 15px;
  padding: 11px 20px;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.2s ease, background 0.2s ease;
}
.btn:active { transform: scale(0.97); }
.btn-gold {
  background: linear-gradient(180deg, #ffe9a0, #ffd700 55%, #e0b206);
  color: #1a1405;
  box-shadow: 0 6px 22px rgba(255, 215, 0, 0.30);
}
.btn-gold:hover { color: #1a1405; box-shadow: 0 8px 30px rgba(255, 215, 0, 0.45); }
.btn-glass {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--border-light);
  color: var(--text);
}
.btn-glass:hover { background: rgba(255, 255, 255, 0.08); color: var(--text); }

/* ----------------------------- HERO ---------------------------- */
.hero {
  position: relative;
  overflow: hidden;
  text-align: center;
  padding: 96px 0 84px;
}
.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  background-image: url("assets/aperture-hero-bg.jpg");
  background-size: cover;
  background-position: center top;
  opacity: 0.48;
  mask-image: linear-gradient(180deg, #000 35%, transparent 96%);
  -webkit-mask-image: linear-gradient(180deg, #000 35%, transparent 96%);
}
.hero .container { position: relative; z-index: 1; }
.hero-icon {
  width: 116px; height: 116px;
  border-radius: 26px;
  margin: 0 auto 28px;
  box-shadow: 0 0 60px rgba(255, 215, 0, 0.28), 0 14px 40px rgba(0,0,0,0.55);
  border: 1px solid rgba(255, 215, 0, 0.18);
}
.hero h1 {
  font-size: clamp(40px, 7vw, 68px);
  margin-bottom: 18px;
}
.hero h1 .glow { color: var(--gold); text-shadow: 0 0 34px rgba(255, 215, 0, 0.45); }
.hero .lede {
  font-size: clamp(18px, 2.4vw, 22px);
  color: var(--text-2);
  max-width: 660px;
  margin: 0 auto 34px;
}
.hero-cta { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.hero-sub { margin-top: 18px; font-size: 13px; color: var(--muted); }

/* App Store badge (placeholder until live) */
.appstore-badge {
  display: inline-flex; align-items: center; gap: 11px;
  padding: 11px 20px 11px 18px;
  border-radius: 14px;
  background: #000;
  border: 1px solid var(--border-light);
  color: #fff;
}
.appstore-badge:hover { color: #fff; border-color: var(--gold); }
.appstore-badge svg { width: 26px; height: 26px; flex: none; }
.appstore-badge .small { font-size: 11px; line-height: 1; color: #c8c8d4; letter-spacing: 0.02em; }
.appstore-badge .big { font-size: 19px; line-height: 1.1; font-weight: 600; }
.badge-pill {
  display:inline-block; font-size:11px; font-weight:700; letter-spacing:.12em;
  text-transform:uppercase; color:var(--gold);
  background:var(--gold-soft); border:1px solid rgba(255,215,0,.30);
  padding:4px 11px; border-radius:999px; margin-left:8px; vertical-align:middle;
}

/* --------------------------- SECTIONS -------------------------- */
section { padding: 76px 0; }
.section-head { max-width: 680px; margin: 0 auto 52px; text-align: center; }
.section-head h2 { font-size: clamp(28px, 4vw, 40px); }
.section-head p { color: var(--text-2); font-size: 18px; margin: 0; }
.divider { height: 1px; background: var(--hairline); border: 0; margin: 0; }

/* Feature grid */
.grid { display: grid; gap: 18px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 860px) { .grid-3 { grid-template-columns: 1fr; } .grid-2 { grid-template-columns: 1fr; } }

.card {
  background: linear-gradient(180deg, #1b1b3c, #13132c);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px;
  position: relative;
  overflow: hidden;
}
.card::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 1px;
  background: var(--hairline);
}
.card h3 { font-family: var(--sans); font-weight: 650; font-size: 19px; margin-bottom: 8px; }
.card p { color: var(--text-2); font-size: 15.5px; margin: 0; }
.card .ico {
  width: 46px; height: 46px; border-radius: 12px;
  display: grid; place-items: center; margin-bottom: 16px;
  background: var(--accent-soft); border: 1px solid rgba(139,111,240,.3);
}
.card .ico svg { width: 24px; height: 24px; stroke: var(--accent-light); fill: none; stroke-width: 1.7; }
.card.gold .ico { background: var(--gold-soft); border-color: rgba(255,215,0,.3); }
.card.gold .ico svg { stroke: var(--gold); }

/* Privacy band */
.band {
  background:
    linear-gradient(180deg, rgba(18,18,42,0.6), rgba(10,10,26,0.6));
  border-top: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline);
}
.privacy-list { display: grid; grid-template-columns: repeat(2,1fr); gap: 14px 28px; margin: 28px 0 0; padding: 0; list-style: none; }
.privacy-list li { display: flex; gap: 12px; align-items: flex-start; color: var(--text-2); font-size: 15.5px; }
.privacy-list .check {
  flex: none; width: 22px; height: 22px; margin-top: 1px; border-radius: 999px;
  background: rgba(0,224,136,.12); border: 1px solid rgba(0,224,136,.4);
  display: grid; place-items: center;
}
.privacy-list .check svg { width: 12px; height: 12px; stroke: var(--success); stroke-width: 2.4; fill: none; }
@media (max-width: 720px){ .privacy-list { grid-template-columns: 1fr; } }

/* Protocol timeline */
.weeks { display: grid; grid-template-columns: repeat(4,1fr); gap: 16px; }
@media (max-width: 860px){ .weeks { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px){ .weeks { grid-template-columns: 1fr; } }
.week {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 22px; position: relative;
}
.week .wk { font-family: var(--serif); font-size: 13px; letter-spacing: .14em; text-transform: uppercase; color: var(--gold); }
.week h4 { font-family: var(--sans); font-weight: 650; font-size: 17px; margin: 8px 0 6px; }
.week p { color: var(--text-2); font-size: 14.5px; margin: 0; }

/* Eta / science callout */
.eta-figure {
  display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 36px; align-items: center;
}
@media (max-width: 860px){ .eta-figure { grid-template-columns: 1fr; } }
.eta-stats { display: flex; flex-direction: column; gap: 14px; }
.eta-stat {
  display: flex; align-items: baseline; gap: 14px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 14px 18px; background: rgba(8,8,20,.5);
}
.eta-stat .n { font-family: var(--serif); font-size: 28px; color: var(--gold); min-width: 92px; }
.eta-stat .l { color: var(--text-2); font-size: 15px; }
.figure-frame {
  border: 1px solid var(--border); border-radius: var(--radius);
  background: rgba(6,6,16,.55); padding: 20px; overflow: hidden;
}
.figure-frame figcaption { color: var(--muted); font-size: 13px; margin-top: 12px; text-align: center; }

/* Disclaimer note */
.note {
  border-left: 3px solid var(--gold);
  background: var(--gold-soft);
  padding: 16px 20px; border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--text-2); font-size: 15px;
}
.note strong { color: var(--text); }

/* --------------------------- FOOTER ---------------------------- */
.footer { border-top: 1px solid var(--hairline); padding: 54px 0 64px; }
.footer-inner { display: flex; justify-content: space-between; gap: 30px; flex-wrap: wrap; }
.footer .brand { margin-bottom: 14px; }
.footer p { color: var(--muted); font-size: 14px; max-width: 380px; margin: 0; }
.footer nav { display: flex; gap: 30px; flex-wrap: wrap; }
.footer-col h5 { font-family: var(--sans); font-size: 12px; text-transform: uppercase; letter-spacing: .16em; color: var(--text-2); margin: 0 0 12px; }
.footer-col a { display: block; color: var(--muted); font-size: 14.5px; margin-bottom: 9px; }
.footer-col a:hover { color: var(--gold); }
.footer-legal { margin-top: 40px; padding-top: 22px; border-top: 1px solid var(--hairline); color: var(--muted); font-size: 13px; display:flex; justify-content:space-between; gap:16px; flex-wrap:wrap; }

/* --------------------- LEGAL / PROSE PAGES --------------------- */
.page-header { padding: 64px 0 26px; text-align: center; }
.page-header h1 { font-size: clamp(32px, 5vw, 46px); }
.page-header .updated { color: var(--muted); font-size: 14px; margin-top: 6px; }

.prose { padding: 16px 0 80px; }
.prose .container { max-width: 760px; }
.prose h2 {
  font-family: var(--sans); font-weight: 650; font-size: 21px;
  margin: 40px 0 12px; padding-top: 16px; border-top: 1px solid var(--hairline);
  color: var(--text);
}
.prose h2:first-of-type { border-top: 0; padding-top: 0; }
.prose h3 { font-family: var(--sans); font-weight: 600; font-size: 17px; margin: 24px 0 8px; color: var(--text); }
.prose p, .prose li { color: var(--text-2); font-size: 16.5px; }
.prose ul { padding-left: 22px; }
.prose li { margin-bottom: 8px; }
.prose strong { color: var(--text); }
.prose a { text-decoration: underline; text-underline-offset: 2px; }
.toc {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px 24px; margin: 8px 0 12px;
}
.toc h4 { font-family: var(--sans); font-size: 12px; text-transform: uppercase; letter-spacing: .16em; color: var(--text-2); margin: 0 0 12px; }
.toc ol { margin: 0; padding-left: 20px; columns: 2; column-gap: 28px; }
.toc li { margin-bottom: 7px; font-size: 15px; }
@media (max-width: 600px){ .toc ol { columns: 1; } }

/* FAQ accordion */
.faq { display: flex; flex-direction: column; gap: 12px; }
.faq details {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 4px 22px;
}
.faq details[open] { border-color: var(--border-light); }
.faq summary {
  cursor: pointer; list-style: none; padding: 18px 0;
  font-weight: 600; font-size: 17px; color: var(--text);
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+"; color: var(--gold); font-size: 24px; font-weight: 400; line-height: 1;
  transition: transform .2s ease;
}
.faq details[open] summary::after { transform: rotate(45deg); }
.faq .a { padding: 0 0 20px; color: var(--text-2); font-size: 16px; }
.faq .a p { margin: 0 0 10px; }
.faq .a p:last-child { margin: 0; }

/* contact card */
.contact {
  display:flex; gap:18px; align-items:center; flex-wrap:wrap; justify-content:space-between;
  background: linear-gradient(180deg, #1b1b3c, #13132c);
  border:1px solid var(--border); border-radius: var(--radius); padding: 24px 28px;
}
.contact .big { font-family: var(--serif); font-size: 20px; }
