/* ============================================================
   SwissMed Health — Design Tokens & Base
   Palette: Travertine + Cypress (inferred from Cyprus + Swiss clinical heritage)
   ============================================================ */

:root, [data-theme="light"] {
  /* Typography */
  --text-xs:   clamp(0.75rem, 0.7rem + 0.25vw, 0.875rem);
  --text-sm:   clamp(0.875rem, 0.8rem + 0.35vw, 1rem);
  --text-base: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  --text-lg:   clamp(1.125rem, 1rem + 0.75vw, 1.5rem);
  --text-xl:   clamp(1.5rem, 1.2rem + 1.25vw, 2.25rem);
  --text-2xl:  clamp(2rem, 1.2rem + 2.5vw, 3.5rem);
  --text-3xl:  clamp(2.5rem, 1rem + 4vw, 5rem);
  --text-hero: clamp(3rem, 0.5rem + 7vw, 7.5rem);

  /* Spacing */
  --space-1: 0.25rem; --space-2: 0.5rem;  --space-3: 0.75rem; --space-4: 1rem;
  --space-5: 1.25rem; --space-6: 1.5rem;  --space-8: 2rem;    --space-10: 2.5rem;
  --space-12: 3rem;   --space-16: 4rem;   --space-20: 5rem;   --space-24: 6rem;
  --space-32: 8rem;   --space-40: 10rem;

  /* Surfaces — travertine warm */
  --color-bg:               #F5F1EA;
  --color-surface:          #FAF7F1;
  --color-surface-2:        #FFFCF7;
  --color-surface-offset:   #ECE5D8;
  --color-surface-offset-2: #E0D8C8;
  --color-divider:          #D6CDB9;
  --color-border:           #C9BFA8;

  /* Ink */
  --color-text:         #1A1A17;
  --color-text-muted:   #6B6659;
  --color-text-faint:   #A79F8B;
  --color-text-inverse: #FAF7F1;

  /* Legacy aliases — keep prior CSS references working (ink, hairline, surface-warm) */
  --color-ink:          var(--color-text);
  --color-ink-soft:     var(--color-text-muted);
  --color-hairline:     var(--color-divider);
  --color-surface-warm: var(--color-surface-offset);

  /* Accent — Cypress deep green */
  --color-primary:            #1F3B2D;
  --color-primary-hover:      #0F2B1F;
  --color-primary-active:     #071C13;
  --color-primary-highlight:  #D5DBC9;

  /* Secondary — Aegean blue (reserved for Clinic path) */
  --color-blue:         #2A4A5C;
  --color-blue-hover:   #1A3A4C;
  --color-blue-highlight:#C8D4DB;

  /* Accent — Ochre (reserved for editorial highlights) */
  --color-ochre:        #B8832F;
  --color-ochre-highlight:#EDE0C4;

  /* Radius */
  --radius-sm: 2px;
  --radius-md: 4px;
  --radius-lg: 8px;
  --radius-full: 9999px;

  /* Transitions */
  --transition-interactive: 240ms cubic-bezier(0.16, 1, 0.3, 1);
  --transition-slow:        600ms cubic-bezier(0.16, 1, 0.3, 1);

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(26, 26, 23, 0.04);
  --shadow-md: 0 4px 16px rgba(26, 26, 23, 0.06);
  --shadow-lg: 0 24px 48px rgba(26, 26, 23, 0.10);

  /* Content widths */
  --content-narrow:  640px;
  --content-default: 980px;
  --content-wide:    1280px;
  --content-full:    100%;

  /* Fonts */
  --font-display: 'Instrument Serif', 'Cormorant Garamond', Georgia, serif;
  --font-body:    'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono:    'JetBrains Mono', ui-monospace, monospace;
}

[data-theme="dark"] {
  --color-bg:               #14130F;
  --color-surface:          #1B1A16;
  --color-surface-2:        #201E1A;
  --color-surface-offset:   #25231E;
  --color-surface-offset-2: #2C2A24;
  --color-divider:          #2A2823;
  --color-border:           #3A3630;

  --color-text:         #E8E3D6;
  --color-text-muted:   #8A8574;
  --color-text-faint:   #5A5648;
  --color-text-inverse: #14130F;

  --color-primary:            #8BA68D;
  --color-primary-hover:      #A5BCA7;
  --color-primary-active:     #B9CFBB;
  --color-primary-highlight:  #2A3830;

  --color-blue:         #6B8B9E;
  --color-blue-hover:   #8AA8B9;
  --color-blue-highlight:#2B3A44;

  --color-ochre:        #D4A858;
  --color-ochre-highlight:#3A2F1C;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 24px 48px rgba(0, 0, 0, 0.5);
}

/* ============================================================
   Base
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
  scroll-padding-top: var(--space-20);
}

body {
  min-height: 100dvh;
  line-height: 1.6;
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--color-text);
  background: var(--color-bg);
  overflow-x: hidden;
}

img, picture, video, canvas, svg { display: block; max-width: 100%; height: auto; }
ul[role="list"], ol[role="list"] { list-style: none; }
input, button, textarea, select { font: inherit; color: inherit; }

h1, h2, h3, h4, h5, h6 {
  text-wrap: balance;
  line-height: 1.05;
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: -0.015em;
}

p, li, figcaption { text-wrap: pretty; max-width: 68ch; }

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

::selection {
  background: color-mix(in oklab, var(--color-primary) 25%, transparent);
  color: var(--color-text);
}

:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

button { cursor: pointer; background: none; border: none; }

a, button, [role="button"] {
  transition:
    color var(--transition-interactive),
    background var(--transition-interactive),
    border-color var(--transition-interactive),
    opacity var(--transition-interactive),
    transform var(--transition-interactive);
}

.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border-width: 0;
}
