/* ─── Base — resets, type, layout primitives, shared bits ────────────────────
   Mobile-first; breakpoints 480 / 640 / 768 / 992 / 1200 (docs/styling.md).
   ────────────────────────────────────────────────────────────────────────── */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + 8px);
  /* Themed page scrollbar — never the unstyled OS default. */
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--text-color) 55%, var(--bg-color)) var(--bg-color);
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

@supports not (scrollbar-color: auto) {
  ::-webkit-scrollbar {
    width: 10px;
    height: 10px;
  }
  ::-webkit-scrollbar-track {
    background: var(--bg-color);
  }
  ::-webkit-scrollbar-thumb {
    background: color-mix(in srgb, var(--text-color) 55%, var(--bg-color));
    border: 2px solid var(--bg-color);
    border-radius: var(--radius-pill);

    &:hover {
      background: var(--primary-color);
    }
  }
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--base);
  color: var(--ink);
  font-family: var(--font-text);
  font-size: var(--t-md);
  font-weight: 500;
  letter-spacing: -0.04em;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.is-locked {
  overflow: hidden;
}

h1, h2, h3, h4, h5, h6 {
  margin: 0;
  font-family: var(--font-text);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.04em;
}

p {
  margin: 0;
  text-wrap: pretty;
}

ul, ol {
  margin: 0;
  padding: 0;
}

[role="list"] {
  list-style: none;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--hover-duration) ease-out;
}

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

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

button {
  cursor: pointer;
}

figure, blockquote {
  margin: 0;
}

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

[hidden] {
  display: none !important;
}

/* ─── Display face — uppercase dot-matrix headlines ─── */
.display {
  font-family: var(--font-display);
  font-weight: 800;
  text-transform: uppercase;
  line-height: 0.82;
  letter-spacing: -0.02em;
}

.eyebrow {
  display: inline-block;
  font-size: var(--t-sm);
  font-weight: 500;
}

.wordmark {
  font-family: var(--font-text);
  font-weight: 600;
  font-size: 20px;
  letter-spacing: -0.06em;
  text-transform: lowercase;
  line-height: 1;

  @media (min-width: 768px) {
    font-size: 24px;
  }
}

/* ─── Layout primitives ─── */
.section {
  padding: var(--section-y) var(--gutter);
}

.section-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px 32px;
}

.section-head__main {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 20px;
}

.section-head__title {
  font-size: var(--d-lg);
}

.section-head__text {
  max-width: 420px;
  font-size: var(--t-md);
  color: var(--ink-2);

  &.section-head__text--lg {
    font-size: var(--t-lg);
    color: var(--ink);
  }
}

.arrows {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ─── Chips ─── */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chip {
  display: inline-flex;
  align-items: center;
  padding: 5px 11px;
  border-radius: var(--radius-pill);
  background: var(--block);
  color: var(--ink);
  font-size: var(--t-xs);
  line-height: 1.3;
  white-space: nowrap;

  &.chip--base {
    background: var(--base);
  }
}

a.chip:hover {
  background: var(--ink);
  color: var(--on-dark);
}

.avatar {
  flex: none;
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--on-dark);
  font-size: 22px;
  font-weight: 900;
  line-height: 1;
}

/* ─── Accessibility helpers ─── */
.screen-reader-text {
  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: -9999px;
  top: 8px;
  z-index: 200;
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  background: var(--ink);
  color: var(--on-dark);

  &:focus {
    left: 16px;
  }
}

/* ─── Reveal on scroll (script.js adds .js-reveal to <html> only when
   motion is allowed, so content is never hidden without JS) ─── */
@media (prefers-reduced-motion: no-preference) {
  .js-reveal [data-reveal] {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
  }

  .js-reveal [data-reveal].is-revealed {
    opacity: 1;
    transform: none;
  }
}

/* ─── Custom cursor dot (pointer: fine only, script.js) ─── */
.cursor-dot {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 999;
  width: 40px;
  height: 40px;
  margin: -20px 0 0 -20px;
  border-radius: 50%;
  background: var(--white);
  mix-blend-mode: difference;
  pointer-events: none;
  /* Position (translate) is driven every frame by script.js — no transition
     on it, or the dot lags. Only the grow/shrink over links (scale) eases. */
  translate: -100px -100px;
  scale: 0.3;
  transition: scale 0.25s ease-out;
  will-change: translate;
}

@media (pointer: coarse), (prefers-reduced-motion: reduce) {
  .cursor-dot {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@media print {
  .site-header,
  .site-footer,
  .menu-overlay,
  .cursor-dot,
  [data-noprint] {
    display: none !important;
  }

  body {
    background: none;
  }
}
