/* ============================================================================
   ATIVA PILATES — base.css
   Design tokens, reset, typography scale, utilities, motion primitives.
   ==========================================================================*/

/* ---------------------------------------------------------------- tokens  */
:root {
  color-scheme: light;

  /* --- brand ramp: sage / olive, taken from the Ativa logo -------------- */
  --sage-950: #171C13;
  --sage-900: #222A1C;
  --sage-800: #303A27;
  --sage-700: #46543A;
  --sage-600: #4F6140;
  --sage-500: #6E8158;
  --sage-400: #8A9C74;
  --sage-300: #A9BB93;
  --sage-200: #CBD6BC;
  --sage-100: #E5EBDC;
  --sage-50:  #F1F4EA;

  /* --- warm neutrals ---------------------------------------------------- */
  --cream-50: #FBF9F3;
  --cream-100:#F7F4ED;
  --cream-200:#F0EBDF;
  --cream-300:#E4DCC9;
  --sand:     #D9CDB2;

  /* --- accent: soft brass, used for rating + editorial detail ----------- */
  --brass-600:#7E6218;  /* text-safe on cream */
  --brass-500:#A8842A;
  --brass-400:#C9A227;
  --brass-300:#DFC167;

  --ink: #1E2419;

  /* --- semantic (light theme is the default) ---------------------------- */
  --bg:            var(--cream-100);
  --bg-alt:        var(--cream-50);
  --bg-deep:       var(--sage-900);
  --surface:       #FFFFFF;
  --surface-2:     var(--cream-50);
  --surface-sunk:  var(--cream-200);

  --text:          var(--ink);
  --text-muted:    #5A6450;
  --text-soft:     #66705B;
  --text-on-deep:  #F2F0E6;
  --text-on-deep-muted: #B9C2AC;

  --accent:        var(--sage-600);
  --accent-hover:  var(--sage-700);
  --accent-soft:   var(--sage-100);
  --accent-contrast: #FFFFFF;
  --gold:          var(--brass-600);
  --gold-deco:     var(--brass-400);

  --line:          #E0DAC9;
  --line-strong:   #CCC3AC;
  --line-on-deep:  rgba(233, 238, 222, .16);

  --shadow-sm: 0 1px 2px rgba(34, 42, 28, .06), 0 2px 6px rgba(34, 42, 28, .05);
  --shadow-md: 0 4px 12px rgba(34, 42, 28, .07), 0 12px 28px rgba(34, 42, 28, .07);
  --shadow-lg: 0 8px 24px rgba(34, 42, 28, .08), 0 28px 60px rgba(34, 42, 28, .12);
  --shadow-glow: 0 18px 50px rgba(79, 97, 64, .28);

  /* --- typography -------------------------------------------------------- */
  --font-display: "Cormorant Garamond", "Iowan Old Style", Garamond, Georgia, "Times New Roman", serif;
  --font-sans: "Manrope", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  /* fluid type scale — clamp(min, preferred, max) */
  --fs-display: clamp(2.85rem, 1.6rem + 6.2vw, 7rem);
  --fs-h1:      clamp(2.4rem, 1.5rem + 4.4vw, 5rem);
  --fs-h2:      clamp(2rem, 1.35rem + 3vw, 3.75rem);
  --fs-h3:      clamp(1.45rem, 1.2rem + 1.2vw, 2.1rem);
  --fs-h4:      clamp(1.2rem, 1.08rem + .55vw, 1.5rem);
  --fs-lead:    clamp(1.05rem, .98rem + .45vw, 1.3rem);
  --fs-body:    1rem;
  --fs-sm:      .9375rem;
  --fs-xs:      .8125rem;
  --fs-eyebrow: .75rem;

  /* --- spacing (marketing page = generous) -------------------------------- */
  --space-2xs: .25rem;
  --space-xs:  .5rem;
  --space-sm:  .75rem;
  --space-md:  1rem;
  --space-lg:  1.5rem;
  --space-xl:  2rem;
  --space-2xl: 3rem;
  --space-3xl: 4.5rem;
  --space-4xl: 6rem;
  --section-y: clamp(4.5rem, 3rem + 8vw, 9.5rem);

  /* --- shape -------------------------------------------------------------- */
  --r-xs: 6px;
  --r-sm: 10px;
  --r-md: 16px;
  --r-lg: 24px;
  --r-xl: 32px;
  --r-pill: 999px;

  --container: 1240px;
  --container-narrow: 860px;
  --gutter: clamp(1.15rem, .6rem + 2.4vw, 3rem);

  /* --- motion -------------------------------------------------------------- */
  --ease-out: cubic-bezier(.22, 1, .36, 1);         /* settle */
  --ease-in-out: cubic-bezier(.65, .05, .36, 1);
  --ease-spring: cubic-bezier(.34, 1.56, .64, 1);   /* slight overshoot */
  --dur-fast: 140ms;      /* hover / press feedback */
  --dur-base: 260ms;      /* state change */
  --dur-slow: 520ms;      /* entrance */
  --dur-reveal: 900ms;    /* scroll reveal */

  --nav-h: 78px;
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 1rem);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  font-weight: 400;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}

body.is-locked { overflow: hidden; }

h1, h2, h3, h4, h5, h6 { margin: 0; font-weight: 600; line-height: 1.12; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
figure { margin: 0; }

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

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

button, input, select, textarea {
  font: inherit;
  color: inherit;
}
button { background: none; border: 0; cursor: pointer; }

::selection { background: var(--accent); color: var(--accent-contrast); }

/* Visible, high-contrast focus. Never removed — only restyled.             */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: var(--r-xs);
}
:focus:not(:focus-visible) { outline: none; }

/* ---------------------------------------------------------------- type    */
.display,
.h1, .h2, .h3 {
  font-family: var(--font-display);
  font-weight: 500;
  letter-spacing: -.015em;
}
.display { font-size: var(--fs-display); line-height: .98; }
.h1 { font-size: var(--fs-h1); line-height: 1.02; }
.h2 { font-size: var(--fs-h2); line-height: 1.06; }
.h3 { font-size: var(--fs-h3); line-height: 1.18; }
.h4 {
  font-family: var(--font-sans);
  font-size: var(--fs-h4);
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -.01em;
}

.display em, .h1 em, .h2 em, .h3 em {
  font-style: italic;
  font-weight: 400;
}

.lead {
  font-size: var(--fs-lead);
  line-height: 1.6;
  color: var(--text-muted);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  font-size: var(--fs-eyebrow);
  font-weight: 600;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--accent);
}
.eyebrow::before {
  content: "";
  inline-size: 28px;
  block-size: 1px;
  background: currentColor;
  opacity: .55;
  flex: none;
}
.eyebrow--center::after {
  content: "";
  inline-size: 28px;
  block-size: 1px;
  background: currentColor;
  opacity: .55;
  flex: none;
}

.muted { color: var(--text-muted); }
.balance { text-wrap: balance; }   /* stops orphan words in headings */
.pretty  { text-wrap: pretty; }

/* ---------------------------------------------------------------- layout  */
.container {
  inline-size: 100%;
  max-inline-size: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.container--narrow { max-inline-size: var(--container-narrow); }

.section { padding-block: var(--section-y); position: relative; }
.section--tight { padding-block: clamp(3rem, 2rem + 5vw, 6rem); }
.section--alt { background: var(--bg-alt); }
.section--deep {
  background: var(--bg-deep);
  color: var(--text-on-deep);
}
.section--deep .lead,
.section--deep .muted { color: var(--text-on-deep-muted); }
.section--deep .eyebrow { color: var(--sage-300); }

.section-head { max-inline-size: 46rem; margin-bottom: clamp(2.25rem, 1.5rem + 2.6vw, 4rem); }
.section-head--center { margin-inline: auto; text-align: center; }
.section-head--center .eyebrow { justify-content: center; }
.section-head > * + * { margin-top: var(--space-md); }

.grid { display: grid; gap: var(--space-lg); }

/* ---------------------------------------------------------------- a11y    */
.visually-hidden {
  position: absolute !important;
  inline-size: 1px; block-size: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  inset-block-start: -100%;
  inset-inline-start: var(--space-md);
  z-index: 999;
  padding: .85rem 1.25rem;
  background: var(--accent);
  color: var(--accent-contrast);
  border-radius: var(--r-sm);
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  transition: inset-block-start var(--dur-base) var(--ease-out);
}
.skip-link:focus-visible { inset-block-start: var(--space-md); }

/* ---------------------------------------------------------------- motion  */
/* Scroll-reveal primitives. Transform + opacity + clip-path only — never
   width/height/top — so every frame stays on the compositor.               */
[data-reveal] {
  opacity: 0;
  transform: translate3d(0, 26px, 0);
  transition:
    opacity var(--dur-reveal) var(--ease-out),
    transform var(--dur-reveal) var(--ease-out);
  transition-delay: var(--reveal-delay, 0ms);
  will-change: transform, opacity;
}
[data-reveal="left"]  { transform: translate3d(-32px, 0, 0); }
[data-reveal="right"] { transform: translate3d(32px, 0, 0); }
[data-reveal="scale"] { transform: translate3d(0, 20px, 0) scale(.965); }
[data-reveal="fade"]  { transform: none; }

[data-reveal="mask"] {
  opacity: 1;
  transform: none;
  clip-path: inset(0 0 100% 0);
  transition: clip-path 1.1s var(--ease-out);
  transition-delay: var(--reveal-delay, 0ms);
}

.is-revealed[data-reveal] {
  opacity: 1;
  transform: translate3d(0, 0, 0) scale(1);
  will-change: auto;
}
.is-revealed[data-reveal="mask"] { clip-path: inset(0 0 0 0); }

/* Per-character headline reveal (built by JS from the source text).
   Each word masks its own characters, so the effect survives any line wrap
   without measuring line boxes.                                            */
.split-word {
  display: inline-block;
  overflow: hidden;
  vertical-align: top;
  padding-block-end: .16em;
  margin-block-end: -.16em;
}
.split-char {
  display: inline-block;
  transform: translate3d(0, 108%, 0) rotate(4deg);
  opacity: 0;
  transition:
    transform 1s var(--ease-out),
    opacity .6s linear;
  transition-delay: var(--char-delay, 0ms);
  will-change: transform;
}
.is-revealed .split-char,
.split-ready .split-char { transform: translate3d(0, 0, 0) rotate(0); opacity: 1; }

/* With JS off nothing can trigger a reveal, so everything must start visible. */
html:not(.js) .split-char { transform: none; opacity: 1; }
html:not(.js) [data-reveal] {
  opacity: 1 !important;
  transform: none !important;
  clip-path: none !important;
}

@keyframes float-y {
  0%, 100% { transform: translate3d(0, 0, 0); }
  50%      { transform: translate3d(0, -14px, 0); }
}
@keyframes drift {
  0%, 100% { transform: translate3d(0,0,0) scale(1); }
  33%      { transform: translate3d(2%, -3%, 0) scale(1.04); }
  66%      { transform: translate3d(-2%, 2%, 0) scale(1.02); }
}
@keyframes marquee {
  from { transform: translate3d(0, 0, 0); }
  to   { transform: translate3d(-50%, 0, 0); }
}
@keyframes pulse-ring {
  0%   { transform: scale(.82); opacity: .65; }
  70%  { transform: scale(1.5); opacity: 0; }
  100% { transform: scale(1.5); opacity: 0; }
}
@keyframes spin-slow { to { transform: rotate(360deg); } }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes scroll-cue {
  0%        { transform: translate3d(0,0,0); opacity: 0; }
  25%       { opacity: 1; }
  75%       { opacity: 1; }
  100%      { transform: translate3d(0, 14px, 0); opacity: 0; }
}

/* --------------------------------------------------------- reduced motion */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
  [data-reveal],
  .split-char {
    opacity: 1 !important;
    transform: none !important;
    clip-path: none !important;
  }
}
