﻿/* ════════════════════════════════════════════════════════════════════════
   SistemaGym Design System — Colors & Type
   BigTech-leaning refresh. Dark-first with light theme swap via [data-theme="light"].
   ════════════════════════════════════════════════════════════════════════ */

/* Fonts are loaded via <link> in layout.html — no duplicate @import here. */

:root {
  /* ─── Brand ───────────────────────────────────────────────────────── */
  --brand-red:        #9580FF;
  --brand-red-600:    #7B6FE0;
  --brand-red-700:    #B82F28;
  --brand-red-rgb:    149,128,255;
  --brand-ember:      #F59E0B;
  --brand-ember-rgb:  245,158,11;
  --brand-cyan:       #9580FF;
  --brand-cyan-rgb:   149,128,255;
  --brand-violet:     #7B6FE0;
  --brand-emerald:    #2BA37E;

  /* ─── Backgrounds (dark) ──────────────────────────────────────────── */
  --bg-0:             #0A0E17;
  --bg-1:             #0F172A;
  --bg-2:             #1E293B;
  --bg-3:             #334155;
  --bg-card:          rgba(255,255,255,0.03);
  --bg-card-hover:    rgba(255,255,255,0.06);
  --bg-glass:         rgba(15,23,42,0.85);
  --bg-overlay:       rgba(0,0,0,0.55);

  /* ─── Foreground (dark) ───────────────────────────────────────────── */
  --fg-1:             #F1F5F9;
  --fg-2:             #94A3B8;
  --fg-3:             rgba(255,255,255,0.45);
  --fg-on-accent:     #FFFFFF;

  /* ─── Borders & lines ─────────────────────────────────────────────── */
  --border-hairline:  rgba(148,163,184,0.12);
  --border-strong:    rgba(148,163,184,0.24);
  --border-accent:    rgba(149,128,255,0.40);

  /* ─── Semantic ────────────────────────────────────────────────────── */
  --success:          #10B981;
  --success-bg:       rgba(16,185,129,0.12);
  --warning:          #F59E0B;
  --warning-bg:       rgba(245,158,11,0.12);
  --danger:           #EF4444;
  --danger-bg:        rgba(239,68,68,0.12);
  --info:             #3B82F6;
  --info-bg:          rgba(59,130,246,0.12);

  /* ─── Radii ───────────────────────────────────────────────────────── */
  --r-sm:  0.5rem;     /* 8px  */
  --r-md:  0.75rem;    /* 12px */
  --r-lg:  1rem;       /* 16px */
  --r-xl:  1.5rem;     /* 24px */
  --r-pill:9999px;

  /* ─── Spacing (8pt grid) ──────────────────────────────────────────── */
  --s-1:  0.25rem;  /* 4  */
  --s-2:  0.5rem;   /* 8  */
  --s-3:  0.75rem;  /* 12 */
  --s-4:  1rem;     /* 16 */
  --s-5:  1.25rem;  /* 20 */
  --s-6:  1.5rem;   /* 24 */
  --s-8:  2rem;     /* 32 */
  --s-10: 2.5rem;   /* 40 */
  --s-12: 3rem;     /* 48 */
  --s-16: 4rem;     /* 64 */

  /* ─── Shadows ─────────────────────────────────────────────────────── */
  --shadow-card:  0 4px 16px rgba(0,0,0,0.20);
  --shadow-raise: 0 12px 40px rgba(0,0,0,0.30);
  --shadow-pop:   0 25px 50px -12px rgba(0,0,0,0.50);
  --glow-red:     0 0 60px rgba(184,51,104,0.18);
  --glow-cyan:    0 0 60px rgba(149,128,255,0.18);
  --glow-ember:   0 0 60px rgba(180,83,9,0.18);

  /* ─── Focus ring ──────────────────────────────────────────────────── */
  --focus-ring:   0 0 0 3px rgba(149,128,255,0.25);

  /* ─── Motion ──────────────────────────────────────────────────────── */
  --ease-drawer:  cubic-bezier(0.32, 0.72, 0, 1);
  --ease-bar:     cubic-bezier(0.22, 1, 0.36, 1);
  --ease-out:     cubic-bezier(0.16, 1, 0.3, 1);
  --dur-hover:    150ms;
  --dur-state:    250ms;
  --dur-drawer:   300ms;
  --dur-reveal:   600ms;

  /* ─── Type family ─────────────────────────────────────────────────── */
  --font-sans:  'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-display: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono:  'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;

  /* ─── Control heights (matches production layout.html) ────────────── */
  --ctl-sm: 2rem;      /* 32 */
  --ctl-md: 2.5rem;    /* 40 */
  --ctl-lg: 2.875rem;  /* 46 */
  --nav-h:  3.25rem;   /* 52 */
}

/* ─── Light theme swap ────────────────────────────────────────────────── */
[data-theme="light"] {
  --bg-0:            #F9FAFB;
  --bg-1:            #FFFFFF;
  --bg-2:            #F3F4F6;
  --bg-3:            #E5E7EB;
  --bg-card:         #FFFFFF;
  --bg-card-hover:   #F9FAFB;
  --bg-glass:        rgba(255,255,255,0.85);
  --bg-overlay:      rgba(15,23,42,0.45);
  --fg-1:            #111827;
  --fg-2:            #4B5563;
  --fg-3:            #6B7280;
  --border-hairline: #E5E7EB;
  --border-strong:   #D1D5DB;
  --shadow-card:     0 1px 2px rgba(0,0,0,0.04), 0 4px 12px rgba(0,0,0,0.06);
  --shadow-raise:    0 4px 16px rgba(0,0,0,0.08);
  --shadow-pop:      0 16px 40px rgba(0,0,0,0.12);
}

/* ════════════════════════════════════════════════════════════════════════
   TYPOGRAPHY — base + semantic classes
   ════════════════════════════════════════════════════════════════════════ */

html, body {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5;
  color: var(--fg-1);
  background: var(--bg-0);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.font-mono, .mono { font-family: var(--font-mono); }

/* Scale — use as classes, not element selectors */
.t-display {
  font-size: clamp(2.5rem, 4.5vw, 3.5rem);
  line-height: 1.05;
  font-weight: 800;
  letter-spacing: -0.025em;
}
.t-h1 {
  font-size: clamp(2rem, 3vw, 2.5rem);
  line-height: 1.15;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.t-h2 {
  font-size: 2rem;
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: -0.015em;
}
.t-h3 {
  font-size: 1.25rem;
  line-height: 1.3;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.t-h4 {
  font-size: 1rem;
  line-height: 1.4;
  font-weight: 600;
}
.t-body {
  font-size: 0.9375rem;
  line-height: 1.6;
  font-weight: 400;
  color: var(--fg-1);
}
.t-body-sm {
  font-size: 0.8125rem;
  line-height: 1.5;
  font-weight: 400;
  color: var(--fg-2);
}
.t-caption {
  font-size: 0.75rem;
  line-height: 1.4;
  font-weight: 400;
  color: var(--fg-3);
}
.t-label {
  font-size: 0.75rem;
  line-height: 1.2;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--fg-2);
}
.t-eyebrow {
  font-size: 0.8125rem;
  line-height: 1.2;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--brand-red);
}
.t-num {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
}

/* ════════════════════════════════════════════════════════════════════════
   SIGNATURE APP BACKGROUND — radial glow corners
   Apply to <body> on any app shell.
   ════════════════════════════════════════════════════════════════════════ */
.bg-app {
  background-color: var(--bg-0);
  background-image:
    radial-gradient(900px 500px at 8% 10%, rgba(var(--brand-red-rgb), 0.08), transparent 60%),
    radial-gradient(800px 400px at 92% 88%, rgba(var(--brand-cyan-rgb), 0.06), transparent 60%);
  background-attachment: fixed;
}
.bg-grid {
  background-image:
    linear-gradient(rgba(148,163,184,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148,163,184,0.03) 1px, transparent 1px);
  background-size: 64px 64px;
}

/* ════════════════════════════════════════════════════════════════════════
   RESET-ISH — only what we need
   ════════════════════════════════════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; }
button { font-family: inherit; cursor: pointer; }
a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }

::selection { background: rgba(149,128,255,0.30); color: var(--fg-1); }

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(148,163,184,0.2); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(148,163,184,0.35); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}
