/* Base reset, typography, layout primitives and accessibility foundations. */
*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.6;
}
/* Locks the page's own scrollbar while a <dialog> is open (assets/js/dialog.js)
   — native showModal() doesn't do this on its own, so without it a tall
   dialog shows two scrollbars: the page's and the dialog panel's. */
body.has-open-dialog {
  overflow: hidden;
}

/* Reserve space for the fixed bottom tab bar (components.css .tab-bar) so
   it never overlaps the footer or a page's last section content. */
@media (max-width: 1399px) {
  body {
    padding-bottom: calc(58px + env(safe-area-inset-bottom));
  }
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-heading);
  color: var(--color-text);
  margin: 0 0 var(--space-3);
}

h1 {
  font-size: var(--text-display);
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: -0.01em;
  /* At --text-display's largest sizes, a long hyphenated word (e.g.
     "high-consideration") can occupy more than a narrow phone's width
     before a break opportunity — this guarantees it wraps instead of
     overflowing the viewport. */
  overflow-wrap: break-word;
}

h2 {
  font-size: var(--text-h2);
  font-weight: 500;
  line-height: 1.25;
}

h3 {
  font-size: var(--text-h3);
  font-weight: 400;
  line-height: 1.25;
}

h4 {
  font-size: var(--text-h4);
  font-weight: 400;
  line-height: 1.25;
}

p {
  margin: 0 0 var(--space-3);
  color: var(--color-text-secondary);
}

a {
  color: var(--color-primary);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-accent-warm);
  margin: 0 0 var(--space-3);
}
.eyebrow::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--color-accent);
  flex-shrink: 0;
}

/* Container + 12-column grid (docs/13 §4) */
.container {
  max-width: var(--container-max-width);
  margin-inline: auto;
  padding-inline: var(--container-padding);
}

.grid-12 {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: var(--grid-gutter);
}
.grid-12 > * {
  grid-column: 1 / -1;
}

@media (min-width: 768px) {
  /* Longhand grid-column-end only, so col-start-* (grid-column-start) can
     combine with col-span-* on the same element without either clobbering
     the other via the grid-column shorthand's implicit reset. */
  .col-span-1 { grid-column-end: span 1; }
  .col-span-2 { grid-column-end: span 2; }
  .col-span-3 { grid-column-end: span 3; }
  .col-span-4 { grid-column-end: span 4; }
  .col-span-5 { grid-column-end: span 5; }
  .col-span-6 { grid-column-end: span 6; }
  .col-span-7 { grid-column-end: span 7; }
  .col-span-8 { grid-column-end: span 8; }
  .col-span-9 { grid-column-end: span 9; }
  .col-span-10 { grid-column-end: span 10; }
  .col-span-11 { grid-column-end: span 11; }
  .col-span-12 { grid-column-end: span 12; }
  .col-start-2 { grid-column-start: 2; }
  .col-start-3 { grid-column-start: 3; }
  .col-start-4 { grid-column-start: 4; }
  .col-start-7 { grid-column-start: 7; }
  .col-start-8 { grid-column-start: 8; }
}

.page {
  padding-block: 0;
}

/* Section rhythm — docs/03 alternating warm-neutral/white sections, fluid spacing */
.section {
  padding-block: var(--section-padding);
}
.section--tinted {
  background: var(--color-neutral-surface);
}
.section--brand {
  background: var(--color-primary);
}
.section--dark {
  background: var(--color-ink);
}
.section--dark h2,
.section--dark h3,
.section--dark p,
.section--brand h2,
.section--brand h3,
.section--brand p {
  color: #fff;
}
.section--lavender {
  background: var(--color-tint);
}

/* Accessibility: skip link (docs/08-seo-accessibility.md) */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--color-primary);
  color: #fff;
  padding: var(--space-2) var(--space-3);
  z-index: 200;
  text-decoration: none;
}

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

/* Accessibility: visible focus state for every interactive element */
:focus-visible {
  outline: 3px solid var(--color-primary);
  outline-offset: 2px;
}
.section--dark :focus-visible,
.section--brand :focus-visible {
  outline-color: var(--color-accent);
}

.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;
}

/* Scroll reveal: hidden state only applies once JS adds .reveal-init, so
   content is fully visible by default with no JS (progressive enhancement). */
[data-reveal].reveal-init {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.42s ease-out, transform 0.42s ease-out;
}
[data-reveal].reveal-init.is-visible {
  opacity: 1;
  transform: none;
}

/* Accessibility: respect reduced-motion preference sitewide */
@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;
  }
}
