/* ============================================================
   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("/assets/fonts/newsreader-latin-fe979712.woff2") format('woff2');
}
@font-face {
  font-family: 'Newsreader';
  font-style: italic;
  font-weight: 300 700;
  font-display: swap;
  src: url("/assets/fonts/newsreader-italic-latin-fd8d4ba4.woff2") format('woff2');
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/fonts/ibm-plex-mono-400-latin-d13bb5b4.woff2") format('woff2');
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/assets/fonts/ibm-plex-mono-500-latin-deab9c2b.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;
}
.eyebrow::before { content:""; width: 26px; height: 1px; background: var(--accent-line); }
h1.display {
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(42px, 6vw, 78px); line-height: 1; letter-spacing: -1.4px;
  margin: 0 0 26px; max-width: 17ch; 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; }

/* ---------- Faithful hero product view ---------- */
.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 {
  --paper: #f6f1e7;
  --paper-raised: #fffdf8;
  --paper-sunken: #eee8dc;
  --paper-ink: #29251e;
  --paper-muted: #70695e;
  --paper-faint: #9b9386;
  --paper-line: #ddd5c7;
  --paper-gold: #a77d20;
  --paper-gold-soft: rgba(167,125,32,.11);
  position: relative;
  border: 1px solid var(--border); border-radius: 16px;
  background: var(--paper);
  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; color: var(--paper-ink); text-align: left;
}
.mock-bar { display:flex; align-items:center; gap:18px; padding: 13px 18px; border-bottom: 1px solid rgba(255,255,255,.08); background: #111827; color: #e9ecf6; }
.mock-brand { font-family: var(--serif); font-size: 16px; display: inline-flex; align-items: center; gap: 8px; }
.mock-brand i { color: var(--accent); font-style: normal; font-size: 12px; }
.mock-matter { padding-left: 18px; border-left: 1px solid rgba(255,255,255,.12); font-size: 12px; color: #d5d9e5; }
.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; }

.mock-workflow { display:flex; align-items:center; gap:8px; padding: 9px 14px; border-bottom: 1px solid var(--paper-line); background: var(--paper-raised); white-space: nowrap; overflow: hidden; }
.mock-workflow span { display: inline-flex; align-items:center; gap:5px; padding: 4px 6px; font-size: 10.5px; color: var(--paper-faint); }
.mock-workflow span i { width:7px; height:7px; border:1px solid var(--paper-line); border-radius:50%; font-size:9px; line-height:7px; font-style:normal; }
.mock-workflow span.done { color: var(--paper-muted); }
.mock-workflow span.done i { width:auto; height:auto; color:#39704b; border:0; font-weight:700; }
.mock-workflow span.active { color: var(--paper-ink); background: var(--paper-gold-soft); border:1px solid rgba(167,125,32,.28); border-radius:6px; font-weight:600; }
.mock-workflow span.active i { background: var(--paper-gold); border-color: var(--paper-gold); }
.mock-workflow small { font-family:var(--mono); font-size:8.5px; font-weight:400; color:var(--paper-faint); }
.mock-workflow > b { color: var(--paper-line); font-weight:400; }

.mock-body { display:grid; grid-template-columns: 136px minmax(0,1fr) 226px; min-height: 510px; }
.mock-sidebar { padding:14px 9px; border-right:1px solid var(--paper-line); background:var(--paper-raised); display:flex; flex-direction:column; gap:3px; }
.mock-sidebar span { display:flex; justify-content:space-between; align-items:center; padding:8px 9px; border-left:2px solid transparent; font-size:11.5px; color:var(--paper-muted); }
.mock-sidebar span.selected { border-left-color:var(--paper-gold); background:var(--paper-gold-soft); color:var(--paper-ink); font-weight:600; }
.mock-sidebar b { font-family:var(--mono); font-size:9px; font-weight:500; color:var(--paper-faint); }

.mock-main { min-width:0; padding:18px; }
.mock-heading { display:flex; align-items:end; justify-content:space-between; margin-bottom:10px; }
.app-label { font-family:var(--mono); font-size:9px; letter-spacing:1.6px; text-transform:uppercase; color:var(--paper-gold); }
.mock-heading h3, .mock-argument h3 { margin:4px 0 0; font-family:var(--serif); font-size:20px; font-weight:560; color:var(--paper-ink); }
.case-count { font-family:var(--mono); font-size:9.5px; color:var(--paper-faint); }
.reading-list { border:1px solid var(--paper-line); border-radius:8px; background:var(--paper-raised); overflow:hidden; }
.reading-row { display:grid; grid-template-columns:14px 7px 1fr; gap:8px; align-items:start; padding:9px 11px; border-bottom:1px solid var(--paper-line); }
.reading-row:last-child { border-bottom:0; }
.row-num { font-family:var(--mono); font-size:9px; color:var(--paper-faint); text-align:right; padding-top:2px; }
.judgment { display:inline-block; width:6px; height:6px; border-radius:50%; flex:none; }
.reading-row .judgment { margin-top:4px; }
.judgment.favorable { background:#3e7c51; }
.judgment.adverse { background:#a54b43; }
.reading-row b { font-family:var(--serif); font-size:12px; font-weight:600; color:var(--paper-gold); }
.reading-row p { margin:2px 0 0; font-size:10.5px; line-height:1.35; color:var(--paper-muted); }

.product-case { margin-top:12px; padding:13px 14px; border:1px solid var(--paper-line); border-left:3px solid rgba(167,125,32,.55); border-radius:8px; background:var(--paper-raised); }
.product-case-top { display:flex; align-items:start; justify-content:space-between; gap:12px; }
.product-case h4 { margin:0; font-family:var(--serif); font-size:14px; font-weight:650; color:var(--paper-ink); }
.product-case-top p { margin:3px 0 0; font-size:9.5px; color:var(--paper-faint); }
.case-signals { display:flex; align-items:center; gap:5px; flex:none; }
.case-signals span { display:inline-flex; align-items:center; gap:4px; border:1px solid var(--paper-line); border-radius:4px; padding:3px 6px; font-family:var(--mono); font-size:8.5px; color:var(--paper-muted); }
.case-signals .score { border-color:rgba(167,125,32,.28); background:var(--paper-gold-soft); color:#826018; }
.case-signals .good i { width:5px; height:5px; border-radius:50%; background:#3e7c51; }
.product-case > p { margin:8px 0 0; font-size:10.5px; line-height:1.45; color:var(--paper-muted); }
.product-case > p b { color:var(--paper-ink); font-weight:600; }
.product-case .found-by { display:grid; grid-template-columns:52px 1fr; gap:5px; font-size:9.5px; }
.product-case .found-by b { text-transform:uppercase; letter-spacing:.6px; color:var(--paper-faint); }
.product-case .passage { padding:8px 9px; background:var(--paper-sunken); border-radius:5px; font-family:var(--serif); }
.case-use { display:flex; align-items:center; justify-content:space-between; margin-top:9px; padding-top:8px; border-top:1px solid var(--paper-line); font-size:9.5px; color:var(--paper-gold); }
.case-use b { display:inline-flex; align-items:center; gap:5px; color:var(--paper-muted); font-weight:500; }

.mock-argument { padding:18px 14px; border-left:1px solid var(--paper-line); background:var(--paper-raised); }
.mock-argument h3 { font-size:16px; }
.mock-argument > p { margin:3px 0 0; font-size:9.5px; color:var(--paper-faint); }
.argument-rule { height:1px; margin:13px 0; background:var(--paper-line); }
.argument-item { position:relative; display:grid; grid-template-columns:8px 1fr; gap:8px; padding:8px 0; }
.argument-item > i { width:7px; height:7px; margin-top:3px; border-radius:50%; background:#3e7c51; }
.argument-item.open > i { background:#bd7b2a; }
.argument-item b, .argument-item span { display:block; }
.argument-item b { font-size:10.5px; font-weight:600; color:var(--paper-ink); }
.argument-item span { margin-top:2px; font-size:9px; color:var(--paper-faint); }

/* ---------- 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-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; }
  /* The primary message and product view must render immediately. Scroll
     reveals are progressive decoration for the sections below the fold. */
  html.js .hero .reveal { opacity: 1; transform: none; animation: none; }
}
/* 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: 126px minmax(0,1fr); }
  .mock-argument { display: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; }
  .mock-shell { margin-top: 48px; }
  .mock-matter, .mock-bar .scope { display:none; }
  .mock-workflow { gap:3px; }
  .mock-workflow span { padding:4px; }
  .mock-workflow span:nth-of-type(n+4), .mock-workflow span:nth-of-type(n+4) + b { display:none; }
  .mock-body { display:block; min-height:0; }
  .mock-sidebar { display:none; }
  .mock-main { padding:14px 12px; }
  .reading-row:nth-child(3) { display:none; }
  .product-case-top { display:block; }
  .case-signals { margin-top:7px; }
  .product-case .found-by { display:block; }
  .product-case .found-by b { margin-right:4px; }
  .case-use { align-items:flex-start; gap:8px; }
}
