/* Reset + base typography + primitives */

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

html,
body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    font-size: var(--fs-2);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    font-feature-settings: "ss01", "cv11";
    overflow-x: hidden;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-display);
    letter-spacing: -0.015em;
    line-height: 1.15;
}

img {
    max-width: 100%;
    display: block;
}

a {
    color: var(--link-ink);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

h1,
h2,
h3,
h4 {
    font-family: var(--font-display);
    font-weight: 700;
    line-height: 1.12;
    letter-spacing: -0.02em;
    margin: 0 0 var(--space-4) 0;
    color: var(--text);
}

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

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

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

p {
    margin: 0 0 var(--space-4) 0;
    color: var(--text);
}

.container {
    width: 100%;
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 var(--space-5);
}

/* === Nav ============================================================ */
.nav {
    position: sticky;
    top: 0;
    z-index: 50;
    background: color-mix(in srgb, var(--bg-elevated) 94%, transparent);
    backdrop-filter: saturate(140%) blur(8px);
    border-bottom: 1px solid var(--border);
}

.nav__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    /* Block only: the element is also a .container, whose side padding a
       `padding: X 0` erased, so on phones the crest touched the edge. */
    padding-block: var(--space-3);
    gap: var(--space-5);
    min-width: 0;
}

.nav__logo {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    min-width: 0;
}

.nav__logo img {
    height: 38px;
    width: auto;
}

.nav__logo span {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: var(--fs-2);
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nav__links {
    display: flex;
    gap: clamp(var(--space-2), 0.8vw, var(--space-4));
    list-style: none;
    margin: 0;
    padding: 0;
    flex-wrap: nowrap;
    min-width: 0;
}

.nav__links a {
    color: var(--text);
    font-weight: 500;
    font-size: clamp(0.78rem, 0.68rem + 0.2vw, 0.94rem);
    white-space: nowrap;
}

.nav__actions {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    flex-shrink: 0;
}

.nav__login,
.nav__cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-2) var(--space-4);
    min-height: 40px;
    border-radius: var(--radius-pill);
    font-weight: 600;
    font-size: var(--fs-1);
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
}

.nav__login {
    background: var(--bg-elevated);
    color: var(--link-ink);
    border: 1px solid rgba(226, 83, 47, 0.42);
    box-shadow: 0 1px 0 rgba(226, 83, 47, 0.08);
}

.nav__login:hover {
    background: var(--accent-soft);
    border-color: var(--accent);
    color: var(--link-ink);
    text-decoration: none;
}

.nav__cta {
    background: var(--accent);
    color: var(--text-on-accent);
    border: 1px solid var(--accent);
}

.nav__cta:hover {
    background: var(--accent-strong);
    color: #fff;
    text-decoration: none;
}

/* (Mobile drawer rules in site.css take over at <=880px.) */

/* === Hero =========================================================== */
.hero {
    padding: var(--space-9) 0;
    background:
        radial-gradient(1100px 500px at 80% -10%, var(--accent-soft) 0%, rgba(255, 244, 214, 0) 60%),
        var(--bg);
    border-bottom: 1px solid var(--border);
}

.hero__grid {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
    gap: var(--space-8);
    align-items: center;
}

.hero__eyebrow {
    display: inline-block;
    font-size: var(--fs-1);
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--link-ink);
    margin-bottom: var(--space-4);
}

.hero h1 {
    font-size: var(--fs-7);
    margin-bottom: var(--space-5);
}

.hero p.lead {
    font-size: var(--fs-3);
    color: var(--text-muted);
    max-width: 56ch;
}

.hero__actions {
    display: flex;
    gap: var(--space-3);
    margin-top: var(--space-6);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px var(--space-6);
    border-radius: 999px;
    font-weight: 600;
    font-size: var(--fs-2);
    letter-spacing: 0.02em;
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
    transition: transform 120ms ease, background 150ms ease, box-shadow 150ms ease, color 150ms ease;
}

.btn:hover {
    text-decoration: none;
    transform: translateY(-1px);
}

.btn--primary {
    background: var(--accent);
    color: var(--text-on-accent);
}

.btn--primary:hover {
    background: var(--accent-strong);
    color: #fff;
}

.btn--ghost {
    background: transparent;
    color: var(--text);
    border-color: var(--border);
}

.btn--ghost:hover {
    border-color: var(--accent);
    color: var(--link-ink);
}

.hero__visual {
    aspect-ratio: 4 / 5;
    border-radius: var(--radius-lg);
    background:
        linear-gradient(135deg, rgba(212, 160, 23, 0.15), rgba(212, 160, 23, 0)),
        var(--bg-secondary);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-family: var(--font-display);
}

@media (max-width: 900px) {
    .hero {
        padding: var(--space-7) 0;
    }

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

    .hero h1 {
        font-size: var(--fs-6);
    }

    .hero__visual {
        aspect-ratio: 16 / 10;
    }
}

/* === Sections ======================================================= */
.section {
    padding: var(--space-9) 0;
}

.section--alt {
    background: var(--bg-secondary);
}

.section__head {
    max-width: 720px;
    margin: 0 auto var(--space-7) auto;
    text-align: center;
}

/* Kicker: the uppercase accent micro-label heading every band. */
.section__eyebrow {
    display: block;
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--link-ink);
    font-weight: 700;
    margin-bottom: var(--space-2);
}

/* Auto-responsive feature grid (the auto-fit/minmax pattern) */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: var(--space-5);
}

.card {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-card);
    padding: var(--space-6);
    transition: box-shadow 150ms ease, transform 150ms ease, border-color 150ms ease;
}

.card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
    border-color: var(--accent);
}

.card__icon {
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    background: var(--accent-soft);
    color: var(--link-ink);
    margin-bottom: var(--space-4);
    font-weight: 700;
    font-family: var(--font-display);
}

.card h3 {
    font-size: var(--fs-4);
    margin-bottom: var(--space-2);
}

.card p {
    color: var(--text-muted);
    margin: 0;
}

/* === KPI strip ====================================================== */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: var(--space-5);
}

.kpi {
    padding: var(--space-5);
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
}

.kpi__value {
    font-family: var(--font-display);
    font-size: var(--fs-6);
    font-weight: 600;
    color: var(--text);
    line-height: 1;
}

.kpi__label {
    margin-top: var(--space-2);
    font-size: var(--fs-1);
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

/* === News teaser ==================================================== */
.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--space-5);
}

.news-card {
    border: 1px solid var(--border);
    border-radius: var(--radius-card);
    overflow: hidden;
    background: var(--bg-elevated);
    display: flex;
    flex-direction: column;
    transition: border-color 150ms ease, transform 150ms ease, box-shadow 150ms ease;
}

.news-card:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.news-card__media {
    aspect-ratio: 16/9;
    background: var(--bg-secondary);
}

.news-card__body {
    padding: var(--space-5);
}

.news-card__date {
    font-size: var(--fs-1);
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.news-card h3 {
    font-size: var(--fs-4);
    margin: var(--space-2) 0 var(--space-3);
}

/* === Footer ========================================================= */
.footer {
    background: var(--bg-darkest);
    color: var(--text-on-dark-muted);
    padding: var(--space-8) 0 var(--space-6);
    margin-top: var(--space-8);
}

.footer__grid {
    display: grid;
    grid-template-columns: minmax(220px, 1.4fr) repeat(auto-fit, minmax(160px, 1fr));
    gap: var(--space-6);
}

/* A 220px brand column plus 160px link columns cannot fit a phone: the link
   column ran past a 390px screen. Two link columns under the brand. */
@media (max-width: 600px) {
    .footer__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .footer__grid > :first-child {
        grid-column: 1 / -1;
    }
}

/* Footer column headings read as uppercase kickers (grouped IA). */
.footer h4 {
    color: var(--text-on-dark-faint);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    margin-bottom: var(--space-3);
}

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

.footer li {
    margin-bottom: var(--space-2);
}

.footer a {
    color: var(--text-on-dark-muted);
}

.footer a:hover {
    color: var(--link-ink);
    text-decoration: none;
}

.footer__legal {
    margin-top: var(--space-7);
    padding-top: var(--space-5);
    border-top: 1px solid var(--hairline-on-dark);
    display: flex;
    justify-content: space-between;
    gap: var(--space-4);
    font-size: var(--fs-1);
    color: var(--text-on-dark-faint);
    flex-wrap: wrap;
}

/* ============================================================
   Micro-interactions & focus polish
   ============================================================ */

/* Visible, on-brand focus ring everywhere — keyboard only */
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
    border-radius: var(--radius-sm);
}

/* Selection */
::selection {
    background: var(--accent);
    color: var(--text-on-accent);
}

/* Default link: animated underline (replaces flat hover-underline) */
.prose a,
.bio-card__body a,
main p a {
    position: relative;
    color: var(--link-ink);
    text-decoration: none;
    background-image: linear-gradient(currentColor, currentColor);
    background-size: 0% 1.5px;
    background-repeat: no-repeat;
    background-position: 0 100%;
    transition: background-size var(--dur-base, 0.28s) var(--ease-out, ease);
}

.prose a:hover,
.bio-card__body a:hover,
main p a:hover {
    background-size: 100% 1.5px;
    text-decoration: none;
}

/* Nav link underline on hover */
.nav__links a {
    position: relative;
}

.nav__links a::after {
    content: "";
    position: absolute;
    left: 0;
    right: 100%;
    bottom: -6px;
    height: 2px;
    background: var(--accent);
    border-radius: 2px;
    transition: right var(--dur-base, 0.28s) var(--ease-out, ease);
}

.nav__links a:hover::after,
.nav__links a:focus-visible::after {
    right: 0;
}

.nav__links a:hover {
    text-decoration: none;
}

/* Buttons: subtle press */
.btn:active {
    transform: translateY(0) scale(0.98);
}

/* Profile / bio cards: lift + image zoom */
.profile-card,
.bio-card {
    transition: transform var(--dur-base, 0.28s) var(--ease-out, ease),
        box-shadow var(--dur-base, 0.28s) var(--ease-out, ease);
    will-change: transform;
}

.profile-card:hover,
.bio-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg, 0 16px 48px -12px rgba(15, 23, 42, .18));
}

.profile-card__photo,
.bio-card__photo {
    overflow: hidden;
}

.profile-card__photo img,
.bio-card__photo img {
    transition: transform 0.6s var(--ease-out, ease);
    will-change: transform;
}

.profile-card:hover .profile-card__photo img,
.bio-card:hover .bio-card__photo img {
    transform: scale(1.05);
}

/* Reveal-on-scroll */
.reveal {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 0.7s var(--ease-out, ease),
        transform 0.7s var(--ease-out, ease);
    will-change: opacity, transform;
}

.reveal.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Stagger children inside a reveal container */
.reveal-stagger>* {
    opacity: 0;
    transform: translateY(14px);
    transition: opacity 0.6s var(--ease-out, ease),
        transform 0.6s var(--ease-out, ease);
}

.reveal-stagger.is-visible>* {
    opacity: 1;
    transform: translateY(0);
}

.reveal-stagger.is-visible>*:nth-child(1) {
    transition-delay: 0.00s;
}

.reveal-stagger.is-visible>*:nth-child(2) {
    transition-delay: 0.05s;
}

.reveal-stagger.is-visible>*:nth-child(3) {
    transition-delay: 0.10s;
}

.reveal-stagger.is-visible>*:nth-child(4) {
    transition-delay: 0.15s;
}

.reveal-stagger.is-visible>*:nth-child(5) {
    transition-delay: 0.20s;
}

.reveal-stagger.is-visible>*:nth-child(6) {
    transition-delay: 0.25s;
}

.reveal-stagger.is-visible>*:nth-child(7) {
    transition-delay: 0.30s;
}

.reveal-stagger.is-visible>*:nth-child(8) {
    transition-delay: 0.35s;
}

.reveal-stagger.is-visible>*:nth-child(n+9) {
    transition-delay: 0.40s;
}

@media (prefers-reduced-motion: reduce) {

    .reveal,
    .reveal-stagger>*,
    .profile-card,
    .bio-card,
    .profile-card__photo img,
    .bio-card__photo img,
    .nav__links a::after,
    .prose a {
        transition: none !important;
        animation: none !important;
    }

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

    .reveal-stagger>* {
        opacity: 1;
        transform: none;
    }
}

/* ============================================================
   View Transitions API — cross-document fade + lift.
   Supported: Chrome/Edge 126+, Safari 18+. Other browsers: hard nav.
   ============================================================ */
@view-transition {
    navigation: auto;
}

::view-transition-old(root),
::view-transition-new(root) {
    animation-duration: 0.32s;
    animation-timing-function: var(--ease-out, cubic-bezier(0.2, 0.9, 0.25, 1.05));
    mix-blend-mode: normal;
}

::view-transition-old(root) {
    animation-name: ehcb-fade-out;
}

::view-transition-new(root) {
    animation-name: ehcb-fade-in;
}

@keyframes ehcb-fade-out {
    to {
        opacity: 0;
        transform: translateY(-6px);
    }
}

@keyframes ehcb-fade-in {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
}

/* Anchor the sticky nav so it appears continuous across navigations */
.nav {
    view-transition-name: ehcb-nav;
}

/* Coach portrait morph — see js/coach-modal.js. Slower, springy curve so
   the photo glides from card to modal hero. */
::view-transition-old(coach-portrait),
::view-transition-new(coach-portrait) {
    animation-duration: 0.55s;
    animation-timing-function: var(--ease-spring);
    mix-blend-mode: normal;
}

::view-transition-group(coach-portrait) {
    animation-duration: 0.55s;
    animation-timing-function: var(--ease-spring);
}

@media (prefers-reduced-motion: reduce) {

    ::view-transition-old(root),
    ::view-transition-new(root) {
        animation: none !important;
    }
}

/* Visually-hidden but screen-reader-available */
.sr-only {
    position: absolute !important;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0);
    white-space: nowrap; border: 0;
}
