/* =========================================================
   base.css — global tokens + foundations (clinic dark default)
   Fixes:
   - No more “white flash” on mobile scroll (html + body bg locked)
   - Background/glow layer no longer uses negative z-index
   - Proper spa theme overrides (bg/bg2/text/muted/line)
   ========================================================= */

/* =========================
   Theme Tokens
   ========================= */

:root {
  --bg: #070808;
  --bg2: #0b0d0d;
  --text: rgba(255, 255, 255, .92);
  --muted: rgba(255, 255, 255, .70);
  --line: rgba(255, 255, 255, .12);

  /* clinic default */
  --accent: #12c08a;
  --accent2: #0ea375;
  --accentSoft: rgba(18, 192, 138, .18);

  --warm: #c58a63;

  --radius-xl: 26px;
  --radius-lg: 20px;
  --radius-md: 16px;

  --shadow: 0 22px 70px rgba(0, 0, 0, .55);
  --shadow-soft: 0 14px 40px rgba(0, 0, 0, .35);

  --container: 80%;
}

/* Clinic (explicit, optional) */
html[data-brand="clinic"] {
  --bg: #070808;
  --bg2: #0b0d0d;
  --text: rgba(255, 255, 255, .92);
  --muted: rgba(255, 255, 255, .70);
  --line: rgba(255, 255, 255, .12);

  --accent: #12c08a;
  --accent2: #0ea375;
  --accentSoft: rgba(18, 192, 138, .18);
}

/* ✅ Spa overrides (FULL theme, not just accent) */
html[data-brand="spa"] {
  --bg: #fbf7f1;
  --bg2: #f3eee6;
  --text: rgba(20, 20, 20, .92);
  --muted: rgba(20, 20, 20, .70);
  --line: rgba(0, 0, 0, .12);

  --accent: #d6a36b;
  --accent2: #b9854f;
  --accentSoft: rgba(214, 163, 107, .18);
}

/* =========================
   Resets / Base
   ========================= */

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  height: auto;
  overflow-x: clip;

  /* ✅ lock viewport paint to theme (prevents mobile white flash) */
  background: var(--bg);
  background-color: var(--bg);

  color: var(--text);
}

@supports not (overflow: clip) {

  html,
  body {
    overflow-x: hidden;
  }
}

body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;

  /* main surface gradient for the whole page */
  background: linear-gradient(180deg, var(--bg), var(--bg2) 70%);

  overflow-x: hidden;

  /* ✅ critical: keep decorative layers inside a stable stacking context */
  position: relative;
  isolation: isolate;
}

/* =========================
   Global Ambient Glow Layer
   (no seams between sections)
   ✅ no negative z-index; lives behind content within body context
   ========================= */

body::before {
  content: "";
  position: fixed;
  inset: -20vh -20vw;
  pointer-events: none;

  /* behind content, but not behind the browser canvas */
  z-index: 0;

  background:
    radial-gradient(900px 520px at 12% 18%, var(--accentSoft), transparent 60%),
    radial-gradient(900px 560px at 88% 22%, rgba(197, 138, 99, .10), transparent 62%),
    radial-gradient(1100px 700px at 30% 85%, rgba(255, 255, 255, .04), transparent 65%);

  filter: blur(2px);
  opacity: 1;
}

/* Ensure normal page content sits above the glow */
.site-header,
main,
footer {
  position: relative;
  z-index: 1;
}

/* Links / Media */
a {
  color: inherit;
  text-decoration: none;
}

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

/* Layout container */
.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 22px;
}

/* =========================
   Buttons
   ========================= */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;

  padding: 12px 16px;
  border-radius: 999px;
  border: 1px solid transparent;

  font-weight: 650;
  line-height: 1;
  cursor: pointer;
  white-space: nowrap;

  transition: transform .15s ease, background .15s ease, border-color .15s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn-outline {
  background: transparent;
  border-color: var(--line);
}

.btn-outline:hover {
  background: rgba(255, 255, 255, .06);
}

/* spa needs darker hover surface because text is dark */
html[data-brand="spa"] .btn-outline:hover {
  background: rgba(0, 0, 0, .05);
}

.btn-accent {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #04140e;
}

/* On spa, keep accent button text readable */
html[data-brand="spa"] .btn-accent {
  color: rgba(0, 0, 0, .92);
}

/* =========================
   TILE GRID PRESETS (shared)
   ========================= */

.tile-grid {
  display: grid;
  gap: 22px;
}

.tile-grid.grid-1 {
  grid-template-columns: 1fr;
}

.tile-grid.grid-2 {
  grid-template-columns: repeat(2, 1fr);
}

.tile-grid.grid-3 {
  grid-template-columns: repeat(3, 1fr);
}

@media (max-width: 1100px) {

  .tile-grid.grid-1,
  .tile-grid.grid-2,
  .tile-grid.grid-3 {
    grid-template-columns: 1fr;
  }
}

/* =========================
   Scroll Reveal Animations
   ========================= */

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition:
    opacity 1.5s ease,
    transform 1.5s cubic-bezier(.22, .61, .36, 1);
  will-change: opacity, transform;
}

.reveal.is-visible {
  opacity: 1;
  transform: none;
}

.reveal-stagger>* {
  opacity: 0;
  transform: translateY(18px);
}

.reveal-stagger.is-visible>* {
  opacity: 1;
  transform: none;
  transition:
    opacity 1.5s ease,
    transform 1.5s cubic-bezier(.22, .61, .36, 1);
}

@media (prefers-reduced-motion: reduce) {

  .reveal,
  .reveal-stagger>* {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
}

/* =========================================================
   Staggered reveal for logo slabs
   Assumes your reveal script toggles: .reveal.is-visible
   ========================================================= */

.reveal-slab .reveal-item,
.reveal-slab .reveal-bullet {
  opacity: 0;
  transform: translateY(14px);
  transition:
    opacity .65s ease,
    transform .75s cubic-bezier(.2, .85, .2, 1);
  will-change: opacity, transform;
}

/* When the slab becomes visible, animate in */
.reveal-slab.is-visible .reveal-item,
.reveal-slab.is-visible .reveal-bullet {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger order inside each slab */
.reveal-slab.is-visible .logo-slab__logo.reveal-item {
  transition-delay: .05s;
}

.reveal-slab.is-visible .logo-slab__title.reveal-item {
  transition-delay: .18s;
}

/* Bullets stagger (adjust counts if you have more/less) */
.reveal-slab.is-visible .logo-slab__bullets .reveal-bullet:nth-child(1) {
  transition-delay: .28s;
}

.reveal-slab.is-visible .logo-slab__bullets .reveal-bullet:nth-child(2) {
  transition-delay: .36s;
}

.reveal-slab.is-visible .logo-slab__bullets .reveal-bullet:nth-child(3) {
  transition-delay: .44s;
}

.reveal-slab.is-visible .logo-slab__bullets .reveal-bullet:nth-child(4) {
  transition-delay: .52s;
}

.reveal-slab.is-visible .logo-slab__cta.reveal-item {
  transition-delay: .62s;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {

  .reveal-slab .reveal-item,
  .reveal-slab .reveal-bullet {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
}

/* =========================================
   REVEAL (safe + simple)
   - Only elements with .reveal animate in
   - .reveal-stagger animates its direct children
   ========================================= */

/* Base reveal */
.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity .55s ease, transform .55s ease;
  will-change: opacity, transform;
}

/* When visible */
.reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* Stagger container doesn't hide itself */
.reveal-stagger {
  /* no opacity/transform here */
}

/* Children start hidden */
.reveal-stagger > * {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity .55s ease, transform .55s ease;
  will-change: opacity, transform;
}

/* When container is visible, children animate in with stagger delays */
.reveal-stagger.is-visible > * {
  opacity: 1;
  transform: none;
}

/* Stagger timing (up to 24 items; extend if you need more) */
.reveal-stagger.is-visible > *:nth-child(1)  { transition-delay: .00s; }
.reveal-stagger.is-visible > *:nth-child(2)  { transition-delay: .06s; }
.reveal-stagger.is-visible > *:nth-child(3)  { transition-delay: .12s; }
.reveal-stagger.is-visible > *:nth-child(4)  { transition-delay: .18s; }
.reveal-stagger.is-visible > *:nth-child(5)  { transition-delay: .24s; }
.reveal-stagger.is-visible > *:nth-child(6)  { transition-delay: .30s; }
.reveal-stagger.is-visible > *:nth-child(7)  { transition-delay: .36s; }
.reveal-stagger.is-visible > *:nth-child(8)  { transition-delay: .42s; }
.reveal-stagger.is-visible > *:nth-child(9)  { transition-delay: .48s; }
.reveal-stagger.is-visible > *:nth-child(10) { transition-delay: .54s; }
.reveal-stagger.is-visible > *:nth-child(11) { transition-delay: .60s; }
.reveal-stagger.is-visible > *:nth-child(12) { transition-delay: .66s; }
.reveal-stagger.is-visible > *:nth-child(13) { transition-delay: .72s; }
.reveal-stagger.is-visible > *:nth-child(14) { transition-delay: .78s; }
.reveal-stagger.is-visible > *:nth-child(15) { transition-delay: .84s; }
.reveal-stagger.is-visible > *:nth-child(16) { transition-delay: .90s; }
.reveal-stagger.is-visible > *:nth-child(17) { transition-delay: .96s; }
.reveal-stagger.is-visible > *:nth-child(18) { transition-delay: 1.02s; }
.reveal-stagger.is-visible > *:nth-child(19) { transition-delay: 1.08s; }
.reveal-stagger.is-visible > *:nth-child(20) { transition-delay: 1.14s; }
.reveal-stagger.is-visible > *:nth-child(21) { transition-delay: 1.20s; }
.reveal-stagger.is-visible > *:nth-child(22) { transition-delay: 1.26s; }
.reveal-stagger.is-visible > *:nth-child(23) { transition-delay: 1.32s; }
.reveal-stagger.is-visible > *:nth-child(24) { transition-delay: 1.38s; }

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  .reveal,
  .reveal-stagger > * {
    transition: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}


/* =========================
   Shared Section Head
   Clinic default + Spa overrides
   ========================= */

.section-eyebrow {
  display: inline-block;
  letter-spacing: .14em;
  text-transform: uppercase;
  font-weight: 900;
  font-size: .82rem;
  color: rgba(18, 192, 138, .92);
  margin-bottom: 10px;
}

.section-title {
  margin: 0 0 14px;
  font-size: clamp(2.05rem, 3.2vw, 3.15rem);
  line-height: 1.03;
  letter-spacing: -0.03em;
  color: rgba(255, 255, 255, .94);
  font-weight: 650;
}

.section-divider {
  width: 54px;
  height: 2px;
  border-radius: 999px;
  background: rgba(18, 192, 138, .85);
  margin: 14px 0 18px;
}

.section-sub {
  margin: 0;
  max-width: 70ch;
  color: rgba(255, 255, 255, .66);
  line-height: 1.75;
}

/* Spa section head colors */
html[data-brand="spa"] .section-eyebrow {
  color: rgba(110, 74, 40, .85);
}

html[data-brand="spa"] .section-title {
  color: rgba(20, 20, 20, .92);
}

html[data-brand="spa"] .section-divider {
  background: rgba(214, 163, 107, .85);
}

html[data-brand="spa"] .section-sub {
  color: rgba(20, 20, 20, .70);
}

.green-divider {
  width: 33%;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), transparent);
  margin: 18px 0 22px;
  border-radius: 2px;
}

/* =========================================================
   CLINIC — Make basic outline buttons glow blue by default
   ========================================================= */



/* Optional: slightly stronger on hover */
html[data-brand="clinic"] .btn.btn-outline:hover {
  box-shadow:
    0 0 0 1px rgba(18, 192, 138, .92),
    0 0 24px rgba(18, 192, 138, 0.55);
}

