/* ============================================================
   Starry marketing / welcome page.
   Self-contained — only loaded by layouts/marketing.html.erb, so the
   global resets and :root tokens here never touch the rest of the app.
   Ported from design_handoff_starry_welcome/. Fonts self-hosted under
   /public/fonts (CSP font-src is :self; Google Fonts links are blocked).
   ============================================================ */

@font-face {
  font-family: 'Newsreader';
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url("/fonts/newsreader-latin.woff2") format('woff2');
}
@font-face {
  font-family: 'Newsreader';
  font-style: italic;
  font-weight: 300 700;
  font-display: swap;
  src: url("/fonts/newsreader-italic-latin.woff2") format('woff2');
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/ibm-plex-mono-400-latin.woff2") format('woff2');
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/fonts/ibm-plex-mono-500-latin.woff2") format('woff2');
}

/* Scoped to .marketing-page so these globals (variables, body background,
   link/selection resets) never leak into the main app, which loads this
   stylesheet on every page. Without the scope, the unlayered `body` rule
   below overrides the app's Tailwind body background everywhere. */
.marketing-page {
  --bg: #0a0e1a;
  --bg-deep: #070a13;
  --panel: rgba(255,255,255,0.025);
  --panel-2: rgba(255,255,255,0.04);
  --border: rgba(255,255,255,0.09);
  --border-strong: rgba(255,255,255,0.16);
  --text: #e9ecf6;
  --text-soft: #c2c8da;
  --muted: #828aa3;
  --muted-dim: #586079;
  --accent: #e8c87d;          /* starlight gold */
  --accent-soft: rgba(232,200,125,0.14);
  --accent-line: rgba(232,200,125,0.32);
  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --sans: "Helvetica Neue", Helvetica, Arial, system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --maxw: 1180px;
  --star-intensity: 1;
}

.marketing-page * { box-sizing: border-box; }
html:has(.marketing-page) { scroll-behavior: smooth; }
.marketing-page {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
.marketing-page a { color: inherit; text-decoration: none; }
.marketing-page ::selection { background: var(--accent-soft); color: #fff; }

/* ---------- Background field ---------- */
#starfield {
  position: fixed; inset: 0;
  width: 100%; height: 100%;
  z-index: 1; pointer-events: none;
}
.bg-grad {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(1200px 700px at 78% -8%, rgba(232,200,125,0.07), transparent 60%),
    radial-gradient(1000px 800px at 12% 8%, rgba(86,108,170,0.10), transparent 62%),
    linear-gradient(180deg, #0a0e1a 0%, #090d18 40%, #070a13 100%);
}
.grain {
  position: fixed; inset: 0; z-index: 2; pointer-events: none; opacity: 0.5;
  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'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.035'/%3E%3C/svg%3E");
}
.page { position: relative; z-index: 3; }

.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 28px; }

/* ---------- Nav ---------- */
header.nav {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(10px);
  background: linear-gradient(180deg, rgba(10,14,26,0.82), rgba(10,14,26,0.45));
  border-bottom: 1px solid transparent;
  transition: border-color .3s ease, background .3s ease;
}
header.nav.scrolled { border-bottom-color: var(--border); }
.nav-in { display: flex; align-items: center; justify-content: space-between; height: 70px; }
.brand { display: flex; align-items: center; gap: 11px; font-family: var(--serif); font-size: 21px; letter-spacing: .2px; font-weight: 500; }
.brand .mark { color: var(--accent); font-size: 17px; transform: translateY(-1px); }
.nav-links { display: flex; align-items: center; gap: 34px; }
.nav-links a.link { font-size: 14px; color: var(--text-soft); letter-spacing: .2px; transition: color .2s; }
.nav-links a.link:hover { color: #fff; }
.nav-cta { display: flex; align-items: center; gap: 18px; }

.btn {
  display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--sans); font-size: 14px; font-weight: 500; letter-spacing: .2px;
  padding: 11px 19px; border-radius: 9px; cursor: pointer;
  border: 1px solid transparent; transition: transform .15s ease, border-color .2s, box-shadow .25s, background-color .2s;
  white-space: nowrap;
}
/* Scoped with .marketing-page so the dark-on-gold text beats the
   `.marketing-page a { color: inherit }` reset (0,1,1) — otherwise the
   anchor buttons inherit the white body text and render white-on-gold. */
.marketing-page .btn-primary {
  background-color: var(--accent); color: #1a1408;
  box-shadow: 0 1px 0 rgba(255,255,255,0.35) inset, 0 10px 30px -12px rgba(232,200,125,0.55);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 1px 0 rgba(255,255,255,0.4) inset, 0 16px 38px -12px rgba(232,200,125,0.7); }
.btn-ghost { background-color: transparent; color: var(--text); border-color: var(--border-strong); }
.btn-ghost:hover { background-color: var(--panel-2); border-color: var(--text-soft); }
.btn-lg { padding: 14px 24px; font-size: 15px; border-radius: 11px; }
.login-link { font-size: 14px; color: var(--text-soft); transition: color .2s; }
.login-link:hover { color: #fff; }

/* ---------- Hero ---------- */
.hero { padding: 92px 0 40px; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--mono); font-size: 12px; letter-spacing: 2.4px; text-transform: uppercase;
  color: var(--accent); margin-bottom: 26px;
  padding: 7px 14px; border: 1px solid var(--accent-line); border-radius: 100px;
  background: var(--accent-soft);
}
.eyebrow .dot { width: 5px; height: 5px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 10px var(--accent); }
h1.display {
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(42px, 6.4vw, 84px); line-height: 0.98; letter-spacing: -1.4px;
  margin: 0 0 26px; max-width: 14ch; text-wrap: balance;
}
h1.display em { font-style: italic; color: var(--accent); }
.lede { font-size: clamp(17px, 1.5vw, 20px); line-height: 1.6; color: var(--text-soft); max-width: 52ch; margin: 0 0 34px; text-wrap: pretty; }
.hero-cta { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.hero-note { margin-top: 20px; font-size: 13px; color: var(--muted); font-family: var(--mono); letter-spacing: .3px; display: flex; align-items: center; gap: 9px; }
.hero-note .pulse { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 0 var(--accent-line); animation: pulse 2.6s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(232,200,125,.4);} 70%{ box-shadow: 0 0 0 8px rgba(232,200,125,0);} 100%{ box-shadow:0 0 0 0 rgba(232,200,125,0);} }

/* ---------- Hero product mock ---------- */
.mock-shell { margin-top: 64px; position: relative; }
.mock-glow { position:absolute; inset: -2px -2px auto -2px; height: 200px; background: radial-gradient(600px 160px at 30% 0, rgba(232,200,125,0.12), transparent 70%); pointer-events:none; }
.mock {
  position: relative;
  border: 1px solid var(--border); border-radius: 16px;
  background: linear-gradient(180deg, rgba(20,26,44,0.92), rgba(12,16,30,0.92));
  box-shadow: 0 40px 100px -40px rgba(0,0,0,0.8), 0 0 0 1px rgba(255,255,255,0.02) inset;
  overflow: hidden;
}
.mock-bar { display:flex; align-items:center; gap:14px; padding: 14px 18px; border-bottom: 1px solid var(--border); background: rgba(255,255,255,0.015); }
.dots { display:flex; gap:7px; }
.dots i { width:11px; height:11px; border-radius:50%; background: #2c3350; display:block; }
.mock-tab { margin-left: 4px; font-family: var(--mono); font-size: 11px; letter-spacing: 1px; text-transform: uppercase; color: var(--text-soft); }
.mock-bar .scope { margin-left:auto; font-family: var(--mono); font-size:11px; color: var(--muted); letter-spacing:.5px; display:flex; align-items:center; gap:7px; }
.mock-bar .scope b { color: var(--text-soft); font-weight:500; }

/* fact-pattern input */
.mock-input { padding: 17px 20px 15px; border-bottom: 1px solid var(--border); background: rgba(0,0,0,0.16); }
.fp-label { font-family: var(--mono); font-size: 11px; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); margin-bottom: 11px; display:flex; align-items:center; gap:8px; }
.fp-label .ico { color: var(--accent); }
.fp { font-size: 14px; line-height: 1.72; color: var(--text-soft); margin: 0; max-width: 74ch; }
.fp .caret { display:inline-block; width:1.5px; height:14px; background: var(--accent); vertical-align:-2px; margin-left:1px; animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.hl { color:#fff; background: var(--accent-soft); box-shadow: inset 0 -1px 0 var(--accent-line); border-radius: 2px; padding: 0 2px; }
.fp-foot { display:flex; align-items:center; gap:12px; margin-top: 15px; flex-wrap: wrap; }
.signals { display:flex; align-items:center; gap:7px; flex-wrap: wrap; }
.sig { font-family: var(--mono); font-size: 10.5px; letter-spacing:.2px; color: var(--text-soft); border:1px solid var(--border-strong); border-radius: 100px; padding: 4px 10px; display:flex; align-items:center; gap:6px; }
.sig::before { content:""; width:5px; height:5px; border-radius:50%; background: var(--accent); flex:none; }
.find-btn { margin-left:auto; display:inline-flex; align-items:center; gap:8px; font-family: var(--sans); font-size: 12.5px; font-weight:600; color:#1a1408; background: var(--accent); border-radius: 8px; padding: 8px 14px; white-space:nowrap; }

.mock-body { display: grid; grid-template-columns: 1.55fr 1fr; min-height: 340px; }
.results { padding: 18px 18px 22px; display:flex; flex-direction: column; gap: 12px; border-right: 1px solid var(--border); }
.results-head { display:flex; align-items:center; justify-content: space-between; font-family: var(--mono); font-size: 11px; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); margin-bottom: 2px; }
.case {
  border: 1px solid var(--border); border-radius: 11px; padding: 14px 15px;
  background: rgba(255,255,255,0.018); transition: border-color .2s, background .2s, transform .2s;
  cursor: default;
}
.case:hover { border-color: var(--border-strong); background: rgba(255,255,255,0.035); transform: translateY(-1px); }
.case.lead { border-color: var(--accent-line); background: linear-gradient(180deg, rgba(232,200,125,0.07), rgba(255,255,255,0.015)); }
.case-top { display:flex; align-items:center; justify-content: space-between; margin-bottom: 7px; }
.cite { font-family: var(--mono); font-size: 11.5px; color: var(--accent); letter-spacing: .3px; }
.match { font-family: var(--mono); font-size: 10.5px; color: var(--muted); display:flex; align-items:center; gap:7px; }
.match .barwrap { width:46px; height:4px; border-radius: 3px; background: rgba(255,255,255,0.1); overflow:hidden; }
.match .barfill { height:100%; background: var(--accent); border-radius:3px; }
.case h4 { margin: 0 0 5px; font-family: var(--serif); font-weight: 500; font-size: 15.5px; color: #fff; letter-spacing: .1px; }
.case p { margin:0; font-size: 12.5px; line-height: 1.5; color: var(--muted); }
.case .holding { color: var(--text-soft); }
.case .from { margin-top: 9px; padding-top: 8px; border-top: 1px dashed var(--border); font-family: var(--mono); font-size: 10.5px; color: var(--muted); display:flex; gap:7px; align-items:baseline; letter-spacing:.2px; }
.case .from b { color: var(--accent); font-weight: 500; }

.constel { position: relative; padding: 18px; display:flex; flex-direction:column; }
.constel .results-head { margin-bottom: 10px; }
.constel svg { width: 100%; flex: 1; display:block; }
.constel .legend { font-family: var(--mono); font-size: 10.5px; color: var(--muted); margin-top: 8px; line-height: 1.7; letter-spacing:.3px; }
.constel .legend b { color: var(--accent); font-weight: 500; }

/* ---------- Section scaffolding ---------- */
section.band { padding: 110px 0; position: relative; }
.sec-label { font-family: var(--mono); font-size: 12px; letter-spacing: 2.2px; text-transform: uppercase; color: var(--accent); margin-bottom: 18px; display:flex; align-items:center; gap:10px; }
.sec-label::before { content:""; width: 26px; height:1px; background: var(--accent-line); }
h2.sec-title { font-family: var(--serif); font-weight: 400; font-size: clamp(30px, 3.6vw, 46px); line-height: 1.06; letter-spacing: -.6px; margin: 0 0 18px; max-width: 18ch; text-wrap: balance; }
.sec-sub { font-size: 17px; line-height: 1.6; color: var(--text-soft); max-width: 56ch; margin: 0; text-wrap: pretty; }
.sec-head { margin-bottom: 56px; }

/* steps */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
.step { position: relative; padding-top: 30px; border-top: 1px solid var(--border); }
.step .num { font-family: var(--mono); font-size: 12px; color: var(--accent); letter-spacing: 1px; margin-bottom: 16px; }
.step h3 { font-family: var(--serif); font-weight: 500; font-size: 22px; margin: 0 0 11px; color: #fff; letter-spacing: .1px; }
.step p { margin: 0; font-size: 15px; line-height: 1.62; color: var(--muted); }

/* features */
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: 16px; overflow: hidden; }
.feature { background: linear-gradient(180deg, rgba(20,26,44,0.55), rgba(12,16,30,0.4)); padding: 34px 30px 38px; transition: background .25s; }
.feature:hover { background: linear-gradient(180deg, rgba(28,35,58,0.7), rgba(16,21,38,0.5)); }
.feature .glyph { width: 40px; height: 40px; border-radius: 10px; display:grid; place-items:center; border: 1px solid var(--accent-line); background: var(--accent-soft); margin-bottom: 20px; }
.feature .glyph svg { width: 19px; height: 19px; stroke: var(--accent); fill: none; stroke-width: 1.5; }
.feature h3 { font-family: var(--serif); font-weight: 500; font-size: 20px; margin: 0 0 10px; color: #fff; }
.feature p { margin: 0; font-size: 14.5px; line-height: 1.6; color: var(--muted); }

/* comparison */
.compare { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.col { border: 1px solid var(--border); border-radius: 16px; padding: 32px 30px; background: var(--panel); }
.col.old { opacity: .82; }
.col.new { border-color: var(--accent-line); background: linear-gradient(180deg, rgba(232,200,125,0.05), rgba(255,255,255,0.012)); }
.col .tag { font-family: var(--mono); font-size: 11px; letter-spacing: 1.4px; text-transform: uppercase; color: var(--muted); margin-bottom: 22px; }
.col.new .tag { color: var(--accent); }
.col ul { list-style: none; margin: 0; padding: 0; display:flex; flex-direction: column; gap: 16px; }
.col li { display:flex; gap: 13px; font-size: 15px; line-height: 1.5; color: var(--text-soft); }
.col li .ic { flex: none; width: 18px; height: 18px; margin-top: 1px; }
.col.old li .ic { color: var(--muted-dim); }
.col.new li .ic { color: var(--accent); }
.col li b { color: #fff; font-weight: 500; }

/* security band */
.security { border: 1px solid var(--border); border-radius: 20px; padding: 56px; background: linear-gradient(135deg, rgba(18,24,42,0.75), rgba(10,14,26,0.6)); position: relative; overflow: hidden; }
.security::after { content:""; position:absolute; right:-80px; top:-80px; width: 320px; height:320px; background: radial-gradient(circle, rgba(86,108,170,0.18), transparent 65%); pointer-events:none; }
.sec-grid { display:grid; grid-template-columns: 1.1fr 1fr; gap: 50px; align-items: center; position: relative; }
.sec-points { display:flex; flex-direction: column; gap: 22px; }
.sec-point { display:flex; gap: 15px; }
.sec-point .ic { flex:none; width: 22px; height: 22px; color: var(--accent); margin-top: 2px; }
.sec-point h4 { margin: 0 0 5px; font-size: 15.5px; color: #fff; font-weight: 600; letter-spacing:.1px; }
.sec-point p { margin: 0; font-size: 14px; line-height: 1.55; color: var(--muted); }

/* final cta */
.final { text-align: center; padding: 130px 0 120px; position: relative; }
.final h2 { font-family: var(--serif); font-weight: 400; font-size: clamp(34px, 5vw, 64px); line-height: 1.02; letter-spacing: -1px; margin: 0 auto 22px; max-width: 16ch; text-wrap: balance; }
.final p { font-size: 18px; color: var(--text-soft); max-width: 48ch; margin: 0 auto 38px; line-height: 1.6; }
.final .hero-cta { justify-content: center; }

/* footer */
footer.foot { border-top: 1px solid var(--border); padding: 44px 0 56px; position: relative; z-index: 3; }
.foot-in { display:flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.foot-left { display:flex; align-items:center; gap: 24px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.foot-left .brand { font-size: 17px; }
.foot-sep { width:1px; height: 14px; background: var(--border-strong); }
.foot-links { display:flex; align-items:center; gap: 24px; font-size: 13px; color: var(--muted); }
.foot-links a { transition: color .2s; }
.foot-links a:hover { color: var(--text); }

/* reveal — visible by default; only hidden/animated when JS + motion are available */
.reveal { opacity: 1; transform: none; }
@keyframes revealIn { from { opacity: 0; transform: translateY(22px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: no-preference) {
  html.js .reveal:not(.in) { opacity: 0; transform: translateY(22px); }
  html.js .reveal.in { animation: revealIn .7s cubic-bezier(.2,.7,.2,1) both; }
}
/* hard failsafe: once locked, nothing can stay hidden */
html.reveals-locked .reveal { opacity: 1 !important; transform: none !important; animation: none !important; }

/* responsive */
@media (max-width: 900px) {
  .nav-links { display: none; }
  .mock-body { grid-template-columns: 1fr; }
  .constel { display:none; }
  .results { border-right: none; }
  .steps { grid-template-columns: 1fr; gap: 0; }
  .step { padding: 26px 0; border-top: 1px solid var(--border); }
  .features { grid-template-columns: 1fr; }
  .compare { grid-template-columns: 1fr; }
  .sec-grid { grid-template-columns: 1fr; gap: 34px; }
  .security { padding: 36px 26px; }
}
@media (max-width: 560px) {
  .wrap { padding: 0 20px; }
  .hero { padding: 64px 0 20px; }
  .nav-cta .btn-ghost { display: none; }
}
