/* ==========================================================================
   ElevatteLife — 02. Global
   Reset, base typography, layout primitives and utility helpers.
   ========================================================================== */

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

* {
  margin: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 96px; /* sticky header offset for in-page anchors */
}

body {
  min-height: 100vh;
  background-color: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  font-weight: var(--fw-regular);
  line-height: var(--lh-body);
  letter-spacing: -0.005em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden; /* guarantees no horizontal scrolling on mobile */
}

/* Kill the layout shift caused by locking scroll when the drawer opens. */
body.is-locked {
  overflow: hidden;
}

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

img {
  height: auto;
}

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

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

ul[class],
ol[class] {
  list-style: none;
  padding: 0;
}

a {
  color: var(--brand-mid);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

hr {
  border: 0;
  border-top: 1px solid var(--line);
}

::selection {
  background: var(--brand-tint-strong);
  color: var(--brand-deep);
}

/* ------------------------------------------------------------ Focus ring -- */
:focus-visible {
  outline: 2px solid var(--brand-mid);
  outline-offset: 3px;
  border-radius: var(--r-xs);
}

.on-dark :focus-visible,
.section--deep :focus-visible,
.deep :focus-visible,
.cta-band :focus-visible,
.brand-moment :focus-visible,
.site-footer :focus-visible {
  outline-color: var(--p-green-500);
}

/* --------------------------------------------------------------- Type ---- */
h1,
h2,
h3,
h4,
h5 {
  font-family: var(--font-display);
  font-weight: var(--fw-semibold);
  line-height: var(--lh-heading);
  letter-spacing: var(--tr-tight);
  color: var(--brand-deep);
  text-wrap: balance;
}

h1 {
  font-size: var(--fs-h1);
  line-height: var(--lh-snug);
  letter-spacing: var(--tr-display);
}

h2 {
  font-size: var(--fs-h2);
  line-height: var(--lh-snug);
  letter-spacing: var(--tr-display);
}

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

h4 {
  font-size: var(--fs-h4);
  font-family: var(--font-body);
  font-weight: var(--fw-semibold);
  letter-spacing: -0.01em;
  line-height: 1.4;
}

p {
  text-wrap: pretty;
}

.display {
  font-family: var(--font-display);
  font-size: var(--fs-display);
  font-weight: var(--fw-semibold);
  line-height: var(--lh-tight);
  letter-spacing: var(--tr-display);
  color: var(--brand-deep);
  text-wrap: balance;
}

.lead {
  font-size: var(--fs-lead);
  line-height: 1.65;
  color: var(--ink-muted);
  max-width: var(--container-text);
}

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

.small {
  font-size: var(--fs-sm);
}

/* Card headings that use h2 need the explicit size — .card__title alone would
   otherwise be overridden by the h2 rule that loads after it. */
h2.card__title.fs-h3 {
  font-size: var(--fs-h3);
}

.caption {
  font-size: var(--fs-caption);
  color: var(--ink-faint);
  line-height: 1.6;
}

.strong {
  font-weight: var(--fw-semibold);
  color: var(--ink);
}

/* -------------------------------------------------------- Layout shell --- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.container--wide {
  max-width: var(--container-wide);
}

.container--narrow {
  max-width: var(--container-narrow);
}

.section {
  position: relative;
  padding-block: var(--section-y);
}

.section--tight {
  padding-block: var(--section-y-sm);
}

.section--tint {
  background-color: var(--bg-tint);
}

.section--sand {
  background-color: var(--surface);
}

.section--brand {
  background-color: var(--brand-tint);
}

.section--deep {
  background-color: var(--surface-deep);
  color: var(--ink-invert-soft);
}

.section--deep h1,
.section--deep h2,
.section--deep h3,
.section--deep .display {
  color: var(--ink-invert);
}

.section--deep .lead {
  color: var(--ink-invert-soft);
}

.section--line {
  border-top: 1px solid var(--line);
}

/* Stack helpers */
.stack > * + * {
  margin-top: var(--stack);
}

.stack-sm > * + * {
  margin-top: var(--stack-sm);
}

.stack-lg > * + * {
  margin-top: var(--stack-lg);
}

.flow > * + * {
  margin-top: var(--space-4);
}

/* ------------------------------------------------------------ Reveal ----- */
/* Progressive enhancement: content is always visible without JavaScript. */
.reveal-init [data-reveal] {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity var(--dur-slow) var(--ease-out),
    transform var(--dur-slow) var(--ease-out);
  will-change: opacity, transform;
}

.reveal-init [data-reveal].is-visible {
  opacity: 1;
  transform: none;
}

.reveal-init [data-reveal][data-reveal-delay="1"] { transition-delay: 80ms; }
.reveal-init [data-reveal][data-reveal-delay="2"] { transition-delay: 160ms; }
.reveal-init [data-reveal][data-reveal-delay="3"] { transition-delay: 240ms; }
.reveal-init [data-reveal][data-reveal-delay="4"] { transition-delay: 320ms; }
.reveal-init [data-reveal][data-reveal-delay="5"] { transition-delay: 400ms; }

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .reveal-init [data-reveal] {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* ----------------------------------------------------------- Utilities --- */
.skip-link {
  position: absolute;
  left: var(--space-4);
  top: -64px;
  z-index: calc(var(--z-nav) + 10);
  background: var(--brand);
  color: #fff;
  padding: 0.75rem 1.125rem;
  border-radius: var(--r-sm);
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  text-decoration: none;
  transition: top var(--dur) var(--ease);
}

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

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

.no-wrap {
  white-space: nowrap;
}

/* Spacing utilities — used instead of inline styles for one-off rhythm */
.mt-2 { margin-top: var(--space-2); }
.mt-3 { margin-top: var(--space-3); }
.mt-4 { margin-top: var(--space-4); }
.mt-5 { margin-top: var(--space-5); }
.mt-6 { margin-top: var(--space-6); }
.mt-8 { margin-top: var(--space-8); }
.mt-10 { margin-top: var(--space-10); }
.mt-12 { margin-top: var(--space-12); }
.mb-0 { margin-bottom: 0; }

.center {
  justify-content: center;
}

.text-center {
  text-align: center;
}

.mx-auto {
  margin-inline: auto;
}

.fs-h3 { font-size: var(--fs-h3); }
.fs-body { font-size: var(--fs-body); }

.gap-block {
  margin-block: var(--space-8);
}

/* Keyboard-only shortcut targets stay reachable but out of the flow. */
[id] {
  scroll-margin-top: 96px;
}

/* Print — keep it readable if anyone prints a consultation brief. */
@media print {
  .site-header,
  .site-footer,
  .cta-band,
  .nav-toggle {
    display: none !important;
  }

  body {
    color: #000;
  }

  a[href^="http"]::after {
    content: " (" attr(href) ")";
    font-size: 0.8em;
    color: #555;
  }
}
