/* Radio Bici — "L'Officina"
 *
 * The site has no photographs at all, and the content is tools and torque:
 * numbers, thresholds, materials. So it is designed as a workshop bench
 * rather than a magazine — graph-paper ground, technical drawing rules,
 * monospace figures, and tables treated as the primary content type rather
 * than an afterthought.
 *
 * The name suggests broadcast, but the content is maintenance. Design follows
 * the content.
 */

/* ------------------------------------------------------------------ font -- */

/* Space Grotesk for headings: drawn from a monospace, so it keeps the
 * engineering register without the rigidity of setting titles in mono. IBM
 * Plex Sans for running text — the family was made for technical
 * documentation and shares its skeleton with Plex Mono, which carries every
 * torque figure, capacity and measurement. One voice, three registers. */

@font-face {
  font-family: "Space Grotesk";
  src: url("../fonts/space-grotesk-latin-var.woff2") format("woff2-variations");
  font-weight: 400 700;
  font-display: swap;
}

@font-face {
  font-family: "IBM Plex Sans";
  src: url("../fonts/ibm-plex-sans-latin-var.woff2") format("woff2-variations");
  font-weight: 400 600;
  font-display: swap;
}

@font-face {
  font-family: "IBM Plex Mono";
  src: url("../fonts/ibm-plex-mono-latin-400.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}

/* ----------------------------------------------------------------- token -- */

:root {
  --acciaio: #16191d;
  --acciaio-tenue: #5b636d;
  --banco: #f4f5f2;
  --pannello: #ffffff;
  /* 5.35:1 on white. The brighter amber this began as measured 2.91:1 and
   * failed AA wherever it carried text (current menu item, link hover, the
   * footer brand). The bright tone is kept for rules and borders, which are
   * decoration and only need 3:1. */
  --giallo: #9e5a10;
  --giallo-vivo: #cc7718;
  --verde: #2f6b4f;
  --filo: #d9dcd6;
  --griglia: rgba(22, 25, 29, 0.055);

  --fondo: var(--banco);
  --superficie: var(--pannello);
  --inchiostro: var(--acciaio);
  --inchiostro-tenue: var(--acciaio-tenue);
  --accento: var(--giallo);
  --bordo: var(--filo);

  --titolo: "Space Grotesk", "Helvetica Neue", Arial, sans-serif;
  --testo: "IBM Plex Sans", system-ui, "Segoe UI", sans-serif;
  --dati: "IBM Plex Mono", ui-monospace, Consolas, monospace;

  --misura: 68ch;
  --gutter: 1.25rem;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --fondo: #101215;
    --superficie: #181c20;
    --inchiostro: #e8eaec;
    --inchiostro-tenue: #99a2ac;
    --accento: #f0a04b;
    --bordo: #2c3238;
    --griglia: rgba(232, 234, 236, 0.05);
  }
}

/* ------------------------------------------------------------------ base -- */

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

/* Graph paper: the bench surface, drawn not photographed. */
body {
  margin: 0;
  background-color: var(--fondo);
  background-image:
    linear-gradient(var(--griglia) 1px, transparent 1px),
    linear-gradient(90deg, var(--griglia) 1px, transparent 1px);
  background-size: 22px 22px;
  color: var(--inchiostro);
  font-family: var(--testo);
  font-size: 1.05rem;
  line-height: 1.66;
  -webkit-text-size-adjust: 100%;
}

a {
  color: var(--inchiostro);
  text-decoration-color: var(--accento);
  text-decoration-thickness: 2px;
  text-underline-offset: 0.16em;
}

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

:focus-visible {
  outline: 3px solid var(--accento);
  outline-offset: 2px;
}

.skip {
  position: absolute;
  left: -9999px;
}

.skip:focus {
  position: static;
  display: inline-block;
  padding: 0.6rem 1rem;
  background: var(--giallo-vivo);
  color: #16191d;
}

/* -------------------------------------------------------------- masthead -- */

.masthead {
  background: var(--superficie);
  border-bottom: 1px solid var(--bordo);
}

.masthead__inner {
  max-width: 72rem;
  margin: 0 auto;
  padding: 1.1rem var(--gutter) 0.85rem;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.2rem 1rem;
}

.brand {
  font-family: var(--titolo);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--inchiostro);
  border-left: 5px solid var(--giallo-vivo);
  padding-left: 0.6rem;
}

.brand__tagline {
  margin: 0;
  font-family: var(--dati);
  font-size: 0.74rem;
  color: var(--inchiostro-tenue);
}

/* ------------------------------------------------------------------ menu -- */

.menu {
  background: var(--superficie);
  border-bottom: 1px solid var(--bordo);
}

.menu__inner {
  max-width: 72rem;
  margin: 0 auto;
  padding: 0.75rem var(--gutter) 0.95rem;
  display: grid;
  gap: 0.9rem 2.5rem;
  grid-template-columns: repeat(auto-fit, minmax(12rem, auto));
  justify-content: start;
}

.menu__heading {
  margin: 0 0 0.35rem;
  font-family: var(--dati);
  font-size: 0.64rem;
  font-weight: 400;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--inchiostro-tenue);
  border-bottom: 1px solid var(--bordo);
  padding-bottom: 0.28rem;
}

.menu__list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.menu__link {
  font-size: 0.9rem;
  text-decoration: none;
  color: var(--inchiostro);
}

.menu__link:hover {
  color: var(--accento);
}

.menu__link.is-current {
  color: var(--accento);
  font-weight: 700;
}

/* ------------------------------------------------------------------ main -- */

.main {
  max-width: var(--misura);
  margin: 2rem auto;
  padding: 2rem var(--gutter) 3rem;
  background: var(--superficie);
  border: 1px solid var(--bordo);
}

.main__title {
  margin: 0 0 1.5rem;
  font-family: var(--titolo);
  font-weight: 700;
  font-size: clamp(1.7rem, 5.5vw, 2.5rem);
  line-height: 1.12;
  letter-spacing: -0.025em;
  padding-bottom: 0.9rem;
  border-bottom: 3px solid var(--giallo-vivo);
}

.prose > * + * {
  margin-top: 1.1em;
}

.prose h2 {
  margin-top: 2.3em;
  font-family: var(--titolo);
  font-weight: 700;
  font-size: 1.3rem;
  line-height: 1.25;
  letter-spacing: -0.015em;
  padding-left: 0.7rem;
  border-left: 4px solid var(--giallo-vivo);
}

.prose h3 {
  margin-top: 1.8em;
  font-family: var(--titolo);
  font-weight: 700;
  font-size: 1.02rem;
  color: var(--verde);
}

.prose ul,
.prose ol {
  padding-left: 1.25rem;
}

.prose li + li {
  margin-top: 0.35em;
}

.prose img {
  max-width: 100%;
  height: auto;
}

/* Tables are the point on a maintenance site, not a fallback. */
.prose table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--dati);
  font-size: 0.84rem;
  background: var(--fondo);
}

.prose th,
.prose td {
  border: 1px solid var(--bordo);
  padding: 0.5rem 0.65rem;
  text-align: left;
  vertical-align: top;
}

.prose th {
  background: var(--superficie);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 0.72rem;
}

.prose blockquote {
  margin: 1.5rem 0;
  padding: 0.8rem 1rem;
  background: var(--fondo);
  border-left: 4px solid var(--verde);
  color: var(--inchiostro-tenue);
}

/* ---------------------------------------------------------------- footer -- */

.footer {
  max-width: var(--misura);
  margin: 0 auto 3rem;
  padding: 1.4rem var(--gutter);
  font-family: var(--dati);
  font-size: 0.75rem;
  line-height: 1.65;
  color: var(--inchiostro-tenue);
  border-top: 1px solid var(--bordo);
}

.footer p {
  margin: 0 0 0.35rem;
}

.footer__brand {
  color: var(--accento);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* ---------------------------------------------------------- breakpoints -- */

@media (max-width: 32rem) {
  .menu__inner {
    grid-template-columns: 1fr;
  }

  .main {
    margin: 0 auto;
    border-left: 0;
    border-right: 0;
  }
}

@media (prefers-reduced-motion: no-preference) {
  a,
  .menu__link {
    transition: color 140ms ease;
  }
}
