/* RistorUp base: reset, type, buttons, inputs, header, footer, cards.
   Needs tokens.css loaded first. */

/* Reset */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 84px;
}
body {
  background: var(--white);
  color: var(--ink);
  font: 400 17px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img, svg, video { display: block; max-width: 100%; }
img { height: auto; }
input, button, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
h1, h2, h3, h4 { font-weight: 800; letter-spacing: -0.03em; line-height: 1.1; text-wrap: balance; }
p { text-wrap: pretty; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* Focus: always visible for keyboard users */
:focus-visible {
  outline: 3px solid var(--focus, var(--ink));
  outline-offset: 3px;
  border-radius: 6px;
}
.on-dark, .on-red { --focus: var(--white); }

/* Helpers */
.container {
  width: 100%;
  max-width: calc(var(--max) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  padding: 12px 18px; border-radius: var(--r-pill);
  background: var(--ink); color: var(--white);
  font-weight: 700; text-decoration: none;
}
.skip-link:focus { top: 12px; }

.i { width: 1em; height: 1em; fill: currentColor; flex: none; }

/* Type */
.eyebrow {
  font: 500 14px/1.2 var(--font-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-secondary);
}
.on-dark .eyebrow { color: var(--text-on-dark); }
.h-display { font-size: clamp(40px, 6.4vw, 80px); line-height: 1; letter-spacing: -0.045em; }
.h-section { font-size: clamp(32px, 4.6vw, 56px); line-height: 1.05; letter-spacing: -0.035em; }
.lead { font-size: clamp(18px, 1.8vw, 21px); line-height: 1.5; color: var(--text-body); }
.meta { font-size: 15px; color: var(--text-secondary); }

/* Buttons: pill, 56px (primary 58px). Red buttons use 19px bold labels so
   white on --red counts as large text for WCAG AA. */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: var(--h-button);
  padding: 0 26px;
  border: 1.5px solid transparent;
  border-radius: var(--r-pill);
  font: 700 17px/1.2 var(--font);
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}
.btn .i { font-size: 22px; }
.btn-primary {
  min-height: var(--h-button-primary);
  background: var(--red); color: var(--white);
  font-size: 19px;
}
.btn-primary:hover { background: var(--red-pressed); }
.btn-primary:active { background: var(--red-pressed); }
.btn-ink { background: var(--ink); color: var(--white); }
.btn-ink:hover { background: #2A2A2A; }
.btn-light { background: var(--white); color: var(--ink); }
.btn-light:hover { background: var(--surface); }
.btn-outline { border-color: var(--ink); color: var(--ink); background: transparent; }
.btn-outline:hover { background: var(--surface); }
.btn-secondary { background: var(--surface); color: var(--ink); }
.btn-secondary:hover { background: var(--disabled-bg); }
.btn-sm { min-height: var(--tap); padding: 0 18px; font-size: 15px; }
.btn-block { display: flex; width: 100%; white-space: normal; padding-inline: 20px; }
.btn[disabled], .btn[aria-disabled="true"] {
  background: var(--disabled-bg); color: var(--disabled-text); border-color: transparent; cursor: not-allowed;
}

/* Text links */
.link {
  color: var(--ink);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 3px;
}
.link:hover { color: var(--red-pressed); }

/* Inputs */
.field { display: flex; flex-direction: column; gap: 8px; }
.field label { font: 600 14px/1.2 var(--font); }
.field .hint { font-size: 15px; color: var(--text-secondary); }
.input {
  width: 100%;
  height: var(--h-field);
  padding: 0 16px;
  border: 1.5px solid transparent;
  border-radius: var(--r-image);
  background: var(--surface);
  font: 500 17px var(--font);
  color: var(--ink);
  transition: background-color .15s ease, border-color .15s ease;
}
.input::placeholder { color: var(--text-secondary); }
.input:focus { outline: none; background: var(--white); border-color: var(--ink); }
.input:focus-visible { outline: none; }

/* Alerts */
.alert { padding: 14px 16px; border-radius: var(--r-image); font-size: 15px; line-height: 1.45; }
.alert-success { background: var(--success-bg); color: var(--success-text); }
.alert-warning { background: var(--warning-bg); color: var(--warning-text); }
.alert-danger { background: var(--danger-bg); color: var(--danger-text); }

/* Cards */
.card { background: var(--white); border-radius: var(--r-card); padding: 28px; }
.card-lg { border-radius: var(--r-card-lg); padding: 32px; }
.card-soft { background: var(--surface-warm); }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: rgba(255, 255, 255, .92);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line-soft);
}
.site-header__in { display: flex; align-items: center; gap: 24px; min-height: 72px; }
.site-header__brand { display: inline-flex; align-items: center; min-height: var(--tap); flex: none; }
.site-header__brand img { width: 88px; height: 30px; }
.site-nav { display: flex; gap: 4px; flex: 1; }
.site-nav a {
  display: inline-flex; align-items: center; min-height: var(--tap); padding: 0 10px;
  font: 500 15px var(--font); color: var(--text-body); text-decoration: none;
  border-radius: var(--r-pill);
}
.site-nav a:hover { color: var(--ink); background: var(--surface); }
.site-header .btn { margin-left: auto; flex: none; }
@media (max-width: 860px) {
  .site-nav { display: none; }
}

/* Footer */
.site-footer { background: var(--ink); color: var(--text-on-dark); --focus: var(--white); }
.site-footer__in {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 16px 24px; padding-block: 32px;
  font: 500 15px var(--font);
}
.site-footer__brand { display: flex; align-items: center; gap: 14px; }
.site-footer__brand img { width: 70px; height: 24px; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 0 20px; }
.site-footer nav a {
  display: inline-flex; align-items: center; min-height: var(--tap);
  color: var(--text-on-dark); text-decoration: none;
}
.site-footer nav a:hover { color: var(--white); text-decoration: underline; text-underline-offset: 3px; }
