/* =========================================================
   Contin-U Medical — Base
   Modern reset + typography defaults + layout primitives.
   ========================================================= */

/* ---------- Modern reset ---------- */

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

html {
  -webkit-text-size-adjust: 100%;
  -moz-tab-size: 4;
  tab-size: 4;
  /* Smooth scrolling is opt-in only. Declaring it unconditionally here made
     every in-page anchor jump animate even for users who asked the OS for
     reduced motion, which is a vestibular-accessibility problem and not
     something the duration tokens below can undo -- scroll-behavior is not a
     duration. Gated to the no-preference case instead. */
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: var(--fw-regular);
  line-height: var(--lh-normal);
  letter-spacing: var(--track-body);
  /* Inter feature tags, corrected 2026-09-22.
     Was: 'ss01','ss03','cv11' labelled "cleaner numerals". Only ss01 had
     anything to do with numerals.
       cv11 -> substitutes EVERY lowercase a with a.1, Inter's single-storey
               geometric alternate. That is why body copy read as Futura
               rather than Inter, and it is the whole reason the checkout
               looked untrustworthy. Removed.
       ss03 -> comma-accent forms for Latvian/Romanian (G K L N R S T with
               cedilla). Does nothing in English. Removed.
       ss01 -> "Open Digits"; the one tag that matched the comment. Kept.
     Use font-variant-numeric, never font-feature-settings, for numerals in
     descendants: font-feature-settings does not merge with the inherited
     value, it replaces it wholesale, which silently dropped ss01. */
  font-feature-settings: 'ss01';
}

/* Sideways-scroll guard. overflow-x:hidden on <body> alone does NOT contain
   overflow on iOS Safari - html stays the scrolling element, so a wide child
   (the .sx-rail marquee clones) made the whole page pan sideways on iPhone.
   `clip` is deliberate over `hidden`: hidden would turn these into scroll
   containers and break position:sticky plus every view() scroll timeline on
   the page. clip suppresses the overflow without creating a scrollport. */
html, body {
  overflow-x: clip;
  max-width: 100%;
}

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

button, input, select, textarea {
  font: inherit;
  color: inherit;
}

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

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--dur-fast) var(--ease-out);
}

ul, ol {
  list-style: none;
}

/* Selection */
::selection {
  background: var(--cyan-500);
  color: #FFFFFF;
}

/* Focus */
:focus-visible {
  outline: 2px solid var(--cyan-500);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

/* ---------- Typography ---------- */

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: var(--fw-semibold);
  line-height: var(--lh-tight);
  letter-spacing: var(--track-tight);
  color: var(--text);
  text-wrap: balance;
}

h1 {
  font-size: var(--text-hero);
  line-height: var(--lh-hero);
  letter-spacing: var(--track-hero);
  font-weight: var(--fw-medium);
}

h2 {
  font-size: var(--text-5xl);
  font-weight: var(--fw-medium);
}

h3 {
  font-size: var(--text-3xl);
}

h4 {
  font-size: var(--text-2xl);
}

h5 {
  font-size: var(--text-xl);
}

h6 {
  font-size: var(--text-lg);
}

p {
  max-width: var(--container-text);
  text-wrap: pretty;
}

p + p {
  margin-top: 1em;
}

strong, b {
  font-weight: var(--fw-semibold);
}

em, i {
  font-style: italic;
}

small {
  font-size: var(--text-sm);
}

code, kbd, samp {
  font-family: var(--font-mono);
  font-size: 0.95em;
  letter-spacing: var(--track-mono);
}

/* Utility type roles */

.eyebrow {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: var(--text-2xs);
  font-weight: var(--fw-medium);
  text-transform: uppercase;
  letter-spacing: var(--track-caps);
  color: var(--text-brand);
  margin-bottom: var(--space-4);
}

.mono {
  font-family: var(--font-mono);
  /* font-variant-numeric, not font-feature-settings: the latter would
     replace the inherited 'ss01' rather than add tabular figures to it. */
  font-variant-numeric: tabular-nums;
  letter-spacing: var(--track-mono);
}

.tnum {
  font-variant-numeric: tabular-nums;
}

.serif {
  font-family: var(--font-serif);
  font-weight: var(--fw-regular);
  letter-spacing: 0;
}

.lede {
  font-size: var(--text-xl);
  line-height: var(--lh-normal);
  color: var(--text-muted);
  max-width: var(--container-text);
  text-wrap: pretty;
}

/* ---------- Layout primitives ---------- */

.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.container-wide {
  width: 100%;
  max-width: var(--container-wide);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section {
  padding-block: var(--section-y);
}

.section-tight {
  padding-block: var(--section-y-tight);
}

.stack > * + * {
  margin-top: var(--stack-gap, var(--space-6));
}

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

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

/* Motion — animation-timeline reveal (gated)
   Gate tests BOTH animation-timeline and animation-range. A partial
   implementation that supports the timeline but not the range runs with
   timing badly off, so testing one property alone is not safe.
   Firefox (currently 156) does not support scroll-driven animations at all,
   so this whole layer is enhancement only -- the base state below is the
   FINAL state, never a hidden one. */
@supports ((animation-timeline: view()) and (animation-range: 0% 100%)) {
  @media (prefers-reduced-motion: no-preference) {
    .reveal {
      animation: reveal-in linear both;
      animation-timeline: view();
      animation-range: entry 0% entry 60%;
    }

    @keyframes reveal-in {
      from {
        opacity: 0;
        transform: translateY(24px);
      }
      to {
        opacity: 1;
        transform: translateY(0);
      }
    }
  }
}

/* Fallback for non-supporting browsers — just show it */
.reveal {
  opacity: 1;
  transform: none;
}

/* ---------- Skip link ----------
   Offscreen until keyboard-focused, then it drops into view above the nav.
   Must not use display:none -- that removes it from the tab order entirely,
   which defeats the point. */
.skip-link {
  position: absolute;
  left: var(--space-4);
  top: 0;
  transform: translateY(-120%);
  z-index: 200;
  padding: var(--space-3) var(--space-5);
  background: var(--brand-500);
  color: var(--ground-950);
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: var(--fw-semibold);
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  text-decoration: none;
  transition: transform var(--dur-fast) var(--ease-out);
}
.skip-link:focus {
  transform: translateY(0);
  outline: 2px solid var(--ground-25);
  outline-offset: 2px;
}

/* ---------------------------------------------------------
   Native <select> popup
   color-scheme:dark handles this on macOS/iOS, but Chrome and
   Firefox on Windows/Linux paint the popup from the option's own
   computed colors. Without these the options inherit the control's
   text colour — including the grey placeholder colour set by
   .inp--sel:has(option[value=""]:checked) — and vanish on white.
   --------------------------------------------------------- */
select option,
select optgroup {
  background-color: var(--ground-850);
  color: var(--ground-25);
}
/* the disabled "Select state…" row stays subordinate but readable */
select option:disabled,
select option[value=""] {
  color: var(--ground-300);
}
