/* ============================================================
   NIDAA INVESTWISE — shared editorial styles
   Tokens are driven by :root data-attrs so Tweaks can swap them.
   ============================================================ */

:root {
  /* Default: DARK / ink navy / warm paper / gold */
  --bg: #0a1628;
  --bg-2: #0d1b30;
  --bg-3: #122238;
  --fg: #f5f1ea;
  --fg-dim: #b8b0a0;
  --fg-faint: #6b6558;
  --rule: rgba(245, 241, 234, 0.12);
  --rule-strong: rgba(245, 241, 234, 0.28);
  --accent: #d4a574;
  --accent-2: #c9462c;
  --up: #4ade80;
  --down: #f87171;

  /* type stacks */
  --serif: "Instrument Serif", "Newsreader", Georgia, serif;
  --sans: "Inter Tight", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --body: "Newsreader", Georgia, serif;

  /* scale */
  --step-0: 14px;
  --step-1: 16px;
  --step-2: 18px;
  --step-3: 22px;
  --step-4: 28px;
  --step-5: 40px;
  --step-6: 64px;
  --step-7: 96px;
  --step-8: 140px;

  --container: 1400px;
  --gutter: 40px;

  --anim: 1; /* 0-1 multiplier */
  --ease: cubic-bezier(0.2, 0.7, 0.1, 1);
}

/* LIGHT mode */
:root[data-mode="light"] {
  --bg: #f5f1ea;
  --bg-2: #ece6db;
  --bg-3: #e2dbcc;
  --fg: #1a1410;
  --fg-dim: #5a5247;
  --fg-faint: #8a8373;
  --rule: rgba(26, 20, 16, 0.14);
  --rule-strong: rgba(26, 20, 16, 0.32);
  --accent: #b8813c;
  --accent-2: #a8371d;
}

/* PALETTE variants */
:root[data-palette="ink"] { /* default ink+gold, nothing to override */ }

:root[data-palette="crimson"] {
  --bg: #f7f5f0;
  --bg-2: #efeae0;
  --bg-3: #e6dfd0;
  --fg: #1a1410;
  --fg-dim: #5a5247;
  --fg-faint: #8a8373;
  --rule: rgba(26, 20, 16, 0.14);
  --rule-strong: rgba(26, 20, 16, 0.32);
  --accent: #1a3a2e;
  --accent-2: #c9462c;
}

:root[data-palette="terminal"] {
  --bg: #0b0d0c;
  --bg-2: #101412;
  --bg-3: #161b18;
  --fg: #e8f0ea;
  --fg-dim: #8aa293;
  --fg-faint: #536157;
  --rule: rgba(232, 240, 234, 0.12);
  --rule-strong: rgba(232, 240, 234, 0.3);
  --accent: #00d084;
  --accent-2: #6ee7b7;
}

:root[data-palette="mono"] {
  --bg: #fafafa;
  --bg-2: #f0f0f0;
  --bg-3: #e6e6e6;
  --fg: #0a0a0a;
  --fg-dim: #4a4a4a;
  --fg-faint: #888;
  --rule: rgba(0, 0, 0, 0.12);
  --rule-strong: rgba(0, 0, 0, 0.3);
  --accent: #4a5fd1;
  --accent-2: #0a0a0a;
}

/* TYPOGRAPHY variants */
:root[data-type="editorial"] {
  --serif: "Instrument Serif", "Newsreader", Georgia, serif;
  --body: "Newsreader", Georgia, serif;
}
:root[data-type="bold-sans"] {
  --serif: "Inter Tight", "Helvetica Neue", sans-serif;
  --body: "Inter Tight", "Helvetica Neue", sans-serif;
}
:root[data-type="serif-mono"] {
  --serif: "Fraunces", "Newsreader", Georgia, serif;
  --body: "JetBrains Mono", ui-monospace, monospace;
}

/* ============================================================ */

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--body);
  font-size: var(--step-1);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

body {
  transition: background 0.6s var(--ease), color 0.6s var(--ease);
}

a { color: inherit; text-decoration: none; }
button { background: none; border: 0; color: inherit; font: inherit; cursor: pointer; }
img, svg { display: block; max-width: 100%; }

::selection { background: var(--accent); color: var(--bg); }

/* ---------- primitives ---------- */

.container { max-width: var(--container); margin: 0 auto; padding: 0 var(--gutter); }

.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; letter-spacing: 0.02em; }
.serif { font-family: var(--serif); }
.sans { font-family: var(--sans); }

.eyebrow {
  font-family: var(--mono);
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.18em;
  color: var(--fg-dim);
  display: inline-flex; align-items: center; gap: 10px;
}
.eyebrow::before {
  content: ""; width: 22px; height: 1px; background: var(--accent);
}

.display {
  font-family: var(--serif);
  font-weight: 400;
  line-height: 0.92;
  letter-spacing: -0.02em;
  font-size: clamp(48px, 9vw, var(--step-8));
}
.display em { font-style: italic; color: var(--accent); }

.h1 { font-family: var(--serif); font-size: clamp(40px, 6vw, var(--step-7)); line-height: 0.95; letter-spacing: -0.02em; font-weight: 400;}
.h2 { font-family: var(--serif); font-size: clamp(32px, 4.4vw, var(--step-6)); line-height: 1.0; letter-spacing: -0.015em; font-weight: 400;}
.h3 { font-family: var(--serif); font-size: clamp(24px, 2.6vw, var(--step-5)); line-height: 1.05; letter-spacing: -0.01em; font-weight: 400;}
.h4 { font-family: var(--serif); font-size: var(--step-4); line-height: 1.15; font-weight: 400;}
.lede { font-family: var(--body); font-size: clamp(18px, 1.5vw, 22px); line-height: 1.5; color: var(--fg-dim); max-width: 56ch; }

/* rules */
.rule { height: 1px; background: var(--rule); width: 100%; }
.rule-strong { height: 1px; background: var(--rule-strong); }

/* buttons */
.btn {
  display: inline-flex; align-items: center; gap: 12px;
  padding: 14px 22px;
  border: 1px solid var(--rule-strong);
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  transition: all 0.35s var(--ease);
  position: relative;
  overflow: hidden;
}
.btn .arrow { transition: transform 0.35s var(--ease); }
.btn:hover { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.btn:hover .arrow { transform: translateX(4px); }
.btn.primary { background: var(--accent); color: var(--bg); border-color: var(--accent); }
.btn.primary:hover { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.btn.ghost { border-color: var(--rule); }

/* magnetic wrapper */
.magnetic { display: inline-block; will-change: transform; }

/* ---------- NAV ---------- */
:root {
  --nav-h: 82px;      /* must match .nav vertical footprint */
  --ticker-h: 44px;   /* must match .ticker vertical footprint */
  --chrome-h: calc(var(--nav-h) + var(--ticker-h));
}
body { padding-top: var(--chrome-h); }
.nav {
  position: fixed; top: var(--ticker-h); left: 0; right: 0; z-index: 100;
  height: var(--nav-h);
  padding: 0 var(--gutter);
  display: flex; align-items: center; justify-content: space-between;
  background: color-mix(in oklab, var(--bg) 92%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--rule);
  transition: backdrop-filter 0.3s, background 0.3s;
}
.nav.scrolled { background: color-mix(in oklab, var(--bg) 96%, transparent); }
.nav__logo {
  display: flex; align-items: center; gap: 12px;
  font-family: var(--serif);
  font-size: 22px;
  letter-spacing: -0.01em;
}
.nav__logo-img {
  height: 34px; width: auto; display: block;
  transition: transform 0.35s var(--ease), opacity 0.4s var(--ease);
}
.nav__logo-img--dark { display: none; }
:root[data-mode="light"] .nav__logo-img--light,
:root[data-palette="crimson"] .nav__logo-img--light,
:root[data-palette="mono"] .nav__logo-img--light { display: none; }
:root[data-mode="light"] .nav__logo-img--dark,
:root[data-palette="crimson"] .nav__logo-img--dark,
:root[data-palette="mono"] .nav__logo-img--dark { display: block; }
.nav__logo:hover .nav__logo-img { transform: scale(1.03); }
.nav__logo .mark {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--accent); color: var(--bg);
  display: grid; place-items: center;
  font-family: var(--serif); font-weight: 700; font-size: 18px; font-style: italic;
}
.nav__logo .mark svg { width: 22px; height: 22px; }
.nav__links { display: flex; gap: 28px; font-family: var(--mono); font-size: 12px; text-transform: uppercase; letter-spacing: 0.14em; color: var(--fg-dim);}
.nav__links a { position: relative; padding: 6px 0;}
.nav__links a::after {
  content: ""; position: absolute; left: 0; bottom: 0; width: 0; height: 1px; background: var(--accent);
  transition: width 0.35s var(--ease);
}
.nav__links a:hover { color: var(--fg); }
.nav__links a:hover::after, .nav__links a.active::after { width: 100%; }
.nav__cta { display: flex; align-items: center; gap: 16px; }
.nav__time {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.14em; color: var(--fg-faint); text-transform: uppercase;
  display: flex; align-items: center; gap: 8px;
}
.nav__time .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--up); box-shadow: 0 0 8px var(--up); animation: pulse 2s infinite;}

@keyframes pulse { 0%,100% {opacity: 1;} 50% {opacity: 0.4;} }

@media (max-width: 900px) {
  .nav__links, .nav__time { display: none; }
}

/* ---------- TICKER ---------- */
.ticker {
  position: fixed; top: 0; left: 0; right: 0; z-index: 101;
  height: var(--ticker-h);
  display: flex; align-items: center;
  border-bottom: 1px solid var(--rule);
  overflow: hidden;
  background: var(--bg-2);
}
.ticker__track {
  display: flex; gap: 48px; width: max-content;
  animation: tick calc(60s / var(--anim, 1)) linear infinite;
  white-space: nowrap;
  will-change: transform;
}
.ticker__item {
  display: inline-flex; align-items: center; gap: 12px;
  font-family: var(--mono); font-size: 13px; letter-spacing: 0.03em;
}
.ticker__sym { color: var(--fg-dim); }
.ticker__val { color: var(--fg); font-weight: 500;}
.ticker__chg.up { color: var(--up); }
.ticker__chg.down { color: var(--down); }

@keyframes tick {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

/* ---------- reveal ---------- */
.reveal { opacity: 0; transform: translateY(calc(32px * var(--anim))); transition: opacity 0.9s var(--ease), transform 0.9s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
.reveal.delay-1 { transition-delay: 0.1s; }
.reveal.delay-2 { transition-delay: 0.2s; }
.reveal.delay-3 { transition-delay: 0.3s; }
.reveal.delay-4 { transition-delay: 0.4s; }
.reveal.delay-5 { transition-delay: 0.5s; }

.char-reveal { display: inline-block; overflow: hidden; vertical-align: bottom; clip-path: inset(0 -20% 0 0); padding-right: 0.08em; }
.char-reveal > span { display: inline-block; transform: translateY(110%); transition: transform 0.9s var(--ease); padding-right: 0.02em; }
.char-reveal.in > span { transform: none; }

/* ---------- footer ---------- */
.footer {
  border-top: 1px solid var(--rule);
  padding: 80px var(--gutter) 40px;
  margin-top: 120px;
}
.footer__grid {
  max-width: var(--container); margin: 0 auto;
  display: grid; grid-template-columns: 2fr 1fr 1fr 1fr 1fr; gap: 40px;
}
.footer__brand .display-sm { font-family: var(--serif); font-size: 44px; line-height: 0.95; letter-spacing: -0.02em; margin-bottom: 20px;}
.footer__brand .lede-sm { color: var(--fg-dim); max-width: 40ch; }
.footer__col h5 { font-family: var(--mono); font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--fg-faint); margin-bottom: 18px;}
.footer__col a { display: block; padding: 6px 0; font-family: var(--body); color: var(--fg-dim); transition: color 0.3s, padding 0.3s;}
.footer__col a:hover { color: var(--accent); padding-left: 6px;}
.footer__contact { margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--rule); }
.footer__contact a { font-family: var(--mono); font-size: 13px; color: var(--fg); letter-spacing: 0.02em; border-bottom: 1px solid var(--rule); padding-bottom: 2px; transition: color 0.3s, border-color 0.3s; }
.footer__contact a:hover { color: var(--accent); border-color: var(--accent); }
.footer__fine { font-family: var(--body); font-size: 13px; line-height: 1.55; color: var(--fg-dim); }
.footer__bottom {
  max-width: var(--container); margin: 60px auto 0;
  padding-top: 30px; border-top: 1px solid var(--rule);
  display: flex; justify-content: space-between; align-items: center;
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em; color: var(--fg-faint); text-transform: uppercase;
}

@media (max-width: 900px) {
  .footer__grid { grid-template-columns: 1fr 1fr; }
  .footer__bottom { flex-direction: column; gap: 12px; align-items: flex-start;}
}

/* ---------- data card / numbers ---------- */
.big-num {
  font-family: var(--serif);
  font-size: clamp(64px, 9vw, 140px);
  line-height: 0.9;
  letter-spacing: -0.03em;
  font-feature-settings: "tnum";
}
.big-num .unit { font-size: 0.4em; color: var(--fg-dim); margin-left: 6px; letter-spacing: 0; font-style: italic;}

/* ---------- spotlight cursor ---------- */
.cursor-spot {
  position: fixed; pointer-events: none; z-index: 1;
  width: 520px; height: 520px; border-radius: 50%;
  background: radial-gradient(circle, color-mix(in oklab, var(--accent) 18%, transparent), transparent 70%);
  mix-blend-mode: screen;
  transform: translate(-50%, -50%);
  transition: opacity 0.4s;
  opacity: calc(var(--anim) * 1);
}
:root[data-mode="light"] .cursor-spot, :root[data-palette="crimson"] .cursor-spot, :root[data-palette="mono"] .cursor-spot {
  mix-blend-mode: multiply;
  background: radial-gradient(circle, color-mix(in oklab, var(--accent) 22%, transparent), transparent 70%);
}

/* ---------- tweaks panel ---------- */
.tweaks {
  position: fixed; right: 24px; bottom: 24px; z-index: 200;
  width: 320px;
  background: var(--bg-2);
  border: 1px solid var(--rule-strong);
  border-radius: 14px;
  padding: 18px;
  font-family: var(--mono); font-size: 11px;
  display: none;
  box-shadow: 0 20px 60px rgba(0,0,0,0.45);
}
.tweaks.open { display: block; }
.tweaks h6 { font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--fg-dim); margin-bottom: 14px; display: flex; justify-content: space-between; align-items: center;}
.tweaks h6 button { color: var(--fg-faint); }
.tweaks__row { margin-bottom: 14px; }
.tweaks__row label { display: block; font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--fg-faint); margin-bottom: 8px;}
.tweaks__opts { display: flex; flex-wrap: wrap; gap: 6px; }
.tweaks__opt {
  padding: 7px 10px; border: 1px solid var(--rule); border-radius: 999px;
  font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--fg-dim);
}
.tweaks__opt.active { background: var(--accent); color: var(--bg); border-color: var(--accent);}
.tweaks__opt:hover { border-color: var(--fg); color: var(--fg);}
.tweaks input[type=range] { width: 100%; accent-color: var(--accent);}

/* ================================================================
   MOBILE — hamburger menu, responsive scales, touch-friendly spacing
   Every breakpoint below triggers on narrow screens so any new page
   inherits the responsive behavior automatically.
   ================================================================ */

/* Hamburger button hidden on desktop */
.nav__burger {
  display: none;
  width: 40px; height: 40px; border-radius: 8px;
  background: transparent; border: 1px solid var(--rule);
  position: relative; cursor: pointer;
  transition: border-color 0.3s;
}
.nav__burger:hover { border-color: var(--fg); }
.nav__burger span {
  position: absolute; left: 9px; right: 9px; height: 1.5px;
  background: var(--fg); transition: all 0.3s var(--ease);
  border-radius: 2px;
}
.nav__burger span:nth-child(1) { top: 13px; }
.nav__burger span:nth-child(2) { top: 19px; }
.nav__burger span:nth-child(3) { top: 25px; }
.nav__burger[aria-expanded="true"] span:nth-child(1) { top: 19px; transform: rotate(45deg); }
.nav__burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav__burger[aria-expanded="true"] span:nth-child(3) { top: 19px; transform: rotate(-45deg); }

/* Mobile menu overlay */
.mobile-menu {
  display: none; /* desktop: fully hidden; mobile rules below override */
  position: fixed; inset: 0; z-index: 99;
  background: color-mix(in oklab, var(--bg) 97%, transparent);
  backdrop-filter: blur(16px);
  transform: translateY(-100%);
  transition: transform 0.45s var(--ease);
  align-items: center; justify-content: center;
  padding: calc(var(--chrome-h) + 40px) var(--gutter) 40px;
}
@media (max-width: 900px) {
  .mobile-menu { display: flex; }
}
.mobile-menu.open { transform: translateY(0); }
.mobile-menu__inner {
  display: flex; flex-direction: column; gap: 4px;
  width: 100%; max-width: 440px;
}
.mobile-menu__inner a {
  font-family: var(--serif);
  font-size: clamp(32px, 8vw, 56px);
  line-height: 1.15; letter-spacing: -0.015em;
  padding: 14px 0; border-bottom: 1px solid var(--rule);
  color: var(--fg); transition: color 0.3s;
}
.mobile-menu__inner a.active { color: var(--accent); font-style: italic; }
.mobile-menu__inner a:hover { color: var(--accent); }
.mobile-menu__inner .btn {
  margin-top: 28px; justify-content: center; width: fit-content;
  font-size: 13px; padding: 14px 26px;
}

/* ---------- NAV: desktop → mobile ---------- */
@media (max-width: 900px) {
  :root { --nav-h: 68px; --ticker-h: 40px; --gutter: 20px; }
  .nav__links { display: none; }
  .nav__cta .nav__time { display: none; }
  .nav__cta .btn { display: none; }
  .nav__burger { display: block; }
  .nav__logo-img { height: 28px; }
}

/* ---------- TICKER: tighter on mobile ---------- */
@media (max-width: 900px) {
  .ticker__item { font-size: 11px; gap: 8px; }
  .ticker__track { gap: 32px; }
}

/* ---------- SECTIONS: desktop defaults ---------- */
/* These desktop rules were previously only inline in index.html — porting here
   so about.html, pricing.html, ai-features.html, contact.html also get consistent
   horizontal padding instead of content touching the viewport edge. */
section.block { padding: 120px var(--gutter); position: relative; }
.block__inner { max-width: var(--container); margin: 0 auto; }
.block__head { display: flex; justify-content: space-between; align-items: flex-end; gap: 40px; margin-bottom: 60px; flex-wrap: wrap; }
.block__head .eyebrow { margin-bottom: 16px; }
.block__head .h2 { max-width: 18ch; }
.block__head .lede { max-width: 42ch; color: var(--fg-dim); }

.bigcta { padding: 160px var(--gutter); text-align: center; border-top: 1px solid var(--rule); }
.bigcta .line { font-family: var(--serif); font-size: clamp(48px, 8vw, 140px); line-height: 0.95; letter-spacing: -0.02em; }
.bigcta .line em { font-style: italic; color: var(--accent); }
.bigcta .btn { margin-top: 48px; }

/* ---------- SECTIONS: mobile overrides ---------- */
@media (max-width: 900px) {
  section.block { padding: 64px var(--gutter); }
  .block__head { flex-direction: column; align-items: flex-start; margin-bottom: 36px; }
  .block__head .lede { font-size: 16px; }

  .hero { padding: 72px var(--gutter) 40px; min-height: auto; }

  /* Hero A */
  .heroA__eyebrow-row { flex-direction: column; align-items: flex-start; gap: 16px; margin-bottom: 40px; }
  .heroA__eyebrow-row > div:last-child { text-align: left !important; }
  .heroA__sub { grid-template-columns: 1fr; gap: 24px; margin-top: 48px; padding-top: 24px; }
  .heroA__cta { flex-direction: column; align-items: stretch; gap: 12px; }
  .heroA__cta .btn { justify-content: center; }

  /* Hero B */
  .heroB__masthead { flex-wrap: wrap; gap: 8px; padding: 12px 0; font-size: 10px; }
  .heroB__grid { grid-template-columns: 1fr; gap: 40px; }
  .heroB__lede { column-count: 1; }

  /* Hero C */
  .heroC__grid { grid-template-columns: 1fr; gap: 40px; }
  .pulse-card { padding: 20px; }
  .pulse-card .price { font-size: 52px; }
  .pulse-row { grid-template-columns: 1fr 1fr; }

  /* Hero D */
  .heroD__foot { grid-template-columns: 1fr; gap: 28px; margin-top: 40px; }

  /* Metrics, steps */
  .metrics { grid-template-columns: 1fr 1fr; }
  .metric { padding: 28px 18px; }
  .metric:nth-child(2n) { border-right: 0; }
  .metric:nth-child(-n+2) { border-bottom: 1px solid var(--rule); }
  .steps { grid-template-columns: 1fr 1fr; }
  .step:nth-child(2n) { border-right: 0; }
  .step:nth-child(-n+2) { border-bottom: 1px solid var(--rule); }

  /* CTA */
  .bigcta { padding: 80px var(--gutter); }
  .bigcta .btn { justify-content: center; }

  /* Footer */
  .footer { padding: 56px var(--gutter) 28px; margin-top: 64px; }
  .footer__grid { grid-template-columns: 1fr 1fr; gap: 32px 20px; }
  .footer__brand { grid-column: 1 / -1; }
  .footer__brand .display-sm { font-size: 32px; }
  .footer__wordmark { font-size: clamp(60px, 22vw, 180px); margin-top: 48px; padding-top: 28px; }
  .footer__bottom { margin-top: 48px; }
}

@media (max-width: 600px) {
  :root { --gutter: 16px; }
  .metrics { grid-template-columns: 1fr; }
  .metric { border-right: 0 !important; border-bottom: 1px solid var(--rule); }
  .metric:last-child { border-bottom: 0; }
  .steps { grid-template-columns: 1fr; }
  .step { border-right: 0 !important; border-bottom: 1px solid var(--rule); }
  .step:last-child { border-bottom: 0; }
  .pulse-row { grid-template-columns: 1fr; }
  .footer__grid { grid-template-columns: 1fr; }
  .tweaks { right: 12px; bottom: 12px; width: calc(100vw - 24px); max-width: 340px; }
}

/* Touch-friendly tap targets — anywhere */
@media (hover: none) and (pointer: coarse) {
  .btn, a.btn, button { min-height: 44px; }
  .cursor-spot { display: none; }
}
