/* ============================================================
   base.css — reset, fonts, base typography, layout primitives
   ============================================================ */

/* --- Self-hosted Inter (fallback for PPNeueMontreal per DESIGN.md) --- */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 200;
  font-display: swap;
  src: url('../fonts/inter-200.woff2') format('woff2');
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/inter-400.woff2') format('woff2');
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('../fonts/inter-600.woff2') format('woff2');
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../fonts/inter-700.woff2') format('woff2');
}

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

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

body {
  font-family: var(--font-sans);
  font-weight: var(--weight-extralight);
  font-size: var(--text-body);
  line-height: var(--leading-body);
  color: var(--text-primary);
  background: var(--color-void);
  min-height: 100vh;
  overflow-x: hidden;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: 'ss01' on, 'cv01' on;
}

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

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

a {
  color: inherit;
  text-decoration: none;
}

/* Soft violet selection — content stays copyable but the highlight is
   quiet and keeps each text's own color instead of flashing solid violet. */
::selection {
  background: rgba(128, 82, 255, 0.32);
}

/* UI chrome shouldn't highlight when the user drag-selects content.
   Content itself (headings, paragraphs, research, emails) stays selectable. */
.btn,
.btn-ghost,
.nav__link,
.brand,
.badge,
.ctone,
.cmsg__copy,
.rcard__cta,
.rcard__index,
.mock,
.field__label,
.panel__label {
  -webkit-user-select: none;
  user-select: none;
}

/* --- Type scale utility classes ---
   Hierarchy comes from SCALE + tracking, not weight (Dala rule): headlines weight 400. */
.t-display {
  font-size: var(--text-display);
  line-height: var(--leading-display);
  letter-spacing: var(--tracking-display);
  font-weight: var(--weight-regular);
}
.t-heading-lg {
  font-size: var(--text-heading-lg);
  line-height: var(--leading-heading-lg);
  letter-spacing: var(--tracking-heading-lg);
  font-weight: var(--weight-regular);
}
.t-heading {
  font-size: var(--text-heading);
  line-height: var(--leading-heading);
  letter-spacing: var(--tracking-heading);
  font-weight: var(--weight-regular);
}
.t-heading-sm {
  font-size: var(--text-heading-sm);
  line-height: var(--leading-heading-sm);
  letter-spacing: var(--tracking-heading-sm);
  font-weight: var(--weight-regular);
}
.t-subheading {
  font-size: var(--text-subheading);
  line-height: var(--leading-subheading);
  font-weight: var(--weight-regular);
}
.t-heading-xs {
  font-size: var(--text-heading-xs);
  line-height: var(--leading-heading-xs);
  font-weight: var(--weight-regular);
}
.t-heading-2xs {
  font-size: var(--text-heading-2xs);
  line-height: var(--leading-heading-2xs);
  letter-spacing: var(--tracking-heading-2xs);
  font-weight: var(--weight-regular);
}
.t-body {
  font-size: var(--text-body);
  line-height: var(--leading-body);
  font-weight: var(--weight-extralight);
}
.t-caption {
  font-size: var(--text-caption);
  line-height: var(--leading-caption);
  font-weight: var(--weight-regular);
}

/* Small uppercase label — amber emphasis (Section Headline Block pattern) */
.t-label {
  font-size: var(--text-nav-label);
  line-height: var(--leading-nav-label);
  letter-spacing: var(--tracking-nav-label);
  font-weight: var(--weight-semibold);
  text-transform: uppercase;
}
.t-label--emphasis {
  color: var(--emphasis);
}
.t-label--accent {
  color: var(--accent);
}

/* Color helpers */
.c-secondary { color: var(--text-secondary); }
.c-tertiary { color: var(--text-tertiary); }
.c-accent { color: var(--accent); }
.c-emphasis { color: var(--emphasis); }

/* --- Layout primitives --- */
.page {
  width: 100%;
  max-width: var(--page-max);
  margin-inline: auto;
  padding-inline: var(--space-24);
}

@media (min-width: 900px) {
  .page {
    padding-inline: var(--space-60);
  }
}

.stack > * + * {
  margin-top: var(--space-18);
}
.stack-tight > * + * {
  margin-top: var(--space-6);
}
.stack-loose > * + * {
  margin-top: var(--space-30);
}

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

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

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