/* YUKI HEALTH - Base: reset, typography, layout, utilities.
   Depends on tokens.css. */

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

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

body {
    margin: 0;
    overflow-x: clip; /* safety net: never allow sideways scrolling (clip keeps the sticky header working) */
    font-family: var(--font-sans);
    font-size: var(--text-base);
    line-height: var(--leading-normal);
    color: var(--color-text);
    background: var(--color-bg);
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
}

[hidden] { display: none !important; }
img, svg { display: block; max-width: 100%; height: auto; }
iframe { border: 0; }

h1, h2, h3, h4 {
    margin: 0 0 var(--space-3);
    line-height: var(--leading-tight);
    font-weight: var(--weight-bold);
    letter-spacing: -0.02em;
    color: var(--color-text);
}
h1, h2 { text-wrap: balance; }
h1 { font-size: var(--text-3xl); }
h2 { font-size: var(--text-2xl); }
h3 { font-size: var(--text-lg); letter-spacing: -0.01em; }
p { margin: 0 0 var(--space-4); }
p:last-child { margin-bottom: 0; }

a { color: var(--color-brand-ink); text-underline-offset: 3px; }
a:hover { color: var(--color-brand-hover); }

:focus { outline: none; }
:focus-visible { box-shadow: var(--focus-ring); border-radius: var(--radius-sm); }

/* :where() keeps this at zero specificity so component spacing always wins */
:where(ul[role="list"], ol[role="list"]) { list-style: none; margin: 0; padding: 0; }

address { font-style: normal; }

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

.section { padding-block: var(--section-y); }
.section--ivory { background: var(--color-ivory); }
.section--tight { padding-block: calc(var(--section-y) * 0.6); }

.section-head { max-width: 640px; margin-bottom: var(--space-6); }
.section-head p:not(.eyebrow) { color: var(--color-text-muted); font-size: var(--text-lg); }

.eyebrow {
    display: inline-block;
    margin-bottom: var(--space-2);
    font-size: var(--text-xs);
    font-weight: var(--weight-semibold);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--color-brand-ink);
}

.muted { color: var(--color-text-muted); }
.nowrap { white-space: nowrap; }

.grid { display: grid; gap: var(--space-5); }
@media (min-width: 640px) {
    .grid--3 { grid-template-columns: repeat(2, 1fr); }
    .grid--4 { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 960px) {
    .grid--3 { grid-template-columns: repeat(3, 1fr); }
    .grid--4 { grid-template-columns: repeat(4, 1fr); }
}

/* Accessibility utilities */
.visually-hidden {
    position: absolute !important;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0 0 0 0);
    white-space: nowrap; border: 0;
}

.skip-link {
    position: absolute;
    left: var(--space-4);
    top: -100px;
    z-index: 200;
    padding: var(--space-3) var(--space-4);
    background: var(--color-text);
    color: #fff;
    border-radius: var(--radius-sm);
    font-weight: var(--weight-semibold);
    text-decoration: none;
}
.skip-link:focus-visible { top: var(--space-3); color: #fff; }

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

/* Focus moved here by "back to top" - no visible ring needed on the whole page area */
main:focus { outline: none; box-shadow: none; }
