/* ==========================================================================
   Fundamental Health UI — Foundation
   Tokens, reset, typography and global browser behavior.
   ========================================================================== */

:root {
    color-scheme: light;

    --fh-font-sans:
        "Onest",
        ui-sans-serif,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;

    --fh-bg: #f4f7f5;
    --fh-bg-warm: #f7f6f2;

    --fh-surface: #ffffff;
    --fh-surface-subtle: #eef4f1;
    --fh-surface-strong: #e3eeea;

    --fh-text: #17211e;
    --fh-text-soft: #3f4d48;
    --fh-text-muted: #6d7a75;

    --fh-border: #dce5e1;
    --fh-border-strong: #c8d7d1;

    --fh-primary: #126b59;
    --fh-primary-hover: #0d594a;
    --fh-primary-active: #094b3e;
    --fh-primary-soft: #e1f2ec;

    --fh-success: #147a52;
    --fh-success-soft: #e4f5ed;

    --fh-warning: #986400;
    --fh-warning-soft: #fff4d6;

    --fh-danger: #b42318;
    --fh-danger-hover: #941d14;
    --fh-danger-soft: #fff0ee;

    --fh-info: #2a5ca8;
    --fh-info-soft: #edf4ff;

    --fh-focus: #68ad9e;

    --fh-radius-xs: 6px;
    --fh-radius-sm: 9px;
    --fh-radius-md: 13px;
    --fh-radius-lg: 18px;
    --fh-radius-xl: 24px;

    --fh-shadow-sm:
        0 1px 2px rgb(20 41 35 / 0.04),
        0 4px 12px rgb(20 41 35 / 0.04);

    --fh-shadow-md:
        0 16px 45px rgb(20 41 35 / 0.09);

    --fh-content-width: 1180px;
    --fh-reading-width: 760px;

    --fh-transition:
        150ms ease;
}

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

html {
    min-height: 100%;
    font-family: var(--fh-font-sans);
    font-size: 16px;
    line-height: 1.5;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
}

body {
    min-width: 320px;
    min-height: 100vh;
    margin: 0;

    background: var(--fh-bg);
    color: var(--fh-text);
}

body,
button,
input,
select,
textarea {
    font-family: var(--fh-font-sans);
}

button,
input,
select,
textarea {
    font-size: 1rem;
}

button {
    margin: 0;
}

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

img {
    height: auto;
}

[hidden] {
    display: none !important;
}

::selection {
    background: var(--fh-primary-soft);
    color: var(--fh-text);
}

/* -------------------------------------------------- */
/* TYPOGRAPHY                                          */
/* -------------------------------------------------- */
h1,
h2,
h3,
h4,
h5,
p {
    margin-top: 0;
}

h1,
h2,
h3,
h4,
h5 {
    color: var(--fh-text);
    font-weight: 650;
    line-height: 1.18;
    letter-spacing: -0.025em;
}

h1 {
    font-size: clamp(2rem, 3.5vw, 3rem);
}

h2 {
    font-size: clamp(1.35rem, 2vw, 1.75rem);
}

h3 {
    font-size: 1.15rem;
}

p {
    color: var(--fh-text-soft);
}

small {
    color: var(--fh-text-muted);
}

a {
    color: var(--fh-primary);
    text-decoration-color: rgb(18 107 89 / 0.35);
    text-underline-offset: 3px;

    transition:
        color var(--fh-transition),
        text-decoration-color var(--fh-transition);
}

a:hover {
    color: var(--fh-primary-hover);
    text-decoration-color: currentColor;
}

/* -------------------------------------------------- */
/* FOCUS                                               */
/* -------------------------------------------------- */
:focus-visible {
    outline: 3px solid rgb(104 173 158 / 0.35);
    outline-offset: 2px;
}

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