/* Northline design system: institutional, restrained, data first. */
:root {
  --bg: #07090d;
  --bg-2: #0b0f15;
  --panel: #0f141c;
  --panel-2: #131a24;
  --line: #1c2430;
  --line-2: #263142;
  --text: #eef1f6;
  --text-2: #c4cad6;
  --muted: #7d8799;
  --faint: #4a5466;
  --accent: #4d8dff;
  --accent-2: #7fb0ff;
  --accent-ink: #0b1a33;
  --up: #2fd39b;
  --down: #f2556a;
  --warn: #f2b84b;
  --radius: 14px;
  --radius-sm: 8px;
  --mono: 'Geist Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --sans: 'Geist', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  --display: 'Geist', system-ui, sans-serif;
  --shadow: 0 1px 0 rgba(255, 255, 255, 0.03) inset, 0 30px 80px -40px rgba(0, 0, 0, 0.8);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
.num, .mono { font-family: var(--mono); font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 28px; }

/* Faint engineering grid behind the page */
.grid-bg {
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background-image:
    linear-gradient(to right, rgba(255,255,255,0.025) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, black 30%, transparent 75%);
}
.glow {
  position: absolute; pointer-events: none; z-index: 0;
  width: 900px; height: 600px; left: 50%; top: -260px; transform: translateX(-50%);
  background: radial-gradient(closest-side, rgba(77,141,255,0.20), transparent);
  filter: blur(10px);
}
main, header, footer, section { position: relative; z-index: 1; }

/* Nav */
.nav { display: flex; align-items: center; justify-content: space-between; height: 72px; }
.brand { display: flex; align-items: center; gap: 11px; font-family: var(--display); font-weight: 600; letter-spacing: -0.03em; font-size: 19px; }
.brand-mark { width: 30px; height: 30px; display: block; flex: 0 0 auto; }
.nav-links { display: flex; gap: 30px; color: var(--muted); font-size: 14px; }
.nav-links a:hover { color: var(--text); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; height: 44px; padding: 0 20px; border-radius: 10px; font-weight: 600; font-size: 14px; border: 1px solid transparent; cursor: pointer; transition: transform .15s ease, background .15s ease, border-color .15s ease; }
.btn-primary { background: var(--text); color: #05070a; }
.btn-primary:hover { background: #fff; transform: translateY(-1px); }
.btn-ghost { border-color: var(--line-2); color: var(--text); background: rgba(255,255,255,0.02); }
.btn-ghost:hover { border-color: #3a4760; }
.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover { background: #5e9aff; }

/* Type */
.eyebrow { display: inline-flex; align-items: center; gap: 10px; font: 600 12px/1 var(--mono); letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent-2); }
.eyebrow::before { content: ''; width: 18px; height: 1px; background: var(--accent-2); }
h1, h2, h3 { font-family: var(--display); letter-spacing: -0.04em; margin: 0; }
h1 { font-size: clamp(44px, 7vw, 92px); line-height: 0.98; font-weight: 600; }
h2 { font-size: clamp(32px, 4.2vw, 54px); line-height: 1.04; font-weight: 600; }
h3 { font-size: 20px; letter-spacing: -0.02em; font-weight: 600; }
.lede { font-size: clamp(17px, 1.6vw, 20px); color: var(--text-2); max-width: 620px; line-height: 1.55; }
.muted { color: var(--muted); }
.accent { color: var(--accent-2); }

/* Panels */
.panel { background: linear-gradient(180deg, var(--panel), var(--bg-2)); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.panel-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--line); font: 600 11px/1 var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: 999px; font: 600 11px/1 var(--mono); letter-spacing: 0.04em; border: 1px solid var(--line-2); color: var(--text-2); background: rgba(255,255,255,0.02); }
.chip.up { color: var(--up); border-color: rgba(47,211,155,0.35); background: rgba(47,211,155,0.06); }
.chip.down { color: var(--down); border-color: rgba(242,85,106,0.35); background: rgba(242,85,106,0.06); }
.chip.warn { color: var(--warn); border-color: rgba(242,184,75,0.35); background: rgba(242,184,75,0.06); }
.chip.live::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--up); box-shadow: 0 0 10px var(--up); }
.up { color: var(--up); } .down { color: var(--down); } .warn { color: var(--warn); }

.divider { height: 1px; background: var(--line); border: 0; margin: 0; }
section { padding: 120px 0; }
.section-head { display: grid; gap: 18px; margin-bottom: 56px; max-width: 760px; }

@media (max-width: 860px) {
  .nav-links { display: none; }
  section { padding: 80px 0; }
  .wrap { padding: 0 18px; }
}

/* Ad slots (filled by ads.js; hidden until an ad is ready) */
.ad-slot { padding: 24px 0; }
.ad-slot[hidden] { display: none; }
.ad-slot-panel { padding: 0 18px 18px; }
.ad-label { display: block; margin-bottom: 8px; font: 500 11px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.ad-unit { display: flex; justify-content: center; overflow: hidden; border-radius: 12px; }
.ad-unit hype-banner { display: block; max-width: 100%; }
footer a[data-ad-choices], footer a[href="/privacy"] { color: inherit; text-decoration: underline; text-underline-offset: 3px; }

/* First-visit notice: the text scrolls inside the card, the footer with both choices always stays in view.
   Height follows the visible viewport (dvh), so mobile browser toolbars never push it off screen. */
.notice { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 16px; background: rgba(4,6,10,0.62); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); opacity: 0; transition: opacity .35s ease; }
.notice.open { opacity: 1; }
.notice[hidden] { display: none; }
.notice-card { display: flex; flex-direction: column; width: min(540px, 100%); max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); overflow: hidden; border-radius: 20px; border: 1px solid var(--line-2); background: linear-gradient(180deg, #111824, #0b0f16); box-shadow: 0 50px 140px -40px rgba(0,0,0,0.95), 0 1px 0 rgba(255,255,255,0.05) inset; transform: translateY(12px) scale(.985); transition: transform .45s cubic-bezier(.2,.8,.2,1); }
.notice.open .notice-card { transform: none; }
.notice-scroll { overflow-y: auto; overscroll-behavior: contain; padding: 28px 30px 18px; }
.notice-top { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; }
.notice-top img { width: 28px; height: 28px; }
.notice-top span { font: 500 13px var(--sans); letter-spacing: -0.01em; color: var(--text-2); }
.notice h2 { font-size: 24px; letter-spacing: -0.03em; margin-bottom: 12px; }
.notice-body { display: grid; gap: 10px; color: var(--text-2); font-size: 14px; line-height: 1.55; }
.notice-body p { margin: 0; }
.notice-body strong { color: var(--text); font-weight: 600; }
.notice-body .notice-ads { color: var(--muted); font-size: 12.5px; }
.notice-body a { color: var(--text-2); text-decoration: underline; text-underline-offset: 3px; }
.notice-foot { flex: 0 0 auto; padding: 14px 30px 18px; border-top: 1px solid var(--line); background: rgba(9,12,18,0.92); }
.notice-actions { display: flex; gap: 10px; }
.notice-actions .btn { flex: 1; height: 46px; padding: 0 16px; }
.notice-foot small { display: block; margin-top: 10px; color: var(--muted); font-size: 11.5px; line-height: 1.45; }
body.locked { overflow: hidden; }
@media (max-width: 520px) {
  .notice { padding: 10px; }
  .notice-card { max-height: calc(100vh - 20px); max-height: calc(100dvh - 20px); border-radius: 18px; }
  .notice-scroll { padding: 20px 20px 14px; }
  .notice-top { margin-bottom: 12px; }
  .notice h2 { font-size: 21px; margin-bottom: 10px; }
  .notice-body { font-size: 13.5px; line-height: 1.5; }
  .notice-foot { padding: 12px 20px 14px; }
  .notice-actions .btn { height: 44px; padding: 0 10px; font-size: 13.5px; }
}
@media (prefers-reduced-motion: reduce) { .notice, .notice-card { transition: none; } }

/* iOS Safari zooms the page in when a field under 16px is focused (and stays zoomed), so phones get 16px fields */
@media (max-width: 640px) { input, textarea, select { font-size: 16px !important; } }
