/* ==========================================================================
   OrthoAlign Rehab — Base Styles
   Modern reset, typography, and global utilities
   ========================================================================== */

/* ── Modern CSS Reset ────────────────────────────────────────────────────── */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

body {
    font-family: var(--font-body);
    font-size: var(--text-base);
    line-height: var(--leading-normal);
    color: var(--gray-700);
    background-color: var(--white);
    overflow-x: hidden;
    min-height: 100vh;
    min-height: -webkit-fill-available;
}

img, video, svg {
    display: block;
    max-width: 100%;
    height: auto;
    flex-shrink: 0;
}

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

button {
    cursor: pointer;
    border: none;
    outline: none;
    background: none;
    font-family: inherit;
    font-size: inherit;
}

ul, ol {
    list-style: none;
}

input, textarea, select {
    font-family: inherit;
    font-size: inherit;
    border: none;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    border-radius: 0;
}

::selection {
    background: var(--primary-200);
    color: var(--navy);
}

/* ── Typography ──────────────────────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: var(--weight-bold);
    line-height: var(--leading-tight);
    color: var(--navy);
}

h1 {
    font-size: clamp(2.25rem, 5vw, 3.75rem);
    font-weight: var(--weight-extrabold);
    letter-spacing: -0.02em;
}

h2 {
    font-size: clamp(1.875rem, 4vw, 3rem);
    font-weight: var(--weight-bold);
    letter-spacing: -0.01em;
}

h3 {
    font-size: clamp(1.5rem, 3vw, 2.25rem);
    font-weight: var(--weight-bold);
}

h4 {
    font-size: clamp(1.25rem, 2.5vw, 1.5rem);
    font-weight: var(--weight-semibold);
}

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

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

p {
    line-height: var(--leading-relaxed);
    color: var(--gray-600);
}

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

/* ── Container ───────────────────────────────────────────────────────────── */
.container {
    width: 100%;
    max-width: var(--container-max);
    margin-left: auto;
    margin-right: auto;
    padding-left: var(--space-6);
    padding-right: var(--space-6);
}

.container--wide {
    max-width: var(--container-wide);
}

.container--narrow {
    max-width: var(--container-narrow);
}

/* ── Section Rhythm ──────────────────────────────────────────────────────── */
.section {
    padding-top: var(--section-padding);
    padding-bottom: var(--section-padding);
    position: relative;
}

.section--gray {
    background-color: var(--gray-50);
}

.section--navy {
    background-color: var(--navy);
    color: var(--white);
}

.section--navy h2,
.section--navy h3,
.section--navy h4 {
    color: var(--white);
}

.section--navy p {
    color: rgba(255, 255, 255, 0.8);
}

/* ── Section Headers ─────────────────────────────────────────────────────── */
.section-header {
    text-align: center;
    margin-bottom: clamp(3rem, 6vw, 5rem);
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.section-header__subtitle {
    font-family: var(--font-body);
    font-size: var(--text-sm);
    font-weight: var(--weight-semibold);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--primary);
    margin-bottom: var(--space-3);
    display: block;
}

.section-header__title {
    margin-bottom: var(--space-4);
}

.section-header__accent {
    width: 48px;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    border-radius: var(--radius-full);
    margin: 0 auto var(--space-6);
}

.section-header__description {
    font-size: var(--text-lg);
    color: var(--gray-500);
    max-width: 600px;
    margin: 0 auto;
}

/* ── Utility Classes ─────────────────────────────────────────────────────── */
.text-center { text-align: center; }
.text-left { text-align: left; }

.text-primary { color: var(--primary); }
.text-accent { color: var(--accent); }
.text-navy { color: var(--navy); }
.text-white { color: var(--white); }
.text-gray { color: var(--gray-500); }

.font-heading { font-family: var(--font-heading); }
.font-body { font-family: var(--font-body); }

.fw-medium { font-weight: var(--weight-medium); }
.fw-semibold { font-weight: var(--weight-semibold); }
.fw-bold { font-weight: var(--weight-bold); }

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

.glass {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.4);
}

/* ── Scroll Margin for Anchor Links ──────────────────────────────────────── */
[id] {
    scroll-margin-top: calc(var(--nav-height) + var(--space-4));
}
