/* ═══════════════════════════════════════════════════════════════
   wbal.io DESIGN TOKENS
   Single self-contained file. Link BEFORE style.css:
     <link rel="stylesheet" href="tokens.css">
     <link rel="stylesheet" href="style.css">
   ═══════════════════════════════════════════════════════════════ */

@import url('vendor/fonts/fonts.css');

:root {
  /* ── Brand blue ramp ───────────────────────────── */
  --blue:        #185FA5;
  --blue-mid:    #378ADD;
  --blue-light:  #E6F1FB;
  --blue-dark:   #0C447C;

  /* ── Ink + paper neutrals (marketing) ──────────── */
  --ink:         #2C2C2A;
  --ink-mid:     #5F5E5A;
  --soft:        #D3D1C7;
  --paper:       #F1EFE8;
  --white:       #FFFFFF;

  /* ── App neutrals ───────────────────────────────── */
  --gray-border: #E2E6EA;
  --gray-text:   #1A1A1A;
  --gray-muted:  #6B7280;
  --gray-bg:     #F5F7FA;

  /* ── Brand green (curve + formulae) ────────────── */
  --green:        #3B6D11;
  --green-light:  #EAF3DE;
  --green-curve:  #C0DD97;

  /* ── Semantic ──────────────────────────────────── */
  --red:        #DC2626;
  --red-tint:   #FEF2F2;
  --success:    #16A34A;
  --success-tint: #F0FDF4;

  /* ── Tool accents — one per analysis surface ───── */
  --tool-analyse: #38BDF8;
  --tool-cp:      #059669;
  --tool-calc:    #7C3AED;
  --tool-diary:   #D97706;
  --tool-planner: #E11D48;
  --tool-coach:   #6366F1;
  --tool-account: #0D9488;
  --tool-threshold: #C026D3;

  /* ── App shell (dark cockpit header + mastheads) ── */
  --shell-bg:     #0A1626;
  --shell-bg-2:   #0F2038;
  --shell-border: #1E3452;
  --shell-text:   #94A3B8;
  --shell-bright: #F1F5F9;


  /* ── Dark app ramp (signed-in pages, via app.css) ──
     Four steps of navy from page to hover, two hairlines, three text
     weights. app.css points the older light names (--bg, --white, --text,
     --muted, --border) at these, so existing rules turn dark without edits. */
  --surface-0:   #070F1C;   /* page */
  --surface-1:   #0D1A2D;   /* panel */
  --surface-2:   #132339;   /* raised tile, input */
  --surface-3:   #1B2E49;   /* hover, active */
  --line:        #1F3350;
  --line-strong: #2C4466;
  --fg-hi:       #F1F5F9;
  --fg:          #CBD5E1;
  --fg-lo:       #8DA0B8;

  /* Each tool's accent as it reads on the dark ramp (the --tool-* values
     above are tuned for light surfaces). */
  --tool-analyse-hi:   #38BDF8;
  --tool-cp-hi:        #34D399;
  --tool-calc-hi:      #A78BFA;
  --tool-diary-hi:     #FBBF24;
  --tool-planner-hi:   #FB7185;
  --tool-coach-hi:     #818CF8;
  --tool-account-hi:   #2DD4BF;
  --tool-threshold-hi: #E879F9;

  /* ── What data means, the same on every chart and figure ──
     W′bal is the brightest line on any chart it is on. */
  --data-wbal:    #60A5FA;
  --data-power:   #94A3B8;
  --data-above:   #F87171;   /* power above CP */
  --data-hr:      #F43F5E;
  --data-cadence: #A78BFA;
  --data-speed:   #2DD4BF;
  --data-elev:    #64748B;
  --data-cp:      #FBBF24;
  --data-ceiling: #C084FC;
  --data-good:    #4ADE80;
  --data-caution: #FBBF24;
  --data-empty:   #F87171;

  /* ── Display typeface for mastheads / hero titles ── */
  --font-display: 'Sora', 'Atkinson Hyperlegible Next', system-ui, sans-serif;

  /* Dark dashboard surfaces (Analyse tab) */
  --dash-bg:      #0F172A;
  --dash-surface: #1E293B;
  --dash-border:  #334155;
  --dash-text:    #E2E8F0;
  --dash-muted:   #94A3B8;

  /* ── Semantic aliases ──────────────────────────── */
  --text-body:        var(--ink);
  --text-muted:       var(--ink-mid);
  --text-brand:       var(--blue);
  --surface-page:     var(--white);
  --surface-paper:    var(--paper);
  --surface-card:     var(--white);
  --surface-tint:     var(--blue-light);
  --border-hairline:  var(--soft);
  --border-card:      var(--gray-border);

  /* ── Typography ────────────────────────────────── */
  --font-sans: 'Atkinson Hyperlegible Next', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono: 'DM Mono', 'SF Mono', ui-monospace, 'Courier New', monospace;
  --font-ui:   'Atkinson Hyperlegible Next', system-ui, -apple-system, 'Segoe UI', sans-serif;

  --text-xs:   11px;
  --text-sm:   13px;
  --text-base: 14px;
  --text-md:   16px;
  --text-lg:   18px;
  --text-xl:   22px;
  --text-2xl:  30px;
  --text-3xl:  46px;

  --weight-regular:  400;
  --weight-medium:   500;
  --weight-semibold: 600;
  --weight-bold:     700;

  --leading-tight:   1.12;
  --leading-snug:    1.3;
  --leading-normal:  1.6;
  --leading-relaxed: 1.7;

  --tracking-tight:  -0.035em;
  --tracking-snug:   -0.02em;
  --tracking-wide:    0.08em;

  --type-eyebrow-size:  var(--text-xs);
  --type-eyebrow-track: var(--tracking-wide);
  --type-hero-size:     var(--text-3xl);
  --type-title-size:    var(--text-2xl);
  --type-body-size:     var(--text-md);
  --type-mono-size:     var(--text-sm);

  /* ── Spacing ───────────────────────────────────── */
  --space-1:  4px;
  --space-2:  8px;
  --space-3:  12px;
  --space-4:  16px;
  --space-5:  20px;
  --space-6:  24px;
  --space-8:  32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;

  /* ── Radii ─────────────────────────────────────── */
  --radius-xs:   4px;
  --radius-sm:   6px;
  --radius-md:   7px;
  --radius-lg:   10px;
  --radius-xl:   12px;
  --radius-pill: 99px;

  /* ── Borders ───────────────────────────────────── */
  --border-thin:   0.5px solid var(--soft);
  --border-card:   1px solid var(--gray-border);
  --border-accent: 4px;

  /* ── Shadows ───────────────────────────────────── */
  --shadow-none:    none;
  --shadow-modal:   0 8px 40px rgba(0,0,0,0.18);
  --shadow-popover: 0 4px 16px rgba(0,0,0,0.25);

  /* ── Layout ────────────────────────────────────── */
  --width-prose:   900px;
  --width-app:     1100px;
  --header-height: 56px;

  /* ── Motion ────────────────────────────────────── */
  --ease-ui:   0.15s;
  --ease-slow: 0.3s;

  /* ── Legacy aliases (for style.css compatibility) ─ */
  --border: var(--gray-border);
  --text:   var(--gray-text);
  --muted:  var(--gray-muted);
  --bg:     var(--gray-bg);
}

/* ── Sign-up mode ───────────────────────────────────
   The server marks every page <html data-signup="open|invite"> from
   OPEN_REGISTRATION (_mark_signup_mode in main.py). Copy that only fits one
   mode carries data-signup-only="open" or "invite" and is hidden in the other.
   With no mark (a page opened as a file) the invite-only copy shows. */
html[data-signup="open"] [data-signup-only="invite"],
html:not([data-signup="open"]) [data-signup-only="open"] { display: none !important; }
