/*
 * OK Clinic — base tokens & resets
 * Adapted from prototype (src/styles/base.css) for WordPress environment.
 * DO NOT change tokens without updating docs/memory/DECISIONS.md.
 */

:root {
  /* Brand palette */
  --lavender: #beb2d5;
  --lavender-50: #f4f1f8;
  --lavender-100: #e9e3f1;
  --lavender-300: #d4cae2;
  --lavender-600: #7b6c9a;
  --lavender-700: #6a5d84;
  --lavender-800: #5f527a;
  --success: #49e287;
  --danger: #b84a5b;
  --danger-text: #8a3543;

  --ink: #0f0d13;
  --ink-2: #2a2630;
  --ink-dark: #1a1624;
  --ink-dark-2: #1d1828;
  --muted: #6b6575;
  --muted-2: #9a94a4;
  --line: #e6e3ec;
  --line-2: #efecf3;
  --bg: #ffffff;
  --bg-soft: #fafafa;

  /* Type */
  --font-display: 'Unbounded', ui-sans-serif, system-ui, sans-serif;
  --font-brand: 'Unbounded', ui-sans-serif, system-ui, sans-serif;
  --font-body: 'Montserrat', ui-sans-serif, system-ui, -apple-system, sans-serif;

  /* Motion */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-soft: cubic-bezier(0.65, 0, 0.35, 1);

  /* ============================================================
   * Design tokens (use these for ALL new code).
   * Existing pixel-perfect blocks may keep raw clamp() — do not
   * mass-refactor; touch only when fixing/extending a block.
   * Source values: see docs/memory/DESIGN-TOKENS.md
   * ============================================================ */

  /* Breakpoints (reference, not consumed in CSS) — keep in sync across files:
     --bp-sm: 414px   (large mobile)
     --bp-md: 768px   (tablet portrait)
     --bp-lg: 1024px  (tablet landscape / small desktop)
     --bp-xl: 1440px  (desktop)
  */

  /* Layout — mobile-first floors with desktop ceilings.
     Floors must be comfortable at 360-414px (clinic, not cramped). */
  --page-max: 1440px;
  --pad-side: clamp(16px, 4vw, 40px);            /* section side padding: 16 on mobile, 40 on desktop */
  --pad-section-y: clamp(36px, 6.3vw, 90px);     /* section vertical: 36 on mobile, 90 on desktop (~180px total between sections) */
  --pad-section-y-sm: clamp(28px, 4.8vw, 68px);  /* compact section variant */

  /* Touch target baseline — Apple HIG / WCAG 2.5.5 */
  --touch-target: 44px;

  /* Spacing scale */
  --gap-xs: clamp(6px, 0.8vw, 12px);
  --gap-sm: clamp(10px, 1.2vw, 16px);
  --gap-md: clamp(14px, 1.6vw, 22px);
  --gap-lg: clamp(18px, 2vw, 28px);
  --gap-xl: clamp(24px, 3vw, 40px);
  --gap-2xl: clamp(32px, 4.5vw, 64px);

  /* Card / container inner padding */
  --pad-card: clamp(16px, 2vw, 28px);

  /* Radius scale */
  --radius-xs: 8px;
  --radius-sm: 12px;
  --radius-md: clamp(14px, 1.3vw, 18px);
  --radius-lg: clamp(16px, 1.5vw, 20px);
  --radius-xl: clamp(20px, 2vw, 28px);
  --radius-2xl: clamp(18px, 1.8vw, 24px);
  --radius-3xl: clamp(24px, 2.4vw, 32px);
  --radius-pill: 999px;

  /* Typography scale — mobile-first.
     Floors tested on 360px viewport; ceilings on 1440px. */
  --fs-eyebrow: 11px;                            /* uppercase tag, letter-spacing 0.18em */
  --fs-meta: 12px;                               /* labels, dates */
  --fs-small: 13px;
  --fs-body: 14px;                               /* default body text in cards */
  --fs-body-lg: clamp(15px, 1.2vw, 17px);
  --fs-lead: clamp(15px, 1.4vw, 20px);
  --fs-h3: clamp(18px, 1.8vw, 24px);
  --fs-h2: clamp(24px, 3.6vw, 52px);             /* was 28px floor — too big on 360px */
  --fs-h1: clamp(36px, 6vw, 88px);               /* was 48px floor — hero h1 overflowed on 360px */
  --fs-hero: clamp(30px, 4.8vw, 72px);           /* hero headline — slightly smaller floor for dark photographic heroes */

  --lh-tight: 1.05;
  --lh-snug: 1.2;
  --lh-normal: 1.5;
  --lh-relaxed: 1.6;
  --ls-tight: -0.02em;
  --ls-eyebrow: 0.18em;

  /* Border / line */
  --bw-hair: 1px;

  /* Shadows */
  --shadow-card:  0 4px 24px color-mix(in oklab, var(--lavender-700) 8%, transparent);
  --shadow-hover: 0 14px 30px -12px color-mix(in oklab, var(--lavender-700) 55%, transparent);
  --shadow-pop:   0 16px 36px -14px color-mix(in oklab, var(--lavender-700) 60%, transparent);
  --shadow-modal: 0 30px 60px -30px color-mix(in oklab, var(--lavender-700) 45%, transparent);
  --shadow-modal-soft: 0 30px 60px -30px color-mix(in oklab, var(--lavender-700) 35%, transparent);
  --shadow-cinematic: 0 40px 80px -40px color-mix(in oklab, var(--ink) 45%, transparent), 0 20px 50px -28px color-mix(in oklab, var(--lavender-700) 35%, transparent);
}

html {
  color-scheme: light;
  color: var(--ink);
  background: var(--bg);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  /* `clip` instead of `hidden` so sticky #wpadminbar still works */
  overflow-x: clip;
  /* Smooth anchor scroll with sticky-header offset (DESIGN-AUDIT P2.9).
     Header is ~93px on mobile, ~138-162px on desktop. */
  scroll-behavior: smooth;
  scroll-padding-top: clamp(96px, 10vh, 160px);
}

body {
  margin: 0;
  padding: 0;
  min-height: 100svh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  /* Prevent overflow on narrow mobile viewports (≤360px) without breaking sticky positioning. */
  overflow-x: clip;
}

/* Headings: NEVER break individual words. A long word that doesn't fit
   should overflow its line and wrap whole to the next line — never split
   character-by-character (which produces orphan letters like "и" alone).
   Chrome's auto-hyphenation for Ukrainian is also wrong, so we keep it
   off. If a heading overflows its container, the container is too narrow
   or the font-size is too large — fix that, not the word-breaking. */
h1, h2, h3, h4 {
  overflow-wrap: normal;
  word-break: keep-all;
  hyphens: manual;
}
/* Only on very narrow mobile (≤480px) do we allow last-resort breaking,
   because a single Ukrainian word can be >100% of viewport width. */
@media (max-width: 480px) {
  h1, h2, h3, h4 {
    overflow-wrap: anywhere;
    word-break: normal;
  }
}

/* Long URLs / inline code in content shouldn't overflow on mobile */
p, li, dd {
  overflow-wrap: break-word;
}

/* Touch targets: every interactive control must be ≥44px on touch devices.
   Desktop hover devices can have smaller targets via explicit sizing. */
@media (hover: none) {
  a:not(.hdr__logo):not(.skip-link),
  button {
    min-height: var(--touch-target);
  }
}

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

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

button {
  font: inherit;
  cursor: pointer;
  border: 0;
  background: transparent;
  color: inherit;
  padding: 0;
}

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

::selection {
  background: var(--lavender);
  color: var(--ink);
}

/* A11y: reduced motion (DESIGN-AUDIT P2.8) */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Tabular numerals on numeric tokens (DESIGN-AUDIT P1.2) */
:where(
  .hero__trust strong,
  .svc__count strong,
  .tm__cardExp strong,
  .rv__metric dd strong,
  .tm__stats dd,
  .st__amenity dd
) {
  font-variant-numeric: tabular-nums;
}

/* Global focus-visible (DESIGN-AUDIT P1.3) */
:focus-visible {
  outline: 2px solid var(--lavender-700);
  outline-offset: 3px;
  border-radius: 6px;
}

/* Skip link — hidden until focused via keyboard */
.skip-link {
  position: fixed;
  top: -100px;
  left: 16px;
  z-index: 9999;
  padding: 12px 20px;
  background: var(--lavender-700);
  color: var(--bg);
  font: 600 14px/1 var(--font-body);
  text-decoration: none;
  border-radius: 8px;
  transition: top 0.2s ease-out;
}

.skip-link:focus {
  top: 16px;
}
