/*
 * Tanzschule Happy Feet design tokens (v1)
 * https://design.tanzschule-happyfeet.ch/v1/tokens.css
 *
 * Colors are stored as "r, g, b" triplets so you can add opacity:
 *   color: rgb(var(--blue-1-rgb));
 *   background: rgba(var(--blue-6-rgb), 0.3);
 * Ready-to-use aliases are also available: var(--blue-1), var(--accent), ...
 *
 * Dark mode follows the OS setting. Opt out with <html data-theme="light">,
 * force it with <html data-theme="dark">.
 */

:root {
  color-scheme: light;

  /* Brand blues: 1 = darkest, 6 = lightest (swapped in dark mode) */
  --blue-1-rgb: 24, 35, 47;    /* #18232F */
  --blue-2-rgb: 48, 71, 94;    /* #30475E */
  --blue-3-rgb: 67, 88, 109;   /* #43586D */
  --blue-4-rgb: 182, 200, 218; /* #B6C8DA */
  --blue-5-rgb: 197, 211, 225; /* #C5D3E1 */
  --blue-6-rgb: 231, 237, 243; /* #E7EDF3 */

  /* Accent (one color, same in light and dark mode) */
  --accent-rgb: 217, 154, 69; /* #D99A45 */

  /* Status */
  --green-rgb: 36, 179, 130; /* #24B382 */
  --red-rgb: 161, 89, 89;    /* #A15959 */

  /* Spacing */
  --spacing-l: 2rem;
  --spacing-m: 1rem;
  --spacing-s: 0.5rem;
  --spacing-xs: 0.2rem;

  --padding-xl: 2rem 2.5rem;
  --padding-l: 1rem 2rem;
  --padding-m: 0.8rem 1.2rem;
  --padding-s: 8px 12px;
  --padding-xs: 5px 8px;
  --padding-xxs: 1px 6px;

  /* Shape and motion */
  --border-radius: 8px;
  --transition: 0.15s ease-in-out;

  /* Fonts. Expo Sans Pro is loaded via Adobe Fonts (Typekit), not from this host. */
  --font-heading: 'Billion Dreams', cursive;
  --font-body: expo-sans-pro, system-ui, 'Segoe UI', Roboto, Arial, sans-serif;
  --font-condensed: expo-sans-pro-condensed, expo-sans-pro, system-ui, sans-serif;
}

/* Dark mode: same token names, values swapped */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --blue-1-rgb: 231, 237, 243;
    --blue-2-rgb: 197, 211, 225;
    --blue-3-rgb: 182, 200, 218;
    --blue-4-rgb: 67, 88, 109;
    --blue-5-rgb: 48, 71, 94;
    --blue-6-rgb: 24, 35, 47;
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --blue-1-rgb: 231, 237, 243;
  --blue-2-rgb: 197, 211, 225;
  --blue-3-rgb: 182, 200, 218;
  --blue-4-rgb: 67, 88, 109;
  --blue-5-rgb: 48, 71, 94;
  --blue-6-rgb: 24, 35, 47;
}

/*
 * Inverse surface: a dark panel on the light theme (and a light one on the
 * dark theme). Inside it the blues are flipped, so text, fields, checkboxes
 * and buttons use their dark-surface colors without extra CSS.
 *
 *   <form class="hf-inverse" style="background: var(--blue-6)"> … </form>
 *
 * Note: the panel's own background is var(--blue-6) *inside* the inverse,
 * which renders dark on the light theme.
 */
.hf-inverse {
  color-scheme: dark;
  --blue-1-rgb: 231, 237, 243;
  --blue-2-rgb: 197, 211, 225;
  --blue-3-rgb: 182, 200, 218;
  --blue-4-rgb: 67, 88, 109;
  --blue-5-rgb: 48, 71, 94;
  --blue-6-rgb: 24, 35, 47;
  color: var(--blue-1);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .hf-inverse {
    color-scheme: light;
    --blue-1-rgb: 24, 35, 47;
    --blue-2-rgb: 48, 71, 94;
    --blue-3-rgb: 67, 88, 109;
    --blue-4-rgb: 182, 200, 218;
    --blue-5-rgb: 197, 211, 225;
    --blue-6-rgb: 231, 237, 243;
  }
}

:root[data-theme="dark"] .hf-inverse {
  color-scheme: light;
  --blue-1-rgb: 24, 35, 47;
  --blue-2-rgb: 48, 71, 94;
  --blue-3-rgb: 67, 88, 109;
  --blue-4-rgb: 182, 200, 218;
  --blue-5-rgb: 197, 211, 225;
  --blue-6-rgb: 231, 237, 243;
}

/*
 * Derived tokens, recomputed on the root and on every .hf-inverse panel.
 * If you re-theme a section yourself by overriding a triplet on another
 * element (e.g. .panel { --blue-6-rgb: ... }), use rgb(var(--blue-6-rgb))
 * there, not var(--blue-6): the alias keeps the value from above.
 */
:root,
.hf-inverse {
  --blue-1: rgb(var(--blue-1-rgb));
  --blue-2: rgb(var(--blue-2-rgb));
  --blue-3: rgb(var(--blue-3-rgb));
  --blue-4: rgb(var(--blue-4-rgb));
  --blue-5: rgb(var(--blue-5-rgb));
  --blue-6: rgb(var(--blue-6-rgb));
  --accent: rgb(var(--accent-rgb));
  --green: rgb(var(--green-rgb));
  --red: rgb(var(--red-rgb));

  --gradient-dark: linear-gradient(210deg, var(--blue-6), var(--blue-4));
  --gradient-light: linear-gradient(210deg, var(--blue-4), var(--blue-2));
  --box-shadow: 2px 4px 20px 5px rgba(var(--blue-6-rgb), 0.3);
}
