/**
 * base.css
 * Reset, root-level styles, typography base, accessibility utilities.
 * Depends on: tokens.css
 */

/* --------------------------------------------------------------------------
 * Box-sizing reset
 * -------------------------------------------------------------------------- */

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

/* --------------------------------------------------------------------------
 * Root / HTML / Body
 * -------------------------------------------------------------------------- */

html {
  font-size: 100%; /* 16px base */
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  font-size: var(--text-body);
  font-weight: 400;
  line-height: var(--lh-body);
  color: var(--color-ink-700);
  background-color: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  min-width: 320px;
  overflow-x: hidden;
}

/* --------------------------------------------------------------------------
 * Typography — headings
 * -------------------------------------------------------------------------- */

h1, .h1 {
  font-family: var(--font-sans);
  font-size: var(--text-h1);
  font-weight: 500;
  line-height: var(--lh-h1);
  letter-spacing: var(--ls-h1);
  color: var(--color-ink-900);
  text-wrap: balance;
}

h2, .h2 {
  font-family: var(--font-sans);
  font-size: var(--text-h2);
  font-weight: 500;
  line-height: var(--lh-h2);
  letter-spacing: var(--ls-h2);
  color: var(--color-ink-900);
  text-wrap: balance;
}

h3, .h3 {
  font-family: var(--font-sans);
  font-size: var(--text-h3);
  font-weight: 500;
  line-height: var(--lh-h3);
  letter-spacing: var(--ls-h3);
  color: var(--color-ink-900);
  text-wrap: balance;
}

h4, .h4 {
  font-family: var(--font-sans);
  font-size: var(--text-h4);
  font-weight: 500;
  line-height: var(--lh-h4);
  color: var(--color-ink-900);
}

h5, .h5 {
  font-family: var(--font-sans);
  font-size: var(--text-h5);
  font-weight: 500;
  line-height: var(--lh-h5);
  color: var(--color-ink-900);
}

h6, .h6 {
  font-family: var(--font-sans);
  font-size: var(--text-h6);
  font-weight: 600;
  letter-spacing: var(--ls-h6);
  color: var(--color-ink-900);
}

/* --------------------------------------------------------------------------
 * Typography — body variants
 * -------------------------------------------------------------------------- */

.body-lg {
  font-size: var(--text-body-lg);
  font-weight: 400;
  line-height: var(--lh-body-lg);
  color: var(--color-ink-700);
}

.body-sm {
  font-size: var(--text-body-sm);
  font-weight: 400;
  line-height: var(--lh-body-sm);
  color: var(--color-ink-500);
}

.meta {
  font-size: var(--text-meta);
  font-weight: 500;
  line-height: var(--lh-meta);
  color: var(--color-ink-500);
}

/* --------------------------------------------------------------------------
 * Typography — eyebrow (mono uppercase)
 * -------------------------------------------------------------------------- */

.eyebrow {
  font-family: var(--font-mono);
  font-size: var(--text-eyebrow);
  font-weight: 500;
  letter-spacing: var(--ls-eyebrow);
  text-transform: uppercase;
  color: var(--color-ink-500);
  display: block;
}

/* --------------------------------------------------------------------------
 * Typography — mono data label
 * -------------------------------------------------------------------------- */

.mono,
.mono-data {
  font-family: var(--font-mono);
  font-size: var(--text-mono);
  font-weight: 400;
}

/* --------------------------------------------------------------------------
 * Typography — inline elements
 * -------------------------------------------------------------------------- */

p {
  color: var(--color-ink-700);
}

p + p {
  margin-top: var(--space-4);
}

a {
  color: var(--color-brand-green);
  text-decoration: none;
  transition: color var(--dur-fast) var(--ease-out);
}

a:hover {
  color: var(--color-brand-green-hover);
}

strong {
  font-weight: 600;
  color: inherit;
}

/* --------------------------------------------------------------------------
 * Lists
 * -------------------------------------------------------------------------- */

ul, ol {
  list-style: none;
}

/* --------------------------------------------------------------------------
 * Images and media
 * -------------------------------------------------------------------------- */

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

img {
  height: auto;
}

/* --------------------------------------------------------------------------
 * Icon base styles
 * All inline SVG icons carry the .icon class set in svg-icons.php.
 * -------------------------------------------------------------------------- */

.icon {
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: butt;
  stroke-linejoin: miter;
  fill: none;
  transition: stroke-width var(--dur-fast) var(--ease-out);
}

/* --------------------------------------------------------------------------
 * Buttons
 * -------------------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-sans);
  font-size: var(--text-body-sm);
  font-weight: 500;
  line-height: 1;
  letter-spacing: 0.01em;
  text-decoration: none;
  border: none;
  cursor: pointer;
  padding: 0 var(--space-6);
  height: 52px;
  transition:
    background-color var(--dur-fast) var(--ease-out),
    color var(--dur-fast) var(--ease-out);
}

.btn--primary {
  background-color: var(--color-brand-green);
  color: var(--color-ink-900);
  border-radius: var(--radius-btn);
}

.btn--primary:hover,
.btn--primary:focus-visible {
  background-color: var(--color-brand-green-hover);
  color: var(--color-ink-900);
}

.btn--dark {
  background-color: var(--color-ink-900);
  color: var(--color-surface);
  border-radius: 0;
}

.btn--dark:hover,
.btn--dark:focus-visible {
  background-color: var(--color-ink-700);
  color: var(--color-surface);
}

/* Text link with arrow */
.text-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--color-ink-900);
  font-size: var(--text-body-sm);
  font-weight: 500;
  text-decoration: none;
  border-bottom: 1px solid var(--color-ink-900);
  padding-bottom: 1px;
  transition:
    color var(--dur-fast) var(--ease-out),
    border-color var(--dur-fast) var(--ease-out);
}

.text-link:hover {
  color: var(--color-brand-green);
  border-color: var(--color-brand-green);
}

.text-link .icon {
  transition: transform var(--dur-base) var(--ease-out);
}

.text-link:hover .icon {
  transform: translateX(4px);
}

/* --------------------------------------------------------------------------
 * Focus styles — accessible, using focus-visible
 * -------------------------------------------------------------------------- */

:focus {
  outline: none;
}

:focus-visible {
  outline: 2px solid var(--color-focus-ring);
  outline-offset: 2px;
}

/* --------------------------------------------------------------------------
 * Skip to content link (accessibility)
 * -------------------------------------------------------------------------- */

.skip-to-content {
  position: absolute;
  top: -100%;
  left: var(--space-4);
  z-index: 9999;
  background: var(--color-brand-green);
  color: var(--color-ink-900);
  font-family: var(--font-mono);
  font-size: var(--text-meta);
  font-weight: 500;
  letter-spacing: var(--ls-eyebrow);
  text-transform: uppercase;
  padding: var(--space-2) var(--space-4);
  text-decoration: none;
  transition: top var(--dur-fast) var(--ease-out);
}

.skip-to-content:focus-visible {
  top: var(--space-2);
  outline: 2px solid var(--color-ink-900);
  outline-offset: 2px;
}

/* --------------------------------------------------------------------------
 * Visually hidden (screen-reader accessible)
 * -------------------------------------------------------------------------- */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* --------------------------------------------------------------------------
 * Blockquote (for news/article pages)
 * -------------------------------------------------------------------------- */

blockquote {
  border-left: 3px solid var(--color-brand-green);
  padding-left: var(--space-6);
  margin: var(--space-8) 0;
  font-style: italic;
  font-size: var(--text-body-lg);
  line-height: var(--lh-body-lg);
  color: var(--color-ink-700);
}

/* --------------------------------------------------------------------------
 * Horizontal rule
 * -------------------------------------------------------------------------- */

hr {
  border: none;
  border-top: var(--border-hairline);
  margin: var(--space-8) 0;
}

/* --------------------------------------------------------------------------
 * Tables (fallback)
 * -------------------------------------------------------------------------- */

table {
  border-collapse: collapse;
  width: 100%;
}

/* --------------------------------------------------------------------------
 * Iframe
 * -------------------------------------------------------------------------- */

iframe {
  border: none;
}
