/* tokens.css — design tokens for Toastmasters Sibiu
   Brand: Toastmasters International palette (maroon, blue, gold) + Atlassian-inspired UI neutrals. */

:root {
  /* ── Brand (Toastmasters International official) ─────────────────────────── */
  --tm-maroon: #772432;
  --tm-maroon-dark: #5a1a26;
  --tm-maroon-light: #9a3946;
  --tm-blue: #004165;
  --tm-blue-dark: #003150;
  --tm-blue-light: #0a5a83;
  --tm-gold: #F2DF74;
  --tm-gold-soft: #FBF5D8;

  /* ── Neutrals (Atlassian-inspired) ───────────────────────────────────────── */
  --bg: #ffffff;
  --bg-subtle: #f7f8fa;
  --bg-elevated: #ffffff;
  --sidebar-bg: #fbfbfc;
  --border: #e6e8ec;
  --border-strong: #c1c7d0;
  --text: #172b4d;
  --text-secondary: #42526e;
  --text-muted: #6b778c;
  --text-on-brand: #ffffff;

  /* ── Semantic ────────────────────────────────────────────────────────────── */
  --link: var(--tm-blue);
  --link-hover: var(--tm-maroon);
  --accent: var(--tm-maroon);
  --accent-soft: rgba(119, 36, 50, 0.08);
  --focus-ring: 0 0 0 3px rgba(0, 65, 101, 0.35);

  /* ── Type ───────────────────────────────────────────────────────────────── */
  --font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-mono: ui-monospace, 'JetBrains Mono', 'Cascadia Code', 'SF Mono', Menlo, monospace;
  --font-display: 'Inter', system-ui, sans-serif;

  --text-xs: 0.75rem;     /* 12px */
  --text-sm: 0.875rem;    /* 14px */
  --text-base: 0.9375rem; /* 15px — comfortable body */
  --text-md: 1rem;        /* 16px */
  --text-lg: 1.125rem;    /* 18px */
  --text-xl: 1.375rem;    /* 22px */
  --text-2xl: 1.75rem;    /* 28px */
  --text-3xl: 2.25rem;    /* 36px */

  --leading-tight: 1.25;
  --leading-snug: 1.4;
  --leading-normal: 1.6;
  --leading-relaxed: 1.7;

  /* ── Spacing scale (4px base) ───────────────────────────────────────────── */
  --sp-1: 0.25rem;
  --sp-2: 0.5rem;
  --sp-3: 0.75rem;
  --sp-4: 1rem;
  --sp-5: 1.25rem;
  --sp-6: 1.5rem;
  --sp-7: 2rem;
  --sp-8: 2.5rem;
  --sp-10: 3rem;
  --sp-12: 4rem;
  --sp-16: 5rem;

  /* ── Layout ─────────────────────────────────────────────────────────────── */
  --sidebar-w: 280px;
  --sidebar-w-md: 240px;
  --content-max: 800px;
  --header-h: 56px;

  /* ── Effects ────────────────────────────────────────────────────────────── */
  --radius-sm: 4px;
  --radius: 8px;
  --radius-lg: 12px;
  --radius-pill: 999px;

  --shadow-sm: 0 1px 2px rgba(9, 30, 66, 0.08);
  --shadow: 0 4px 8px -2px rgba(9, 30, 66, 0.1), 0 0 1px rgba(9, 30, 66, 0.31);
  --shadow-lg: 0 12px 24px -6px rgba(9, 30, 66, 0.15), 0 0 1px rgba(9, 30, 66, 0.31);
  --shadow-overlay: 0 24px 48px -12px rgba(9, 30, 66, 0.25), 0 0 1px rgba(9, 30, 66, 0.31);

  --transition-fast: 120ms cubic-bezier(0.2, 0, 0, 1);
  --transition: 180ms cubic-bezier(0.2, 0, 0, 1);
  --transition-slow: 280ms cubic-bezier(0.2, 0, 0, 1);

  /* ── z-index scale ──────────────────────────────────────────────────────── */
  /* Atlassian-style drawer stacking: backdrop < sidebar < toggle.
     Backdrop must sit BELOW the sidebar so it dims the content but not the
     drawer itself; toggle must sit ABOVE sidebar so users can close from
     either side (button stays tappable when drawer is open). */
  --z-backdrop: 150;
  --z-sidebar: 200;
  --z-toggle: 250;
  --z-overlay: 300;
  --z-tooltip: 400;
}

@media (prefers-color-scheme: dark) {
  /* Dark mode reserved for v2 — for now we honor user pref but keep light. */
}

/* Respect motion preferences */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Universal reset */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  font-feature-settings: 'cv05', 'cv11', 'ss01';
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  min-height: 100dvh;
}

img, svg { display: block; max-width: 100%; }
button { font-family: inherit; cursor: pointer; background: none; border: none; color: inherit; }
input, textarea, select { font-family: inherit; font-size: inherit; }

a { color: var(--link); text-decoration: none; transition: color var(--transition-fast); }
a:hover { color: var(--link-hover); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:focus-visible { outline: none; box-shadow: var(--focus-ring); border-radius: 2px; }

button:focus-visible, [tabindex]:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

kbd {
  font-family: var(--font-mono);
  font-size: 0.75em;
  padding: 1px 5px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-bottom-width: 2px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  line-height: 1;
}

::selection { background: var(--tm-gold); color: var(--tm-maroon-dark); }

/* Skip link */
.skip-link {
  position: absolute; top: -100px; left: var(--sp-3);
  background: var(--tm-maroon); color: white;
  padding: var(--sp-2) var(--sp-3); border-radius: var(--radius);
  z-index: 1000; font-weight: 500;
  transition: top var(--transition);
}
.skip-link:focus { top: var(--sp-3); }
