/* keywestsportsmedicine.com token stylesheet.
   Design contract: night-watch instrument console for athletes. Dark
   chart-room surfaces, live data as first-class instruments, calm large
   plain type. Committed in DESIGN_REGISTRY.md; values are not re-decided.
   One stylesheet, versioned with ?v=YYYYMMDD. Zero box shadows anywhere. */

/* ------------------------------------------------------------------ */
/* Tokens                                                              */
/* ------------------------------------------------------------------ */

:root {
    --ink-base: #18101E;
    --ink-panel: #281933;
    --ink-raised: #332042;
    --ink-footer: #110A16;
    --hairline: rgba(233,228,240,0.14);
    --text-primary: #E9E4F0;
    --text-muted: #AE9DBB;
    --violet-primary: #6F3C96;
    --violet-bright: #C096E0;
    --green-accent: #8CE070;
    --green-deep: #2F7020;
    --danger: #F2555A;

    /* Spacing scale */
    --sp-4: 4px;
    --sp-8: 8px;
    --sp-12: 12px;
    --sp-16: 16px;
    --sp-24: 24px;
    --sp-32: 32px;
    --sp-48: 48px;
    --sp-64: 64px;
    --sp-96: 96px;

    --font-body: 'Hanken Grotesk', system-ui, sans-serif;
    --font-display: 'Space Grotesk', 'Hanken Grotesk', system-ui, sans-serif;

    /* Type scale, equal to the literals the site shipped with (13px floor, 15px nav, 18px body) */
    --fs-xs: 0.8125rem;
    --fs-sm: 0.875rem;
    --fs-nav: 0.9375rem;
    --fs-base: 1rem;
    --fs-body: 1.125rem;
    --fs-lead: 1.25rem;
    --fs-wordmark: 1.375rem;
    --fs-rail: 1.5rem;
    --fs-h2: 1.625rem;
    --fs-panel: 2.5rem;
    --fs-h1: clamp(2.125rem, 4.5vw, 3rem);
    --lh-body: 1.65;

    --radius-card: 16px;
    --radius-pill: 999px;
    --container-max: 1220px;
    --article-max: 760px;
}

/* ------------------------------------------------------------------ */
/* Base                                                                */
/* ------------------------------------------------------------------ */

* {
    box-sizing: border-box;
}

html {
    font-size: 100%;
}

body {
    margin: 0;
    background: var(--ink-base);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-weight: 400;
    font-size: var(--fs-body);
    line-height: var(--lh-body);
}

h1, h2, h3 {
    font-family: var(--font-display);
    margin: 0 0 var(--sp-16);
}

h1 {
    font-weight: 700;
    font-size: var(--fs-h1);
    line-height: 1.12;
    text-wrap: balance;
}

h2 {
    font-weight: 700;
    font-size: var(--fs-h2);
    line-height: 1.25;
    text-wrap: pretty;
}

h3 {
    font-weight: 500;
    font-size: var(--fs-lead);
    line-height: 1.35;
    text-wrap: pretty;
}

p {
    margin: 0 0 var(--sp-16);
}

a {
    color: var(--violet-bright);
}

a:hover {
    color: var(--green-accent);
}

/* Body-copy links (unclassed anchors): visited keeps the violet, active flashes the accent. */
a:not([class]):visited {
    color: var(--violet-bright);
}

a:not([class]):active {
    color: var(--green-accent);
}

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

.lead {
    font-size: var(--fs-lead);
    line-height: 1.55;
    color: var(--text-muted);
}

.eyebrow {
    font-family: var(--font-body);
    font-weight: 600;
    font-size: var(--fs-xs);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
}

.small-print {
    font-size: var(--fs-sm);
    color: var(--text-muted);
}

/* Live numerals, always tabular and never animated */
.num-rail,
.num-panel,
.num-meta {
    font-family: var(--font-display);
    font-weight: 500;
    font-variant-numeric: tabular-nums;
}

.num-rail {
    font-size: var(--fs-rail);
}

.num-panel {
    font-size: var(--fs-panel);
}

.num-meta {
    font-size: var(--fs-lead);
}

/* ------------------------------------------------------------------ */
/* Layout                                                              */
/* ------------------------------------------------------------------ */

.container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding-left: 20px;
    padding-right: 20px;
}

.article-col {
    max-width: var(--article-max);
}

.section {
    padding-top: var(--sp-64);
    padding-bottom: var(--sp-64);
}

.grid {
    display: grid;
    gap: var(--sp-24);
}

.card {
    background: var(--ink-panel);
    border: 1px solid var(--hairline);
    border-radius: var(--radius-card);
    padding: var(--sp-24);
}

.card:hover {
    background: var(--ink-raised);
}

.hairline-rule {
    border: 0;
    border-top: 1px solid var(--hairline);
}

.pill {
    border-radius: var(--radius-pill);
}

/* Red-flag surface rule: panel surface, danger hairline, danger heading. */
.red-flag-box {
    background: var(--ink-panel);
    border: 1px solid rgba(242,85,90,0.5);
    border-radius: var(--radius-card);
    padding: var(--sp-24);
}

.red-flag-box h2,
.red-flag-box h3 {
    color: var(--danger);
}

/* ------------------------------------------------------------------ */
/* Buttons and focus                                                   */
/* ------------------------------------------------------------------ */

.btn-primary,
.btn-secondary {
    display: inline-block;
    font-family: var(--font-body);
    font-weight: 700;
    font-size: var(--fs-base);
    line-height: 1.2;
    min-height: 44px;
    padding: var(--sp-12) var(--sp-24);
    border-radius: var(--radius-pill);
    text-decoration: none;
    cursor: pointer;
}

.btn-primary {
    background: var(--green-accent);
    color: var(--ink-base);
    border: 1px solid var(--green-accent);
}

.btn-primary:hover,
.btn-primary:visited {
    color: var(--ink-base);
}

.btn-primary:hover {
    opacity: 0.9;
}

.btn-primary:active {
    opacity: 0.8;
}

.btn-secondary {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--hairline);
}

.btn-secondary:hover,
.btn-secondary:active,
.btn-secondary:visited {
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: var(--ink-raised);
}

.btn-secondary:active {
    border-color: var(--green-accent);
}

:focus-visible {
    outline: 2px solid var(--green-accent);
    outline-offset: 2px;
}

/* ------------------------------------------------------------------ */
/* Skip link                                                           */
/* ------------------------------------------------------------------ */

.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    background: var(--green-accent);
    color: var(--ink-base);
    padding: var(--sp-12) var(--sp-24);
    border-radius: 0 0 var(--radius-card) 0;
    z-index: 100;
}

.skip-link:focus {
    left: 0;
    color: var(--ink-base);
}

/* ------------------------------------------------------------------ */
/* Header                                                              */
/* ------------------------------------------------------------------ */

.header-deck-one {
    background: var(--ink-footer);
    padding: var(--sp-24) 0;
}

.deck-one-inner {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.brand-lockup {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--sp-8);
    text-decoration: none;
    color: var(--text-primary);
}

.brand-lockup:hover {
    color: var(--text-primary);
}

.brand-mark {
    color: var(--green-accent);
    width: 28px;
    height: 28px;
}

.wordmark {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: var(--fs-wordmark);
    line-height: 1.2;
}

.brand-sub {
    font-family: var(--font-body);
    font-weight: 600;
    font-size: var(--fs-xs);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
}

.header-cta {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
}

.menu-toggle {
    display: none;
    min-height: 44px;
    font-family: var(--font-body);
    font-weight: 600;
    font-size: var(--fs-nav);
    color: var(--text-primary);
    background: transparent;
    border: 1px solid var(--hairline);
    border-radius: var(--radius-pill);
    padding: var(--sp-8) var(--sp-16);
    cursor: pointer;
}

.menu-toggle:hover,
.menu-toggle[aria-expanded="true"] {
    color: var(--green-accent);
    border-color: var(--green-accent);
}

.header-deck-two {
    background: var(--ink-base);
    border-bottom: 1px solid var(--hairline);
}

.site-nav ul {
    list-style: none;
    margin: 0;
    padding: var(--sp-12) 20px;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: var(--sp-4);
}

.site-nav a {
    display: inline-block;
    font-weight: 600;
    font-size: var(--fs-nav);
    color: var(--text-primary);
    text-decoration: none;
    padding: var(--sp-12) var(--sp-16);
    border-radius: var(--radius-pill);
}

.site-nav a:hover,
.site-nav a:active {
    color: var(--green-accent);
}

.site-nav a.is-current {
    background: var(--ink-panel);
    color: var(--green-accent);
}

.nav-extra {
    display: none;
}

/* ------------------------------------------------------------------ */
/* Footer                                                              */
/* ------------------------------------------------------------------ */

.site-footer {
    background: var(--ink-footer);
    padding-top: var(--sp-48);
}

.footer-columns {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--sp-24);
    padding-bottom: var(--sp-48);
}

.footer-columns h2 {
    font-family: var(--font-body);
    font-weight: 600;
    font-size: var(--fs-xs);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin-bottom: var(--sp-12);
}

.footer-columns ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.footer-columns li {
    margin-bottom: var(--sp-8);
}

.footer-columns a {
    font-size: var(--fs-nav);
    color: var(--text-muted);
    text-decoration: none;
}

.footer-columns a:hover {
    color: var(--green-accent);
}

.footer-mission {
    font-size: var(--fs-nav);
    color: var(--text-muted);
}

.footer-bottom {
    border-top: 1px solid var(--hairline);
    padding: var(--sp-16) 0;
    font-size: var(--fs-sm);
    color: var(--text-muted);
}

/* ------------------------------------------------------------------ */
/* Motion: 200ms opacity fades only                                    */
/* ------------------------------------------------------------------ */

.fade-in {
    transition: opacity 200ms ease;
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        transition: none !important;
        animation: none !important;
    }
}

/* ------------------------------------------------------------------ */
/* Under 900px: mobile header, reduced section padding                 */
/* ------------------------------------------------------------------ */

@media (max-width: 899px) {
    .section {
        padding-top: var(--sp-48);
        padding-bottom: var(--sp-48);
    }

    .deck-one-inner {
        flex-direction: row;
        justify-content: space-between;
        text-align: left;
    }

    .brand-lockup {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--sp-4);
    }

    .brand-row {
        display: flex;
        align-items: center;
        gap: var(--sp-8);
    }

    .header-cta {
        display: none;
    }

    .menu-toggle {
        display: inline-block;
        position: relative;
        z-index: 60;
    }

    .header-deck-two {
        display: none;
    }

    .site-header.is-open .header-deck-two {
        display: block;
        position: fixed;
        inset: 0;
        background: var(--ink-base);
        z-index: 50;
        overflow-y: auto;
        border-bottom: 0;
        padding-top: var(--sp-96);
    }

    .site-header.is-open .site-nav ul {
        flex-direction: column;
        align-items: center;
        gap: var(--sp-12);
    }

    .site-header.is-open .site-nav a {
        font-size: var(--fs-lead);
    }

    .site-header.is-open .nav-extra {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: var(--sp-16);
        margin-top: var(--sp-24);
    }

    .nav-extra .phone-line {
        font-family: var(--font-display);
        font-weight: 500;
        font-variant-numeric: tabular-nums;
        font-size: var(--fs-lead);
        color: var(--text-primary);
        text-decoration: none;
    }

    .footer-columns {
        grid-template-columns: 1fr;
    }
}

/* ------------------------------------------------------------------ */
/* Print: white paper, green-deep accents, live modules and nav hidden */
/* ------------------------------------------------------------------ */

@media print {
    body {
        background: #fff;
        color: #111;
        font-size: 11pt;
    }

    .site-header,
    .site-footer,
    .menu-toggle,
    .skip-link,
    [data-module] {
        display: none !important;
    }

    h1, h2, h3 {
        color: #111;
    }

    a {
        color: var(--green-deep);
        text-decoration: underline;
    }

    main a[href^="https://"]::after,
    main a[href^="http://"]::after {
        content: " (" attr(href) ")";
        font-size: 0.875em;
        color: #333;
        word-break: break-all;
    }

    .card,
    .red-flag-box {
        background: #fff;
        border: 1px solid #999;
    }

    .red-flag-box h2,
    .red-flag-box h3 {
        color: #111;
    }
}

/* ------------------------------------------------------------------ */
/* Components (Chunk 5): partials, modules, breadcrumbs, 404           */
/* ------------------------------------------------------------------ */

.icon {
    width: 24px;
    height: 24px;
    color: var(--green-accent);
    flex-shrink: 0;
}

.breadcrumbs ol {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-8);
    margin: 0 0 var(--sp-24);
    padding: 0;
}

.breadcrumbs li {
    display: flex;
    align-items: center;
    gap: var(--sp-8);
}

.breadcrumbs li + li::before {
    content: "/";
    color: var(--text-muted);
}

.breadcrumbs a,
.breadcrumbs span {
    display: inline-block;
    background: var(--violet-primary);
    color: var(--text-primary);
    border-radius: var(--radius-pill);
    padding: var(--sp-4) var(--sp-12);
    font-size: var(--fs-sm);
    text-decoration: none;
}

.breadcrumbs span {
    background: var(--ink-panel);
    color: var(--text-muted);
}

.breadcrumbs a:hover {
    color: var(--ink-base);
    background: var(--green-accent);
}

.sport-grid {
    grid-template-columns: repeat(4, 1fr);
    margin: var(--sp-32) 0;
}

@media (max-width: 899px) {
    .sport-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.sport-card {
    display: block;
    color: var(--text-primary);
    text-decoration: none;
}

.sport-card:hover {
    color: var(--text-primary);
}

.sport-card h3 {
    margin: var(--sp-12) 0 var(--sp-8);
}

.season-note {
    display: flex;
    gap: var(--sp-12);
    align-items: flex-start;
    background: var(--ink-panel);
    border: 1px solid var(--hairline);
    border-radius: var(--radius-card);
    padding: var(--sp-16) var(--sp-24);
    margin: var(--sp-24) 0;
}

.season-note p {
    margin: var(--sp-4) 0 0;
    font-size: var(--fs-base);
}

.reviewer-credit {
    margin-top: calc(-1 * var(--sp-8));
    margin-bottom: var(--sp-24);
}

.reviewer-block {
    margin: var(--sp-32) 0;
}

.reviewer-block p {
    margin: 0;
    font-size: var(--fs-base);
}

.kwco-cta {
    margin: var(--sp-32) 0;
    border-color: rgba(140,224,112,0.35);
}

.kwco-cta p:last-child {
    margin-bottom: 0;
}

.rtp-steps {
    counter-reset: rtp;
    list-style: none;
    margin: var(--sp-24) 0;
    padding: 0;
}

.rtp-steps > li {
    counter-increment: rtp;
    position: relative;
    padding: var(--sp-16) 0 var(--sp-16) var(--sp-48);
    border-top: 1px solid var(--hairline);
}

.rtp-steps > li::before {
    content: counter(rtp);
    position: absolute;
    left: 0;
    top: var(--sp-16);
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--green-accent);
    border-radius: var(--radius-pill);
    color: var(--green-accent);
    font-family: var(--font-display);
    font-weight: 500;
    font-variant-numeric: tabular-nums;
    font-size: var(--fs-nav);
}

.faq {
    margin: var(--sp-24) 0;
}

.faq-item {
    border-top: 1px solid var(--hairline);
    padding: var(--sp-12) 0;
}

.faq-item:last-child {
    border-bottom: 1px solid var(--hairline);
}

.faq-item summary {
    cursor: pointer;
    font-family: var(--font-body);
    font-weight: 600;
    font-size: var(--fs-body);
    padding: var(--sp-8) 0;
}

.faq-item summary:hover {
    color: var(--green-accent);
}

.faq-answer {
    padding-top: var(--sp-12);
}

/* Live module internals */
.cond-row {
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-24);
    align-items: flex-end;
    margin: var(--sp-16) 0;
}

.cond-metric {
    display: flex;
    flex-direction: column;
    gap: var(--sp-4);
}

.band-pill {
    display: inline-block;
    background: var(--ink-raised);
    border: 1px solid var(--hairline);
    border-radius: var(--radius-pill);
    color: var(--green-accent);
    padding: var(--sp-4) var(--sp-16);
    font-family: var(--font-display);
    font-weight: 500;
    font-size: var(--fs-base);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.alert-badge,
.alert-badge a {
    color: var(--danger);
    font-weight: 600;
    font-size: var(--fs-base);
}

.module-credit {
    margin-bottom: 0;
}

.wire-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-8);
    margin: var(--sp-12) 0 var(--sp-16);
}

.wire-tab {
    background: transparent;
    border: 1px solid var(--hairline);
    border-radius: var(--radius-pill);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-weight: 600;
    font-size: var(--fs-nav);
    min-height: 44px;
    padding: var(--sp-8) var(--sp-16);
    cursor: pointer;
}

.wire-tab:hover,
.wire-tab:active {
    color: var(--green-accent);
}

.wire-tab[aria-pressed="true"] {
    background: var(--ink-raised);
    color: var(--green-accent);
    border-color: var(--green-accent);
}

.wire-list {
    list-style: none;
    margin: 0 0 var(--sp-16);
    padding: 0;
}

.wire-row {
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-8) var(--sp-12);
    align-items: baseline;
    padding: var(--sp-12) 0;
    border-top: 1px solid var(--hairline);
}

.wire-status {
    background: var(--ink-raised);
    border: 1px solid var(--hairline);
    border-radius: var(--radius-pill);
    color: var(--violet-bright);
    padding: var(--sp-4) var(--sp-12);
    font-size: var(--fs-sm);
    font-weight: 600;
}

.wire-text {
    flex-basis: 100%;
    font-size: var(--fs-base);
    color: var(--text-muted);
}

.wire-chip {
    display: inline-block;
    background: var(--violet-primary);
    color: var(--text-primary);
    border-radius: var(--radius-pill);
    padding: var(--sp-4) var(--sp-12);
    font-size: var(--fs-sm);
    text-decoration: none;
}

.wire-chip:hover {
    background: var(--green-accent);
    color: var(--ink-base);
}

.conchs-rows {
    list-style: none;
    margin: var(--sp-12) 0 var(--sp-16);
    padding: 0;
}

.conchs-row {
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-8) var(--sp-16);
    align-items: baseline;
    padding: var(--sp-8) 0;
    border-top: 1px solid var(--hairline);
}

.conditions-strip,
.conditions-panel,
.wire-module,
.conchs-band {
    margin: var(--sp-24) 0;
}

/* Form controls (Heat Safety Advisor): console fields on the raised surface, pill frames, 44px targets. */
.ha-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--sp-16) var(--sp-24);
    margin: var(--sp-16) 0;
}

.ha-fields p {
    margin: 0;
}

.ha-fields p:has(.btn-primary),
.ha-fields p:has(input[type="checkbox"]),
.ha-slider {
    grid-column: 1 / -1;
}

label {
    font-weight: 600;
}

select,
input[type="text"],
input[type="number"],
textarea {
    display: block;
    width: 100%;
    min-height: 44px;
    margin-top: var(--sp-4);
    padding: var(--sp-8) var(--sp-16);
    font: inherit;
    color: var(--text-primary);
    background: var(--ink-raised);
    border: 1px solid var(--hairline);
    border-radius: var(--radius-pill);
}

select:hover,
input[type="text"]:hover,
input[type="number"]:hover,
textarea:hover {
    border-color: var(--violet-bright);
}

select:focus,
input[type="text"]:focus,
input[type="number"]:focus,
textarea:focus {
    border-color: var(--green-accent);
}

input[type="checkbox"] {
    width: 24px;
    height: 24px;
    margin: 0 var(--sp-8) 0 0;
    vertical-align: middle;
    accent-color: var(--green-accent);
}

input[type="range"] {
    display: block;
    width: 100%;
    min-height: 44px;
    margin-top: var(--sp-4);
    accent-color: var(--green-accent);
}

.ha-result {
    margin-top: var(--sp-16);
    padding: var(--sp-16) var(--sp-24);
    background: var(--ink-raised);
    border: 1px solid var(--hairline);
    border-radius: var(--radius-card);
}

.ha-result p:last-child {
    margin-bottom: 0;
}

@media (max-width: 599px) {
    .ha-fields {
        grid-template-columns: 1fr;
    }
}
