/* ChristopherHarrington.net
   Navy and white with a warm gold accent. Every text colour meets WCAG 2.2 AA; body text meets AAA.
   Sizes use rem so text scales with browser zoom and ZoomText. */

:root {
    --navy: #0b2545;          /* header, footer, hero */
    --navy-deep: #071a33;
    --navy-text: #ffffff;
    --navy-muted: #c9d6ea;    /* 11:1 on navy */
    --gold: #e0a02c;          /* buttons on navy; 8.6:1 with navy text */
    --gold-hover: #f0b647;
    --bg: #ffffff;
    --surface: #f4f7fb;
    --text: #15202e;
    --muted: #475569;         /* 7.4:1 on white */
    --accent: #0b4f9e;        /* links on white, 7.7:1 */
    --accent-hover: #083a75;
    --border: #d4dce8;
    --focus: #b3261e;
    --radius: 0.5rem;
    --measure: 42rem;
    --wide: 72rem;
}

@media (prefers-color-scheme: dark) {
    :root {
        --navy: #0b1e3a;
        --navy-deep: #06142a;
        --bg: #101620;
        --surface: #182132;
        --text: #eef2f8;
        --muted: #b7c2d3;
        --accent: #8fbcff;    /* 9.3:1 on dark bg */
        --accent-hover: #b8d4ff;
        --border: #2d3a52;
        --focus: #ffb4ab;
    }
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: "Atkinson Hyperlegible", "Segoe UI", system-ui, -apple-system, sans-serif;
    font-size: 1.125rem;
    line-height: 1.65;
    -webkit-text-size-adjust: 100%;
}
.wrap { max-width: var(--wide); margin: 0 auto; padding: 0 1.25rem; }
.narrow { max-width: calc(var(--measure) + 2.5rem); }

h1, h2, h3 { line-height: 1.2; margin: 0 0 0.75rem; }
h1 { font-size: clamp(2.3rem, 5.5vw, 3.5rem); letter-spacing: -0.01em; }
h2 { font-size: clamp(1.55rem, 3.2vw, 2rem); }
h3 { font-size: 1.3rem; }
p, ul { margin: 0 0 1.1rem; }

a { color: var(--accent); text-decoration-thickness: 0.08em; text-underline-offset: 0.18em; }
a:hover { color: var(--accent-hover); text-decoration-thickness: 0.14em; }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 4px; }
.site-header :focus-visible, .hero :focus-visible, .site-footer :focus-visible { outline-color: var(--gold); }
main:focus, section:focus { outline: none; }

/* Skip link: hidden until focused */
.skip-link {
    position: absolute; left: 1rem; top: -5rem; z-index: 10;
    padding: 0.75rem 1.25rem;
    background: var(--gold); color: var(--navy-deep);
    font-weight: 700; border-radius: var(--radius);
}
.skip-link:focus { top: 1rem; }

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

/* Header: navy bar with a wordmark and a horizontal menu */
.site-header { background: var(--navy); color: var(--navy-text); border-bottom: 4px solid var(--gold); }
.header-inner {
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
    gap: 0.5rem 1.5rem; padding-top: 1rem; padding-bottom: 1rem;
}
.site-name {
    font-weight: 700; font-size: 1.3rem; letter-spacing: 0.02em;
    color: var(--navy-text); text-decoration: none;
}
.site-name:hover { color: var(--gold-hover); }
.nav-list { display: flex; flex-wrap: wrap; gap: 0.25rem 0.5rem; list-style: none; margin: 0; padding: 0; }
.nav-list a {
    display: inline-block; padding: 0.5rem 0.8rem;
    color: var(--navy-text); text-decoration: none; font-weight: 700;
    border-radius: var(--radius); border-bottom: 3px solid transparent;
}
.nav-list a:hover { background: var(--navy-deep); color: var(--gold-hover); }
.nav-list a[aria-current="page"] { border-bottom-color: var(--gold); border-radius: var(--radius) var(--radius) 0 0; }

/* Hero: navy banner */
.hero {
    background: linear-gradient(160deg, var(--navy) 0%, var(--navy-deep) 100%);
    color: var(--navy-text);
    padding: clamp(3rem, 8vw, 6rem) 0 clamp(2.5rem, 6vw, 4.5rem);
}
.hero-small { padding: clamp(2.25rem, 5vw, 3.5rem) 0; }
.hero h1 { color: var(--navy-text); }
.eyebrow {
    font-size: 0.95rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
    color: var(--gold); margin-bottom: 0.75rem;
}
.lede { font-size: clamp(1.2rem, 2.4vw, 1.45rem); color: var(--navy-muted); max-width: 40rem; }
.hero a:not(.button) { color: var(--navy-text); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.75rem; }

/* Buttons (real links styled larger; minimum 44px touch target) */
.button {
    display: inline-flex; align-items: center; min-height: 2.75rem;
    padding: 0.7rem 1.4rem;
    background: var(--gold); color: var(--navy-deep);
    font-weight: 700; text-decoration: none;
    border: 2px solid var(--gold); border-radius: var(--radius);
    overflow-wrap: anywhere;
}
.button:hover { background: var(--gold-hover); border-color: var(--gold-hover); color: var(--navy-deep); }
.button-quiet { background: transparent; color: var(--navy-text); border-color: var(--navy-muted); }
.button-quiet:hover { background: var(--navy-deep); color: var(--navy-text); border-color: var(--navy-text); }
/* Buttons on white backgrounds */
main > section:not(.hero) .button { background: var(--navy); color: var(--navy-text); border-color: var(--navy); }
main > section:not(.hero) .button:hover { background: var(--accent); border-color: var(--accent); color: #ffffff; }
main > section:not(.hero) .button-quiet { background: transparent; color: var(--accent); border-color: var(--accent); }
main > section:not(.hero) .button-quiet:hover { background: var(--surface); color: var(--accent-hover); }

/* Sections */
section { padding: clamp(2.5rem, 6vw, 4rem) 0; }
.about { background: var(--surface); border-bottom: 1px solid var(--border); }
.section-intro { color: var(--muted); font-size: 1.15rem; }

.badges { display: flex; flex-wrap: wrap; gap: 0.6rem; list-style: none; padding: 0; margin-top: 1.5rem; }
.badges li {
    padding: 0.4rem 0.95rem;
    border: 1px solid var(--border); border-left: 4px solid var(--gold);
    border-radius: var(--radius); background: var(--bg); font-size: 0.98rem; font-weight: 700;
}

/* Project cards */
.cards {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr));
    gap: 1.5rem; list-style: none; padding: 0; margin-top: 1.5rem;
}
.card {
    display: flex; flex-direction: column;
    padding: 1.75rem;
    background: var(--bg); border: 1px solid var(--border); border-top: 6px solid var(--navy);
    border-radius: var(--radius);
    box-shadow: 0 2px 8px rgba(11, 37, 69, 0.08);
}
.card h3 { font-size: 1.5rem; }
.card h3 a { color: var(--text); }
.card h3 a:hover { color: var(--accent); }
.card-kicker { color: var(--accent); font-weight: 700; font-size: 1rem; margin-bottom: 0.6rem; }
.card p { margin-bottom: 1rem; }
.card-actions { margin-top: auto; display: flex; flex-wrap: wrap; gap: 0.6rem; padding-top: 0.5rem; }

/* About page */
.bio h2 { margin-top: 2.5rem; padding-top: 0.5rem; border-top: 1px solid var(--border); }
.bio h3 { margin-top: 1.75rem; color: var(--accent); }
.bio .signoff { font-weight: 700; margin-top: 1.5rem; }
.contents { background: var(--surface); border: 1px solid var(--border); border-left: 5px solid var(--navy); border-radius: var(--radius); padding: 1.25rem 1.5rem; margin-bottom: 2rem; }
.contents h3 { margin: 0 0 0.5rem; color: var(--text); font-size: 1.1rem; }
.contents ol { margin: 0; padding-left: 1.4rem; columns: 2; column-gap: 2rem; }
.contents li { margin: 0.2rem 0; break-inside: avoid; }
@media (max-width: 40rem) { .contents ol { columns: 1; } }

/* Footer: navy */
.site-footer {
    background: var(--navy); color: var(--navy-muted);
    border-top: 4px solid var(--gold);
    padding: 2rem 0; font-size: 1rem; margin-top: 1rem;
}
.site-footer a { color: var(--navy-text); }
.site-footer a:hover { color: var(--gold-hover); }
.site-footer p { margin-bottom: 0.4rem; }

/* High contrast mode on Windows */
@media (forced-colors: active) {
    .button, .card, .badges li { border: 2px solid CanvasText; }
    .nav-list a[aria-current="page"] { text-decoration: underline; }
    .site-header, .site-footer, .hero { border-bottom: 1px solid CanvasText; border-top: 1px solid CanvasText; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

/* Illustrations on the About page */
.bio-figure { margin: 1.5rem 0 2rem; }
.bio-figure img { display: block; width: 100%; height: auto; border-radius: var(--radius); border: 1px solid var(--border); }
.bio-figure figcaption { margin-top: 0.5rem; font-size: 0.95rem; color: var(--muted); }

/* Photos: hero banner photo beside the heading, stacking below it on narrow screens */
.hero-split .wrap { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2rem 3rem; align-items: center; }
.hero-photo { margin: 0; }
.hero-photo img {
    display: block; width: clamp(14rem, 26vw, 21rem); height: auto;
    border: 4px solid var(--gold); border-radius: var(--radius);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}
.hero-photo-small img { width: clamp(11rem, 18vw, 15rem); }
@media (max-width: 48rem) {
    .hero-split .wrap { grid-template-columns: 1fr; }
    .hero-photo img { width: min(100%, 20rem); }
}
/* Portrait photos on the About page: kept to a sensible size and centred */
.bio-photo img { width: min(100%, 24rem); margin: 0 auto; }
.bio-photo-small img { width: min(100%, 17.5rem); }
.bio-photo figcaption { text-align: center; }
@media (forced-colors: active) { .hero-photo img { border-color: CanvasText; } }

/* Member accounts: forms, messages and the Members page */
[hidden] { display: none !important; }
.account-form h2 { margin-top: 2.5rem; padding-top: 0.5rem; border-top: 1px solid var(--border); }
.account-form h2:first-of-type { margin-top: 1.5rem; }
.field { margin-bottom: 1.4rem; }
.field label { display: block; font-weight: 700; margin-bottom: 0.35rem; }
.field input[type="text"], .field input[type="email"], .field input[type="password"] {
    width: 100%; max-width: 30rem; min-height: 2.75rem;
    padding: 0.6rem 0.8rem;
    font: inherit; color: var(--text); background: var(--bg);
    border: 2px solid var(--muted); border-radius: var(--radius);
}
.field input[aria-invalid="true"] { border-color: var(--focus); border-width: 3px; }
.field-check { display: flex; align-items: center; gap: 0.75rem; }
.field-check input { width: 1.5rem; height: 1.5rem; margin: 0; flex: none; accent-color: var(--navy); }
.field-check label { margin: 0; font-weight: 400; }
.password-row { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: center; }
.password-row input { flex: 1 1 16rem; }
.hint { color: var(--muted); margin-bottom: 0.5rem; font-size: 1rem; }
.field-error { color: var(--focus); font-weight: 700; margin: 0.4rem 0 0; }
.field-error::before { content: "Error: "; }
.trap { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
button.button { font: inherit; font-weight: 700; cursor: pointer; }
main > section:not(.hero) .button-danger { background: #9b1c1c; border-color: #9b1c1c; color: #ffffff; }
main > section:not(.hero) .button-danger:hover { background: #7a1414; border-color: #7a1414; }
.button-row { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; margin-bottom: 1rem; }
.button-row form { margin: 0; }
.form-errors {
    border: 3px solid var(--focus); border-radius: var(--radius);
    padding: 1rem 1.25rem; margin: 1rem 0 1.5rem; background: var(--bg);
}
.form-errors h2 { margin: 0 0 0.5rem !important; padding: 0 !important; border: 0 !important; font-size: 1.3rem; }
.form-errors ul { margin: 0; }
.form-errors a { color: var(--focus); font-weight: 700; }
.notice, .flash {
    border-left: 5px solid var(--gold); background: var(--surface);
    padding: 0.9rem 1.2rem; border-radius: var(--radius);
}
.flash { margin: 1.5rem 0 0; font-weight: 700; }
.member { border: 1px solid var(--border); border-left: 5px solid var(--navy); border-radius: var(--radius); padding: 1rem 1.25rem; margin-bottom: 1rem; }
.member h3 { margin-bottom: 0.3rem; }
.member p { margin-bottom: 0.75rem; }
@media (forced-colors: active) {
    .field input, .form-errors, .notice, .flash, .member { border: 2px solid CanvasText; }
}
