/* ============================================
   FUBAO BASE STYLES — reset, typography, layout primitives
============================================ */

*, *::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;
    scroll-behavior: auto !important;
  }
}

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  font-weight: var(--weight-regular);
  line-height: var(--leading-normal);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
  padding-bottom: 56px; /* clearance for mobile floating bar */
}

@media (min-width: 768px) {
  body { padding-bottom: 0; }
}

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

a { color: inherit; text-decoration: none; }

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

ul { margin: 0; padding: 0; list-style: none; }

h1, h2, h3, h4, p { margin: 0; }

h1, h2, h3, h4 {
  font-family: var(--font-sans);
  font-weight: var(--weight-black);
  line-height: var(--leading-tight);
  color: var(--color-text);
}

input, textarea {
  font-family: inherit;
  font-size: 16px; /* prevents iOS zoom */
}

/* ---------- Layout primitives ---------- */
.container {
  width: 100%;
  max-width: var(--container-xl);
  margin: 0 auto;
  padding-left: var(--container-pad);
  padding-right: var(--container-pad);
}

.section {
  padding: var(--space-16) 0;
}

@media (min-width: 1024px) {
  .section { padding: var(--space-24) 0; }
}

.section--warm { background: var(--color-surface-warm); }
.section--bg { background: var(--color-bg); }
.section--highlight { background: #E5E7EB; }

/* First section on a page that has no page-header banner above it — clears the fixed nav */
.section--top-offset {
  padding-top: calc(var(--nav-height) + var(--topbar-height) + var(--space-16));
}

.section-head {
  max-width: 640px;
  margin-bottom: var(--space-10);
}

.section-head--center { margin-left: auto; margin-right: auto; text-align: center; }

.eyebrow {
  display: inline-block;
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #4A3820;
  margin-bottom: var(--space-3);
}

.section--wave-bg .section-title { margin-bottom: -1rem; }

.section--wave-bg .eyebrow {
  display: block;
  font-family: var(--font-sans);
  font-size: var(--text-base);
  font-weight: var(--weight-regular);
  text-transform: none;
  letter-spacing: normal;
  color: var(--color-text);
  margin-bottom: 0;
}

.section-title {
  font-size: var(--text-3xl);
  margin-bottom: var(--space-3);
  text-transform: uppercase;
  color: #4A3820;
}

@media (min-width: 768px) {
  .section-title { font-size: var(--text-4xl); }
}

.section-title-img {
  display: block;
  width: min(289px, 59.5vw);
  height: auto;
  margin: 0 auto;
}

.section-head:not(.section-head--center) .section-title-img {
  margin: 0;
}

.section-title-img--vision {
  width: min(186px, 38.3vw);
}

.section-head:not(.section-head--center) .section-title-img--vision {
  margin-bottom: -1rem;
}

.section-sub {
  color: var(--color-text-muted);
  font-size: var(--text-base);
  line-height: var(--leading-relaxed);
  max-width: 60ch;
}

.text-brand { color: #4A3820; }

/* ---------- Scroll-reveal (JS toggles .is-visible via IntersectionObserver) ---------- */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s cubic-bezier(0.16,1,0.3,1), transform 0.6s cubic-bezier(0.16,1,0.3,1);
}
.reveal.is-visible { opacity: 1; transform: translateY(0); }

.stagger > .reveal:nth-child(1) { transition-delay: 0ms; }
.stagger > .reveal:nth-child(2) { transition-delay: 80ms; }
.stagger > .reveal:nth-child(3) { transition-delay: 160ms; }
.stagger > .reveal:nth-child(4) { transition-delay: 240ms; }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* ---------- Visually hidden (a11y) ---------- */
.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 sentinel (used by IntersectionObserver, not a scroll listener) ---------- */
.top-sentinel {
  position: absolute;
  top: 0;
  width: 1px;
  height: 1px;
  pointer-events: none;
}

/* ---------- Skip link ---------- */
.skip-link {
  position: absolute;
  top: -48px;
  left: var(--space-4);
  background: var(--color-text);
  color: #fff;
  padding: var(--space-3) var(--space-5);
  border-radius: var(--radius-md);
  z-index: 200;
  transition: top var(--transition-fast);
}
.skip-link:focus { top: var(--space-4); }
