/**
 * Base reset + shared UI primitives (buttons, cards, tags, section heads).
 * Page-specific layout lives in home.css.
 */

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

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--nav-height) + 12px);
}

body {
    margin: 0;
    font-family: var(--font-main);
    font-size: var(--fs-body);
    line-height: 1.7;
    color: var(--page-text-soft);
    background: var(--page-bg);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

/* Ambient background glow — matches the cover artwork */
.bg-ambient {
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    /* One faint wash near the hero only — glowing blobs behind every section
       are the fastest way to make a page look machine-generated. */
    background:
        radial-gradient(70% 34% at 62% 0%, var(--page-glow-a) 0%, transparent 68%),
        linear-gradient(180deg, var(--page-bg-soft) 0%, var(--page-bg) 30%);
}

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

h1, h2, h3, h4 {
    font-family: var(--font-display);
    color: var(--page-text);
    line-height: 1.15;
    letter-spacing: var(--tracking-tight);
    margin: 0 0 var(--space-4);
    font-weight: 600;
    text-wrap: balance;
}

/* Body copy holds a readable measure instead of running the full column.
   Scoped to prose blocks — a bare `p` rule would also squeeze cards,
   form hints and centred intros. */
.split__body p,
.about__lead,
.about__content p {
    max-width: 62ch;
}

h1 { font-size: var(--fs-h1); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); }

/* Paragraph gap sits at ~0.7× the line box (1.7 leading), which is the range
   where paragraphs separate without drifting apart. 16px against 28px lines
   was too tight to register as a break. */
p { margin: 0 0 var(--space-5); }
p:last-child { margin-bottom: 0; }

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

a:hover { color: var(--page-text); }

:focus-visible {
    outline: 2px solid var(--brand-accent-bright);
    outline-offset: 3px;
    border-radius: var(--radius-xs);
}

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

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

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

/**
 * Carries the hero's depth downward: every other section lifts very slightly
 * out of the page, so the scroll reads as banded panels rather than one flat
 * black field. Kept near-invisible on its own — it is felt at the seams.
 */
.section:nth-of-type(even)::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background: linear-gradient(
        180deg,
        var(--page-glow-a) 0%,
        var(--page-glow-b) 45%,
        transparent 100%
    );
}

.section--tight { padding-block: clamp(2rem, 4vw, 3.5rem); }

/**
 * Divider between every pair of sections, drawn from CSS rather than an <hr>
 * in the markup — adjacency can't be forgotten when a section is added or
 * moved, and there is nothing to keep in sync.
 *
 * The line fades in from both edges and warms to the brand accent at the
 * centre, so it reads as a seam rather than a hard rule.
 */
.section + .section::before {
    content: "";
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: min(100% - (var(--shell-pad) * 2), var(--shell-max));
    height: 1px;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.10) 14%,
        var(--brand-accent-bright) 50%,
        rgba(255, 255, 255, 0.10) 86%,
        transparent 100%
    );
    /* A short bloom off the centre, echoing the accent rule under the hero
       title. Wide enough to be felt, tight enough not to read as neon. */
    box-shadow: 0 0 10px -2px var(--brand-accent-glow);
    opacity: 0.75;
}

/* Kept so any remaining markup divider stays invisible rather than doubling up. */
.section-divider { display: none; }

/* ---- Eyebrow + section head ---- */
.ui-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--fs-label);
    font-weight: 600;
    letter-spacing: var(--tracking-wide);
    text-transform: uppercase;
    color: var(--brand-accent-bright);
    margin-bottom: var(--space-3);
}

.ui-eyebrow::before {
    content: "";
    width: 20px;
    height: 1px;
    background: var(--brand-accent);
}

.ui-section-head {
    max-width: 62ch;
    margin-bottom: var(--space-8);
}

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

.ui-section-head--center .ui-eyebrow::before { display: none; }

.ui-section-head__text {
    color: var(--page-muted);
    font-size: var(--fs-lead);
    margin: 0;
}

/* ---- Buttons ---- */
.ui-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: 0.85rem 1.5rem;
    border: 1px solid transparent;
    border-radius: var(--radius-pill);
    font-family: var(--font-display);
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    text-align: center;
    transition: transform var(--dur-fast) var(--ease-spring),
                background-color var(--dur-fast) var(--ease-out),
                border-color var(--dur-fast) var(--ease-out),
                box-shadow var(--dur-fast) var(--ease-out);
}

.ui-btn:active { transform: translateY(1px); }

.ui-btn--primary {
    background: var(--brand-accent);
    color: var(--brand-accent-ink);
    box-shadow: var(--shadow-accent);
}

.ui-btn--primary:hover {
    background: var(--brand-accent-hover);
    color: var(--brand-accent-ink);
    transform: translateY(-2px);
}

.ui-btn--ghost {
    background: var(--page-surface);
    color: var(--page-text);
    border-color: var(--page-border-strong);
    backdrop-filter: var(--page-glass-blur);
    -webkit-backdrop-filter: var(--page-glass-blur);
}

.ui-btn--ghost:hover {
    background: var(--page-surface-strong);
    border-color: var(--brand-accent-border);
    color: var(--page-text);
    transform: translateY(-2px);
}

.ui-btn--lg { padding: 1rem 1.9rem; font-size: 1rem; }
.ui-btn--block { width: 100%; }

/* For use on a surface that's always dark regardless of the site theme
   (the CTA band) — a plain page-text ghost button would vanish there. */
.ui-btn--outline-light {
    background: transparent;
    border-color: rgba(255, 255, 255, 0.35);
    color: #fff;
}

.ui-btn--outline-light:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.6);
    color: #fff;
    transform: translateY(-2px);
}

/* ---- Glass card ---- */
.ui-card {
    background: var(--page-surface);
    border: 1px solid var(--page-border);
    border-radius: var(--radius-lg);
    padding: var(--space-6);
    box-shadow: var(--shadow-sm);
    transition: border-color var(--dur-fast) var(--ease-out),
                background-color var(--dur-fast) var(--ease-out),
                box-shadow var(--dur-fast) var(--ease-out);
}

.ui-card__title { margin-bottom: var(--space-2); }

.ui-card__text {
    color: var(--page-muted);
    margin: 0;
}

/* No lift-on-hover: cards floating upward everywhere is a template tic. */
.ui-card--hover:hover {
    border-color: var(--page-border-strong);
    background: var(--page-surface-strong);
    box-shadow: var(--shadow-md);
}

/* ---- Tag / chip ---- */
.ui-tag {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: 0.4rem 0.85rem;
    border-radius: var(--radius-pill);
    border: 1px solid var(--page-border);
    background: var(--page-surface);
    font-size: var(--fs-small);
    font-weight: 500;
    color: var(--page-text-soft);
}

.ui-tag--accent {
    border-color: var(--brand-accent-border);
    background: var(--brand-accent-soft);
    color: var(--brand-accent-bright);
}


@media (min-width: 720px) {
    .ui-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* ---- Quote block ---- */
/* An editorial pull quote: a rule and larger type, not a glowing box. */
.ui-quote {
    position: relative;
    margin: 0;
    padding: 0 0 0 var(--space-6);
    border-left: 2px solid var(--brand-accent);
}

.ui-quote__text {
    font-family: var(--font-display);
    font-size: clamp(1.15rem, 1vw + 0.95rem, 1.5rem);
    font-weight: 500;
    line-height: 1.45;
    letter-spacing: -0.01em;
    color: var(--page-text);
    margin: 0;
    text-wrap: balance;
}

.ui-quote__cite {
    display: block;
    margin-top: var(--space-3);
    font-size: var(--fs-small);
    color: var(--page-faint);
}

/* ---- Forms ---- */
.form-field { margin-bottom: var(--space-4); }

.form-label {
    display: block;
    margin-bottom: var(--space-2);
    font-size: var(--fs-small);
    font-weight: 500;
    color: var(--page-text-soft);
}

.form-control {
    width: 100%;
    padding: 0.85rem 1rem;
    font-family: inherit;
    font-size: 1rem;
    color: var(--page-text);
    background: var(--page-surface-strong);
    border: 1px solid var(--page-border);
    border-radius: var(--radius-sm);
    transition: border-color var(--dur-fast) var(--ease-out),
                box-shadow var(--dur-fast) var(--ease-out);
}

.form-control::placeholder { color: var(--page-faint); }

.form-control:focus {
    outline: none;
    border-color: var(--brand-accent);
    box-shadow: 0 0 0 3px var(--brand-accent-soft);
}

.form-control[aria-invalid="true"] { border-color: #f87171; }

textarea.form-control {
    resize: vertical;
    min-height: 140px;
    line-height: 1.6;
}

.form-error {
    display: block;
    margin-top: var(--space-1);
    font-size: var(--fs-small);
    color: #fca5a5;
}

.form-alert {
    padding: var(--space-4);
    border-radius: var(--radius-sm);
    margin-bottom: var(--space-5);
    font-size: var(--fs-small);
    border: 1px solid transparent;
}

.form-alert--success {
    background: rgba(34, 197, 94, 0.12);
    border-color: rgba(34, 197, 94, 0.35);
    color: #86efac;
}

.form-alert--error {
    background: rgba(248, 113, 113, 0.12);
    border-color: rgba(248, 113, 113, 0.35);
    color: #fca5a5;
}

/* Honeypot */
.hp-field {
    position: absolute;
    left: -9999px;
    opacity: 0;
    pointer-events: none;
}

/* ---- Reveal on scroll ---- */
/* A short, quick settle. Long slides on every element feel like a demo reel. */
.reveal {
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.4s var(--ease-out),
                transform 0.4s var(--ease-out);
}

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

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .reveal { opacity: 1; transform: none; }
}
