/* Base: reset, type scale, layout primitives, focus, reduced motion. Colors and sizes come only
   from tokens.css custom properties. No literal colors in this file (a test checks). */

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

/* The hidden attribute always wins over a component's display value (PL-09: the upload
   progress bar showed before any upload). */
[hidden] {
  display: none !important;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--font-body);
  font-size: var(--type-body-size);
  line-height: var(--type-body-lh);
  color: var(--color-ink);
  background: var(--color-bg);
  overflow-wrap: break-word;
}

main {
  flex: 1 0 auto;
}

main:focus {
  outline: none;
}

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

p,
h1,
h2,
h3,
ul,
ol,
dl,
dd,
figure {
  margin: 0;
}

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

a {
  color: var(--color-accent);
  text-underline-offset: 3px;
  transition: color var(--motion-fast) var(--easing);
}

a:hover {
  color: var(--color-accent-strong);
}

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

/* ---------- Type ---------- */

.hero-title,
h1,
.h1,
h2,
.h2 {
  font-family: var(--font-display);
  font-weight: var(--display-weight);
  letter-spacing: var(--display-tracking);
  text-wrap: balance;
}

.hero-title {
  font-size: var(--type-hero-size);
  line-height: var(--type-hero-lh);
}

h1,
.h1 {
  font-size: var(--type-h1-size);
  line-height: var(--type-h1-lh);
}

h2,
.h2 {
  font-size: var(--type-h2-size);
  line-height: var(--type-h2-lh);
}

h3,
.h3 {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: var(--type-h3-size);
  line-height: var(--type-h3-lh);
}

.lead {
  color: var(--color-ink-muted);
  text-wrap: pretty;
}

[data-look='c'] .lead {
  font-weight: 600;
}

.muted {
  color: var(--color-ink-muted);
}

.small {
  font-size: var(--type-small-size);
  line-height: var(--type-small-lh);
}

.caption {
  font-size: var(--type-caption-size);
  line-height: var(--type-caption-lh);
  color: var(--color-ink-muted);
}

/* ---------- Layout primitives ---------- */

.container {
  width: 100%;
  max-width: calc(var(--container-max) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.stack {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.stack--tight {
  gap: var(--space-2);
}

.stack--loose {
  gap: var(--space-6);
}

.cluster {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
}

.grid {
  display: grid;
  gap: var(--space-3);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
}

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

@media (min-width: 1080px) {
  .section {
    padding-block: var(--space-8);
  }
}

/* ---------- Accessibility helpers ---------- */

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

.skip-link {
  position: absolute;
  left: var(--space-3);
  top: -100px;
  z-index: 100;
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-pill);
  background: var(--color-surface);
  color: var(--color-ink);
  font-weight: 600;
}

.skip-link:focus {
  top: var(--space-3);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
    animation: none !important;
    scroll-behavior: auto !important;
  }
}
