/* Forecast Studio design system, shared by the landing page and the studio.
   Palette, type and motion follow Muster (muster.ajit.business): warm paper, ink-navy,
   one cyan→blue→violet gradient, mono eyebrows, glass cards, CSS-only motion. */

/* ───────────────────────── Tokens ───────────────────────── */
:root {
  --bg: #f5f5f1;
  --surface: #ffffff;
  --surface-2: #fafaf7;
  --sunken: #eeeee8;
  --ink: #121310;
  --ink-2: #33352f;
  --muted: #676a63;
  --faint: #979a92;
  --line: #e2e2da;
  --line-strong: #cbccc3;
  --navy: #0b1033;
  --accent: #4c4df5;
  --accent-ink: #3a32d6;
  --accent-soft: #eef0ff;
  --g1: #12b5fd;
  --g2: #3d6bff;
  --g3: #6d4bfc;
  --ok: #157a3a;
  --ok-soft: #e6f4ea;
  --warn: #9a5800;
  --warn-soft: #fcf1de;
  --bad: #c0281b;
  --bad-soft: #fcebe8;
  /* chart colours */
  --c-actual: #33352f;
  --c-forecast: #3d6bff;
  --c-forecast-weak: rgba(61, 107, 255, 0.07);
  --c-band: rgba(61, 107, 255, 0.16);
  --c-backtest: #7c3aed;
  --c-cp: #e5484d;
  --c-neg: #e5484d;
  /* comparison models: TimesFM 2.5, Chronos-2, TimesFM 3.0 */
  --c-m1: #d97706;
  --c-m2: #0f9f6e;
  --c-m3: #db2777;
  --shadow-sm: 0 1px 0 rgba(18, 19, 16, 0.03), 0 1px 3px rgba(18, 19, 16, 0.05);
  --shadow-pop: 0 1px 0 rgba(18, 19, 16, 0.04), 0 12px 32px -12px rgba(18, 19, 16, 0.28);
  --shadow-glass: 0 1px 0 rgba(255, 255, 255, 0.6) inset, 0 18px 40px -22px rgba(11, 16, 51, 0.35);
  --font: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --radius: 18px;
  --radius-sm: 10px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d0e0c; --surface: #151613; --surface-2: #191a17; --sunken: #1f201c;
    --ink: #ecece6; --ink-2: #cfd0c8; --muted: #93968d; --faint: #6a6d65;
    --line: #2a2b26; --line-strong: #3b3c36; --navy: #ecece6;
    --accent: #7c7eff; --accent-ink: #a5a7ff; --accent-soft: #1a1b3d;
    --ok: #4cc27a; --ok-soft: #0f2418; --warn: #e6a23c; --warn-soft: #2a1f0c; --bad: #ff6b5e; --bad-soft: #2c1210;
    --c-actual: #cfd0c8; --c-forecast: #7896ff; --c-forecast-weak: rgba(120, 150, 255, 0.09);
    --c-band: rgba(120, 150, 255, 0.22); --c-backtest: #b394ff; --c-cp: #ff6b6f; --c-neg: #ff6b6f;
    --c-m1: #f5b04a; --c-m2: #34d399; --c-m3: #f472b6;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.35);
    --shadow-pop: 0 1px 0 rgba(0, 0, 0, 0.4), 0 16px 40px -12px rgba(0, 0, 0, 0.7);
    --shadow-glass: 0 1px 0 rgba(255, 255, 255, 0.05) inset, 0 18px 40px -22px rgba(0, 0, 0, 0.8);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0d0e0c; --surface: #151613; --surface-2: #191a17; --sunken: #1f201c;
  --ink: #ecece6; --ink-2: #cfd0c8; --muted: #93968d; --faint: #6a6d65;
  --line: #2a2b26; --line-strong: #3b3c36; --navy: #ecece6;
  --accent: #7c7eff; --accent-ink: #a5a7ff; --accent-soft: #1a1b3d;
  --ok: #4cc27a; --ok-soft: #0f2418; --warn: #e6a23c; --warn-soft: #2a1f0c; --bad: #ff6b5e; --bad-soft: #2c1210;
  --c-actual: #cfd0c8; --c-forecast: #7896ff; --c-forecast-weak: rgba(120, 150, 255, 0.09);
  --c-band: rgba(120, 150, 255, 0.22); --c-backtest: #b394ff; --c-cp: #ff6b6f; --c-neg: #ff6b6f;
  --c-m1: #f5b04a; --c-m2: #34d399; --c-m3: #f472b6;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.35);
  --shadow-pop: 0 1px 0 rgba(0, 0, 0, 0.4), 0 16px 40px -12px rgba(0, 0, 0, 0.7);
  --shadow-glass: 0 1px 0 rgba(255, 255, 255, 0.05) inset, 0 18px 40px -22px rgba(0, 0, 0, 0.8);
  color-scheme: dark;
}

/* ───────────────────────── Base ───────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 14px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-variant-numeric: tabular-nums;
}
h1, h2, h3, h4 { margin: 0; letter-spacing: -0.02em; font-weight: 600; }
p { margin: 0; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
img, svg { display: block; }
[hidden] { display: none !important; }
::selection { background: color-mix(in oklab, var(--accent) 22%, transparent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.mono { font-family: var(--mono); }

/* ───────────────────────── Shared pieces ───────────────────────── */
.eyebrow {
  font-family: var(--mono); font-size: 11px; font-weight: 500;
  text-transform: uppercase; letter-spacing: 0.14em; color: var(--accent-ink);
}
.grad-text {
  background: linear-gradient(90deg, var(--g1), var(--g2) 30%, var(--g3) 55%, var(--g2) 80%, var(--g1));
  background-size: 250% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: shimmer 9s ease-in-out infinite alternate;
}

/* Top bar */
.topbar {
  position: sticky; top: 0; z-index: 40;
  border-bottom: 1px solid color-mix(in oklab, var(--line) 60%, transparent);
  background: color-mix(in oklab, var(--surface) 75%, transparent);
  backdrop-filter: saturate(1.4) blur(18px); -webkit-backdrop-filter: saturate(1.4) blur(18px);
}
.topbar-inner { display: flex; align-items: center; gap: 22px; height: 56px; padding: 0 20px; margin: 0 auto; }
.brand { display: inline-flex; align-items: center; gap: 9px; text-decoration: none; min-width: 0; }
.brand-mark { width: 26px; height: 26px; flex: none; }
.brand-name { font-weight: 700; font-size: 15.5px; letter-spacing: -0.035em; color: var(--navy); white-space: nowrap; }
.chip {
  font-family: var(--mono); font-size: 11px; color: var(--muted);
  border: 1px solid var(--line); background: var(--surface-2);
  padding: 1px 8px; border-radius: 99px; white-space: nowrap;
}
.nav { display: flex; align-items: center; gap: 22px; font-size: 13.5px; }
.nav a { color: var(--muted); text-decoration: none; }
.nav a:hover { color: var(--ink); }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }

.icon-btn {
  width: 34px; height: 34px; display: grid; place-items: center; cursor: pointer;
  border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink-2);
  transition: border-color 0.15s, background 0.15s;
}
.icon-btn:hover { border-color: var(--line-strong); background: var(--surface-2); }
.icon-btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.theme-sun { display: none; }
:root[data-theme="dark"] .theme-sun { display: block; }
:root[data-theme="dark"] .theme-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-sun { display: block; }
  :root:not([data-theme="light"]) .theme-moon { display: none; }
}

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 36px; padding: 0 14px; border-radius: var(--radius-sm); cursor: pointer; text-decoration: none;
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink);
  font-weight: 600; font-size: 13px; white-space: nowrap;
  transition: background 0.15s, border-color 0.15s, transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.15s;
}
.btn:hover:not(:disabled) { border-color: var(--ink-2); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.btn-sm { height: 32px; padding: 0 12px; font-size: 12.5px; }
.btn-lg { height: 48px; padding: 0 22px; border-radius: 12px; font-size: 15px; }
.btn-primary {
  position: relative; overflow: hidden; color: #fff; border: 0;
  background: linear-gradient(100deg, #1aa8fd, var(--g2) 45%, var(--g3));
  box-shadow: 0 10px 28px -12px rgba(77, 78, 245, 0.75), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}
.btn-primary::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, 0.45) 50%, transparent 70%);
  transform: translateX(-120%); transition: transform 0.75s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.btn-primary:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 16px 34px -12px rgba(77, 78, 245, 0.85), inset 0 1px 0 rgba(255, 255, 255, 0.25); }
.btn-primary:hover:not(:disabled)::after { transform: translateX(120%); }
.btn-ghost {
  background: color-mix(in oklab, var(--surface) 80%, transparent); color: var(--navy);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.btn-ghost:hover:not(:disabled) { transform: translateY(-1px); }

/* Glass card */
.glass {
  border-radius: var(--radius);
  background: color-mix(in oklab, var(--surface) 90%, transparent);
  border: 1px solid color-mix(in oklab, var(--line) 80%, transparent);
  box-shadow: var(--shadow-glass);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}

/* ───────────────────────── Motion ───────────────────────── */
/* CSS only, so animations settle even when the tab is throttled. Each animates *from*
   the hidden state, so with motion off the resting styles are the finished design. */
@keyframes shimmer { from { background-position: 0% 50%; } to { background-position: 100% 50%; } }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }
@keyframes fade { from { opacity: 0; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 50% { opacity: 0.35; } }
.rise { animation: rise 0.6s cubic-bezier(0.2, 0.7, 0.2, 1) both; animation-delay: var(--d, 0ms); }
.fade-in { animation: fade 0.5s ease-out both; animation-delay: var(--d, 0ms); }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
  html { scroll-behavior: auto; }
}

/* A disabled gradient button would show whatever scrolls beneath it, so go solid instead. */
.btn-primary:disabled { opacity: 1; background: var(--sunken); color: var(--faint); box-shadow: none; }
.btn-primary:disabled::after { display: none; }
