/* Riold Visual System - Foundation Core
   Derived from the proven design contract of skipdealer.
   Typography: Unbounded (Headings, Uppercase-only) + JetBrains Mono (Body/Data)
   All font-sizes derive from tokens. Pure semantic palette.
*/

/* 1. FONTS */
@font-face {
  font-family: "Unbounded";
  src: url("../fonts/Unbounded-latin.woff2") format("woff2");
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  unicode-range: U+0020-0060, U+007B-007E, U+00A0-00BF, U+00C0-00DE,
    U+2013-2014, U+2018-201A, U+201C-201E, U+2022, U+2026, U+2039-203A, U+2192,
    U+20AC;
}

@font-face {
  font-family: "JetBrains Mono";
  src: url("../fonts/JetBrainsMono-latin.woff2") format("woff2");
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  unicode-range: U+0000-00FF, U+2013-2014, U+2018-201A, U+201C-201E, U+2022,
    U+2026, U+2039-203A, U+2192, U+20AC;
}

/* 2. DESIGN TOKENS */
:root {
  color-scheme: light;

  /* Palette */
  --ink: #1a1a1a;
  --muted: #555555;
  --quiet: #6b6b6b;
  --line: #e5e5e5;
  --line-strong: #cfcdcd;
  --line-ink: #575757;
  --paper: #ffffff;
  --paper-muted: #d2d2d2;
  --wash: #f5f5f5;
  --wash-warm: #fbf9f8;

  /* Brand and State Accents */
  --red: #b70127;
  --red-dark: #8b001b;
  --red-soft: #f9e9ec;
  --green: #0b7a35;
  --green-soft: #e7f3eb;

  /* Geometry & Grid */
  --radius: 4px;
  --shell: 72rem;
  --shell-wide: 80rem;
  --gutter: clamp(1rem, 4vw, 2.5rem);
  --section: clamp(2rem, 4vw, 3rem);

  /* Typography Families */
  --heading: "Unbounded", "Arial Black", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  /* Responsive Type Scale (375px mobile -> 1440px desktop) */
  --h1: clamp(1.55rem, 5.6vw, 2.5rem);
  --h2: clamp(1.4rem, 4.9vw, 2.2rem);
  --sub: clamp(1.125rem, 1.037rem + 0.376vw, 1.375rem);
  --wordmark: clamp(1rem, 4.6vw, 1.35rem);
  --figure: clamp(1.65rem, 7vw, 2.35rem);
  --figure-small: clamp(1.1rem, 5vw, 1.6rem);

  --copy-lead: clamp(1.0625rem, 0.996rem + 0.282vw, 1.25rem);
  --copy: clamp(1rem, 0.956rem + 0.188vw, 1.125rem);
  --copy-small: clamp(0.875rem, 0.842rem + 0.141vw, 0.969rem);

  --label: clamp(0.8125rem, 0.79rem + 0.094vw, 0.875rem);
  --label-strong: clamp(0.875rem, 0.853rem + 0.094vw, 0.9375rem);
}

/* 3. BASE NORMALIZATION & RESETS */
*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 20rem;
  min-height: 100dvh;
  background: var(--paper);
  color: var(--ink);
  font: 400 1rem/1.55 var(--mono);
  text-rendering: optimizeLegibility;
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
summary,
a {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
}

img,
svg {
  display: block;
  max-width: 100%;
}

/* 4. TYPOGRAPHY RULES */
/* Uppercase is mandatory for Unbounded because the subset contains no lowercase letters. */
h1,
h2,
h3,
.wordmark {
  font-family: var(--heading);
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0.75rem;
  font-size: var(--h1);
  font-weight: 650;
  line-height: 1.2;
  letter-spacing: -0.025em;
  text-wrap: balance;
}

h2 {
  margin-bottom: 1.25rem;
  font-size: var(--h2);
  font-weight: 650;
  line-height: 1.2;
  letter-spacing: -0.025em;
  text-wrap: balance;
}

h3 {
  margin-bottom: 0.75rem;
  font-size: var(--sub);
  font-weight: 650;
  line-height: 1.3;
  letter-spacing: -0.015em;
}

p {
  margin-bottom: 1.25rem;
  font-size: var(--copy);
  line-height: 1.65;
  color: var(--ink);
}

.copy-lead {
  font-size: var(--copy-lead);
  line-height: 1.75;
  color: var(--muted);
}

.copy-small {
  font-size: var(--copy-small);
  line-height: 1.55;
  color: var(--quiet);
}

.eyebrow {
  margin-bottom: 0.5rem;
  color: var(--quiet);
  font-size: var(--label);
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.text-link {
  color: var(--red);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.15s ease;
}

.text-link:hover {
  border-bottom-color: var(--red);
}

/* 5. LAYOUT PRIMITIVES */
.shell {
  width: min(100%, var(--shell));
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.shell-wide {
  width: min(100%, var(--shell-wide));
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section-pad {
  padding-block: var(--section);
}

.section-border {
  border-top: 1px solid var(--line);
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr));
  gap: 1.5rem;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 28rem), 1fr));
  gap: 2rem;
}

/* 6. UI PRIMITIVES: BUTTONS, CARDS, BADGES */
/* Brand lockup: logo mark (static/img/logo-mark.svg, inlined with fill="currentColor") + wordmark in Unbounded 400. */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.22em;
  font-size: var(--wordmark);
  color: var(--red);
  text-decoration: none;
}

.brand-mark {
  height: 1.1em;
  width: auto;
  fill: currentColor;
}

.wordmark {
  font-size: var(--wordmark);
  font-weight: 400;
  line-height: 1;
  letter-spacing: -0.01em;
  color: var(--red);
  text-decoration: none;
}

.brand .wordmark {
  font-size: inherit;
  color: inherit;
}

.section-dark .brand {
  color: var(--paper);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 3rem;
  padding: 0.75rem 1.5rem;
  font-size: var(--label-strong);
  font-weight: 750;
  letter-spacing: 0.075em;
  text-align: center;
  text-decoration: none;
  text-transform: uppercase;
  border: 1px solid transparent;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.button-primary {
  color: var(--paper);
  background: var(--red);
  border-color: var(--red);
}

.button-primary:hover {
  background: var(--red-dark);
  border-color: var(--red-dark);
}

.button-secondary {
  color: var(--ink);
  background: transparent;
  border-color: var(--line-strong);
}

.button-secondary:hover {
  background: var(--wash);
  border-color: var(--ink);
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.card {
  padding: clamp(1.25rem, 3vw, 2rem);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.card-wash {
  background: var(--wash);
  border-color: var(--line);
}

.card:hover {
  border-color: var(--line-strong);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.25rem 0.65rem;
  font-size: var(--label);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: var(--wash);
  border: 1px solid var(--line);
  border-radius: 999px;
}

.badge-green {
  color: var(--green);
  background: var(--green-soft);
  border-color: transparent;
}

.badge-red {
  color: var(--red);
  background: var(--red-soft);
  border-color: transparent;
}

/* 7. DISCLOSURE & DETAILS */
details > summary {
  list-style: none;
  cursor: pointer;
}

details > summary::-webkit-details-marker {
  display: none;
}

.disclosure {
  border-bottom: 1px solid var(--line);
}

.disclosure summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 0;
  font-family: var(--heading);
  font-size: var(--sub);
  font-weight: 650;
  text-transform: uppercase;
  color: var(--ink);
}

.disclosure summary::after {
  content: "+";
  font-family: var(--mono);
  font-size: var(--sub);
  color: var(--quiet);
  transition: transform 0.2s ease;
}

.disclosure[open] summary::after {
  content: "−";
}

.disclosure-body {
  padding-bottom: 1.25rem;
}

/* 8. DARK CHAPTERS / INVERTED BANDS */
/* Rules from skipdealer:
   - Full-width band with background: var(--ink)
   - Running prose uses var(--paper-muted) (#d2d2d2), never var(--muted)
   - Headings use var(--paper) (#fff)
   - Hairlines and secondary button borders use var(--line-ink) (#575757)
   - Eyebrows carry the signature red accent line
*/
.section-dark {
  color: var(--paper-muted);
  background: var(--ink);
  border-top: 1px solid var(--line-ink);
  border-bottom: 1px solid var(--line-ink);
}

.section-dark h1,
.section-dark h2,
.section-dark h3 {
  color: var(--paper);
}

.section-dark p {
  color: var(--paper-muted);
}

.section-dark .copy-lead {
  color: var(--paper-muted);
}

.section-dark .copy-small {
  color: var(--paper-muted);
}

.section-dark .eyebrow {
  position: relative;
  margin: 0 0 0.75rem;
  padding-top: 0.875rem;
  color: var(--paper);
}

.section-dark .eyebrow::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 2.25rem;
  height: 3px;
  background: var(--red);
}

.section-dark .button-secondary {
  color: var(--paper);
  border-color: var(--line-ink);
  background: transparent;
}

.section-dark .button-secondary:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--paper);
}

.section-dark .card {
  background: rgba(255, 255, 255, 0.03);
  border-color: var(--line-ink);
}

.section-dark .card:hover {
  border-color: var(--paper-muted);
}

.section-dark .card h3 {
  color: var(--paper);
}

.section-dark .badge {
  background: rgba(255, 255, 255, 0.08);
  color: var(--paper);
  border-color: var(--line-ink);
}

