/* ============================================================
   BASE — reset, typography primitives, layout, the rhythm system,
   and the reveal primitive. STRUCTURAL — content-free; copy as-is.
   (Per-section styling lives in sections.css; the swap surface in tokens.css.)
   ============================================================ */

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: auto; }
body {
  font-family: var(--font-sans);
  font-size: var(--step-0);
  line-height: var(--leading-body);
  color: var(--text-on-light);        /* espresso body — LIGHT world default */
  background: var(--marble-50);        /* Porcelain Blonde — dominant light canvas */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img, picture, svg, video { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
:focus-visible { outline: 2px solid var(--terracotta); outline-offset: 3px; } /* honey */
::selection { background: var(--terracotta); color: #4b382f; } /* honey ground, espresso text */

/* ---- Lenis smooth-scroll hooks ---- */
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-smooth [data-lenis-prevent] { overscroll-behavior: contain; }
.lenis.lenis-stopped { overflow: hidden; }

/* ---- Typography primitives ----
   The Beauty Suite: display = Prata (editorial serif), body/mini = Manrope.
   Exactly 3 header sizes live in tokens.css (--step-hero/-section/-mini). */
.display {
  font-family: var(--font-display);   /* Prata */
  font-weight: 400;
  font-optical-sizing: auto;
  line-height: var(--leading-display);
  letter-spacing: 0;
}
.eyebrow {
  font-family: var(--font-body);      /* Manrope — Meta-A */
  font-size: var(--step-mini);         /* the 3-size ramp's mini step */
  text-transform: uppercase;
  letter-spacing: var(--tracking-label);
  font-weight: 500;
  color: var(--text-on-light-muted);  /* muted espresso-taupe on porcelain (LIGHT default) */
}
.em { font-style: italic; color: var(--terracotta); } /* the single accent emphasis — honey */
.measure { max-width: var(--measure); }

/* ---- Layout ---- */
.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); }
.wrap--wide { max-width: var(--maxw-wide); }
.stack > * + * { margin-top: var(--space-m); }

/* ---- The rhythm system: THE BEAUTY SUITE LIGHT RHYTHM ----
   One dominant LIGHT canvas (porcelain), a warmer taupe/honey proof seam
   (champagne), a SPARING deep-support contrast (espresso, light text), and an
   open near-white breath for relief/close (paper). Each section declares its
   family via data-bg; same-family neighbours share the EXACT canvas so runs
   read as one continuous seamless surface (T2.20). Set each cell's data-bg per
   the DESIGN rhythm plan. */
.section { position: relative; padding-block: var(--section-pad-y); }
.section[data-bg="porcelain"] { background: var(--marble-50);  color: var(--text-on-light); } /* base light canvas (default) */
.section[data-bg="champagne"] { background: var(--marble-100); color: var(--text-on-light); } /* warmer taupe/honey proof seam */
.section[data-bg="espresso"]  { background: var(--ink-900);    color: var(--text-on-dark);  } /* sparing deep-support contrast, light text */
.section[data-bg="paper"]     { background: var(--cream);      color: var(--text-on-light); } /* open near-white breath — relief/close */

/* Back-compat aliases: any lingering starter family name degrades into the
   nearest LIGHT-world family (never a Sharp dark default). */
.section[data-bg="ink"], .section[data-bg="ink-2"] { background: var(--ink-900); color: var(--text-on-dark); }
.section[data-bg="marble"]     { background: var(--marble-50);  color: var(--text-on-light); }
.section[data-bg="cream"]      { background: var(--cream);      color: var(--text-on-light); }
.section[data-bg="terracotta"] { background: var(--terracotta); color: #4b382f; }

/* ---- Reveal primitive — ALIVE-AT-t0 (no-scroll-reveal law, mandatory) ----
   The Beauty Suite INVERTS the starter's scroll-gated hide. NO content element
   may sit at opacity:0 waiting for scroll. Content is FULLY VISIBLE at load; the
   only load-in is an AMBIENT above-fold micro-motion — a gentle fade+drift that
   plays ONCE on load and settles, never a scroll-gated reveal. Because the
   animation ENDS at the visible resting state (and content has no static hide),
   the guaranteed floor is: content present. If JS never runs, if the animation
   is unsupported, or on reduced-motion — everything is simply visible. 0 content
   elements are gated behind scroll. main.js matches this (ambient, not gated). */
@keyframes ambient-rise {
  /* TRANSFORM-ONLY — opacity never leaves 1. A frozen timeline (the capture
     tool freezes motion; a stalled GSAP ticker) previously left `backwards`
     content stuck on the transparent `from` state → invisible in captures AND
     a real alive-at-t0 risk. Transform-only + opacity:1 is bulletproof: content
     is ALWAYS visible, the intro is a gentle settle-into-frame drift. */
  from { transform: translateY(14px); }
  to   { transform: none; }
}
.js [data-reveal] {
  opacity: 1;                 /* ALWAYS visible — survives frozen timeline / capture freeze / no-JS / reduced-motion */
  animation: ambient-rise var(--dur, 0.6s) var(--ease-out) both;
}
/* Elements the JS chooses to hand a staggered intro carry .is-in when settled;
   it is a no-op on the resting state (content already visible) — kept so the
   motion layer can clear will-change without ever hiding content. */
[data-reveal].is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .js [data-reveal] { animation: none; opacity: 1; transform: none; }
  html { scroll-behavior: auto; }
}

/* ============================================================
   NAV CHROME — bespoke editorial masthead (The Beauty Suite).
   NOT Sharp's left-logo .nav__links bar. A slim masthead with a CENTERED
   Prata wordmark (TEXT, no logo asset), quiet service anchors flanking, and a
   single consultation CTA at the right. Solidifies to a soft porcelain bar on
   scroll past the hero; HIDES on scroll-down / REVEALS on scroll-up (standing
   law). Mobile (≤760px) becomes a bottom-sheet menu with the consult CTA always
   visible after reveal. Shared/locked surface — lives in base.css.
   ============================================================ */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  /* transparent over the hero; solidifies via .is-scrolled */
  background: transparent;
  border-bottom: 1px solid transparent;
  transition:
    transform var(--dur-fast) var(--ease-out),
    background var(--dur-fast) var(--ease-out),
    border-color var(--dur-fast) var(--ease-out),
    box-shadow var(--dur-fast) var(--ease-out);
  /* NO `will-change: transform` here: it forms a containing block that captures
     the position:fixed mobile bottom-sheet (.nav__links), resolving its bottom:0
     against the 76px nav box instead of the viewport → the sheet sat trapped over
     the hero at scroll-0 on mobile. Dropping it lets the sheet resolve viewport-
     relative and park off-screen. The hide/reveal translate still animates fine. */
}
.nav__inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: var(--space-m);
  width: 100%;
}

/* Centered Prata wordmark — TEXT, no logo image. */
.nav__wordmark {
  grid-column: 2;
  justify-self: center;
  font-family: var(--font-display);   /* Prata */
  font-weight: 400;
  font-size: clamp(1.15rem, 0.9rem + 0.7vw, 1.5rem);
  letter-spacing: 0.02em;
  line-height: 1;
  white-space: nowrap;
  color: inherit;
}
.nav__wordmark .nav__wordmark-accent { color: var(--terracotta); } /* honey "Beauty" */

/* Quiet service anchors (left cluster) + CTA (right cluster). */
.nav__links {
  grid-column: 1;
  justify-self: start;
  display: flex;
  align-items: center;
  gap: clamp(1rem, 0.5rem + 1.4vw, 2rem);
}
.nav__links a {
  font-family: var(--font-body);      /* Manrope — Meta-A */
  font-size: var(--step-mini);
  text-transform: uppercase;
  letter-spacing: var(--tracking-label);
  font-weight: 500;
  color: inherit;
  position: relative;
  padding-block: 0.35rem;
}
/* soft underline travel on hover/focus only (motion personality) */
.nav__links a::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0.05rem;
  width: 100%; height: 1px;
  background: var(--terracotta);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--dur-fast) var(--ease-out);
}
.nav__links a:hover::after,
.nav__links a:focus-visible::after { transform: scaleX(1); }

.nav__cta-wrap {
  grid-column: 3;
  justify-self: end;
  display: flex;
  align-items: center;
  gap: var(--space-s);
}
.nav__cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.7rem;
  padding-inline: 1.15rem;
  border-radius: var(--radius);
  background: var(--support, #4b382f); /* espresso ground */
  color: var(--marble-50);             /* porcelain text */
  font-family: var(--font-body);
  font-size: var(--step-mini);
  font-weight: 600;                    /* Meta-A strong */
  letter-spacing: 0.06em;
  white-space: nowrap;
  transition: background var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out);
}
.nav__cta:hover { background: var(--terracotta); color: #4b382f; transform: translateY(-1px); }

/* Solidified state — soft porcelain bar past the hero. */
.nav.is-scrolled {
  background: color-mix(in srgb, var(--marble-50) 88%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom-color: var(--hairline);
  box-shadow: 0 10px 30px -24px rgba(75, 56, 47, 0.5);
  color: var(--text-on-light);         /* espresso ink on the porcelain bar */
}

/* Hide-on-scroll-down / reveal-on-scroll-up (main.js toggles .is-hidden). */
.nav.is-hidden { transform: translateY(-100%); }

/* Mobile bottom-sheet toggle button — hidden on desktop. */
.nav__toggle {
  grid-column: 3;
  justify-self: end;
  display: none;
  flex-direction: column;
  gap: 5px;
  width: 2.4rem; height: 2.4rem;
  align-items: center;
  justify-content: center;
}
.nav__toggle span {
  display: block;
  width: 22px; height: 1.5px;
  background: currentColor;
  transition: transform var(--dur-fast) var(--ease-out), opacity var(--dur-fast) var(--ease-out);
}

/* ---- Mobile (≤760px): bottom-sheet menu ---- */
@media (max-width: 760px) {
  .nav__inner { grid-template-columns: auto 1fr auto; }
  .nav__wordmark { grid-column: 1; justify-self: start; }
  /* links move into the bottom sheet */
  .nav__links {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    grid-column: auto;
    flex-direction: column;
    align-items: stretch;
    gap: var(--space-s);
    padding: var(--space-l) var(--gutter) calc(var(--space-l) + env(safe-area-inset-bottom, 0px));
    background: color-mix(in srgb, var(--marble-50) 96%, transparent);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
    border-top: 1px solid var(--hairline);
    box-shadow: 0 -20px 50px -30px rgba(75, 56, 47, 0.6);
    color: var(--text-on-light);
    transform: translateY(100%);
    transition: transform var(--dur) var(--ease-inout);
    z-index: 110;
  }
  .nav.is-menu-open .nav__links { transform: translateY(0); }
  .nav__links a {
    font-size: 1rem;
    padding-block: 0.7rem;
    border-bottom: 1px solid var(--hairline);
  }
  .nav__links a::after { display: none; }
  /* the consultation CTA stays visible in the sheet after reveal */
  .nav__cta-wrap {
    grid-column: auto;
    position: fixed;
    left: var(--gutter); right: var(--gutter);
    bottom: calc(var(--space-l) + env(safe-area-inset-bottom, 0px));
    justify-self: auto;
    z-index: 111;
    transform: translateY(200%);
    transition: transform var(--dur) var(--ease-inout);
    pointer-events: none;
  }
  .nav.is-menu-open .nav__cta-wrap { transform: translateY(0); pointer-events: auto; }
  .nav__cta { width: 100%; min-height: 3rem; }
  .nav__toggle { display: flex; grid-column: 3; }
  .nav.is-menu-open .nav__toggle span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
  .nav.is-menu-open .nav__toggle span:nth-child(2) { opacity: 0; }
  .nav.is-menu-open .nav__toggle span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }
}

/* ============================================================
   FOOTER CHROME — the real close (wordmark lives in nav + footer ONLY).
   Prata wordmark + espresso ground, founder-led. Shared/locked skeleton
   surface. Phone/hours are lead-fillable placeholders (no invented claims).
   ============================================================ */
.footer { padding-bottom: var(--space-l); }
.footer__inner {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: var(--space-l);
  align-items: start;
}
.footer__wordmark {
  display: inline-block;
  font-family: var(--font-display);   /* Prata */
  font-size: clamp(1.4rem, 1.1rem + 1vw, 2rem);
  letter-spacing: 0.02em;
  line-height: 1;
  color: inherit;
  margin-bottom: var(--space-s);
}
.footer__wordmark-accent { color: var(--terracotta); } /* honey "Beauty" */
.footer__blurb {
  max-width: 42ch;
  color: var(--text-on-dark-muted);
  font-size: var(--step-0);
}
.footer__nav, .footer__contact { display: flex; flex-direction: column; gap: var(--space-2xs); }
.footer__nav h2, .footer__contact h2 {
  font-family: var(--font-body);
  font-size: var(--step-mini);
  text-transform: uppercase;
  letter-spacing: var(--tracking-label);
  font-weight: 600;
  color: var(--terracotta);
  margin-bottom: var(--space-2xs);
}
.footer__nav a {
  color: var(--text-on-dark);
  font-size: var(--step-0);
  width: fit-content;
  transition: color var(--dur-fast) var(--ease-out);
}
.footer__nav a:hover, .footer__nav a:focus-visible { color: var(--terracotta); }
.footer__contact-line { color: var(--text-on-dark-muted); font-size: var(--step-0); }
.footer__contact-line a { color: var(--text-on-dark); }
.footer__contact-line a:hover { color: var(--terracotta); }
.footer__bottom {
  margin-top: var(--space-l);
  padding-top: var(--space-m);
  border-top: 1px solid var(--hairline-dark);
  color: var(--text-on-dark-muted);
  font-size: var(--step-mini);
}
@media (max-width: 760px) {
  .footer__inner { grid-template-columns: 1fr; gap: var(--space-m); }
}
