:root {
    color-scheme: dark;
    --bg: #050505;
    --surface: #0d0d0d;
    --card: #151515;
    --card-strong: #1c1c1c;
    --text: #ffffff;
    --muted: #a8a8a8;
    --soft: #d8e0ea;
    --border: #2a2a2a;
    --brand: #0096ff;
    --brand-strong: #39adff;
    --radius: 8px;
    --shadow: 0 24px 64px rgba(0, 0, 0, 0.42);
}

* { box-sizing: border-box; }

html,
body {
    margin: 0;
    padding: 0;
}

body {
    min-width: 320px;
    font-family: Inter, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.6;
    color: var(--text);
    background:
        linear-gradient(180deg, rgba(0, 150, 255, 0.08) 0, rgba(0, 150, 255, 0) 420px),
        linear-gradient(180deg, #000000 0%, var(--bg) 100%);
}

a {
    color: var(--brand-strong);
    text-underline-offset: 3px;
}

a:hover { color: #78c9ff; }

a:focus-visible,
button:focus-visible {
    outline: 2px solid var(--brand);
    outline-offset: 3px;
}

.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    z-index: 100;
    padding: 10px 16px;
    border-radius: 0 0 var(--radius) 0;
    background: var(--brand);
    color: #00131f;
    font-weight: 800;
}

.skip-link:focus { left: 0; }

.page-shell {
    width: min(1120px, calc(100% - 32px));
    margin: 0 auto;
    padding: 18px 0 44px;
}

.site-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px 18px;
    flex-wrap: wrap;
    margin-bottom: 18px;
    position: relative;
    z-index: 50;
}

.site-nav .brand {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    color: #e6edf8;
    font-weight: 700;
    font-size: 1.02rem;
    text-decoration: none;
}

.site-nav .brand img {
    display: block;
    border-radius: 7px;
}

.site-nav .menu {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.site-nav .nav-item {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    padding: 8px 14px;
    border: 1px solid rgba(94, 163, 255, 0.26);
    border-radius: 999px;
    background: rgba(20, 31, 52, 0.72);
    color: #5ea3ff;
    font-size: 0.92rem;
    text-decoration: none;
    cursor: pointer;
    white-space: nowrap;
    list-style: none;
}

.site-nav .nav-item:hover,
.site-nav .nav-item[aria-current="page"] {
    color: #fff;
    background: #5ea3ff;
}

.site-nav summary.nav-item { list-style: none; }
.site-nav summary.nav-item::-webkit-details-marker { display: none; }

.site-nav summary.nav-item::after {
    content: "";
    width: 6px;
    height: 6px;
    margin-left: 8px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg) translateY(-1px);
}

.site-nav .nav-group { position: relative; }

.site-nav .nav-group[open] > summary.nav-item::after {
    transform: rotate(-135deg) translateY(1px);
}

.site-nav .nav-drop {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    min-width: 250px;
    max-height: min(70vh, 480px);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 8px;
    background: #0f1728;
    border: 1px solid #2b3a57;
    border-radius: 12px;
    box-shadow: 0 18px 44px rgba(0, 0, 0, 0.42);
    z-index: 60;
}

.site-nav .nav-drop a {
    padding: 9px 12px;
    border-radius: 8px;
    color: #e6edf8;
    font-size: 0.92rem;
    text-decoration: none;
    white-space: nowrap;
}

.site-nav .nav-drop a:hover {
    background: rgba(94, 163, 255, 0.16);
    color: #fff;
}

.hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(250px, 360px);
    gap: clamp(22px, 4vw, 44px);
    align-items: center;
    min-height: 390px;
    padding: clamp(24px, 5vw, 46px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--radius);
    background:
        linear-gradient(135deg, rgba(0, 150, 255, 0.16) 0%, rgba(0, 150, 255, 0) 52%),
        linear-gradient(180deg, rgba(21, 21, 21, 0.96) 0%, rgba(10, 10, 10, 0.96) 100%);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.eyebrow {
    margin: 0 0 10px;
    color: var(--brand-strong);
    font-size: 0.82rem;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
}

h1,
h2,
h3,
p {
    letter-spacing: 0;
    overflow-wrap: anywhere;
}

h1 {
    margin: 0;
    font-size: clamp(2.3rem, 6vw, 4.55rem);
    line-height: 0.98;
}

h2 {
    margin: 0 0 14px;
    font-size: clamp(1.45rem, 3vw, 2.25rem);
    line-height: 1.1;
}

h3 {
    margin: 0 0 8px;
    font-size: 1.05rem;
    line-height: 1.24;
}

p { color: var(--soft); }

.hero-lede {
    max-width: 690px;
    margin: 18px 0 0;
    color: #dce6f4;
    font-size: clamp(1rem, 2vw, 1.18rem);
}

.hero-media {
    margin: 0;
    justify-self: center;
    width: min(100%, 250px);
    padding: 10px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 28px;
    background: #050505;
    box-shadow: 0 34px 72px rgba(0, 0, 0, 0.46);
}

.hero-media img {
    display: block;
    width: 100%;
    aspect-ratio: 1242 / 2688;
    object-fit: cover;
    object-position: top;
    border-radius: 20px;
}

.section {
    margin-top: 18px;
    padding: clamp(20px, 4vw, 34px);
    border: 1px solid rgba(255, 255, 255, 0.11);
    border-radius: var(--radius);
    background: rgba(13, 13, 13, 0.92);
}

.blog-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 18px;
}

.blog-toolbar p { margin: 0; }

.filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.filter-button,
.read-link,
.back-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    border: 1px solid rgba(255, 255, 255, 0.11);
    border-radius: var(--radius);
    background: rgba(20, 20, 20, 0.72);
    color: #e8e8e8;
    font: inherit;
    font-size: 0.9rem;
    font-weight: 750;
    text-decoration: none;
    cursor: pointer;
}

.filter-button { padding: 8px 12px; }
.read-link,
.back-link { padding: 8px 14px; }

.filter-button[aria-pressed="true"],
.filter-button:hover,
.read-link:hover,
.back-link:hover {
    border-color: rgba(0, 150, 255, 0.56);
    background: rgba(0, 150, 255, 0.18);
    color: #fff;
}

.post-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.post-card {
    display: flex;
    flex-direction: column;
    min-height: 100%;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius);
    background: var(--card);
    overflow: hidden;
}

.post-card img {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    object-position: top;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.post-card-body {
    display: flex;
    flex: 1;
    flex-direction: column;
    padding: 16px;
}

.post-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 10px;
    color: var(--muted);
    font-size: 0.83rem;
}

.post-card p { margin: 0 0 14px; }

.post-card .read-link {
    align-self: flex-start;
    margin-top: auto;
}

.article-shell {
    display: grid;
    grid-template-columns: minmax(0, 740px) minmax(230px, 1fr);
    gap: 20px;
    align-items: start;
}

.article {
    min-width: 0;
    padding: clamp(22px, 4vw, 38px);
    border: 1px solid rgba(255, 255, 255, 0.11);
    border-radius: var(--radius);
    background: rgba(13, 13, 13, 0.94);
}

.article-header img {
    display: block;
    width: min(100%, 360px);
    height: auto;
    margin: 20px auto 0;
    border: 1px solid rgba(255, 255, 255, 0.11);
    border-radius: var(--radius);
}

.article-header .article-hero-wide {
    width: 100%;
    aspect-ratio: 1200 / 630;
    object-fit: cover;
}

.byline {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 14px;
    margin: 14px 0 0;
    color: var(--muted);
    font-size: 0.86rem;
}

.byline a { font-weight: 700; }

.article-quick-nav {
    margin: 24px 0 30px;
    padding: clamp(16px, 3vw, 22px);
    border: 1px solid rgba(0, 150, 255, 0.34);
    border-radius: var(--radius);
    background: linear-gradient(135deg, rgba(0, 150, 255, 0.13), rgba(0, 150, 255, 0.035));
}

.plan-facts {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 14px;
}

.plan-facts span {
    display: grid;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--soft);
    font-size: 0.88rem;
}

.plan-facts strong { color: var(--text); }

.week-strip {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 6px;
}

.week-strip span {
    display: grid;
    min-width: 0;
    padding: 9px 5px;
    border-radius: var(--radius);
    color: #fff;
    font-size: 0.77rem;
    text-align: center;
}

.week-strip b { font-size: 0.68rem; text-transform: uppercase; }
.week-strip .training-day { background: #086cae; }
.week-strip .rest-day { background: #303846; color: #dce6f4; }

.quick-links {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px 14px;
    margin-top: 16px;
}

.quick-links a:not(.read-link),
.quick-links button {
    border: 0;
    background: transparent;
    color: var(--brand-strong);
    font: inherit;
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
}

html[data-theme="light"] .article-quick-nav {
    border-color: #b8d9ee;
    background: #edf7ff;
}

html[data-theme="light"] .plan-facts span { border-color: var(--vl-border); color: var(--vl-text-soft); }
html[data-theme="light"] .plan-facts strong { color: var(--vl-text); }

.article-content h2 {
    margin: 30px 0 10px;
    font-size: clamp(1.3rem, 2.1vw, 1.65rem);
    line-height: 1.22;
    letter-spacing: -0.01em;
}

.article-content h3 {
    margin: 24px 0 8px;
    color: var(--text);
    font-size: 1.12rem;
}

.article-content p {
    margin: 0 0 16px;
    font-size: 1.05rem;
}
.article-content ul,
.article-content ol { color: var(--soft); }
.article-content li { margin: 7px 0; }

.table-scroll {
    width: 100%;
    max-width: 100%;
    margin: 18px 0 24px;
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.article-content table {
    width: 100%;
    min-width: 560px;
    border-collapse: collapse;
    color: var(--soft);
    background: var(--surface);
}

.article-content th,
.article-content td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    text-align: left;
    vertical-align: top;
}

.article-content th {
    color: var(--text);
    background: var(--card-strong);
    font-size: 0.9rem;
}

.article-content tbody tr:last-child td { border-bottom: 0; }

.article-cta,
.side-panel {
    border: 1px solid rgba(0, 150, 255, 0.24);
    border-radius: var(--radius);
    background: rgba(0, 150, 255, 0.08);
}

.article-cta {
    margin-top: 28px;
    padding: 18px;
}

.contextual-cta {
    margin: 28px 0;
    padding: 20px;
    border: 1px solid rgba(0, 150, 255, 0.32);
    border-radius: var(--radius);
    background: linear-gradient(135deg, rgba(0, 150, 255, 0.14), rgba(0, 150, 255, 0.04));
}

.contextual-cta h2 {
    margin-top: 0;
}

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

.text-link {
    align-self: center;
    font-weight: 700;
}

.cta-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 0;
}

.side-panel {
    position: sticky;
    top: 18px;
    padding: 18px;
}

.side-panel h2 {
    font-size: 1.05rem;
}

.related-list {
    display: grid;
    gap: 10px;
    margin: 12px 0 0;
}

.related-list a {
    color: #e6edf8;
    text-decoration: none;
}

.related-list a:hover { color: #fff; }

.footer {
    margin-top: 24px;
    padding-top: 18px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--muted);
    text-align: center;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.footer-links a {
    color: var(--soft);
    text-decoration: none;
}

.footer-links a:hover { color: #fff; }

/* Explicit light-mode surfaces and interaction states for the blog family. */
html[data-theme="light"] .filter-button,
html[data-theme="light"] .read-link,
html[data-theme="light"] .back-link {
    color: var(--vl-text-soft);
    border-color: var(--vl-border);
    background: var(--vl-surface-raised);
}

html[data-theme="light"] .filter-button[aria-pressed="true"],
html[data-theme="light"] .filter-button:hover,
html[data-theme="light"] .read-link:hover,
html[data-theme="light"] .back-link:hover {
    color: #ffffff;
    border-color: var(--vl-brand);
    background: var(--vl-brand);
}

html[data-theme="light"] .post-card,
html[data-theme="light"] .article {
    color: var(--vl-text);
    border-color: var(--vl-border);
    background: var(--vl-surface);
    box-shadow: var(--vl-shadow-sm);
}

html[data-theme="light"] .post-card img,
html[data-theme="light"] .article-header img,
html[data-theme="light"] .table-scroll,
html[data-theme="light"] .footer {
    border-color: var(--vl-border);
}

html[data-theme="light"] .article-content table {
    color: var(--vl-text-soft);
    background: var(--vl-surface);
}

html[data-theme="light"] .article-content th {
    color: var(--vl-text);
    background: var(--vl-surface-raised);
}

html[data-theme="light"] .article-cta,
html[data-theme="light"] .contextual-cta,
html[data-theme="light"] .side-panel {
    color: var(--vl-text);
    border-color: #b8d9ee;
    background: #edf7ff;
}

@media (max-width: 900px) {
    .hero,
    .article-shell {
        grid-template-columns: 1fr;
    }

    .hero-media {
        justify-self: start;
        width: min(100%, 210px);
    }

    .post-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .side-panel { position: static; }
}

@media (max-width: 720px) {
    .site-nav { gap: 10px; }
    .site-nav .menu { width: 100%; }
    .site-nav .nav-group { position: static; }
    .site-nav .nav-drop {
        position: static;
        min-width: 0;
        width: 100%;
        margin-top: 4px;
        box-shadow: none;
        background: rgba(94, 163, 255, 0.06);
        border-color: rgba(94, 163, 255, 0.18);
    }

    .blog-toolbar {
        align-items: flex-start;
        flex-direction: column;
    }

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

    .plan-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .week-strip { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media print {
    body { background: #fff; color: #000; }
    .site-nav, .back-link, .side-panel, .article-cta, .contextual-cta, .footer, .article-header img, .quick-links, .app-sticky-cta { display: none !important; }
    .page-shell, .article-shell, .article { width: 100%; max-width: none; margin: 0; padding: 0; border: 0; background: #fff; box-shadow: none; }
    .article-content p, .article-content li, .article-content table, .hero-lede, .byline { color: #111; }
    .article-content h2, .article-content h3, .article-content table { break-inside: avoid; }
    .table-scroll { overflow: visible; border-color: #aaa; }
    .article-content table { min-width: 0; font-size: 9pt; }
    .article-content th, .article-content td { padding: 5px 6px; border-color: #aaa; }
    a { color: #000; text-decoration: none; }
}

/* ---- App download CTAs (see app-cta.js) ---- */

.cta-primary {
    border-color: rgba(0, 150, 255, 0.72);
    background: var(--brand-strong, #0096ff);
    color: #fff;
    font-weight: 800;
}

.cta-primary:hover {
    border-color: #fff;
    background: #0086e6;
    color: #fff;
}

.quick-links .cta-primary { text-decoration: none; }

.cta-note {
    margin: 8px 0 0;
    font-size: 0.85rem;
    opacity: 0.75;
}

.cta-figure {
    display: flex;
    gap: 18px;
    align-items: center;
    margin: 0 0 14px;
}

.cta-figure img {
    width: 132px;
    height: auto;
    flex: none;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.cta-figure > div { flex: 1 1 auto; }
.cta-figure h2 { margin-top: 0; }
.cta-figure p:last-child { margin-bottom: 0; }

.app-sticky-cta {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 40;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
    border-top: 1px solid rgba(0, 150, 255, 0.4);
    background: rgba(10, 14, 20, 0.96);
    backdrop-filter: blur(8px);
    box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.35);
}

.app-sticky-cta p {
    flex: 1 1 auto;
    margin: 0;
    font-size: 0.85rem;
    line-height: 1.3;
    color: #e8e8e8;
}

.app-sticky-cta .read-link {
    flex: none;
    border-color: rgba(0, 150, 255, 0.72);
    background: var(--brand-strong, #0096ff);
    color: #fff;
}

.app-sticky-cta__close {
    flex: none;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #9aa7b5;
    font-size: 1.2rem;
    line-height: 1;
    cursor: pointer;
}

.app-sticky-cta__close:hover { color: #fff; }

html[data-theme="light"] .app-sticky-cta {
    background: rgba(255, 255, 255, 0.97);
    box-shadow: 0 -8px 24px rgba(15, 40, 70, 0.14);
}

html[data-theme="light"] .app-sticky-cta p { color: var(--vl-text, #14232f); }
html[data-theme="light"] .cta-figure img { border-color: #b8d9ee; }

@media (min-width: 900px) {
    .app-sticky-cta { display: none; }
}

@media (max-width: 560px) {
    .cta-figure { gap: 12px; }
    .cta-figure img { width: 96px; }
}

.link-button {
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
}

.app-sticky-cta[hidden] { display: none !important; }
