/*
 * global.css — Reset, Base Typography, Utilities
 * These styles apply site-wide.
 * Component-specific styles live in components.css.
 */

/* ── Reset ───────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img, video { max-width: 100%; height: auto; display: block; }
svg { display: block; }
a { color: inherit; text-decoration: none; }
a:focus-visible { outline: 3px solid var(--color-secondary); outline-offset: 3px; border-radius: 2px; }
ul, ol { list-style: none; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
input, textarea, select { font-family: inherit; font-size: inherit; }
p { margin-bottom: var(--space-4); }
p:last-child { margin-bottom: 0; }

/* ── Layout ──────────────────────────────────────────────────── */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--space-6);
  padding-right: var(--space-6);
}
.container--wide   { max-width: var(--container-wide); }
.container--narrow { max-width: var(--container-narrow); }

/* ── Typography ──────────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: var(--font-weight-bold);
  line-height: 1.2;
  color: var(--color-text);
}
h1 { font-size: clamp(var(--text-3xl), 5vw, var(--text-5xl)); font-weight: var(--font-weight-extrabold); }
h2 { font-size: clamp(var(--text-3xl), 4.5vw, var(--text-5xl)); }
h3 { font-size: clamp(var(--text-xl),  3vw, var(--text-3xl)); }
h4 { font-size: var(--text-xl); }
h5 { font-size: var(--text-lg); }
h6 { font-size: var(--text-base); }

/* ── Sections ────────────────────────────────────────────────── */
.section     { padding: var(--space-20) 0; }
.section--sm { padding: var(--space-12) 0; }
.section--lg { padding: var(--space-24) 0; }

/* Section color variants — agent applies backgrounds and text colors */
.section--dark {}
.section--dark h1,
.section--dark h2,
.section--dark h3 {}
.section--surface  {}
.section--surface-2 {}

/* Section header — structural layout only, agent styles in Phase 1/3 */
.section__header {
  text-align: center;
}
.section__tag {
  display: inline-block;
}
.section__title {}
.section__subtitle {
  max-width: 600px;
  margin: 0 auto;
}

/* ── Buttons ─────────────────────────────────────────────────── */
/* STRUCTURAL ONLY — the agent applies all decorative styles
   (colors, backgrounds, padding, border-radius, shadows, hover effects)
   during Phase 1 and Phase 3. These classes define layout behavior only. */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: 48px;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  border: 2px solid transparent;
  white-space: nowrap;
  user-select: none;
}
.btn:focus-visible { outline: 3px solid var(--color-accent); outline-offset: 3px; }

/* Variant classes — agent fills in colors, backgrounds, hovers */
.btn--primary {}
.btn--secondary {}
.btn--white {}
.btn--outline-white {}
.btn--phone {}
.btn--lg { min-height: 56px; }

/* ── Grid Utilities ──────────────────────────────────────────── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-8); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-6); }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-6); }

/* ── Breadcrumb — structural layout only, agent styles colors/fonts ── */
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
}
.breadcrumb a {}
.breadcrumb__sep {}

/* ── Credential Badges — structural layout only, agent styles appearance ── */
.credentials {
  display: flex;
  flex-wrap: wrap;
}
.credential-badge {
  display: inline-flex;
  align-items: center;
}

/* ── Embed Placeholder — structural only, agent styles appearance ── */
.embed-placeholder {
  text-align: center;
}
.embed-placeholder code {
  font-family: monospace;
}

/* ── Scroll Animations — agent customizes distances, timing, easing ── */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
}
.fade-in.is-visible {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  .fade-in {
    opacity: 1;
    transform: none;
    transition: none;
  }
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ── 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;
}
.skip-link {
  position: absolute;
  top: -100%;
  z-index: 9999;
}
.skip-link:focus { top: 0; }

/* ── Responsive Breakpoints ──────────────────────────────────── */
@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 768px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .section     { padding: var(--space-16) 0; }
  .section--sm { padding: var(--space-10) 0; }
}
@media (max-width: 480px) {
  .container { padding-left: var(--space-4); padding-right: var(--space-4); }
  h1 { font-size: var(--text-3xl); }
  h2 { font-size: var(--text-3xl); }
}
