/* ==========================================================================
   Tailored Solutions — Base Styles
   --------------------------------------------------------------------------
   Modern reset, document defaults, typography baseline, and layout
   primitives (.container, .section). Consumes design tokens from tokens.css.
   ========================================================================== */

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

* {
  margin: 0;
  padding: 0;
}

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

body {
  background-color: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  line-height: 1.6;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  overflow-x: hidden;
}

/* --------------------------------------------------------------------------
   Selection — refined deep red highlight on near-black surface
   -------------------------------------------------------------------------- */
::selection {
  background-color: var(--color-accent);
  color: var(--color-white);
}

::-moz-selection {
  background-color: var(--color-accent);
  color: var(--color-white);
}

/* --------------------------------------------------------------------------
   Focus — accessible 2px accent outline with offset, only on keyboard nav
   -------------------------------------------------------------------------- */
:focus {
  outline: none;
}

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

/* --------------------------------------------------------------------------
   Media defaults
   -------------------------------------------------------------------------- */
img,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
  height: auto;
}

/* --------------------------------------------------------------------------
   Form element defaults — inherit typography
   -------------------------------------------------------------------------- */
input,
button,
textarea,
select {
  font: inherit;
  color: inherit;
}

button {
  background: none;
  border: none;
  cursor: pointer;
}

/* --------------------------------------------------------------------------
   Links — inherit color by default; components.css styles named patterns
   -------------------------------------------------------------------------- */
a {
  color: inherit;
  text-decoration: none;
}

/* --------------------------------------------------------------------------
   Typography — display headings with tightened tracking, readable paragraphs
   -------------------------------------------------------------------------- */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--color-text);
  text-wrap: balance;
}

h1 {
  font-size: var(--fs-display);
  letter-spacing: -0.03em;
  line-height: 1.05;
}

h2 {
  font-size: var(--fs-3xl);
  letter-spacing: -0.025em;
}

h3 {
  font-size: var(--fs-2xl);
}

h4 {
  font-size: var(--fs-xl);
  letter-spacing: -0.015em;
}

h5 {
  font-size: var(--fs-lg);
}

h6 {
  font-size: var(--fs-base);
  letter-spacing: 0;
}

p {
  max-width: 65ch;
  color: var(--color-text-muted);
  text-wrap: pretty;
}

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

strong,
b {
  font-weight: 600;
  color: var(--color-text);
}

small {
  font-size: var(--fs-sm);
  color: var(--color-text-dim);
}

code,
kbd,
samp,
pre {
  font-family: var(--font-mono);
  font-size: 0.9em;
}

ul,
ol {
  list-style: none;
}

hr {
  border: 0;
  border-top: 1px solid var(--color-border);
  margin: var(--space-8) 0;
}

/* --------------------------------------------------------------------------
   Layout primitives — .container, .section, .section-tight
   -------------------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--container-padding);
}

.section {
  padding-block: clamp(2.5rem, 5vw, 5rem);
}

.section-tight {
  padding-block: clamp(1.75rem, 3.5vw, 3rem);
}

/* --------------------------------------------------------------------------
   Reduced motion — honor user preference
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* --------------------------------------------------------------------------
   Visually hidden utility — accessible labels only
   -------------------------------------------------------------------------- */
.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;
}
