/*
 * base.css — @font-face + minimal reset + classless dark-theme element base.
 *
 * Purpose: DSGN-02 (fonts applied to elements) and the D-03 load-bearing
 * interim legibility layer — keeps un-reskinned pages legible after Pico
 * is removed (D-02). References tokens.css var(--rp-*) exclusively; no raw
 * hex literals (DSGN-04 single source).
 *
 * Cascade order (must match base.html <link> order):
 *   tokens.css -> base.css -> components.css
 */

/* ---------------------------------------------------------------------
 * (A) @font-face — self-hosted webfonts (D-07/D-08).
 * Filenames below were read directly off disk via
 * `ls src/trapitan/web/static/fonts/*.woff2` (source of truth, RESEARCH
 * Pitfall 3 / W3) — do not hand-edit these without re-confirming against
 * the actual vendored files in that directory.
 * --------------------------------------------------------------------- */
@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/static/fonts/manrope-v20-latin-regular.woff2') format('woff2');
}

@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/static/fonts/manrope-v20-latin-500.woff2') format('woff2');
}

@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/static/fonts/manrope-v20-latin-600.woff2') format('woff2');
}

@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/static/fonts/manrope-v20-latin-700.woff2') format('woff2');
}

@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/static/fonts/jetbrains-mono-v24-latin-regular.woff2') format('woff2');
}

@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/static/fonts/jetbrains-mono-v24-latin-500.woff2') format('woff2');
}

/* ---------------------------------------------------------------------
 * (B) Minimal reset — deliberately ~3 lines. A full Normalize/reset would
 * recreate the framework-opinion fight that removing Pico (D-01) escapes.
 * --------------------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}
body {
  margin: 0;
}
html {
  color-scheme: dark;
}

/* ponytail: light == dark for now (D-05); real light palette is a future phase */
[data-theme="light"] {
  /* intentionally empty — inherits dark tokens */
}

/* ---------------------------------------------------------------------
 * (C) Classless element theming — keeps bare, un-reskinned pages legible
 * after Pico removal (D-02/D-03). Every color/radius/spacing/font value
 * below references tokens.css var(--rp-*); no raw hex literals.
 * --------------------------------------------------------------------- */
body {
  background: var(--rp-surface);
  color: var(--rp-on-surface);
  font-family: var(--rp-font-sans);
  font-size: var(--rp-body-lg-size);
  line-height: var(--rp-body-lg-lh);
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--rp-font-sans);
  margin: 0 0 var(--rp-space-md) 0;
}

h1 {
  font-size: var(--rp-display-sm-size);
  font-weight: var(--rp-display-sm-weight);
  line-height: var(--rp-display-sm-lh);
  letter-spacing: var(--rp-display-sm-ls);
}

h2 {
  font-size: var(--rp-headline-md-size);
  font-weight: var(--rp-headline-md-weight);
  line-height: var(--rp-headline-md-lh);
}

h3,
h4,
h5,
h6 {
  font-size: var(--rp-title-lg-size);
  font-weight: var(--rp-title-lg-weight);
  line-height: var(--rp-title-lg-lh);
}

a {
  color: var(--rp-primary);
}

table {
  border-collapse: collapse;
  width: 100%;
  font-family: var(--rp-font-sans);
}

th,
td {
  padding: var(--rp-space-sm);
  text-align: left;
  border-bottom: 1px solid var(--rp-surface-container-high);
}

th {
  font-size: var(--rp-mono-label-size);
  font-weight: 700;
  line-height: var(--rp-mono-label-lh);
  text-transform: uppercase;
}

td {
  font-size: var(--rp-mono-data-size);
  line-height: var(--rp-mono-data-lh);
}

input,
select,
textarea {
  background: var(--rp-surface);
  color: var(--rp-on-surface);
  font-family: var(--rp-font-sans);
  border: 1px solid var(--rp-outline-variant);
  border-radius: var(--rp-radius);
  padding: var(--rp-space-sm) var(--rp-space-md);
  transition: border-color 0.15s ease;
}

input:focus,
select:focus,
textarea:focus,
input:active,
select:active,
textarea:active {
  border-color: var(--rp-primary);
}

:focus-visible {
  outline: 2px solid var(--rp-primary);
  outline-offset: 2px;
}

/* Rehomed from base.html's inline <style> block (D-02 Pico removal). */
.primary-action,
nav form button,
nav form select {
  min-height: 44px;
}

nav a[aria-current="page"] {
  font-weight: 600;
}
