/* assets/css/01-variables.css
 *
 * Overrides chota's CSS custom properties rather than writing new
 * selectors. "Work with chota, not against it." Full list of chota's
 * variables: https://jenil.github.io/chota/#colors
 *
 * This file is a Nunjucks template that pulls all design tokens from
 * src/_data/site.js (fonts and theme sections). To customize your site's
 * appearance, edit site.js instead of this file. The CSS will automatically
 * pick up your changes on the next build.
 */

/* chota sets the <html> root font-size to 62.5% (so 1rem = 10px) and then
 * scales `body` back up with `--font-size: 1.6rem` (10px * 1.6 = 16px).
 * That's fine for chota's own components, which are all sized in rem to
 * match. But it means any *other* rem value in this file (or yours) is
 * secretly 62.5% of what it looks like. Resetting the root to 100% (so
 * 1rem = 16px, the normal browser default) makes every size in this
 * starter's CSS mean what it says. */
html {
  font-size: 100%;
  box-sizing: border-box;
}

*, *::before, *::after {
  box-sizing: inherit;
}

body {
  max-width: 100vw;
  overflow-x: hidden;
}

/* Global image rules - ensure all images honor viewport */
img {
  max-width: 100%;
  height: auto;
  display: block;
}

:root {
  --font-family-body: system-ui, -apple-system, sans-serif;
  --font-family-sans: system-ui, -apple-system, sans-serif;
  --font-family-mono: ui-monospace, 'Cascadia Code', 'Source Code Pro', Menlo, Consolas, 'DejaVu Sans Mono', monospace;
  --font-size: 1rem;

  --bg-color: #f5f5f5;
  --bg-secondary-color: #e3e3e1;
  --font-color: #171e1e;

  /* The one accent color in this file. */
  --color-primary: #610404;

  --color-lightGrey: #b9bcb2;
  --color-grey: #565c5c;
  --color-darkGrey: #171e1e;
  --color-error: #8a1212;
  --color-success: #3b4a4a;

  /* Not chota variables. chota doesn't expose separate visited/hover
     link colors of its own, so these are used directly in the split CSS files.
     `--color-lightGrey` doubles as the border color throughout. */
  --link-color: var(--color-primary);
  --link-visited-color: #565c5c;
  --link-hover-color: #610404;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-family-sans);
}

a {
  color: var(--link-color);
}

a:visited {
  color: var(--link-visited-color);
}

a:hover {
  color: var(--link-hover-color);
}

/* chota ships light/dark support via [data-theme="dark"] on <html>, but a
   zero-JS CSS-only prefers-color-scheme toggle costs nothing and fits the
   "as little JS as possible" ethos. See README.md for how to
   layer a manual localStorage-backed toggle on top if you want one. */
@media (prefers-color-scheme: dark) {
  :root {
    --bg-color: #18181b;
    --bg-secondary-color: #27272a;
    --font-color: #f4f4f5;

    --color-primary: #6d8cf0;

    --color-lightGrey: #3f3f46;
    --color-grey: #52525b;
    --color-darkGrey: #a1a1aa;
    --color-error: #f87171;
    --color-success: #4ade80;

    --link-color: var(--color-primary);
    --link-visited-color: #a68df0;
    --link-hover-color: #93b4ff;
  }
}
