/* =====================================================
   tokens.css - the single source of truth for the look.
   Change a value here and every redesigned page updates.
   ===================================================== */

/* Self-hosted Inter font (works even if college Wi-Fi blocks Google Fonts) */
@font-face {
  font-family: 'Inter';
  font-weight: 400;
  font-display: swap;
  src: url('../public/fonts/inter-latin-400-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Inter';
  font-weight: 500;
  font-display: swap;
  src: url('../public/fonts/inter-latin-500-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Inter';
  font-weight: 600;
  font-display: swap;
  src: url('../public/fonts/inter-latin-600-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Inter';
  font-weight: 700;
  font-display: swap;
  src: url('../public/fonts/inter-latin-700-normal.woff2') format('woff2');
}

:root {
  /* ---- Neutrals: charcoal and white do most of the work ---- */
  --ink-900: #202328; /* headings, primary text */
  --ink-700: #3a3f47; /* body text */
  --ink-500: #5b616b; /* secondary text */
  --ink-400: #6b717b; /* placeholders (4.8:1 on white, meets WCAG AA) */
  --line: #e1e4e8; /* card and divider borders */
  --line-strong: #c9ced5; /* decorative: step markers, dashed lunch lines, tracks. Not for control edges */
  --card-edge: #c8cdd5; /* cards and panels: about 1.5:1 on the page so a card reads as a card */
  --control-edge: #86898e; /* inputs, segmented controls, icon buttons: 3:1 (WCAG 1.4.11) */
  --canvas: #f4f5f7; /* page background */
  --surface: #ffffff; /* cards, header */
  --summary-surface: #f8fafc;

  /* ---- Brand accent: red from the MIT logo. Use sparingly. ---- */
  --red-600: #d1222e; /* primary buttons, links, active states */
  --red-700: #ad1b25; /* hover */
  --red-50: #fdedee; /* soft red backgrounds */

  /* ---- Status colors (always paired with an icon or text, never color alone) ---- */
  --success-600: #1e7a46;
  --success-50: #e7f5ec;
  --warning-600: #946200; /* 4.8:1 on --warning-50 (was 4.4:1) */
  --warning-50: #fff4d6;
  --danger-600: #b42318;
  --danger-50: #fdeceb;
  --info-600: #1f5fbf;
  --info-50: #e8f0fc;

  /* ---- Type ---- */
  --font-sans:
    'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.375rem;
  --text-2xl: 1.75rem;
  --text-3xl: 2.25rem;
  --text-4xl: 3rem;

  /* ---- Shape and depth ---- */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 2px rgba(32, 35, 40, 0.08), 0 2px 6px rgba(32, 35, 40, 0.05);
  --shadow-md: 0 8px 24px rgba(32, 35, 40, 0.1);

  /* ---- Spacing scale ---- */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;
  --space-8: 4rem;

  /* ---- Layout ---- */
  --content-width: 1120px;
  --touch-target: 44px; /* minimum comfortable tap size on phones */
  --row-hover: #fafbfc; /* table row hover */
  --toast-bg: #202328;
  --toast-ink: #ffffff;
  color-scheme: light;

  /* ---- Text on the brand red (buttons, active steps). Dark in dark mode, where the red is lighter. ---- */
  --on-red: #fff; /* 5.3:1 on --red-600 */
  --scrim: rgba(32, 35, 40, 0.8); /* behind a white icon laid over a photo */
  --head-bg: #e7eaee; /* table header rows */

  /* ---- The timetable sheet: a copy of the printed paper, so it is the same in light and dark mode ---- */
  --sheet-paper: #fff;
  --sheet-ink: #000; /* lines and big text */
  --sheet-ink-2: #202020; /* text in the cells */
  --sheet-ink-3: #333; /* the "shared" mark */
  --sheet-ink-4: #5f5f5f; /* the "+" in empty cells: 6.4:1 on paper */
  --sheet-line: #767676; /* dashed edge of the add buttons: 4.5:1 on paper */
  --sheet-sat: #c5e0b4; /* Saturday row */
  --sheet-head: #d0d0d0; /* sheet header cells */
  --sheet-accent: #b42318; /* hover on the add buttons: 6.6:1 on paper */
  --sheet-new: #2e9d57; /* a cell that will be added: 3.4:1 on paper */
  --sheet-changed: #b86200; /* a cell that will change: 4.4:1 on paper */
  --sheet-removed: #c0392b; /* a cell that will be removed: 5.4:1 on paper */
  --sheet-ghost: #8a2b22; /* struck-through text of a removed cell: 8.6:1 on paper */
}

/* ---------- Dark theme ----------
   Only the token values change; every component already reads them.
   Applies when the person's device is set to dark, unless they picked Light
   with the theme button (data-theme="light"). data-theme="dark" forces dark.
   The two blocks below must stay identical. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --ink-900: #f1f3f5;
    --ink-700: #d3d7dd;
    --ink-500: #a4abb5;
    --ink-400: #98a0ab;
    --line: #343a42;
    --line-strong: #4a515b;
    --card-edge: #3c434c;
    --control-edge: #707882;
    --canvas: #15171a;
    --surface: #1e2125;
    --summary-surface: #1e293b;
    --red-600: #ef5560; /* lighter so it keeps 4.5:1 contrast on dark surfaces */
    --on-red: #1a0608; /* 5.7:1 on the lighter red */
    --head-bg: #2d333b;
    --red-700: #f4747d;
    --red-50: #361b1e;
    --success-600: #4cc38a;
    --success-50: #16301f;
    --warning-600: #e8b04a;
    --warning-50: #382c10;
    --danger-600: #ff8a80;
    --danger-50: #3b1c19;
    --info-600: #6ba4f5;
    --info-50: #172a47;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.5);
    --row-hover: #262a30;
    --toast-bg: #f1f3f5;
    --toast-ink: #15171a;
    color-scheme: dark;
  }
}
:root[data-theme='dark'] {
  --ink-900: #f1f3f5;
  --ink-700: #d3d7dd;
  --ink-500: #a4abb5;
  --ink-400: #98a0ab;
  --line: #343a42;
  --line-strong: #4a515b;
  --card-edge: #3c434c;
  --control-edge: #707882;
  --canvas: #15171a;
  --surface: #1e2125;
  --summary-surface: #1e293b;
  --red-600: #ef5560;
  --on-red: #1a0608;
  --head-bg: #2d333b;
  --red-700: #f4747d;
  --red-50: #361b1e;
  --success-600: #4cc38a;
  --success-50: #16301f;
  --warning-600: #e8b04a;
  --warning-50: #382c10;
  --danger-600: #ff8a80;
  --danger-50: #3b1c19;
  --info-600: #6ba4f5;
  --info-50: #172a47;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.5);
  --row-hover: #262a30;
  --toast-bg: #f1f3f5;
  --toast-ink: #15171a;
  color-scheme: dark;
}
