/**
 * Base — document, typography, utilities, accessibility primitives.
 */

html {
    font-size: calc(100% * var(--font-scale));
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--header-height) + 1rem);
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-body);
    font-size: var(--text-base);
    line-height: var(--leading-normal);
    color: var(--color-text);
    background: var(--color-bg);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    overflow-x: hidden;
}

/* ---- Headings ---- */
h1, h2, h3, h4 {
    font-family: var(--font-display);
    color: var(--color-heading);
    font-weight: 600;
    line-height: var(--leading-tight);
    letter-spacing: -0.012em;
    text-wrap: balance;
}

h1 { font-size: var(--text-3xl); }
h2 { font-size: var(--text-2xl); }
h3 { font-size: var(--text-lg); line-height: var(--leading-snug); }
h4 { font-size: var(--text-md); line-height: var(--leading-snug); }

h5, h6 {
    font-family: var(--font-body);
    font-size: var(--text-sm);
    font-weight: 700;
    letter-spacing: var(--tracking-wide);
    text-transform: uppercase;
    color: var(--color-accent-text);
}

p {
    max-width: var(--measure);
}

p + p,
p + ul,
p + ol,
ul + p,
ol + p {
    margin-top: var(--space-sm);
}

h2 + p,
h3 + p,
h4 + p {
    margin-top: var(--space-xs);
}

/* ---- Links ---- */
a {
    color: var(--color-link);
    text-decoration-color: color-mix(in srgb, var(--color-link) 35%, transparent);
    text-underline-offset: 0.18em;
    text-decoration-thickness: 1px;
    transition: color var(--duration-fast) var(--ease-out),
                text-decoration-color var(--duration-fast) var(--ease-out);
}

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

/* ---- Lists ---- */
ul:not([class]),
ol:not([class]) {
    padding-left: 1.3em;
    max-width: var(--measure);
}

ul:not([class]) li,
ol:not([class]) li {
    margin-bottom: 0.45em;
}

ul:not([class]) ::marker {
    color: var(--gold-600);
}

/* ---- Quotes, rules, misc ---- */
blockquote {
    border-left: 3px solid var(--gold-400);
    padding-left: var(--space-md);
    font-family: var(--font-display);
    font-size: var(--text-md);
    font-style: italic;
    color: var(--navy-800);
}

hr {
    border: 0;
    height: 1px;
    background: var(--color-border);
    margin: var(--space-lg) 0;
}

strong { font-weight: 700; }

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

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

.on-dark :focus-visible,
.band-navy :focus-visible {
    outline-color: var(--gold-300);
}

/* ---- Skip link ---- */
.skip-link {
    position: absolute;
    left: var(--space-sm);
    top: -100%;
    z-index: 2000;
    padding: 0.85rem 1.4rem;
    background: var(--navy-900);
    color: #fff;
    font-weight: 700;
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
    text-decoration: none;
    transition: top var(--duration-fast) var(--ease-out);
}

.skip-link:focus {
    top: 0;
    color: #fff;
}

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

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

.section {
    padding-block: var(--space-section);
    position: relative;
}

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

.band-cream { background: var(--cream); }
.band-sand { background: var(--sand); }
.band-paper { background: var(--paper); }

.band-navy {
    background: var(--navy-900);
    color: var(--navy-100);
    position: relative;
    isolation: isolate;
}

.band-navy h1,
.band-navy h2,
.band-navy h3,
.band-navy h4 { color: #fff; }

.band-navy a { color: var(--gold-300); }
.band-navy a:hover { color: var(--gold-200); }

/* Paper grain, only on dark bands where it reads as texture not noise */
.band-navy::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background-image: var(--grain);
    opacity: 0.055;
    pointer-events: none;
}

/* ---- Typographic utilities ---- */
.eyebrow {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: var(--text-xs);
    font-weight: 700;
    letter-spacing: var(--tracking-wider);
    text-transform: uppercase;
    color: var(--color-accent-text);
    margin-bottom: var(--space-xs);
}

.eyebrow::before {
    content: "";
    width: 1.75rem;
    height: 1px;
    background: var(--gold-500);
    flex: none;
}

.eyebrow--center {
    justify-content: center;
}

.eyebrow--center::after {
    content: "";
    width: 1.75rem;
    height: 1px;
    background: var(--gold-500);
    flex: none;
}

.band-navy .eyebrow { color: var(--gold-300); }
.band-navy .eyebrow::before,
.band-navy .eyebrow::after { background: var(--gold-400); }

.lead {
    font-size: var(--text-md);
    line-height: var(--leading-loose);
    color: var(--color-text-soft);
}

.band-navy .lead { color: var(--navy-200); }

.section-head {
    max-width: 46rem;
    margin-bottom: var(--space-xl);
}

.section-head--center {
    margin-inline: auto;
    text-align: center;
}

.section-head--center .lead { margin-inline: auto; }
.section-head p { max-width: 46rem; }

/* Small cross-and-rule ornament used between major blocks */
.ornament {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.9rem;
    margin: var(--space-md) 0;
    color: var(--gold-500);
}

.ornament::before,
.ornament::after {
    content: "";
    height: 1px;
    width: min(5rem, 18vw);
    background: linear-gradient(90deg, transparent, currentColor);
}

.ornament::after {
    background: linear-gradient(270deg, transparent, currentColor);
}

.ornament svg { width: 14px; height: 14px; }

.text-center { text-align: center; }

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

.visually-hidden {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
}

/* ---- Scroll reveal (progressive enhancement; see assets/js/interactions.js) ---- */
.js-reveal {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity var(--duration-slow) var(--ease-out),
                transform var(--duration-slow) var(--ease-out);
    transition-delay: var(--reveal-delay, 0ms);
}

.js-reveal.is-visible {
    opacity: 1;
    transform: none;
}

/* ---- Motion & print ---- */
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    .js-reveal {
        opacity: 1;
        transform: none;
    }
}

@media print {
    .site-header,
    .site-footer,
    .cta-band,
    .skip-link { display: none !important; }

    body { font-size: 12pt; color: #000; background: #fff; }
    a::after { content: " (" attr(href) ")"; font-size: 0.85em; }
}
