/* ==========================================================================
   Base: reset, overflow guardrails (§5.8), typography (§4), layout helpers,
   reveal layer (§6), reduced motion, print (§5.6).
   ========================================================================== */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + 16px);
  background: var(--c-ivory);
}
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  overflow-x: clip;                 /* last-resort guard */
  background: var(--c-ivory);
  color: var(--c-ink);
  font-family: var(--ff-body);
  font-size: var(--fs-body);
  font-weight: 300;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background-color var(--dur-theme) ease, color var(--dur-theme) ease;
}

img, picture, video, svg { max-width: 100%; height: auto; display: block; }
img { font-style: italic; } /* alt text styling if an image fails */

h1, h2, h3, h4 {
  margin: 0;
  font-family: var(--ff-display);
  font-weight: 300;
  line-height: 1.12;
  letter-spacing: -.01em;
  overflow-wrap: anywhere;
  text-wrap: balance;
}
h1 { font-size: var(--fs-h1); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); font-weight: 400; }
h1 em, h2 em, h3 em, .accent { font-style: italic; color: var(--c-accent); font-weight: 400; }

p { margin: 0; text-wrap: pretty; }
p + p { margin-top: 1em; }
ul, ol { margin: 0; padding: 0; }
figure, blockquote { margin: 0; }

a { color: var(--c-brand); text-underline-offset: .2em; text-decoration-thickness: 1px; }
a:hover { color: var(--c-brand-hover); }

input, select, textarea, button { font: inherit; font-size: max(16px, 1rem); color: inherit; }
button { cursor: pointer; }

:focus-visible {
  outline: 2px solid var(--c-focus);
  outline-offset: 3px;
  border-radius: 2px;
}
/* back to top focuses <main> (tabindex=-1 is added on the first click): no ring around the whole page */
main[tabindex="-1"]:focus { outline: none; }

.carousel { overscroll-behavior-x: contain; scroll-snap-type: x mandatory; }

/* ---- helpers ----------------------------------------------------------- */

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

.skip-link {
  position: fixed;
  top: 8px; left: 8px;
  z-index: 200;
  padding: 12px 18px;
  background: var(--c-brand);
  color: var(--c-on-brand);
  font-size: var(--fs-small);
  text-decoration: none;
  transform: translateY(-160%);
  transition: transform .2s;
}
.skip-link:focus { transform: none; color: var(--c-on-brand); }

.container { width: var(--container); margin-inline: auto; }
.container-wide { width: var(--container-wide); margin-inline: auto; }
.container-text { width: var(--container-text); margin-inline: auto; }

.section { padding-block: var(--section-y); position: relative; }
.band-linen { background: var(--c-linen); }
.band-greige { background: var(--c-greige); }
.band-blush { background: var(--c-blush); }
.band-espresso { background: var(--c-espresso); color: var(--c-on-dark); }
.band-linen, .band-greige, .band-blush, .band-espresso {
  transition: background-color var(--dur-theme) ease, color var(--dur-theme) ease;
}

/* Headline pattern: eyebrow → headline with italic accent → lead */
.eyebrow {
  display: inline-flex;
  max-width: 100%;
  overflow-wrap: anywhere;
  align-items: center;
  gap: 14px;
  margin: 0 0 var(--stack-sm);
  font-family: var(--ff-body);
  font-size: var(--fs-eyebrow);
  font-weight: 500;
  letter-spacing: var(--ls-caps);
  text-transform: uppercase;
  color: var(--c-accent-deep);
  line-height: 1.5;
}
.eyebrow::before {
  content: "";
  flex: none;
  width: 32px; height: 1px;
  background: currentColor;
  opacity: .7;
}
.lead {
  max-width: 60ch;
  margin-top: var(--stack-sm);
  font-size: var(--fs-lead);
  color: var(--c-ink-soft);
  line-height: 1.7;
}
.section-head { margin-bottom: var(--stack-lg); }
@media (min-width: 48em) {
  .section-head--center { text-align: center; }
  .section-head--center .lead { margin-inline: auto; }
  .section-head--center .eyebrow::after {
    content: ""; flex: none; width: 32px; height: 1px; background: currentColor; opacity: .7;
  }
}
.script {
  display: block;
  font-family: var(--ff-script);
  font-weight: 400;
  font-size: calc(var(--fs-h2) * 1.7);
  line-height: .9;
  color: var(--c-accent);
  opacity: .7;
  margin-bottom: -.12em;
}

/* ---- reveal layer (§6) -------------------------------------------------
   Content is only hidden when JS is running and motion is allowed,
   so no-JS and reduced-motion visitors always see everything. */

@media (prefers-reduced-motion: no-preference) {
  .js .reveal {
    opacity: 0;
    transform: translate3d(0, 28px, 0);
    transition:
      opacity var(--dur-reveal) var(--ease-out),
      transform var(--dur-reveal) var(--ease-out);
    transition-delay: calc(var(--i, 0) * 90ms);
  }
  .js .reveal.is-visible { opacity: 1; transform: none; }

  .js .unveil { clip-path: inset(8% 8% 8% 8%); }
  .js .unveil img { transform: scale(1.06); }
  .js .unveil, .js .unveil img {
    transition: clip-path 1.2s var(--ease-out), transform 1.2s var(--ease-out);
  }
  .js .unveil.is-visible { clip-path: inset(0 0 0 0); }
  .js .unveil.is-visible img { transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---- print (§5.6) -------------------------------------------------------- */
@media print {
  :root { --c-ivory: #fff; --c-linen: #fff; --c-greige: #fff; --c-blush: #fff; --c-espresso: #fff; --c-ink: #000; --c-ink-soft: #333; --c-on-dark: #000; }
  body { font-size: 11pt; line-height: 1.5; }
  .site-header, .topbar, .menu, .sticky-bar, .wa-bubble, .to-top, .skip-link, .bokeh, .scroll-cue,
  .theme-toggle, .menu-toggle, .carousel-controls, .compare-range, .compare-handle,
  .hero-slide:not(:first-child), .timeline-progress, .mood-col:nth-child(n+2), .insta { display: none !important; }
  .reveal, .unveil, .unveil img { opacity: 1 !important; transform: none !important; clip-path: none !important; }
  .hero { min-height: 0 !important; color: #000; }
  .hero-media { position: static !important; transform: none !important; }
  .hero-scrim { display: none; }
  .hero-content { position: static !important; color: #000; }
  .section { padding-block: 18pt; break-inside: avoid; }
  .band-espresso { color: #000; }
  .site-footer { color: #000; }
  .print-only { display: block !important; }
  a[href^="tel:"]::after, a[href^="mailto:"]::after { content: " (" attr(href) ")"; font-size: 9pt; }
}
.print-only { display: none; }
