/* Datalaku: visual language follows the flux-rate.com landing page
   (Inter, slate ink, electric blue, navy feature cards, blueprint guide lines),
   rebuilt in plain CSS so the strict CSP needs no CDN scripts or inline styles. */

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("/fonts/inter-latin.woff2") format("woff2");
}

:root {
  --ink: #020617;
  --text: #0f172a;
  --muted: #475569;
  --subtle: #64748b;
  --faint: #94a3b8;
  --line: #e2e8f0;
  --line-soft: rgb(226 232 240 / 70%);
  --guide: rgb(148 163 184 / 28%);
  --bg: #ffffff;
  --bg-tint: rgb(248 250 252 / 60%);
  --surface: #ffffff;
  --blue: #2454f4;
  --blue-deep: #1237d8;
  --blue-soft: #eff4ff;
  --navy: #06145b;
  --navy-card: #0b1a66;
  --emerald: #059669;
  --emerald-soft: #d1fae5;
  --amber: #d97706;
  --amber-soft: #fef3c7;
  --danger: #dc2626;
  --danger-soft: #fef2f2;
  --success: #047857;
  --success-soft: #ecfdf5;
  --radius: 20px;
  --radius-sm: 14px;
  --shadow-card: 0 18px 38px rgb(2 6 23 / 8%);
  --shadow-float: 0 18px 38px rgb(2 6 23 / 14%);
  --shadow-panel: 0 30px 70px rgb(2 6 23 / 12%);
  --glow: 0 22px 48px rgb(37 84 244 / 36%);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
html, body { max-width: 100%; overflow-x: clip; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.55 var(--font); -webkit-font-smoothing: antialiased; }
h1, h2, h3 { margin: 0 0 0.5em; font-weight: 600; color: var(--ink); }
h1 { font-size: clamp(1.9rem, 1.4rem + 1.6vw, 2.6rem); line-height: 1.08; letter-spacing: -0.04em; }
h2 { font-size: 1.2rem; letter-spacing: -0.02em; line-height: 1.2; }
h3 { font-size: 1.05rem; letter-spacing: -0.01em; }
p { margin: 0 0 0.9em; }
a { color: var(--blue); }
a:hover { color: var(--blue-deep); }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; border-radius: 6px; }
h1:focus, h2:focus { outline: none; }
svg.icon { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: 8px; top: -48px; background: var(--surface); padding: 8px 12px; z-index: 50; border-radius: 10px; }
.skip-link:focus { top: 8px; }
.boot { padding: 48px 16px; text-align: center; color: var(--subtle); }
.muted { color: var(--muted); }
.small { font-size: 0.875rem; }
.eyebrow { text-transform: uppercase; letter-spacing: 0.12em; font-size: 0.72rem; font-weight: 600; color: var(--blue); margin-bottom: 0.9em; }
.lead { font-size: 1.06rem; line-height: 1.6; color: var(--muted); max-width: 58ch; }
.container { width: 100%; max-width: 1240px; margin: 0 auto; padding: 0 clamp(24px, 5vw, 64px); }
.page-narrow { max-width: 760px; margin: 0 auto; padding: 40px 20px; }
.stack { display: grid; gap: 10px; }

/* ---------- brand ---------- */
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-weight: 650; font-size: 1.12rem; letter-spacing: -0.03em; }
.brand:hover { color: var(--ink); }
.brand svg { width: 32px; height: 32px; }
.brand-tile { fill: var(--navy); }
.brand-wave-1 { fill: none; stroke: #5dd9e8; stroke-width: 2.5; stroke-linecap: round; }
.brand-wave-2 { fill: none; stroke: #fff; stroke-width: 2.5; stroke-linecap: round; }
.brand-sun { fill: var(--blue); stroke: #fff; stroke-width: 1.2; }

/* ---------- buttons & forms ---------- */
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 42px; padding: 0 18px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  font: inherit; font-size: 0.92rem; font-weight: 600; text-decoration: none; cursor: pointer;
  transition: background-color 160ms ease, color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}
.button:hover { background: #f8fafc; color: var(--ink); }
.button:disabled { opacity: 0.5; cursor: not-allowed; }
.button-primary { background: var(--blue); border-color: var(--blue); color: #fff; box-shadow: 0 12px 28px rgb(37 84 244 / 28%); }
.button-primary:hover { background: var(--blue-deep); border-color: var(--blue-deep); color: #fff; }
.button-ghost { background: transparent; }
.button-small { min-height: 34px; padding: 0 14px; font-size: 0.85rem; }
.button-large { min-height: 56px; padding: 0 28px; border-radius: 18px; font-size: 0.95rem; }
.button-large.button-primary { box-shadow: var(--glow); }
.button-white { background: #fff; border-color: #fff; color: var(--navy); box-shadow: var(--glow); }
.button-white:hover { background: #eef2ff; color: var(--navy); }
.button-block { width: 100%; }
@media (prefers-reduced-motion: no-preference) {
  .button-large:hover { transform: translateY(-1px); }
}

label { display: grid; gap: 6px; font-weight: 600; font-size: 0.9rem; margin-bottom: 14px; color: var(--text); }
input, select {
  width: 100%; min-height: 44px; padding: 9px 14px;
  border: 1px solid var(--line); border-radius: 12px;
  background: var(--surface); color: var(--ink); font: inherit; font-weight: 400;
}
input:focus-visible, select:focus-visible { outline: 3px solid rgb(36 84 244 / 25%); outline-offset: 0; border-color: var(--blue); }
input[aria-invalid="true"] { border-color: var(--danger); }
.field-error { color: var(--danger); font-size: 0.84rem; font-weight: 500; margin: -8px 0 12px; }
.hint { color: var(--subtle); font-size: 0.84rem; margin: -8px 0 14px; }
.alert { border-radius: 12px; padding: 11px 14px; margin: 12px 0; font-size: 0.92rem; border: 1px solid transparent; }
.alert p { margin: 0 0 8px; }
.alert-error { background: var(--danger-soft); color: #b91c1c; border-color: #fecaca; }
.alert-success { background: var(--success-soft); color: var(--success); border-color: #a7f3d0; }
.copy-row { display: flex; gap: 8px; }
.copy-row input { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.8rem; }
.turnstile-slot { margin: 4px 0 12px; }

/* ---------- cards ---------- */
.card, .panel { background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--radius); box-shadow: var(--shadow-card); }
.card { padding: 26px; }
.panel { padding: 22px 24px; margin-bottom: 18px; }
.card-navy { background: var(--navy-card); border-color: var(--navy-card); color: #fff; box-shadow: 0 30px 60px rgb(29 78 216 / 34%), inset 0 1px 0 rgb(255 255 255 / 18%); }
.card-navy h3, .card-navy .card-title { color: #fff; }
.card-navy p, .card-navy li { color: rgb(255 255 255 / 72%); }
.card-navy .icon-tile { background: rgb(255 255 255 / 10%); color: #fff; }
.icon-tile { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--blue-soft); color: var(--blue); margin-bottom: 18px; }
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 11px; border-radius: 999px; background: var(--blue-soft); color: var(--blue-deep); font-size: 0.78rem; font-weight: 600; margin: 0; }
.chip { display: inline-flex; align-items: center; gap: 8px; padding: 6px 13px; border: 1px solid var(--line); border-radius: 999px; background: rgb(255 255 255 / 80%); font-size: 0.72rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text); }
.chip svg { width: 14px; height: 14px; color: var(--blue); }

/* ---------- marketing: nav ---------- */
.site-header { position: sticky; top: 0; z-index: 30; padding: 16px 16px 8px; }
.landing-nav {
  max-width: 1240px; margin: 0 auto; height: 64px; padding: 0 12px 0 20px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  border: 1px solid var(--line-soft); border-radius: 999px;
  background: linear-gradient(90deg, rgb(239 246 255 / 85%), rgb(255 255 255 / 92%) 45%, rgb(255 255 255 / 92%));
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 8px 30px rgb(2 6 23 / 6%);
}
.landing-nav .links { display: flex; align-items: center; gap: 30px; font-size: 0.9rem; font-weight: 500; }
.landing-nav .links a { color: var(--muted); text-decoration: none; }
.landing-nav .links a:hover { color: var(--ink); }
.landing-nav .actions { display: flex; align-items: center; gap: 8px; }

/* ---------- marketing: blueprint frame ---------- */
.frame { position: relative; }
.frame::before, .frame::after { content: ""; position: absolute; top: 0; bottom: 0; width: 1px; background: var(--guide); pointer-events: none; }
.frame::before { left: max(16px, calc(50% - 620px)); }
.frame::after { right: max(16px, calc(50% - 620px)); }
.guide-h { position: absolute; left: 0; right: 0; height: 1px; background: var(--guide); pointer-events: none; }
.guide-h.top { top: 34px; }
.guide-h.bottom { bottom: 34px; }
.cross { position: absolute; width: 14px; height: 14px; pointer-events: none; }
.cross::before, .cross::after { content: ""; position: absolute; background: rgb(100 116 139 / 55%); }
.cross::before { top: 50%; left: 0; right: 0; height: 1px; }
.cross::after { left: 50%; top: 0; bottom: 0; width: 1px; }
.cross.tl { top: 27px; left: calc(max(16px, calc(50% - 620px)) - 7px); }
.cross.tr { top: 27px; right: calc(max(16px, calc(50% - 620px)) - 7px); }
.cross.bl { bottom: 27px; left: calc(max(16px, calc(50% - 620px)) - 7px); }
.cross.br { bottom: 27px; right: calc(max(16px, calc(50% - 620px)) - 7px); }

/* ---------- marketing: hero ---------- */
.hero { background: radial-gradient(1200px 600px at 85% 10%, rgb(36 84 244 / 7%), transparent 60%), linear-gradient(180deg, #f8faff, #fff 70%); margin-top: -88px; padding-top: 88px; }
.hero-layout { position: relative; z-index: 2; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr); gap: 48px; align-items: center; padding: 96px 0 88px; }
.hero h1 { font-size: clamp(2.6rem, 1.6rem + 4.4vw, 5.05rem); line-height: 1.03; letter-spacing: -0.065em; margin: 26px 0 24px; }
.hero .lead { margin-bottom: 34px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 40px; }
.hero-stats { display: flex; gap: 32px; align-items: center; }
.hero-stats .stat-value { font-size: 1.5rem; font-weight: 650; letter-spacing: -0.03em; }
.hero-stats .stat-label { font-size: 0.75rem; color: var(--subtle); }
.hero-stats .divider { width: 1px; height: 36px; background: var(--line); }

.reveal-word { display: inline-block; }
@media (prefers-reduced-motion: no-preference) {
  .reveal-word { opacity: 0; filter: blur(10px); transform: translateY(12px); animation: word-in 900ms cubic-bezier(0.2, 0.7, 0.2, 1) forwards; }
  .reveal-word:nth-child(2) { animation-delay: 80ms; }
  .reveal-word:nth-child(3) { animation-delay: 160ms; }
  .reveal-word:nth-child(4) { animation-delay: 240ms; }
  .reveal-word:nth-child(5) { animation-delay: 320ms; }
  .reveal-word:nth-child(6) { animation-delay: 400ms; }
  .reveal-word:nth-child(7) { animation-delay: 480ms; }
  .reveal-word:nth-child(8) { animation-delay: 560ms; }
}
@keyframes word-in { to { opacity: 1; filter: blur(0); transform: none; } }

.hero-visual { position: relative; display: grid; place-items: center; min-height: 520px; }
.mock-card { position: relative; z-index: 1; width: min(380px, 100%); padding: 24px; border: 1px solid var(--line-soft); border-radius: 20px; background: rgb(255 255 255 / 92%); backdrop-filter: blur(20px); box-shadow: var(--shadow-panel); }
.mock-dots { display: flex; gap: 6px; margin-bottom: 20px; }
.mock-dots span { width: 10px; height: 10px; border-radius: 50%; background: #f87171; }
.mock-dots span:nth-child(2) { background: #fbbf24; }
.mock-dots span:nth-child(3) { background: #34d399; }
.mock-card .today { font-size: 0.75rem; color: var(--faint); font-weight: 500; margin-bottom: 4px; }
.mock-card h3 { font-size: 1.5rem; letter-spacing: -0.03em; margin-bottom: 20px; }
.mock-row { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 14px; margin-bottom: 12px; }
.mock-row .t { font-size: 0.88rem; font-weight: 600; }
.mock-row .s { font-size: 0.75rem; color: var(--subtle); }
.dot-icon { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; flex: none; }
.dot-icon svg { width: 16px; height: 16px; }
.dot-icon.green { background: var(--emerald-soft); color: var(--emerald); }
.dot-icon.amber { background: var(--amber-soft); color: var(--amber); }
.dot-icon.blue { background: var(--blue-soft); color: var(--blue); }
.mock-blue { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px; border-radius: 14px; margin-bottom: 12px; background: linear-gradient(135deg, var(--blue-deep), #0b2bb0); color: #fff; box-shadow: 0 30px 60px rgb(29 78 216 / 34%), inset 0 1px 0 rgb(255 255 255 / 28%); }
.mock-blue .k { font-size: 0.68rem; letter-spacing: 0.08em; text-transform: uppercase; color: rgb(255 255 255 / 60%); margin-bottom: 4px; }
.mock-blue .v { font-size: 1.15rem; font-weight: 700; line-height: 1; }
.mock-blue .delta { font-size: 0.75rem; font-weight: 600; color: #6ee7b7; white-space: nowrap; }
.mock-caption { position: absolute; bottom: -2px; left: 50%; transform: translateX(-50%); font-size: 0.7rem; color: var(--faint); white-space: nowrap; }
.float-chip { position: absolute; z-index: 2; display: flex; align-items: center; gap: 12px; padding: 12px 16px; background: #fff; border: 1px solid #f1f5f9; border-radius: 16px; box-shadow: var(--shadow-float); }
.float-chip .t { font-size: 0.75rem; font-weight: 600; }
.float-chip .s { font-size: 0.69rem; color: var(--subtle); }
.float-chip.ready { top: 40px; right: 0; }
.float-chip.sync { top: 190px; left: 0; }
.float-chip.action { bottom: 50px; right: -8px; max-width: 210px; background: var(--blue); border-color: var(--blue); color: #fff; box-shadow: var(--glow); flex-direction: column; align-items: flex-start; gap: 4px; }
.float-chip.action .k { font-size: 0.62rem; letter-spacing: 0.1em; text-transform: uppercase; color: rgb(255 255 255 / 70%); }
.float-chip.action .t { font-size: 0.8rem; line-height: 1.35; }
@media (prefers-reduced-motion: no-preference) {
  .float-y { animation: float-y 4s ease-in-out infinite; }
  .float-y.d1 { animation-delay: 0.3s; }
  .float-y.d2 { animation-delay: 0.7s; }
  .float-y.d3 { animation-delay: 1.1s; }
  .float-y.d4 { animation-delay: 1.5s; }
}
@keyframes float-y { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }

/* ---------- marketing: sections ---------- */
.section { padding: 112px 0; position: relative; }
.section.tint { background: var(--bg-tint); }
.section-head { max-width: 680px; margin-bottom: 56px; }
.section-head h2, .display { font-size: clamp(2.1rem, 1.5rem + 2.4vw, 3.4rem); line-height: 1.08; letter-spacing: -0.045em; margin-bottom: 18px; }
.section-head p { color: var(--muted); font-size: 1.05rem; max-width: 58ch; }

.platform { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 64px; align-items: center; }
.step-list { list-style: none; margin: 36px 0 0; padding: 0; display: grid; gap: 6px; }
.step-list button { display: flex; align-items: center; gap: 14px; width: 100%; padding: 8px 0; border: 0; background: none; font: inherit; font-size: 0.92rem; color: var(--faint); cursor: pointer; text-align: left; }
.step-list button .n { width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--line); display: grid; place-items: center; font-size: 0.7rem; font-weight: 600; }
.step-list button[aria-selected="true"] { color: var(--ink); font-weight: 600; }
.step-list button[aria-selected="true"] .n { border-color: var(--blue); color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); }
.feature-panel { min-height: 330px; padding: 30px; }
.feature-panel h3 { font-size: 1.35rem; letter-spacing: -0.03em; }
.feature-panel p { color: var(--muted); }
.feature-panel .status-row { display: flex; justify-content: space-between; align-items: center; margin-top: 40px; padding: 12px 16px; border: 1px solid var(--line); border-radius: 12px; font-size: 0.82rem; }
.live { display: inline-flex; align-items: center; gap: 6px; color: var(--emerald); font-weight: 600; }
.live::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
@media (prefers-reduced-motion: no-preference) {
  .live::before { animation: pulse-soft 1.8s ease-in-out infinite; }
  .feature-panel.is-entering { animation: panel-in 420ms cubic-bezier(0.2, 0.7, 0.2, 1); }
}
@keyframes pulse-soft { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }
@keyframes panel-in { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

.grid-4 { display: grid; gap: 24px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-3 { display: grid; gap: 24px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-2 { display: grid; gap: 20px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.card h3 { font-size: 1.15rem; letter-spacing: -0.02em; margin-bottom: 10px; }
.card p { color: var(--muted); font-size: 0.92rem; line-height: 1.6; margin: 0; }
.tag-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 16px; }
.tag { display: inline-block; padding: 4px 10px; border: 1px solid var(--line); border-radius: 8px; font-size: 0.72rem; font-weight: 500; color: var(--muted); }
.card-navy .tag { border-color: rgb(255 255 255 / 20%); color: rgb(255 255 255 / 80%); }

.method { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 64px; align-items: start; }
.method .display { margin-bottom: 22px; }
.method > div > p { color: var(--muted); font-size: 1.02rem; max-width: 52ch; }
.check-panel { margin-top: 30px; padding: 22px 24px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-tint); }
.check-panel .k { font-size: 0.7rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--faint); font-weight: 600; margin-bottom: 14px; }
.check-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.check-list li { position: relative; padding-left: 26px; font-size: 0.9rem; color: var(--text); }
.check-list li::before { content: ""; position: absolute; left: 0; top: 4px; width: 14px; height: 8px; border-left: 2px solid var(--blue); border-bottom: 2px solid var(--blue); transform: rotate(-45deg); }
.card-navy .check-list li { color: rgb(255 255 255 / 85%); }
.card-navy .check-list li::before { border-color: #6ee7b7; }

.step-card .n { font-size: 0.75rem; color: var(--faint); font-weight: 600; margin-bottom: 18px; }
.card-navy.step-card .n { color: rgb(255 255 255 / 55%); }
.code-pill { display: inline-flex; align-items: center; gap: 8px; margin-top: 26px; padding: 9px 14px; border: 1px solid var(--line); border-radius: 12px; font-size: 0.78rem; color: var(--muted); }
.card-navy .code-pill { border-color: rgb(255 255 255 / 20%); color: rgb(255 255 255 / 80%); background: rgb(255 255 255 / 6%); }
.ring-stat { display: flex; align-items: center; gap: 14px; margin-top: 26px; font-size: 0.78rem; color: var(--subtle); }
.ring { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; border: 4px solid var(--blue); font-size: 0.72rem; font-weight: 700; color: var(--blue); }

.faq { max-width: 860px; }
.faq details { border-bottom: 1px solid var(--line); padding: 24px 0; }
.faq summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 16px; font-weight: 600; font-size: 1.08rem; letter-spacing: -0.01em; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary svg { color: var(--faint); transition: transform 300ms cubic-bezier(0.4, 0, 0.2, 1); }
.faq details[open] summary svg { transform: rotate(45deg); }
.faq details p { color: var(--muted); font-size: 0.92rem; line-height: 1.65; margin: 14px 0 0; max-width: 70ch; }

.cta { background: var(--navy); color: #fff; overflow: hidden; }
.cta .container { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 48px; align-items: center; }
.cta h2 { color: #fff; font-size: clamp(2.2rem, 1.6rem + 2.4vw, 3.4rem); line-height: 1.08; letter-spacing: -0.04em; margin-bottom: 20px; }
.cta p { color: rgb(255 255 255 / 70%); font-size: 1.1rem; max-width: 34rem; margin-bottom: 32px; }
.orbit { position: relative; width: 300px; height: 300px; margin: 0 auto; }
.orbit .ring-o { position: absolute; inset: 0; border-radius: 50%; border: 1px solid rgb(255 255 255 / 14%); }
.orbit .ring-o.inner { inset: 50px; border-color: rgb(255 255 255 / 20%); }
.orbit .core { position: absolute; inset: 112px; border-radius: 50%; background: #fff; display: grid; place-items: center; box-shadow: 0 20px 50px rgb(0 0 0 / 30%); }
.orbit .core svg { width: 40px; height: 40px; }
.orbit .sat { position: absolute; width: 10px; height: 10px; border-radius: 50%; }
.orbit .spin { position: absolute; inset: 0; }
.orbit .spin.inner { inset: 50px; }
.orbit .spin .sat { top: -5px; left: calc(50% - 5px); background: #5b8cff; box-shadow: 0 0 14px #5b8cff; }
.orbit .spin.inner .sat { top: auto; bottom: 20px; left: 4px; background: #5dd9e8; box-shadow: 0 0 14px #5dd9e8; }
@media (prefers-reduced-motion: no-preference) {
  .orbit .spin { animation: orbit-spin 24s linear infinite; }
  .orbit .spin.inner { animation: orbit-spin 16s linear infinite reverse; }
}
@keyframes orbit-spin { to { transform: rotate(360deg); } }

.site-footer { border-top: 1px solid var(--line-soft); padding: 40px 0; }
.site-footer .container { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.site-footer p { margin: 0; font-size: 0.85rem; color: var(--faint); }

/* scroll reveal (class added by app.js only when IntersectionObserver exists) */
@media (prefers-reduced-motion: no-preference) {
  .js-reveal [data-reveal] { opacity: 0; transform: translateY(24px); transition: opacity 700ms cubic-bezier(0.2, 0.7, 0.2, 1), transform 700ms cubic-bezier(0.2, 0.7, 0.2, 1); }
  .js-reveal [data-reveal].is-visible { opacity: 1; transform: none; }
}

/* ---------- pricing & auth ---------- */
.plan .price { font-size: 2rem; font-weight: 650; letter-spacing: -0.04em; margin: 8px 0 18px; }
.plan .price span { font-size: 0.9rem; font-weight: 500; letter-spacing: 0; }
.plan .check-list { margin-bottom: 24px; }
.card-navy.plan .price span { color: rgb(255 255 255 / 60%); }
.auth-wrap { position: relative; display: grid; place-items: center; padding: 72px 20px 96px; min-height: calc(100vh - 200px); }
.auth-card { width: 100%; max-width: 440px; padding: 32px; box-shadow: var(--shadow-panel); }
.auth-card h1 { font-size: 2rem; }

/* ---------- app shell ---------- */
.app-layout { display: grid; grid-template-columns: 256px 1fr; min-height: 100vh; background: #f8fafc; }
.sidebar { background: #fff; border-right: 1px solid var(--line-soft); padding: 22px 16px; display: flex; flex-direction: column; gap: 18px; position: sticky; top: 0; height: 100vh; }
.sidebar nav { display: grid; gap: 2px; }
.side-link { display: block; padding: 9px 14px; border-radius: 12px; text-decoration: none; color: var(--muted); font-weight: 500; font-size: 0.92rem; }
.side-link:hover { background: #f1f5f9; color: var(--ink); }
.side-link[aria-current="page"] { background: var(--blue-soft); color: var(--blue-deep); font-weight: 600; }
.side-heading { margin: 14px 14px 4px; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--faint); font-weight: 600; }
.org-switch { margin: 0; }
.sidebar-foot { margin-top: auto; }
.app-main { padding: 32px clamp(16px, 3vw, 44px); max-width: 1120px; width: 100%; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 22px; }
.page-head h1 { margin: 0; }
.section-title { margin: 28px 0 14px; }

.checklist { list-style: none; padding: 0; margin: 0; display: grid; gap: 16px; }
.checklist-item { display: grid; grid-template-columns: 30px 1fr; gap: 12px; align-items: start; }
.checklist-item .check { width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--line); display: grid; place-items: center; font-size: 0.8rem; font-weight: 700; color: var(--faint); }
.checklist-item.done .check { background: var(--blue); border-color: var(--blue); color: #fff; box-shadow: 0 6px 16px rgb(37 84 244 / 30%); }
.checklist-title { font-weight: 600; margin: 2px 0 2px; }
.checklist-item.done .checklist-title { color: var(--subtle); }
.checklist-item .muted { margin-bottom: 8px; }

.kpi-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.kpi { background: #fff; border: 1px solid var(--line-soft); border-radius: 18px; padding: 18px 20px; box-shadow: 0 8px 24px rgb(2 6 23 / 4%); }
.kpi-label { color: var(--subtle); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; font-weight: 600; margin: 0 0 8px; }
.kpi-value { font-size: 1.8rem; font-weight: 650; letter-spacing: -0.03em; margin: 0 0 4px; font-variant-numeric: tabular-nums; }
.kpi .small { margin: 0; }

.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px 24px; margin: 14px 0; }
.facts dt { color: var(--faint); font-size: 0.7rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; }
.facts dd { margin: 3px 0 0; font-weight: 500; }
.inline-form { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.inline-form label { flex: 1 1 260px; margin: 0; }
.inline-form [data-form-error] { flex-basis: 100%; }
.invite-form { display: grid; grid-template-columns: 1fr 1fr auto; gap: 12px; align-items: end; }
.invite-form label { margin: 0; }
.invite-form [data-form-error] { grid-column: 1 / -1; }
.form-card { max-width: 540px; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
th { text-align: left; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--faint); font-weight: 600; padding: 8px 12px; border-bottom: 1px solid var(--line); }
td { padding: 13px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
td select { min-height: 36px; width: auto; }
.status { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 0.78rem; font-weight: 600; text-transform: capitalize; background: #f1f5f9; }
.status-connected { background: var(--success-soft); color: var(--success); }
.status-needs_reauth { background: var(--danger-soft); color: #b91c1c; }

/* ---------- responsive ---------- */
@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero-layout, .platform, .method, .cta .container { grid-template-columns: 1fr; }
  .hero-layout { padding: 56px 0 64px; gap: 56px; }
  .hero-visual { min-height: 480px; }
}
@media (max-width: 820px) {
  .landing-nav .links { display: none; }
  .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .section { padding: 80px 0; }
  .app-layout { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; border-right: 0; border-bottom: 1px solid var(--line-soft); gap: 12px; }
  .sidebar nav { display: flex; flex-wrap: wrap; gap: 4px; }
  .side-heading { display: none; }
  .sidebar-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
  .sidebar-foot p { margin: 0; }
  .invite-form { grid-template-columns: 1fr; }
  .hide-sm { display: none; }
}
@media (max-width: 640px) {
  .site-header { padding: 12px 10px 6px; }
  .landing-nav { padding: 0 8px 0 14px; height: 58px; }
  .landing-nav .button { min-height: 38px; padding: 0 13px; font-size: 0.82rem; }
  .grid-4 { grid-template-columns: 1fr; }
  .hero-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
  .hero-stats .divider { display: none; }
  .hero-stats .stat-value { font-size: 1.2rem; }
  .hero-visual { min-height: 0; padding: 70px 0 60px; }
  .mock-card { width: calc(100% - 24px); padding: 20px; }
  .float-chip.ready { top: 0; right: 4px; }
  .float-chip.sync { top: auto; bottom: 8px; left: 4px; }
  .float-chip.action { display: none; }
  .frame::before, .frame::after, .cross { display: none; }
  .orbit { width: 220px; height: 220px; }
  .orbit .core { inset: 78px; }
  .orbit .spin.inner, .orbit .ring-o.inner { inset: 36px; }
}
@media (max-width: 400px) {
  .landing-nav .brand span { display: none; }
}

/* pricing */
.hero-layout-simple { position: relative; z-index: 2; padding: 96px 0 48px; max-width: 760px; }
.hero-layout-simple h1 { margin: 26px 0 18px; }
.pricing-grid { position: relative; z-index: 2; max-width: 940px; padding-bottom: 112px; }
.auth-hero { min-height: calc(100vh - 120px); }
.auth-wrap { z-index: 2; }

/* Navy cards: beat the generic `.card p` rule declared after them. */
.card.card-navy p, .card.card-navy li { color: rgb(255 255 255 / 74%); }
.card.card-navy h2, .card.card-navy h3 { color: #fff; }
.card.card-navy .eyebrow { color: #93b4ff; }

@media (max-width: 640px) {
  /* Turnstile's widget is a fixed 300px; leave room for it inside the card. */
  .auth-wrap { padding: 40px 12px 64px; }
  .auth-card { padding: 24px 18px; }
  .auth-card h1 { font-size: 1.7rem; }
  .float-chip.sync { bottom: 52px; }
  .mock-caption { bottom: 14px; }
}

/* ---------- app: sidebar navigation ---------- */
.sidebar { overflow-y: auto; gap: 14px; }
.sidebar-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.sidebar-body { display: flex; flex-direction: column; gap: 16px; flex: 1; min-height: 0; }
.menu-toggle { display: none; width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 12px; background: #fff; color: var(--ink); cursor: pointer; place-items: center; }
.side-nav { display: grid; gap: 2px; }
.side-link { display: flex; align-items: center; gap: 11px; }
.side-link svg { width: 17px; height: 17px; color: var(--faint); }
.side-link:hover svg { color: var(--muted); }
.side-link[aria-current="page"] svg { color: var(--blue); }
.side-heading:first-child { margin-top: 4px; }
.sidebar-foot { display: grid; gap: 10px; padding-top: 14px; border-top: 1px solid var(--line-soft); }
.side-user { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); padding: 6px; border-radius: 12px; }
.side-user:hover { background: #f1f5f9; color: var(--ink); }
.side-user > span:last-child { display: grid; line-height: 1.3; font-size: 0.88rem; min-width: 0; }
.side-user strong { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--navy); color: #fff; display: grid; place-items: center; font-size: 0.75rem; font-weight: 700; flex: none; }
.sidebar-foot .button { justify-content: flex-start; }

/* ---------- app: feature pages ---------- */
.page-intro { margin: 6px 0 0; max-width: 62ch; }
.section-gap { margin-top: 20px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; }
.toolbar select { flex: 0 1 170px; width: auto; min-width: 0; }
.search-field { position: relative; flex: 1 1 260px; margin: 0; }
.search-field.grow { flex: 3 1 320px; }
.search-field svg { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--faint); width: 16px; height: 16px; }
.search-field input { padding-left: 38px; }
input:disabled, select:disabled { background: #f8fafc; color: var(--faint); cursor: not-allowed; }
.status-tabs { display: flex; gap: 4px; overflow-x: auto; margin: -4px 0 16px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.status-tabs button { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border: 0; border-radius: 999px; background: none; font: inherit; font-size: 0.86rem; font-weight: 500; color: var(--muted); white-space: nowrap; }
.status-tabs button[aria-selected="true"] { background: var(--blue-soft); color: var(--blue-deep); font-weight: 600; }
.status-tabs .count { font-size: 0.72rem; padding: 0 7px; border-radius: 999px; background: #f1f5f9; color: var(--subtle); }
.table-empty { padding: 0 !important; }
.empty-state { text-align: center; padding: 48px 24px; max-width: 520px; margin: 0 auto; }
.empty-state .icon-tile { margin: 0 auto 16px; }
.empty-state h2 { font-size: 1.15rem; }
.empty-state p { font-size: 0.92rem; }
.empty-state .button { margin-top: 6px; }
.panel > .empty-state, main > .empty-state { background: #fff; border: 1px dashed var(--line); border-radius: var(--radius); max-width: none; }
.chart-placeholder { height: 220px; border-radius: 14px; display: grid; place-items: center; font-size: 0.9rem;
  background: repeating-linear-gradient(0deg, transparent 0 43px, var(--line-soft) 43px 44px), linear-gradient(180deg, #f8faff, #fff); }
.legend { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.legend .muted { flex-basis: 100%; margin-top: 4px; }
.label-pill { display: inline-flex; padding: 3px 10px; border-radius: 999px; font-size: 0.74rem; font-weight: 600; }
.label-pill.observed { background: var(--success-soft); color: var(--success); }
.label-pill.estimated { background: var(--amber-soft); color: #b45309; }
.label-pill.unavailable { background: #f1f5f9; color: var(--subtle); }
.feature-list { list-style: none; margin: 8px 0 16px; padding: 0; display: grid; gap: 14px; }
.feature-list li { display: flex; gap: 12px; align-items: flex-start; }
.feature-list .t { font-weight: 600; margin: 2px 0 0; }
.feature-list .muted { margin: 0; }
.report-grid .card { padding: 22px; }
.report-button { margin-top: 16px; }
.range-select { width: auto; }

@media (max-width: 1100px) { .report-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 820px) {
  .sidebar { padding: 12px 16px; gap: 0; overflow: visible; }
  .menu-toggle { display: grid; }
  .sidebar-body { display: none; padding-top: 14px; }
  .sidebar.is-open .sidebar-body { display: flex; }
  .sidebar nav.side-nav { display: grid; }
  .side-heading { display: block; }
  .sidebar-foot { display: grid; }
  .report-grid { grid-template-columns: 1fr; }
}

/* Let the main column shrink below its content's natural width (tables scroll inside .table-wrap). */
.app-main { min-width: 0; }
.kpi-grid { grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr)); }
@media (max-width: 820px) {
  .app-layout { grid-template-columns: minmax(0, 1fr); }
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpi { padding: 14px; }
  .kpi-value { font-size: 1.4rem; }
  .panel { padding: 18px 16px; }
  .toolbar select { flex: 1 1 140px; }
}

/* ---------- language switch ---------- */
.lang-switch { display: inline-flex; padding: 3px; border: 1px solid var(--line); border-radius: 999px; background: #fff; flex: none; }
.lang-switch button { min-width: 36px; height: 30px; padding: 0 10px; border: 0; border-radius: 999px; background: none; font: inherit; font-size: 0.75rem; font-weight: 650; letter-spacing: 0.04em; color: var(--subtle); cursor: pointer; }
.lang-switch button:hover { color: var(--ink); }
.lang-switch button[aria-pressed="true"] { background: var(--navy); color: #fff; }
.landing-nav .actions .lang-switch { margin-right: 4px; }
.foot-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.foot-row .button { justify-content: center; }
.facts dd .lang-switch { margin-top: 4px; }
@media (max-width: 640px) {
  .landing-nav .nav-signin { display: none; }
  .lang-switch button { min-width: 30px; padding: 0 7px; height: 28px; }
}

/* ---------- live data components ---------- */
.notice { display: flex; gap: 10px; align-items: flex-start; padding: 12px 16px; margin-bottom: 16px; border-radius: 14px; background: #fff7ed; border: 1px solid #fed7aa; color: #9a3412; font-size: 0.88rem; }
.notice p { margin: 0; }
.notice svg { margin-top: 2px; }
.notice.info { background: var(--blue-soft); border-color: #c7d7fe; color: var(--blue-deep); align-items: center; }
.spinner { width: 16px; height: 16px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; flex: none; }
@media (prefers-reduced-motion: no-preference) { .spinner { animation: spin 0.9s linear infinite; } }
@keyframes spin { to { transform: rotate(360deg); } }

.kpi-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin: 0; }
.delta-pill { display: inline-flex; padding: 1px 8px; border-radius: 999px; font-size: 0.75rem; font-weight: 650; font-variant-numeric: tabular-nums; }
.delta-pill.up { background: var(--success-soft); color: var(--success); }
.delta-pill.down { background: var(--danger-soft); color: #b91c1c; }
.delta-pill.neutral { background: #f1f5f9; color: var(--subtle); }
.kpi.tone-warn .kpi-value { color: #b45309; }
.kpi.tone-bad .kpi-value { color: #b91c1c; }

.dash-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 18px; margin-top: 18px; align-items: start; }
.dash-grid > .panel { margin-bottom: 0; }
.dash-grid + .muted { margin-top: 16px; }
.panel-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 12px; }
.panel-head h2 { margin: 0; }

.chart { width: 100%; height: auto; display: block; }
.chart-bar { fill: var(--blue); opacity: 0.85; }
.chart-bar:hover { opacity: 1; fill: var(--blue-deep); }
.chart-axis { stroke: var(--line); }
.chart-label { font-size: 11px; fill: var(--faint); font-family: var(--font); }

.top-list { list-style: none; counter-reset: top; margin: 0; padding: 0; display: grid; gap: 4px; }
.top-list li { counter-increment: top; display: grid; grid-template-columns: 24px 1fr auto; grid-template-areas: "n name value" "n sold value"; column-gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line-soft); }
.top-list li:last-child { border-bottom: 0; }
.top-list li::before { content: counter(top); grid-area: n; width: 24px; height: 24px; border-radius: 8px; background: var(--blue-soft); color: var(--blue-deep); font-size: 0.75rem; font-weight: 700; display: grid; place-items: center; }
.top-list .name { grid-area: name; font-weight: 600; font-size: 0.9rem; }
.top-list .muted { grid-area: sold; }
.top-list .value { grid-area: value; align-self: center; font-weight: 650; font-variant-numeric: tabular-nums; }

.ship-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.ship-stat { display: grid; gap: 2px; padding: 14px; border-radius: 14px; background: #f8fafc; border: 1px solid var(--line-soft); }
.ship-stat .n { font-size: 1.6rem; font-weight: 650; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.ship-stat.warn .n { color: #b45309; }
.ship-stat.bad .n { color: #b91c1c; }

.alert-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.alert-list li { display: flex; align-items: center; gap: 12px; padding: 10px 4px; border-bottom: 1px solid var(--line-soft); }
.alert-list li:last-child { border-bottom: 0; }
.alert-list li > div { flex: 1; min-width: 0; }
.alert-list .t { margin: 0; font-weight: 550; font-size: 0.9rem; }
.alert-list .muted { margin: 2px 0 0; }
.alert-list.compact li { font-size: 0.88rem; padding: 8px 0; }
.alert-list li.resolved .t { color: var(--subtle); text-decoration: line-through; text-decoration-color: var(--faint); }
.dot-icon.red { background: var(--danger-soft); color: #b91c1c; }
.count-badge { display: inline-grid; place-items: center; min-width: 24px; height: 22px; padding: 0 7px; border-radius: 999px; background: var(--danger-soft); color: #b91c1c; font-size: 0.75rem; vertical-align: middle; }

.status-pill { display: inline-flex; align-items: center; padding: 2px 10px; border-radius: 999px; font-size: 0.76rem; font-weight: 600; white-space: nowrap; background: #f1f5f9; color: var(--muted); }
.status-pill.ok { background: var(--success-soft); color: var(--success); }
.status-pill.warn { background: var(--amber-soft); color: #b45309; }
.status-pill.bad { background: var(--danger-soft); color: #b91c1c; }

.status-tabs a.status-tab { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 999px; font-size: 0.86rem; font-weight: 500; color: var(--muted); text-decoration: none; white-space: nowrap; }
.status-tabs a.status-tab:hover { background: #f1f5f9; color: var(--ink); }
.status-tabs a.status-tab[aria-current="page"] { background: var(--blue-soft); color: var(--blue-deep); font-weight: 600; }
.toolbar input:not([type="hidden"]) { min-width: 0; }
.toolbar .button { flex: none; }
.inline-filters { display: flex; gap: 8px; flex-wrap: wrap; }
.inline-filters select { width: auto; }

td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: 0; }
.text-bad { color: #b91c1c; font-weight: 600; }
.text-warn { color: #b45309; font-weight: 600; }
tr.clickable { cursor: pointer; }
tr.clickable:hover td { background: #f8fafc; }
tr.clickable:focus-visible { outline: 3px solid var(--blue); outline-offset: -3px; }
tr.detail-row td { background: #f8fafc; }
.order-detail { padding: 6px 4px; }
table.inner { margin-bottom: 8px; background: #fff; border-radius: 12px; }
table.inner th, table.inner td { padding: 8px 10px; }
.table-note { padding: 24px 4px; margin: 0; }
.load-more { display: flex; justify-content: center; padding-top: 16px; }

.shop-list { display: grid; gap: 14px; }
.shop-card { border: 1px solid var(--line); border-radius: 16px; padding: 16px 18px; }
.shop-main { display: flex; align-items: center; gap: 14px; }
.shop-main > div { flex: 1; min-width: 0; }
.shop-main h3 { margin: 0 0 2px; font-size: 1rem; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.shop-main p { margin: 0; }
.shop-logo { width: 40px; height: 40px; border-radius: 12px; background: #ee4d2d; color: #fff; display: grid; place-items: center; font-weight: 800; flex: none; }
.badge.sim { background: #fff7ed; color: #c2410c; }
.shop-facts { display: flex; gap: 28px; margin: 14px 0; flex-wrap: wrap; }
.shop-facts dt { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--faint); font-weight: 600; }
.shop-facts dd { margin: 2px 0 0; font-weight: 600; }
.shop-actions { display: flex; gap: 8px; flex-wrap: wrap; }

@media (max-width: 1100px) { .dash-grid { grid-template-columns: 1fr; } }
@media (max-width: 640px) {
  .ship-stats { grid-template-columns: 1fr; }
  .shop-main { flex-wrap: wrap; }
}
