:root {
  --bg: #0d0d0f;
  --bg-alt: #141417;
  --surface: #1b1b20;
  --line: #2a2a31;
  --text: #f3f1ea;
  --muted: #a5a29a;
  --gold: #e3a92b;
  --gold-ink: #17120a;
  --radius: 16px;
  --wrap: 1120px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 80px; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { line-height: 1.1; margin: 0 0 0.5em; letter-spacing: -0.02em; text-wrap: balance; }
h1 { font-size: clamp(2.4rem, 6vw, 4.4rem); font-weight: 800; }
h2 { font-size: clamp(1.8rem, 4vw, 2.6rem); font-weight: 800; }
h3 { font-size: 1.3rem; font-weight: 700; }
p { margin: 0 0 1em; color: var(--muted); }
a { color: inherit; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 720px; }
.accent { color: var(--gold); }

.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 16px; z-index: 100; background: var(--gold); color: var(--gold-ink); padding: 8px 12px; border-radius: 8px; }

:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(13, 13, 15, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.header-row { display: flex; align-items: center; justify-content: space-between; min-height: 64px; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; font-size: 0.95rem; }
.brand-mark { width: 30px; height: 30px; color: var(--gold); }
.site-nav { display: flex; align-items: center; gap: 28px; }
.site-nav a { text-decoration: none; font-size: 0.95rem; color: var(--muted); }
.site-nav a:hover { color: var(--text); }
.nav-toggle { display: none; background: none; border: 1px solid var(--line); color: var(--text); padding: 8px 14px; border-radius: 999px; font: inherit; font-size: 0.9rem; cursor: pointer; }

/* Buttons */
.btn {
  display: inline-block;
  background: var(--gold); color: var(--gold-ink);
  padding: 14px 24px; border: 0; border-radius: 999px;
  font: inherit; font-weight: 700; text-decoration: none; cursor: pointer;
  transition: transform 0.15s ease, filter 0.15s ease;
}
.btn:hover { filter: brightness(1.08); transform: translateY(-1px); }
.btn[disabled] { opacity: 0.6; cursor: wait; transform: none; }
.btn-ghost { background: transparent; color: var(--text); box-shadow: inset 0 0 0 1px var(--line); }
.btn-ghost:hover { box-shadow: inset 0 0 0 1px var(--gold); }
.site-nav .btn-small { padding: 9px 18px; font-size: 0.9rem; color: var(--gold-ink); }

/* Hero */
.hero { padding: clamp(56px, 10vw, 120px) 0; background: radial-gradient(900px 500px at 85% 10%, rgba(227, 169, 43, 0.14), transparent 60%); }
.hero-grid { display: grid; grid-template-columns: 1.3fr 0.7fr; gap: 48px; align-items: center; }
.eyebrow { color: var(--gold); font-size: 0.8rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; margin-bottom: 14px; }
.lede { font-size: 1.2rem; max-width: 34em; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }

.phone {
  justify-self: center;
  width: min(260px, 100%); aspect-ratio: 9 / 18.5;
  padding: 10px; border-radius: 42px;
  background: linear-gradient(160deg, #34343c, #18181c);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6), inset 0 0 0 1px #45454e;
  transform: rotate(4deg);
}
.phone-screen { position: relative; height: 100%; border-radius: 33px; background: #09090b; overflow: hidden; padding: 56px 18px 18px; display: flex; flex-direction: column; gap: 12px; }
.phone-notch { position: absolute; top: 12px; left: 50%; width: 80px; height: 22px; margin-left: -40px; border-radius: 999px; background: #000; }
.layer { border-radius: 12px; background: var(--surface); border: 1px solid var(--line); }
.l1 { height: 34%; background: linear-gradient(135deg, var(--gold), #b9791a); border: 0; }
.l2 { height: 14%; }
.l3 { height: 14%; width: 78%; }
.l4 { height: 14%; width: 56%; }
.phone-bar { position: absolute; bottom: 10px; left: 50%; width: 96px; height: 4px; margin-left: -48px; border-radius: 4px; background: #55555e; }

/* Sections */
.section { padding: clamp(56px, 9vw, 104px) 0; }
.section-alt { background: var(--bg-alt); border-block: 1px solid var(--line); }

.cards { display: grid; grid-template-columns: 1.4fr 1fr; gap: 20px; margin-top: 32px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 32px; }
.card-feature { border-color: rgba(227, 169, 43, 0.5); background: linear-gradient(160deg, rgba(227, 169, 43, 0.1), var(--surface) 55%); }
.card h3 { font-size: 1.7rem; margin-top: 16px; }
.badge { display: inline-block; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; padding: 5px 12px; border-radius: 999px; background: var(--gold); color: var(--gold-ink); }
.badge-muted { background: var(--line); color: var(--muted); }
.link { color: var(--gold); font-weight: 600; text-decoration: none; }
.link:hover { text-decoration: underline; }

.pillars { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; margin-top: 32px; }
.pillar { border-top: 2px solid var(--gold); padding-top: 20px; }
.pillar-num { display: block; color: var(--gold); font-weight: 800; font-size: 0.85rem; letter-spacing: 0.1em; margin-bottom: 10px; }

/* Form */
.form { margin-top: 28px; display: grid; gap: 18px; }
.field { display: grid; gap: 6px; }
label { font-size: 0.9rem; font-weight: 600; }
input[type="text"], input[type="email"], textarea {
  width: 100%; background: var(--bg); color: var(--text);
  border: 1px solid var(--line); border-radius: 12px;
  padding: 13px 14px; font: inherit;
}
input:focus, textarea:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(227, 169, 43, 0.2); }
textarea { resize: vertical; }
.form .btn { justify-self: start; }
.hp { position: absolute; left: -9999px; }
.form-status { min-height: 1.6em; margin: 0; font-size: 0.95rem; }
.form-status.ok { color: #7fd69a; }
.form-status.err { color: #ff8f7a; }

/* First-visit popup */
.popup {
  width: min(480px, calc(100% - 32px));
  background: var(--surface); color: var(--text);
  border: 1px solid rgba(227, 169, 43, 0.5); border-radius: var(--radius);
  padding: 32px; box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
}
.popup::backdrop { background: rgba(0, 0, 0, 0.7); backdrop-filter: blur(3px); }
.popup h2 { font-size: 1.7rem; padding-right: 24px; }
.popup-close {
  position: absolute; top: 10px; right: 12px;
  width: 36px; height: 36px; border: 0; border-radius: 50%;
  background: none; color: var(--muted); font-size: 1.6rem; line-height: 1; cursor: pointer;
}
.popup-close:hover { color: var(--text); }
.popup-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 20px; }

/* Footer */
.site-footer { padding: 28px 0; border-top: 1px solid var(--line); font-size: 0.9rem; color: var(--muted); }
.footer-row { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.site-footer a { color: var(--muted); }
.footer-links { display: flex; gap: 24px; }

/* Standalone pages (404) */
.center-page { min-height: 100vh; display: grid; place-items: center; text-align: center; padding: 24px; }

@media (max-width: 820px) {
  .hero-grid, .cards, .pillars { grid-template-columns: 1fr; }
  .phone { width: 200px; }
  .nav-toggle { display: block; }
  .site-nav {
    display: none; position: absolute; top: 64px; left: 0; right: 0;
    flex-direction: column; align-items: flex-start; gap: 18px;
    padding: 20px; background: var(--bg); border-bottom: 1px solid var(--line);
  }
  .site-nav.open { display: flex; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn { transition: none; }
}

/* Support page */
.btn-small { padding: 9px 18px; font-size: 0.9rem; }
.support-h { margin-top: 48px; font-size: 1.5rem; }
.support-list { color: var(--muted); padding-left: 1.2em; display: grid; gap: 8px; }

/* App pages */
.phone { display: block; }
.phone-screen:has(.phone-shot) { padding: 0; }
.phone-shot { width: 100%; height: 100%; object-fit: cover; display: block; }
.app-icon { width: 180px; height: 180px; border-radius: 22.5%; box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5); }
.app-icon-small { width: 96px; height: 96px; flex: none; }
.app-hero { display: grid; grid-template-columns: auto 1fr; gap: 40px; align-items: start; }
.app-hero h1 { margin-top: 16px; }
.card-app { display: flex; gap: 24px; align-items: flex-start; }
.card-app h3 { margin-top: 12px; }
.gallery { display: flex; gap: 16px; overflow-x: auto; padding-bottom: 12px; scroll-snap-type: x proximity; }
.gallery img { height: 480px; width: auto; border-radius: 18px; scroll-snap-align: start; flex: none; }
.pillars-wrap { grid-template-columns: repeat(3, 1fr); row-gap: 40px; }
.prose h1 { font-size: clamp(2rem, 5vw, 3rem); }
.prose h2 { font-size: 1.4rem; margin-top: 44px; }
.prose ul { color: var(--muted); padding-left: 1.2em; display: grid; gap: 8px; }
.prose a { color: var(--gold); }
.prose .date { font-size: 0.95rem; }
.table-scroll { overflow-x: auto; }
.prose table { border-collapse: collapse; width: 100%; min-width: 560px; font-size: 0.95rem; }
.prose th, .prose td { text-align: left; vertical-align: top; padding: 10px 12px; border-bottom: 1px solid var(--line); color: var(--muted); }
.prose th { color: var(--text); font-size: 0.85rem; }
@media (max-width: 820px) {
  .app-hero { grid-template-columns: 1fr; gap: 24px; }
  .app-icon { width: 120px; height: 120px; }
  .card-app { flex-direction: column; }
  .pillars-wrap { grid-template-columns: 1fr; }
  .gallery img { height: 400px; }
}

.contact-actions { margin-top: 28px; }

/* Launch sign-up */
.notify-form { margin-top: 16px; }
.fine-print { font-size: 0.8rem; margin: 0; }
.link-second { display: inline-block; margin-left: 20px; }
