/* Base reset, typography utilities, containers, section shells */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

@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;
  }
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--font-size-base);
  font-weight: 400;
  line-height: var(--line-height-normal);
  color: var(--color-text);
  background-color: var(--color-background);
  background-image:
    linear-gradient(180deg, rgba(22, 53, 43, 0.03), transparent 28rem),
    radial-gradient(ellipse 70% 40% at 100% 0%, rgba(154, 132, 96, 0.06), transparent 50%);
  background-repeat: no-repeat;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.nav-open,
body.modal-open {
  overflow: hidden;
}

img,
picture,
svg,
video {
  max-width: 100%;
  height: auto;
  display: block;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

a {
  color: var(--color-text-link);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--color-accent);
}

:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 3px;
}

.skip-link {
  position: absolute;
  top: -100%;
  left: var(--gutter);
  z-index: calc(var(--z-modal) + 1);
  padding: 0.75rem 1.25rem;
  background: var(--color-primary);
  color: var(--color-text-inverse);
  border-radius: var(--radius-md);
  text-decoration: none;
}

.skip-link:focus {
  top: 1rem;
}

/* —— Element defaults —— */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: var(--line-height-tight);
  letter-spacing: var(--letter-spacing-display);
  margin: 0 0 0.75rem;
  color: var(--color-primary-dark);
}

h1 {
  font-size: var(--font-size-display);
}

h2 {
  font-size: var(--font-size-3xl);
}

h3 {
  font-size: var(--font-size-2xl);
}

h4 {
  font-size: var(--font-size-xl);
}

p {
  margin: 0 0 1rem;
}

p:last-child {
  margin-bottom: 0;
}

ul,
ol {
  margin: 0;
  padding: 0;
}

/* =========================================================
   TYPOGRAPHY SYSTEM
   ========================================================= */

.text-eyebrow,
.section-eyebrow {
  display: inline-block;
  margin: 0 0 0.85rem;
  font-family: var(--font-body);
  font-size: var(--font-size-xs);
  font-weight: 500;
  letter-spacing: var(--letter-spacing-eyebrow);
  text-transform: uppercase;
  color: var(--color-accent);
  line-height: 1.4;
}

.heading-display {
  font-family: var(--font-display);
  font-size: var(--font-size-display);
  font-weight: 600;
  line-height: var(--line-height-tight);
  letter-spacing: var(--letter-spacing-display);
  color: var(--color-primary-dark);
}

.heading-section {
  font-family: var(--font-display);
  font-size: var(--font-size-3xl);
  font-weight: 600;
  line-height: var(--line-height-tight);
  letter-spacing: var(--letter-spacing-tight);
  color: var(--color-primary-dark);
  max-width: 18ch;
}

.heading-subsection {
  font-family: var(--font-display);
  font-size: var(--font-size-2xl);
  font-weight: 600;
  line-height: var(--line-height-snug);
  color: var(--color-primary-dark);
}

.text-body {
  font-family: var(--font-body);
  font-size: var(--font-size-md);
  line-height: var(--line-height-normal);
  color: var(--color-text);
  max-width: var(--prose-max);
}

.text-small {
  font-size: var(--font-size-sm);
  line-height: var(--line-height-snug);
  color: var(--color-text-muted);
}

.stat-value {
  display: block;
  font-family: var(--font-display);
  font-size: var(--font-size-stat);
  font-weight: 600;
  line-height: 1;
  letter-spacing: var(--letter-spacing-tight);
  color: var(--color-primary);
}

.stat-label {
  display: block;
  margin-top: 0.55rem;
  font-family: var(--font-body);
  font-size: var(--font-size-xs);
  font-weight: 500;
  letter-spacing: var(--letter-spacing-wide);
  text-transform: uppercase;
  color: var(--color-text-muted);
}

.text-center {
  text-align: center;
}

.text-muted {
  color: var(--color-text-muted);
}

/* =========================================================
   CONTAINER / GRID SYSTEM
   ========================================================= */

.container {
  width: min(100% - (var(--gutter) * 2), var(--container-width));
  margin-inline: auto;
}

.container--narrow {
  width: min(100% - (var(--gutter) * 2), var(--container-narrow));
}

.container--wide {
  width: min(100% - (var(--gutter) * 2), var(--container-wide));
}

.container--full {
  width: 100%;
  max-width: none;
  padding-inline: var(--gutter);
}

.prose {
  max-width: var(--prose-max);
}

.prose--wide {
  max-width: var(--content-max);
}

/* =========================================================
   SECTION SYSTEM
   ========================================================= */

.section {
  position: relative;
  padding: var(--section-padding);
  scroll-margin-top: calc(var(--header-height-scrolled) + 0.75rem);
}

/* Viewport-aware section shells — fit ~1 screen without clipping content */
.section--viewport {
  min-height: var(--section-viewport);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.section--tight {
  padding-block: var(--section-space-sm);
}

.section--loose {
  padding-block: var(--section-space-lg);
}

.section--flush {
  padding-block: 0;
}

/* Light / dark / alt rhythm — locked primary/secondary champagne system */
.section--light,
.section--surface,
.section--secondary {
  background-color: var(--color-bg-secondary);
  background-image:
    radial-gradient(
      ellipse 68% 72% at 50% 38%,
      rgba(255, 252, 246, 0.96) 0%,
      rgba(255, 246, 232, 0.45) 46%,
      transparent 74%
    ),
    linear-gradient(180deg, #f4ebe0 0%, #faf5ec 42%, #f3e8da 100%);
  color: var(--color-text);
}

.section--alt,
.section--muted,
.section--primary-bg {
  background-color: var(--color-bg-primary);
  background-image:
    radial-gradient(
      ellipse 62% 78% at 50% 42%,
      rgba(255, 250, 240, 0.9) 0%,
      rgba(255, 243, 226, 0.45) 42%,
      transparent 72%
    ),
    linear-gradient(
      180deg,
      rgba(236, 214, 186, 0.75) 0%,
      rgba(248, 234, 214, 0.88) 38%,
      rgba(242, 222, 196, 0.85) 100%
    );
  color: var(--color-text);
}

.section--surface-card {
  background: var(--color-surface);
}

.section--dark,
.section--primary {
  background: var(--color-surface-dark);
  color: var(--color-text-inverse);
}

.section--dark h2,
.section--dark h3,
.section--dark .section-heading__title,
.section--dark .heading-section,
.section--dark .heading-subsection,
.section--primary h2,
.section--primary h3,
.section--primary .section-heading__title,
.section--primary .heading-section {
  color: var(--color-text-inverse);
}

.section--dark .section-heading__subtitle,
.section--dark .section-heading__eyebrow,
.section--dark .text-eyebrow,
.section--dark .text-muted,
.section--dark .text-body,
.section--primary .section-heading__subtitle,
.section--primary .section-heading__eyebrow {
  color: var(--color-text-inverse-muted);
}

.section--dark .section-heading__eyebrow,
.section--dark .text-eyebrow,
.section--primary .section-heading__eyebrow {
  color: var(--color-accent);
}

.section--fullbleed {
  padding-inline: 0;
}

.section--divider-top {
  border-top: 1px solid var(--color-border);
}

.section--divider-bottom {
  border-bottom: 1px solid var(--color-border);
}

/* Section header — new name + legacy alias */
.section-header,
.section-heading {
  max-width: var(--content-max);
  margin-bottom: clamp(2rem, 4vw, 3.25rem);
}

.section-header--center,
.section-heading--center {
  margin-inline: auto;
  text-align: center;
}

.section-header--center .heading-section,
.section-heading--center .section-heading__title {
  margin-inline: auto;
}

.section-header .text-eyebrow,
.section-header .section-eyebrow,
.section-heading__eyebrow {
  display: block;
  margin-bottom: 0.85rem;
  font-family: var(--font-body);
  font-size: var(--font-size-xs);
  font-weight: 500;
  letter-spacing: var(--letter-spacing-eyebrow);
  text-transform: uppercase;
  color: var(--color-accent);
}

.section-header h2,
.section-heading__title {
  margin-bottom: 0.85rem;
}

.section-header p,
.section-heading__subtitle {
  margin: 0;
  max-width: var(--prose-max);
  font-size: var(--font-size-md);
  line-height: var(--line-height-snug);
  color: var(--color-text-muted);
}

.section-header--center p,
.section-heading--center .section-heading__subtitle {
  margin-inline: auto;
}

.section-content {
  position: relative;
}

/* =========================================================
   REVEAL MOTION
   ========================================================= */

.js-reveal {
  opacity: 0;
  transform: translateY(1.15rem);
  transition:
    opacity var(--transition-slow) var(--ease-out),
    transform var(--transition-slow) var(--ease-out);
}

.js-reveal.is-inview {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  .js-reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* =========================================================
   UTILITIES
   ========================================================= */

.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;
}

/* =========================================================
   OPT-IN IMAGE COVER UTILITY (never apply globally to all img)
   ========================================================= */

.image-cover {
  position: relative;
  overflow: hidden;
}

.image-cover > picture,
.image-cover > img {
  display: block;
  width: 100%;
  height: 100%;
}

.image-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

.image-contain {
  position: relative;
  overflow: hidden;
}

.image-contain img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  display: block;
}

