/* ============================================================
   layout.css — Boundless You v2
   Reset, base typography, section patterns, utility classes.
   Import AFTER tokens.css on every page.
   v2.0 | Sprint 1
   ============================================================ */

/* ── RESET ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  background: var(--ivory);
  color: var(--charcoal);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; cursor: pointer; }
img { display: block; max-width: 100%; }
ul, ol { list-style: none; }

/* ── PAGE OFFSET (accounts for fixed beta strip + nav) ─────── */
.page-wrap {
  padding-top: calc(var(--nav-height) + var(--beta-h));
}

/* ── SECTION CONTAINER ──────────────────────────────────────── */
.sec {
  padding: var(--section-pad) 6vw;
}
.sec.alt  { background: var(--stone); }
.sec.dark { background: var(--charcoal); color: var(--ivory); }
.sec.green { background: var(--green); color: var(--ivory); }

/* ── CONTENT WIDTH CONSTRAINTS ──────────────────────────────── */
.inner {
  max-width: 660px;
  margin: 0 auto;
}
.inner.wide {
  max-width: var(--content-max);
}
.inner.mid {
  max-width: 840px;
}
.inner.center {
  text-align: center;
}

/* ── SECTION LABEL (spaced caps above headings) ─────────────── */
.section-label,
.label {
  font-size: 0.68rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 1.6rem;
  font-family: var(--sans);
  font-weight: 400;
}
.sec.dark .section-label,
.sec.dark .label  { color: rgba(250,247,242,0.35); }
.sec.green .section-label,
.sec.green .label { color: rgba(250,247,242,0.5); }

/* ── EYEBROW (small caps above H1 in heroes) ────────────────── */
.eyebrow {
  font-size: 0.7rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 2.5rem;
  font-family: var(--sans);
}

/* ── HEADINGS ───────────────────────────────────────────────── */
h1, h2, h3, h4 {
  font-family: var(--serif);
  font-weight: 400;
  line-height: 1.15;
  color: var(--charcoal);
}

h1 {
  font-size: clamp(2.8rem, 6vw, 5.4rem);
  line-height: 1.1;
  margin-bottom: 2rem;
}

h2 {
  font-size: clamp(1.9rem, 3.6vw, 3rem);
  line-height: 1.2;
  margin-bottom: 2rem;
}

h3 {
  font-size: clamp(1.3rem, 2vw, 1.7rem);
  margin-bottom: 1rem;
}

h4 {
  font-size: 1.1rem;
  margin-bottom: 0.75rem;
}

h1 em, h2 em, h3 em { font-style: italic; color: var(--green); }

.sec.dark h1, .sec.dark h2, .sec.dark h3 { color: var(--ivory); }
.sec.dark h1 em, .sec.dark h2 em { color: rgba(250,247,242,0.55); }
.sec.green h1, .sec.green h2 { color: var(--ivory); }

/* ── BODY TEXT ───────────────────────────────────────────────── */
p {
  font-size: clamp(0.93rem, 1.15vw, 1.02rem);
  font-weight: 300;
  line-height: 1.9;
  color: var(--muted);
  margin-bottom: 1.1rem;
}
p:last-child { margin-bottom: 0; }

.sec.dark p { color: rgba(250,247,242,0.65); }
.sec.green p { color: rgba(250,247,242,0.75); }

p em {
  font-style: italic;
  font-family: var(--serif);
  font-size: 1.04em;
  color: var(--charcoal);
}
.sec.dark p em { color: var(--ivory); }

/* ── HERO BLOCK ─────────────────────────────────────────────── */
.hero {
  min-height: calc(100vh - var(--nav-height));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: clamp(5rem, 10vw, 9rem) 6vw clamp(5rem, 8vw, 7rem);
}

.hero.hero-sm {
  min-height: 40vh;
}

.hero-sub {
  font-size: clamp(0.92rem, 1.3vw, 1.05rem);
  font-weight: 300;
  line-height: 1.85;
  color: var(--muted);
  max-width: 520px;
  margin-bottom: 3.5rem;
}
.hero-dark .hero-sub { color: rgba(250,247,242,0.7); }

/* ── SITE IMAGES ─────────────────────────────────────────────── */
.site-img {
  width: 100%;
  object-fit: cover;
  object-position: center;
}
.site-img.tall  { height: 72vh; }
.site-img.mid   { height: 56vh; }
.site-img.short { height: 40vh; }
.site-img.about-a3 { height: 65vh; }

@media (max-width: 768px) {
  .site-img.tall  { height: 55vw; }
  .site-img.mid   { height: 45vw; }
  .site-img.short { height: 35vw; }
}

/* ── DIVIDER LINE ────────────────────────────────────────────── */
.rule {
  width: 36px;
  height: 1px;
  background: var(--taupe);
  margin: 2.5rem auto;
}
.sec.dark .rule { background: rgba(250,247,242,0.2); }

.section-divider {
  border: none;
  border-top: 1px solid var(--taupe);
  margin: 0;
}

/* ── STATEMENT BLOCK (large stacked lines) ───────────────────── */
.statement h2 {
  font-size: clamp(2.4rem, 5vw, 4.2rem);
  margin-bottom: 0.4rem;
  line-height: 1.1;
}

/* ── FORMAT LIST ─────────────────────────────────────────────── */
.flist { list-style: none; margin-top: 0.8rem; }
.flist li {
  font-size: clamp(0.9rem, 1.1vw, 1rem);
  font-weight: 300;
  color: var(--muted);
  padding: 0.55rem 0 0.55rem 1.4rem;
  border-bottom: 1px solid var(--taupe);
  position: relative;
}
.flist li:first-child { border-top: 1px solid var(--taupe); }
.flist li::before { content: '›'; position: absolute; left: 0; color: var(--gold-dark); font-size: 1rem; line-height: 1.6; }

/* ── ABOUT STAGES ────────────────────────────────────────────── */
.stage + .stage { border-top: 1px solid var(--taupe); padding-top: 3.5rem; margin-top: 3.5rem; }
.stage-lbl {
  font-size: 0.66rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--taupe);
  margin-bottom: 1.2rem;
}
.sec.dark .stage-lbl { color: rgba(250,247,242,0.25); }

/* ── FOUNDER SIGNATURE ───────────────────────────────────────── */
.founder-sig {
  margin-top: 2.2rem;
  font-family: var(--serif);
  font-size: 1rem;
  font-style: italic;
  color: var(--green);
}
.sec.dark .founder-sig { color: var(--gold); }

/* ── MICRO TEXT ──────────────────────────────────────────────── */
.micro {
  font-size: 0.74rem;
  font-style: italic;
  color: var(--muted);
}

/* ── CTA STACK ───────────────────────────────────────────────── */
.cta-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.8rem;
}

/* ── FADE IN ON SCROLL ───────────────────────────────────────── */
.fi {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.fi.on {
  opacity: 1;
  transform: none;
}

/* Directional variants */
.fi-left {
  opacity: 0;
  transform: translateX(-32px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.fi-right {
  opacity: 0;
  transform: translateX(32px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.fi-left.on,
.fi-right.on {
  opacity: 1;
  transform: none;
}

/* Stagger: add class="stagger" to a grid/list parent — children get cascading delays */
.stagger > .fi:nth-child(1),
.stagger > .fi-left:nth-child(1),
.stagger > .fi-right:nth-child(1) { transition-delay: 0s; }
.stagger > .fi:nth-child(2),
.stagger > .fi-left:nth-child(2),
.stagger > .fi-right:nth-child(2) { transition-delay: 0.09s; }
.stagger > .fi:nth-child(3),
.stagger > .fi-left:nth-child(3),
.stagger > .fi-right:nth-child(3) { transition-delay: 0.18s; }
.stagger > .fi:nth-child(4),
.stagger > .fi-left:nth-child(4),
.stagger > .fi-right:nth-child(4) { transition-delay: 0.27s; }
.stagger > .fi:nth-child(5),
.stagger > .fi-left:nth-child(5),
.stagger > .fi-right:nth-child(5) { transition-delay: 0.36s; }
.stagger > .fi:nth-child(6),
.stagger > .fi-left:nth-child(6),
.stagger > .fi-right:nth-child(6) { transition-delay: 0.45s; }

/* Scroll progress bar — inserted by JS on calc pages */
.scroll-progress {
  position: fixed;
  top: calc(var(--beta-h, 0px) + var(--nav-height, 70px));
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--gold);
  transform-origin: left center;
  transform: scaleX(0);
  z-index: 199;
  transition: transform 0.08s linear;
  pointer-events: none;
}

/* Count-up numbers — JS writes the animated value into [data-count] spans */
.count-up {
  display: inline-block;
  font-variant-numeric: tabular-nums;
}

/* ── STATS ROW ───────────────────────────────────────────────── */
.stats-row {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem 4rem;
  justify-content: center;
  margin-top: 2rem;
}
.stat-item { text-align: center; }
.stat-num {
  display: block;
  font-family: var(--serif);
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 400;
  color: var(--green);
  line-height: 1;
}
.stat-label {
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 0.4rem;
}

/* ── GRID UTILITIES ──────────────────────────────────────────── */
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem;
}

@media (max-width: 960px) {
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .grid-3, .grid-2 { grid-template-columns: 1fr; }
}

/* ── RESPONSIVE BASE ─────────────────────────────────────────── */
@media (max-width: 768px) {
  .sec { padding: 3.5rem 5vw; }
  h2 { font-size: clamp(1.7rem, 6vw, 2.4rem); }
  .statement h2 { font-size: clamp(2rem, 7vw, 3.2rem); }
  .hero { padding: 4rem 5vw; }
}
