/* ==========================================================================
   PROTMED — base.css
   Reset · Design tokens · Typography · Layout primitives · Utilities
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. DESIGN TOKENS
   Extracted from the Figma mockup (1280px reference frame).
   -------------------------------------------------------------------------- */
:root {
  /* ---- Brand palette ---- */
  --c-teal:        #1FAF9A;
  --c-teal-dark:   #17998A;
  --c-teal-deep:   #0E7D70;
  --c-teal-soft:   #7FD1C2;
  --c-teal-mist:   #A8DED3;
  --c-teal-pale:   #D7F0EC;

  --c-red:         #E31E24;
  --c-red-dark:    #C0161C;

  /* ---- Neutrals ---- */
  --c-ink:         #2E3338;  /* primary text + primary dark surface */
  --c-ink-700:     #21282E;
  --c-ink-900:     #141C23;
  --c-ink-hero:    #00191B;
  --c-grey:        #6C6C6C;
  --c-grey-soft:   #8A9096;
  --c-line:        #D5D5D5;
  --c-line-soft:   #E7E9EB;

  --c-white:       #FFFFFF;
  --c-surface:     #FFFFFF;
  --c-surface-2:   #FBFBFB;
  --c-surface-3:   #F7F9FB;
  --c-field:       #F7F7F7;

  /* ---- Semantic ---- */
  --c-text:            var(--c-ink);
  --c-text-muted:      var(--c-grey);
  --c-text-invert:     var(--c-white);
  --c-text-invert-dim: rgba(255, 255, 255, .78);

  /* ---- Typography ---- */
  --f-display: "Poppins", "Segoe UI", system-ui, -apple-system, sans-serif;
  --f-body:    "Lato", "Segoe UI", system-ui, -apple-system, sans-serif;

  /* Fluid scale — min @360px … max @1280px */
  --fs-display: clamp(1.75rem, 1.05rem + 3.11vw, 2.625rem);  /* 28 → 42 */
  --fs-h2:      clamp(1.375rem, 1.02rem + 1.56vw, 1.875rem); /* 22 → 30 */
  --fs-h3:      clamp(1.625rem, 0.86rem + 3.40vw, 2.75rem);  /* 26 → 44 */
  --fs-h4:      clamp(1.25rem, 1.17rem + 0.35vw, 1.375rem);  /* 20 → 22 */
  --fs-h5:      1.25rem;                                     /* 20 */
  --fs-lead:    clamp(1rem, 0.93rem + 0.35vw, 1.125rem);     /* 16 → 18 */
  --fs-body:    1rem;                                        /* 16 */
  --fs-sm:      0.875rem;                                    /* 14 */
  --fs-xs:      0.8125rem;                                   /* 13 */

  --lh-display: 1.17;
  --lh-heading: 1.15;
  --lh-body:    1.5;
  --ls-eyebrow: .09em;

  /* ---- Space scale (4pt) ---- */
  --sp-1:  .25rem;  --sp-2:  .5rem;   --sp-3:  .75rem;  --sp-4: 1rem;
  --sp-5:  1.25rem; --sp-6:  1.5rem;  --sp-7:  1.75rem; --sp-8: 2rem;
  --sp-10: 2.5rem;  --sp-12: 3rem;    --sp-14: 3.5rem;  --sp-16: 4rem;
  --sp-20: 5rem;    --sp-24: 6rem;

  /* Vertical rhythm for sections */
  --section-y:    clamp(3rem, 1.9rem + 4.9vw, 5rem);
  --section-y-lg: clamp(3.5rem, 2.1rem + 6.2vw, 5.75rem);

  /* ---- Layout ---- */
  --gutter:        clamp(1.25rem, .6rem + 2.9vw, 2.5rem);
  --w-shell:      1200px;  /* header, topbar, footer */
  --w-content:    1120px;  /* default section content */
  --w-narrow:      990px;  /* plans */
  --w-tight:       960px;  /* faq, centred headings */
  --w-wide:       1240px;  /* wide grids */
  --w-bleed:      1232px;  /* testimonials — near full-bleed, 24px gutter */

  /* ---- Radii ---- */
  --r-xs:  6px;
  --r-sm:  8px;
  --r-md:  12px;
  --r-lg:  16px;
  --r-xl:  24px;
  --r-pill: 999px;

  /* ---- Elevation ---- */
  --sh-sm:  0 1px 2px rgba(46, 51, 56, .06);
  --sh-md:  0 8px 24px rgba(46, 51, 56, .08);
  --sh-lg:  0 18px 48px rgba(46, 51, 56, .12);
  --sh-teal: 0 12px 28px rgba(31, 175, 154, .28);

  /* ---- Motion ---- */
  --ease:      cubic-bezier(.22, .61, .36, 1);
  --ease-out:  cubic-bezier(.16, 1, .3, 1);
  --t-fast:    .18s;
  --t-base:    .3s;
  --t-slow:    .6s;

  --header-h: 73px;
  --topbar-h: 40px;
}

/* --------------------------------------------------------------------------
   2. RESET
   -------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

* { margin: 0; padding: 0; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
}

body {
  font-family: var(--f-body);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  color: var(--c-text);
  background: var(--c-surface);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

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

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

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

ul, ol { list-style: none; }

h1, h2, h3, h4, h5, h6 {
  font-family: var(--f-display);
  font-weight: 700;
  line-height: var(--lh-heading);
}

:focus-visible {
  outline: 2px solid var(--c-teal);
  outline-offset: 3px;
  border-radius: 2px;
}

/* --------------------------------------------------------------------------
   3. LAYOUT PRIMITIVES
   -------------------------------------------------------------------------- */
.shell {
  width: 100%;
  max-width: calc(var(--w-shell) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.container {
  width: 100%;
  max-width: calc(var(--w-content) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.container--wide   { max-width: calc(var(--w-wide)   + var(--gutter) * 2); }
.container--narrow { max-width: calc(var(--w-narrow) + var(--gutter) * 2); }
.container--tight  { max-width: calc(var(--w-tight)  + var(--gutter) * 2); }
.container--bleed  { --gutter: 24px; max-width: calc(var(--w-bleed) + 48px); }

.section { padding-block: var(--section-y); position: relative; }
.section--lg   { padding-block: var(--section-y-lg); }
.section--flush-bottom { padding-bottom: 0; }

/* Surfaces */
.surface-light { background: var(--c-surface-3); }
.surface-white { background: var(--c-surface); }
.surface-dark  { background: var(--c-ink); color: var(--c-text-invert); }

/* --------------------------------------------------------------------------
   4. TYPOGRAPHY BLOCKS
   -------------------------------------------------------------------------- */
.eyebrow {
  font-family: var(--f-display);
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: var(--ls-eyebrow);
  text-transform: uppercase;
  color: var(--c-red);
  display: block;
}
.eyebrow--teal { color: var(--c-teal); }

.display {
  font-size: var(--fs-display);
  line-height: var(--lh-display);
  text-transform: uppercase;
}

.headline {
  font-size: var(--fs-h2);
  line-height: var(--lh-heading);
  text-transform: uppercase;
}

.lead {
  font-size: var(--fs-lead);
  line-height: var(--lh-body);
}

.accent { color: var(--c-teal); }
.accent-red { color: var(--c-red); }

/* Centred section intro: eyebrow + headline + optional subtitle */
.section-head {
  text-align: center;
  max-width: 46rem;
  margin-inline: auto;
  margin-bottom: clamp(1.75rem, 1.35rem + 1.7vw, 2.125rem);
}
/* Balanced ragging only where headings are centred. */
.section-head .headline,
.section-head .display { text-wrap: balance; }
.section-head .eyebrow { margin-bottom: var(--sp-4); }
.section-head__sub {
  margin-top: var(--sp-4);
  font-size: var(--fs-lead);
  color: var(--c-text);
}
.section-head--invert .headline,
.section-head--invert .section-head__sub { color: var(--c-text-invert); }

/* --------------------------------------------------------------------------
   5. UTILITIES
   -------------------------------------------------------------------------- */
.u-center      { text-align: center; }
.u-nowrap      { white-space: nowrap; }
.u-mt-6        { margin-top: var(--sp-6); }
.u-mt-8        { margin-top: var(--sp-8); }
.u-mt-10       { margin-top: var(--sp-10); }
.u-stack-center{ display: flex; flex-direction: column; align-items: center; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: var(--sp-4);
  top: -100%;
  z-index: 999;
  padding: var(--sp-3) var(--sp-5);
  background: var(--c-teal);
  color: var(--c-white);
  border-radius: var(--r-sm);
  transition: top var(--t-fast) var(--ease);
}
.skip-link:focus { top: var(--sp-4); }

/* --------------------------------------------------------------------------
   6. SCROLL REVEAL
   Defensive by design: elements are visible by default for split content,
   and a JS safety timeout removes the hidden state if the observer fails.
   -------------------------------------------------------------------------- */
.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity var(--t-slow) var(--ease-out),
              transform var(--t-slow) var(--ease-out);
  transition-delay: var(--reveal-delay, 0ms);
  will-change: opacity, transform;
}
.reveal.is-visible { opacity: 1; transform: none; }

/* Safety net: if JS never boots, nothing stays hidden. */
.no-js .reveal { opacity: 1; transform: none; }
.reveal[data-split] { opacity: 1; transform: none; }
