/* Quantamatica landing — dark fintech, minimalist */

:root {
  --bg: #0a0c10;
  --bg2: #0d1117;
  --text: #e6edf3;
  --muted: #6b7280;
  --blue: #63b3ed;
  --green: #22d3a5;
  --red: #e53e3e;
  --border: rgba(99, 179, 237, 0.18);
  --mono: 'JetBrains Mono', ui-monospace, monospace;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", Inter, system-ui, sans-serif;
  --display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", Inter, system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body.landing {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Headers: SF Pro Display */
body.landing h1,
body.landing h2,
body.landing h3,
body.landing h4,
body.landing h5,
body.landing h6 {
  font-family: var(--display);
}

a {
  color: var(--blue);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* ── Top nav ───────────────────────────────────────────────── */
.top-nav {
  position: absolute;
  top: calc(18px + env(safe-area-inset-top, 0px));
  left: calc(18px + env(safe-area-inset-left, 0px));
  right: calc(18px + env(safe-area-inset-right, 0px));
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(13, 17, 23, 0.45);
  border: 1px solid rgba(99, 179, 237, 0.16);
  backdrop-filter: blur(14px);
}

.top-nav-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.top-nav-brand svg {
  width: 24px;
  height: 24px;
  filter: drop-shadow(0 0 12px rgba(99, 179, 237, 0.22));
}

.top-nav-links {
  display: flex;
  align-items: center;
  gap: 16px;
  color: var(--muted);
  font-size: 12px;
}

/* Topics dropdown (homepage D10) — desktop nav */
.top-nav-dropdown {
  position: relative;
}
.top-nav-dropdown-btn {
  background: transparent;
  border: none;
  color: inherit;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  padding: 6px 0;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.top-nav-dropdown-btn::after {
  content: "";
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid var(--muted);
  opacity: 0.85;
}
.top-nav-dropdown-btn:hover,
.top-nav-dropdown-btn[aria-expanded="true"] {
  color: var(--text);
}
.top-nav-dropdown-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 220px;
  padding: 8px 0;
  background: rgba(22, 27, 39, 0.98);
  border: 1px solid rgba(48, 54, 61, 0.85);
  border-radius: 10px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
  z-index: 80;
}
.top-nav-dropdown-panel[hidden] {
  display: none !important;
}
.top-nav-dropdown-panel a {
  display: block;
  padding: 10px 16px;
  color: var(--text);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-transform: none;
  line-height: 1.35;
}
.top-nav-dropdown-panel a:hover {
  background: rgba(99, 179, 237, 0.1);
  color: var(--blue);
}
.top-nav-links a {
  color: rgba(230, 237, 243, 0.8);
  text-decoration: none;
  font-family: var(--display);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.top-nav-links a:hover {
  color: var(--blue);
  text-decoration: none;
}

.top-nav-auth {
  display: flex;
  align-items: center;
  gap: 10px;
}
.top-nav-auth-link {
  color: rgba(230, 237, 243, 0.75);
  font-family: var(--display);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border: 1px solid rgba(48, 54, 61, 0.75);
  padding: 7px 10px;
  border-radius: 10px;
}
.top-nav-auth-link:hover {
  color: var(--text);
  border-color: rgba(99, 179, 237, 0.28);
  text-decoration: none;
}
.top-nav-auth-cta {
  color: var(--blue);
  font-family: var(--display);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: rgba(99, 179, 237, 0.14);
  border: 1px solid rgba(99, 179, 237, 0.38);
  padding: 7px 10px;
  border-radius: 10px;
}
.top-nav-auth-cta:hover {
  filter: brightness(1.08);
  text-decoration: none;
}

.top-nav-refresh {
  display: none;
}
.top-nav-toggle {
  display: none;
  width: 38px;
  height: 34px;
  border-radius: 10px;
  background: rgba(13, 17, 23, 0.35);
  border: 1px solid rgba(48, 54, 61, 0.75);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.top-nav-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  background: rgba(230, 237, 243, 0.75);
  border-radius: 2px;
  position: relative;
}
.top-nav-toggle span::before,
.top-nav-toggle span::after {
  content: '';
  position: absolute;
  left: 0;
  width: 18px;
  height: 2px;
  background: rgba(230, 237, 243, 0.75);
  border-radius: 2px;
}
.top-nav-toggle span::before { top: -6px; }
.top-nav-toggle span::after { top: 6px; }

html.nav-open .top-nav-toggle span {
  background: transparent;
}
html.nav-open .top-nav-toggle span::before {
  top: 0;
  transform: rotate(45deg);
}
html.nav-open .top-nav-toggle span::after {
  top: 0;
  transform: rotate(-45deg);
}

.nav-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(2px);
}
html.nav-open .nav-overlay { display: block; }

.nav-drawer {
  position: absolute;
  right: calc(12px + env(safe-area-inset-right, 0px));
  top: calc(62px + env(safe-area-inset-top, 0px));
  width: min(92vw, 360px);
  background: rgba(22, 27, 39, 0.92);
  border: 1px solid rgba(99, 179, 237, 0.18);
  border-radius: 14px;
  padding: 14px;
  box-shadow: 0 16px 60px rgba(0,0,0,0.55);
}
.nav-drawer a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 12px;
  border-radius: 10px;
  text-decoration: none;
  color: rgba(230, 237, 243, 0.9);
  border: 1px solid rgba(48, 54, 61, 0.55);
  background: rgba(13, 17, 23, 0.35);
  font-family: var(--display);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 10px;
}
.nav-drawer a:hover {
  border-color: rgba(99, 179, 237, 0.28);
  color: var(--blue);
}
.nav-drawer .nav-auth {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 4px;
}
.nav-drawer .nav-auth a {
  margin-bottom: 0;
  justify-content: center;
}
.nav-drawer .nav-auth a.primary {
  background: rgba(99, 179, 237, 0.16);
  border-color: rgba(99, 179, 237, 0.35);
  color: var(--blue);
}

.pricing-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 10010;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(8, 12, 18, 0.75);
  backdrop-filter: blur(8px);
}
.pricing-modal-overlay[hidden] {
  display: none !important;
  visibility: hidden;
  pointer-events: none;
}
.pricing-modal {
  width: min(92vw, 460px);
  max-width: 460px;
  padding: 28px 26px;
  border-radius: 24px;
  background: rgba(13, 17, 23, 0.98);
  border: 1px solid rgba(99, 179, 237, 0.24);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.55);
  position: relative;
}
.pricing-modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(99, 179, 237, 0.18);
  border-radius: 14px;
  background: rgba(13, 17, 23, 0.9);
  color: var(--text);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}
.pricing-modal-close:hover {
  border-color: rgba(99, 179, 237, 0.4);
}
.pricing-modal h2 {
  margin: 0 0 16px;
  font-size: 1.25rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text);
}
.pricing-modal-copy,
.pricing-modal-note {
  margin: 0;
  color: rgba(230, 237, 243, 0.88);
  font-size: 0.95rem;
  line-height: 1.8;
}
.pricing-modal-copy {
  margin-bottom: 16px;
}
.pricing-modal-note {
  margin-bottom: 22px;
  color: var(--muted);
}
.pricing-modal-footer {
  text-align: right;
}
.pricing-modal-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 18px;
  border-radius: 999px;
  background: rgba(99, 179, 237, 0.18);
  border: 1px solid rgba(99, 179, 237, 0.35);
  color: var(--blue);
  font-family: var(--display);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.pricing-modal-cta:hover {
  background: rgba(99, 179, 237, 0.28);
}

/* ── Hero: space stage ─────────────────────────────────────── */
.hero-stage {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  /* Prevent clipping on short viewports / iOS browser chrome */
  padding-top: calc(82px + env(safe-area-inset-top, 0px));
  padding-bottom: calc(22px + env(safe-area-inset-bottom, 0px));
}

#space-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.hero-vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse 80% 70% at 50% 45%, transparent 0%, rgba(10, 12, 16, 0.4) 55%, var(--bg) 100%);
  z-index: 1;
}

/* Rocket + ticker trail (DOM layer on top of canvas) */
.rocket-layer {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  overflow: hidden;
}

.rocket-svg {
  position: absolute;
  width: min(28vw, 200px);
  height: auto;
  left: 50%;
  top: 42%;
  transform: translate(-50%, -50%) rotate(-35deg);
  filter: drop-shadow(0 0 24px rgba(99, 179, 237, 0.35));
  animation: rocket-drift 14s ease-in-out infinite;
}

@keyframes rocket-drift {
  0%,
  100% {
    transform: translate(-48%, -52%) rotate(-33deg);
  }
  50% {
    transform: translate(-52%, -48%) rotate(-38deg);
  }
}

.ticker-trail {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 140%;
  height: 120px;
  transform: translate(-35%, -20%) rotate(-28deg);
  opacity: 0.85;
  mask-image: linear-gradient(90deg, transparent 0%, #000 15%, #000 85%, transparent 100%);
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 15%, #000 85%, transparent 100%);
}

.ticker-trail-inner {
  display: flex;
  gap: 2rem;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  white-space: nowrap;
  animation: trail-scroll 38s linear infinite;
  color: rgba(99, 179, 237, 0.75);
}

.ticker-trail-inner span.up {
  color: var(--green);
}
.ticker-trail-inner span.down {
  color: var(--red);
}

@keyframes trail-scroll {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-50%);
  }
}

.hero-content {
  position: relative;
  z-index: 10;
  width: min(92vw, 1000px);
  max-width: 1000px;
  padding: 24px 18px;
  pointer-events: auto;
}

@media (max-height: 720px) {
  .hero-stage {
    align-items: flex-start;
  }
  .hero-content {
    padding-top: 10px;
    padding-bottom: 10px;
  }
}

/* ── Brand hero (landing: no default CTA card) ───────────────── */
.brand-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 54vh;
  user-select: none;
}
.brand-hero-row {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 16px 18px;
  border-radius: 18px;
  border: 1px solid rgba(99, 179, 237, 0.18);
  background: rgba(13, 17, 23, 0.35);
  backdrop-filter: blur(14px);
  box-shadow: 0 22px 70px rgba(0,0,0,0.55);
}
.brand-hero-logo {
  width: 84px;
  height: 84px;
  border-radius: 18px;
  box-shadow: 0 0 0 1px rgba(99, 179, 237, 0.16), 0 18px 50px rgba(0,0,0,0.5);
}
.brand-hero-wordmark {
  font-family: var(--display);
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: clamp(26px, 5.4vw, 58px);
  line-height: 1;
  color: rgba(230, 237, 243, 0.96);
  text-shadow: 0 0 40px rgba(99, 179, 237, 0.12);
}
.brand-hero-sub {
  margin-top: 14px;
  font-family: var(--font);
  font-size: 14px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(230, 237, 243, 0.72);
}

/* ── Login card ─────────────────────────────────────────────── */
.login-card {
  background: rgba(22, 27, 39, 0.82);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px 26px 24px;
  backdrop-filter: blur(16px);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.login-brand {
  text-align: center;
  margin-bottom: 20px;
}

.login-brand svg {
  width: 40px;
  height: 40px;
  margin-bottom: 10px;
}

.login-brand h1 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.login-brand p {
  margin: 6px 0 0;
  font-size: 12px;
  color: var(--muted);
}

.auth-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 18px;
  padding: 4px;
  background: rgba(13, 17, 23, 0.9);
  border-radius: 10px;
  border: 1px solid rgba(48, 54, 61, 0.6);
}

.auth-tabs button {
  flex: 1;
  padding: 8px 10px;
  font-size: 11px;
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.auth-tabs button.active {
  background: rgba(99, 179, 237, 0.12);
  color: var(--blue);
}

.auth-panel {
  display: none;
}
.auth-panel.active {
  display: block;
}

.signin-wrap .mfa-panel {
  margin-top: 0;
}

.field {
  margin-bottom: 14px;
}

.field label {
  display: block;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 6px;
  font-family: var(--mono);
}

.field input {
  width: 100%;
  padding: 11px 12px;
  border-radius: 8px;
  border: 1px solid rgba(48, 54, 61, 0.9);
  background: var(--bg2);
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  outline: none;
}
.field input:focus {
  border-color: rgba(99, 179, 237, 0.45);
}

.pw-wrap {
  position: relative;
}
.pw-wrap input {
  padding-right: 44px;
}
.pw-toggle {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid rgba(48, 54, 61, 0.75);
  background: rgba(13, 17, 23, 0.35);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: rgba(230, 237, 243, 0.72);
  transition: border-color 0.12s, color 0.12s, filter 0.12s;
}
.pw-toggle:hover {
  border-color: rgba(99, 179, 237, 0.35);
  color: var(--blue);
}
.pw-toggle:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(99, 179, 237, 0.15);
}
.pw-rule {
  font-size: 11px;
  color: var(--muted);
  font-family: var(--font);
  display: flex;
  align-items: center;
  gap: 7px;
  transition: color 0.2s;
}
.pw-rule-icon {
  font-size: 12px;
  width: 14px;
  text-align: center;
  flex-shrink: 0;
}
.pw-rule.met {
  color: var(--green);
}
.pw-rule.fail {
  color: var(--red);
}

.pw-toggle svg {
  width: 16px;
  height: 16px;
  display: block;
}

.field-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 8px;
}

.checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
  cursor: pointer;
  user-select: none;
}
.checkbox input {
  width: auto;
  accent-color: var(--blue);
}

.btn-primary {
  width: 100%;
  margin-top: 8px;
  padding: 12px 16px;
  border: none;
  border-radius: 10px;
  background: linear-gradient(165deg, rgba(99, 179, 237, 0.25), rgba(99, 179, 237, 0.1));
  border: 1px solid rgba(99, 179, 237, 0.35);
  color: var(--blue);
  font-size: 13px;
  font-weight: 600;
  font-family: var(--mono);
  cursor: pointer;
  transition: filter 0.15s, transform 0.1s;
}
.btn-primary:hover:not(:disabled) {
  filter: brightness(1.08);
}
.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-ghost {
  width: 100%;
  margin-top: 10px;
  padding: 10px;
  background: transparent;
  border: 1px solid rgba(48, 54, 61, 0.8);
  border-radius: 8px;
  color: var(--muted);
  font-size: 12px;
  font-family: var(--mono);
  cursor: pointer;
}
.btn-ghost:hover {
  border-color: var(--muted);
  color: var(--text);
}

.auth-msg {
  font-size: 12px;
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  line-height: 1.4;
}
.auth-msg.error {
  background: rgba(229, 62, 62, 0.1);
  border: 1px solid rgba(229, 62, 62, 0.25);
  color: #fca5a5;
}
.auth-msg.success {
  background: rgba(34, 211, 165, 0.08);
  border: 1px solid rgba(34, 211, 165, 0.22);
  color: var(--green);
}
.auth-msg.info {
  background: rgba(99, 179, 237, 0.08);
  border: 1px solid rgba(99, 179, 237, 0.2);
  color: var(--blue);
}

.mfa-panel {
  display: none;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid rgba(48, 54, 61, 0.6);
}
.mfa-panel.visible {
  display: block;
}

.mfa-panel h3 {
  margin: 0 0 10px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  font-weight: 600;
}

.alt-mfa {
  margin-top: 12px;
  font-size: 11px;
  color: var(--muted);
  line-height: 1.5;
}

/* MFA panel redesign */
.mfa-method {
  padding: 12px 14px;
  border-radius: 10px;
  background: rgba(99,179,237,0.06);
  border: 1px solid rgba(99,179,237,0.14);
}
.mfa-method-header {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
  font-weight: 700;
  color: rgba(99,179,237,0.9);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 6px;
}
.mfa-method-desc {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.55;
}
.mfa-send-link-btn {
  margin-top: 10px !important;
}
.mfa-or {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 14px 0;
  font-size: 10px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.mfa-or::before,
.mfa-or::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(48,54,61,0.8);
}

/* Passkey / biometric button */
.passkey-btn {
  background: linear-gradient(135deg, rgba(99,179,237,0.18) 0%, rgba(34,211,165,0.12) 100%);
  border: 1px solid rgba(99,179,237,0.4);
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 12px;
}
.passkey-btn:hover:not(:disabled) {
  background: linear-gradient(135deg, rgba(99,179,237,0.28) 0%, rgba(34,211,165,0.20) 100%);
  border-color: rgba(99,179,237,0.7);
}

.skip-row {
  margin-top: 16px;
  text-align: center;
  font-size: 12px;
  color: var(--muted);
}

.dev-banner {
  margin-top: 14px;
  padding: 10px;
  font-size: 11px;
  color: var(--muted);
  border: 1px dashed rgba(107, 114, 128, 0.4);
  border-radius: 8px;
  text-align: center;
}

/* ── Narrative (white section + unfurl) ─────────────────────── */
.narrative {
  background: #ffffff;
  color: #000000;
  padding: 92px 0 78px;
}
.narrative-grid {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 34px;
  align-items: start;
}
.narrative-wrap {
  max-width: none;
  margin: 0;
  padding: 0;
}
.narrative-line {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", Inter, system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.75;
  color: #0b0f18;
  letter-spacing: 0.002em;
  font-weight: 600;
  margin: 0 0 18px;
  max-width: 92ch;
  text-rendering: geometricPrecision;
  font-kerning: normal;
  opacity: 0;
  transform: translateY(12px);
  filter: blur(2px);
  transition: opacity 700ms ease, transform 700ms ease, filter 700ms ease;
  position: relative;
  overflow: hidden;
}
.narrative-line::after {
  content: '';
  position: absolute;
  left: -20%;
  top: 0;
  bottom: 0;
  width: 60%;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.88) 35%, transparent 70%);
  transform: translateX(-120%);
}
.narrative-line.reveal {
  opacity: 1;
  transform: translateY(0);
  filter: blur(0);
}
.narrative-line.reveal::after {
  animation: unfurl-sheen 1200ms ease forwards;
}
@keyframes unfurl-sheen {
  0% { transform: translateX(-120%); }
  100% { transform: translateX(260%); }
}

.narrative-finale {
  margin-top: 18px;
  padding-top: 22px;
  border-top: 1px solid rgba(17, 24, 39, 0.14);
  display: none;
}
.narrative-wrap.done .narrative-finale {
  display: block;
  animation: finale-in 700ms ease forwards;
}
@keyframes finale-in {
  0% { opacity: 0; transform: translateY(10px); }
  100% { opacity: 1; transform: translateY(0); }
}
.finale-title {
  font-family: var(--display);
  color: #000000;
  font-size: 17px;
  line-height: 1.75;
  margin-bottom: 14px;
  font-weight: 600;
}
.finale-list {
  display: grid;
  gap: 6px;
  font-family: var(--display);
  color: #000000;
  font-size: 17px;
  font-weight: 600;
  line-height: 1.75;
  letter-spacing: normal;
  text-transform: none;
}

.narrative-graphic {
  position: sticky;
  top: 92px;
  align-self: start;
}
.narrative-graphic img {
  width: 100%;
  height: auto;
  aspect-ratio: 1200 / 760;
  object-fit: cover;
  object-position: center;
  display: block;
  border-radius: 18px;
  border: 1px solid rgba(17, 24, 39, 0.10);
  box-shadow: 0 18px 60px rgba(0,0,0,0.10);
}

@media (max-width: 900px) {
  .narrative-grid {
    grid-template-columns: 1fr;
    gap: 18px;
  }
  .narrative-graphic {
    position: relative;
    top: auto;
    order: 2;
  }
}

/* ── Homepage topics (D10) ─────────────────────────────────── */
.landing-d10 {
  max-width: 960px;
  margin: 0 auto;
  padding: 28px 24px 48px;
  border-top: 1px solid rgba(48, 54, 61, 0.35);
}
.landing-d10-inner {
  max-width: 720px;
}
.landing-d10 h2 {
  font-size: 1.15rem;
  font-weight: 600;
  margin: 0 0 10px;
  letter-spacing: -0.02em;
  color: var(--text);
}
.landing-d10-intro {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
  margin: 0 0 28px;
  max-width: 62ch;
}
.landing-d10-grid {
  display: flex;
  flex-direction: column;
  gap: 22px;
}
.landing-d10-card {
  background: rgba(22, 27, 39, 0.45);
  border: 1px solid rgba(48, 54, 61, 0.5);
  border-radius: 12px;
  padding: 18px 20px;
  scroll-margin-top: 96px;
}
.landing-d10-card h3 {
  margin: 0 0 10px;
  font-size: 15px;
  font-weight: 600;
  color: var(--blue);
  letter-spacing: -0.01em;
}
.landing-d10-body p {
  margin: 0 0 10px;
  font-size: 14px;
  line-height: 1.65;
  color: rgba(230, 237, 243, 0.88);
}
.landing-d10-body p:last-child {
  margin-bottom: 0;
}

.nav-drawer-d10 {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px 0 12px;
  margin: 4px 0 8px;
  border-top: 1px solid rgba(48, 54, 61, 0.45);
  border-bottom: 1px solid rgba(48, 54, 61, 0.45);
}
.nav-drawer-d10-label {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 4px 0 2px;
}
.nav-drawer-d10 a {
  color: var(--text);
  text-decoration: none;
  font-size: 14px;
  padding: 6px 0;
}
.nav-drawer-d10 a:hover {
  color: var(--blue);
}

/* Mobile drawer group (e.g. Macro Economics) */
.nav-drawer-group {
  display: flex;
  flex-direction: column;
}
.nav-drawer-group-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: transparent;
  border: 1px solid rgba(48, 54, 61, 0.6);
  border-radius: 8px;
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 10px 14px;
  cursor: pointer;
  text-transform: uppercase;
  margin-bottom: 10px;
  width: 100%;
  text-align: left;
}
.nav-drawer-group-btn::after {
  content: '';
  width: 0; height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 5px solid var(--muted);
  opacity: 0.85;
  transition: transform 0.15s;
}
.nav-drawer-group-btn[aria-expanded="true"]::after {
  transform: rotate(180deg);
}
.nav-drawer-group-btn:hover { border-color: rgba(99, 179, 237, 0.28); color: var(--blue); }
.nav-drawer-group-panel {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 0 0 8px 12px;
  border-left: 2px solid rgba(99, 179, 237, 0.25);
  margin-bottom: 10px;
}
.nav-drawer-group-panel[hidden] { display: none !important; }
.nav-drawer-group-panel a {
  color: var(--text);
  text-decoration: none;
  font-size: 14px;
  padding: 6px 0;
}
.nav-drawer-group-panel a:hover { color: var(--blue); }

/* ── Features / benefits ───────────────────────────────────── */
.features-wrap {
  max-width: 960px;
  margin: 0 auto;
  padding: 42px 24px 100px;
}

.features-wrap h2 {
  font-size: 1.35rem;
  font-weight: 600;
  margin: 0 0 8px;
  letter-spacing: -0.02em;
}

.features-wrap .lead {
  color: var(--muted);
  font-size: 14px;
  max-width: 56ch;
  margin: 0 0 40px;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
}

.feature-card {
  background: rgba(22, 27, 39, 0.5);
  border: 1px solid rgba(48, 54, 61, 0.5);
  border-radius: 12px;
  padding: 22px 20px;
  transition: border-color 0.2s;
}
.feature-card:hover {
  border-color: rgba(99, 179, 237, 0.25);
}

.feature-card h3 {
  margin: 0 0 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.feature-card p {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.55;
}

.landing-footer {
  padding: 32px 24px 48px;
  text-align: center;
  font-size: 11px;
  color: var(--muted);
  border-top: 1px solid rgba(48, 54, 61, 0.35);
}

@media (max-width: 520px) {
  .top-nav {
    top: calc(10px + env(safe-area-inset-top, 0px));
    left: calc(10px + env(safe-area-inset-left, 0px));
    right: calc(10px + env(safe-area-inset-right, 0px));
    padding: 10px 10px;
  }
  .top-nav-links {
    display: none;
  }
  .top-nav-auth {
    display: none;
  }
  .top-nav-refresh {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 34px;
    border-radius: 10px;
    background: rgba(13, 17, 23, 0.35);
    border: 1px solid rgba(48, 54, 61, 0.75);
    color: rgba(230, 237, 243, 0.75);
    font-size: 18px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
  }
  .top-nav-toggle {
    display: inline-flex;
  }
  .login-card {
    padding: 22px 18px;
  }
  .rocket-svg {
    width: min(40vw, 160px);
  }
}

/* ── Admin: edit landing copy ─────────────────────────────── */
.landing-edit-fab {
  position: fixed;
  bottom: max(20px, env(safe-area-inset-bottom, 0px));
  right: max(20px, env(safe-area-inset-right, 0px));
  z-index: 60;
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid rgba(99, 179, 237, 0.45);
  background: rgba(30, 58, 95, 0.92);
  color: var(--blue);
  font-family: var(--font);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}
.landing-edit-fab:hover {
  background: rgba(45, 95, 153, 0.95);
  border-color: rgba(99, 179, 237, 0.65);
}

.landing-edit-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(0, 0, 0, 0.62);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right))
    max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
}

.landing-edit-panel {
  width: min(100%, 720px);
  max-height: min(90vh, 900px);
  display: flex;
  flex-direction: column;
  background: var(--bg2);
  border: 1px solid #30363d;
  border-radius: 12px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
}

.landing-edit-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px 12px;
  border-bottom: 1px solid rgba(48, 54, 61, 0.6);
  flex-shrink: 0;
}

.landing-edit-head h2 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}

.landing-edit-close {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}
.landing-edit-close:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
}

.landing-edit-hint {
  margin: 0;
  padding: 0 18px 12px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.45;
  flex-shrink: 0;
}

.landing-edit-fields {
  flex: 1;
  overflow-y: auto;
  padding: 0 18px 8px;
  -webkit-overflow-scrolling: touch;
}

.landing-edit-field {
  margin-bottom: 14px;
}

.landing-edit-field label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin-bottom: 6px;
}

.landing-edit-field textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid #30363d;
  background: #0d1117;
  color: var(--text);
  font-family: var(--font);
  font-size: 13px;
  line-height: 1.45;
  resize: vertical;
  min-height: 52px;
}

.landing-edit-field textarea:focus {
  outline: none;
  border-color: rgba(99, 179, 237, 0.55);
  box-shadow: 0 0 0 1px rgba(99, 179, 237, 0.2);
}

.landing-edit-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 12px 18px 16px;
  border-top: 1px solid rgba(48, 54, 61, 0.6);
  flex-shrink: 0;
}

.landing-edit-cancel {
  padding: 8px 16px;
  border-radius: 8px;
  border: 1px solid #30363d;
  background: transparent;
  color: var(--muted);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.landing-edit-cancel:hover {
  color: var(--text);
  border-color: #4b5563;
}

.landing-edit-save {
  padding: 8px 18px;
  border-radius: 8px;
  border: none;
  background: var(--blue);
  color: #0d1117;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.landing-edit-save:hover {
  filter: brightness(1.06);
}

.landing-edit-msg {
  margin: 0;
  padding: 0 18px 14px;
  font-size: 12px;
  min-height: 1.2em;
}

.landing-edit-section-title {
  margin: 20px 0 10px;
  padding-top: 14px;
  border-top: 1px solid rgba(48, 54, 61, 0.55);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

/* Legal / trust footer (marketing + auth pages) */
.landing-footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 16px;
  margin: 0 0 14px;
  padding: 0;
  list-style: none;
}
.landing-footer-links a {
  color: var(--blue);
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
}
.landing-footer-links a:hover {
  text-decoration: underline;
}

.site-legal-footer {
  padding: 28px 24px 40px;
  text-align: center;
  font-size: 11px;
  color: var(--muted);
  line-height: 1.65;
  border-top: 1px solid rgba(48, 54, 61, 0.35);
}
.site-legal-footer nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 14px;
  margin-bottom: 12px;
}
.site-legal-footer a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
}
.site-legal-footer a:hover {
  color: var(--blue);
  text-decoration: underline;
}
.site-legal-footer .legal-note {
  max-width: 62ch;
  margin: 0 auto;
  opacity: 0.92;
}

.legal-doc {
  max-width: 720px;
  margin: 0 auto;
}
.legal-doc h2 {
  font-size: 1rem;
  margin: 28px 0 10px;
  color: var(--text);
}
.legal-doc p,
.legal-doc li {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.65;
  margin: 0 0 12px;
}
.legal-doc ul {
  margin: 0 0 14px 1.1em;
  padding: 0;
}
.legal-doc li {
  margin-bottom: 8px;
}
.legal-doc .legal-lead {
  color: rgba(230, 237, 243, 0.88);
  font-size: 15px;
}
.legal-doc .legal-updated {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 20px;
}
