/* ============================================================
   THE HEARTSPACE — Base (base.css)
   ------------------------------------------------------------
   Modern reset, typography, layout primitives & helpers.
   Depends on variables.css.
   ============================================================ */

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

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

body {
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.65;
  color: var(--ink);
  background: var(--ivory);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

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

/* Global default icon size — prevents any un-sized inline SVG from
   ballooning. More specific rules (.btn .icon, .value-card .icon, …)
   still override this. */
.icon {
  width: 1.25em;
  height: 1.25em;
  flex-shrink: 0;
}

img { height: auto; }

input, button, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: none; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; padding: 0; }

/* Respect users who prefer less motion */
@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;
  }
}

/* ---------- Typography ---------- */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.08;
  letter-spacing: -0.01em;
  color: var(--green-800);
}

h1 { font-size: var(--step-4); }
h2 { font-size: var(--step-3); }
h3 { font-size: var(--step-2); }
h4 { font-size: var(--step-1); }

p { max-width: 68ch; }

strong { font-weight: 600; }
em { font-style: italic; }

/* Editorial serif emphasis (used for pull quotes / leads) */
.lead {
  font-size: var(--step-1);
  line-height: 1.5;
  color: var(--ink-soft);
  font-weight: 400;
}

.serif { font-family: var(--font-display); }

/* Small uppercase eyebrow label — a signature brand detail */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
  font-size: var(--step--1);
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--coral-600);
}
.eyebrow::before {
  content: "";
  width: 28px;
  height: 1px;
  background: var(--coral-500);
}
.eyebrow.center::after {
  content: "";
  width: 28px;
  height: 1px;
  background: var(--coral-500);
}

/* Gold accent on a single word in headings */
.accent { color: var(--coral-600); font-style: italic; }

/* ---------- Layout primitives ---------- */
.container {
  width: 100%;
  max-width: var(--content-max);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.container--wide { max-width: var(--wide-max); }
.container--narrow { max-width: 760px; }

.section { padding-block: clamp(2.75rem, 5vw, 4.5rem); }
.section--tight { padding-block: clamp(2rem, 4vw, 3.25rem); }

/* Vertical rhythm helper — stacks children with even gaps */
.stack > * + * { margin-top: var(--space-sm); }
.stack-lg > * + * { margin-top: var(--space-lg); }

/* Simple responsive grids */
.grid { display: grid; gap: var(--space-md); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 900px) {
  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

/* Section heading block */
.section-head { max-width: 640px; margin-bottom: var(--space-lg); }
.section-head.center { margin-inline: auto; text-align: center; }
.section-head h2 { margin-top: var(--space-xs); }
.section-head p { margin-top: var(--space-sm); color: var(--ink-soft); }
.section-head.center p { margin-inline: auto; }

/* ---------- Utility helpers ---------- */
.text-center { text-align: center; }
/* Keep paragraphs in centered blocks visually centered (their
   max-width would otherwise anchor them to the left). */
.text-center > p { margin-inline: auto; }
.muted { color: var(--ink-soft); }
.gold { color: var(--coral-600); }
.mx-auto { margin-inline: auto; }
.mt-0 { margin-top: 0; }
.full-bleed {
  width: 100vw;
  margin-left: 50%;
  transform: translateX(-50%);
}

/* Visually-hidden (screen-reader only) — accessibility */
.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;
}

/* Visible keyboard focus ring — WCAG requirement */
:focus-visible {
  outline: 2px solid var(--coral-500);
  outline-offset: 3px;
  border-radius: 4px;
}

/* Skip link for keyboard users */
.skip-link {
  position: absolute;
  left: var(--space-sm);
  top: -60px;
  z-index: var(--z-toast);
  padding: 0.6rem 1rem;
  background: var(--green-700);
  color: var(--white);
  border-radius: var(--radius-sm);
  transition: top var(--dur-fast) var(--ease-out);
}
.skip-link:focus { top: var(--space-sm); }
