* {
    box-sizing: border-box;
}

:root {
    color-scheme: light;
    --page-bg: #f0f0f0;
    --surface: rgba(255, 255, 255, 0.95);
    --surface-strong: #ffffff;
    --surface-soft: #f5f5f5;
    --border: rgba(0, 0, 0, 0.1);
    --text: #1a1a1a;
    --muted: #666666;
    --accent: #3a4a5a;
    --accent-2: #4a5a6a;
    --shadow: 0 24px 60px rgba(0, 0, 0, 0.12);
}

html,
body {
    min-height: 100%;
}

body {
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    font-family: "Trebuchet MS", "Segoe UI", sans-serif;
    line-height: 1.6;
    color: var(--text);
    background: #f0f0f0;
}

header,
footer {
    color: white;
    background: #2a2a2a;
}

header {
    padding: 1.5rem 1rem 1.35rem;
}

header h1,
footer p {
    margin: 0;
}

footer {
    margin-top: auto;
    padding: 1rem;
    text-align: center;
}

nav {
    width: min(1100px, 92vw);
    margin: 0 auto;
    padding: 1rem 0 0;
    text-align: center;
}

nav ul {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem;
    padding: 0;
    margin: 0;
}

nav ul li {
    list-style: none;
}

nav ul li a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.75rem;
    padding: 0.7rem 1rem;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: #3a3a3a;
    color: #f8fafc;
    text-decoration: none;
    font-weight: 700;
    box-shadow: none;
    transition: none;
}

nav ul li a:hover,
nav ul li a:focus-visible {
    transform: translateY(-1px);
    background: #1a1a1a;
    text-decoration: none;
}

main {
    width: min(1100px, 92vw);
    margin: 1.5rem auto;
    flex: 1;
    padding: clamp(1.5rem, 3vw, 2.5rem);
    background: var(--surface);
    backdrop-filter: blur(14px);
    border: 1px solid var(--border);
    border-radius: 30px;
    box-shadow: var(--shadow);
    display: grid;
    gap: 1.25rem;
}

main > article,
main > section {
    background: var(--surface-strong);
    border: 1px solid var(--border);
    border-radius: 26px;
    padding: 1.5rem;
    box-shadow: none;
}

main h2,
main h3,
main h4 {
    margin-top: 0;
    line-height: 1.2;
}

main p {
    margin-top: 0;
}

a {
    color: var(--accent-2);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

main a[role="button"],
.action-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 2.9rem;
    padding: 0.85rem 1.15rem;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    background: #3a4a5a;
    color: #ffffff !important;
    font-weight: 700;
    letter-spacing: 0.01em;
    text-decoration: none;
    box-shadow: 0 10px 22px rgba(0, 0, 0, 0.18);
    transition: transform 0.2s ease, filter 0.2s ease, box-shadow 0.2s ease;
}

main a[role="button"]:hover,
main a[role="button"]:focus-visible,
.action-button:hover,
.action-button:focus-visible {
    transform: translateY(-2px);
    filter: brightness(1.12) saturate(1.03);
    box-shadow: 0 14px 28px rgba(15, 23, 42, 0.24);
    text-decoration: none;
}

main a[role="button"].secondary,
.action-button.secondary {
    background: #4a4a4a;
    color: #f8fafc !important;
    border-color: rgba(255, 255, 255, 0.12);
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.10);
}

main a[role="button"].secondary:hover,
main a[role="button"].secondary:focus-visible,
.action-button.secondary:hover,
.action-button.secondary:focus-visible {
    filter: brightness(1.02);
    box-shadow: 0 12px 22px rgba(15, 23, 42, 0.14);
}

.hero-panel {
    background: #2a2a2a;
    color: #eaeaea;
}

.hero-layout {
    display: grid;
    gap: 1.25rem;
    align-items: center;
}

.hero-copy {
    display: grid;
    gap: 0.9rem;
}

.hero-panel .hero-copy p,
.hero-panel .hero-copy h2,
.hero-panel .hero-copy strong {
    color: #eaeaea;
}

.hero-accent {
    width: min(140px, 100%);
    height: 4px;
    border-radius: 999px;
    background: #3a4a5a;
}

.hero-panel h2 {
    font-size: clamp(1.8rem, 4vw, 3rem);
}

.hero-actions,
.link-grid,
.exercise-grid {
    display: grid;
    gap: 1rem;
}

.hero-actions {
    grid-template-columns: repeat(auto-fit, minmax(180px, max-content));
    margin-top: 1rem;
}

.overview-panel {
    display: grid;
    gap: 1.25rem;
}

.panel-columns {
    display: grid;
    gap: 1.25rem;
}

.panel-group {
    display: grid;
    gap: 1rem;
}

.panel-divider {
    height: 4px;
    border-radius: 999px;
    background: #3a4a5a;
}

.compact-grid {
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.muted-note {
    color: var(--muted);
}

.link-grid,
.exercise-grid {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.hero-portrait {
    margin: 0;
    padding: 0.85rem;
    border-radius: 28px;
    border: 1px solid rgba(0, 0, 0, 0.28);
    background: #ffffff;
    box-shadow: 0 18px 36px rgba(0, 0, 0, 0.12);
}

.hero-portrait img {
    width: 100%;
    aspect-ratio: 4 / 5;
    object-fit: cover;
    border-radius: 22px;
    display: block;
}

.hero-portrait figcaption {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    align-items: center;
    padding: 0.9rem 0.35rem 0.25rem;
    color: #eaeaea;
}

.hero-portrait figcaption span {
    color: #cfcfcf;
    font-size: 0.95rem;
}

.link-card {
    display: flex;
    min-height: 132px;
    flex-direction: column;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 1.25rem;
    border-radius: 22px;
    border: 1px solid var(--border);
    background: #ffffff;
    box-shadow: none;
    color: var(--text);
    transition: transform 0.2s ease, filter 0.2s ease, box-shadow 0.2s ease;
}

.link-card:hover,
.link-card:focus-visible {
    transform: translateY(-2px);
    filter: brightness(1.03);
    box-shadow: 0 14px 28px rgba(0, 0, 0, 0.12);
    text-decoration: none;
}

.link-card strong {
    font-size: 1.05rem;
}

.link-card span {
    color: var(--muted);
}

.full-width {
    grid-column: 1 / -1;
}

main > a {
    display: block;
    border-radius: 20px;
    overflow: hidden;
    line-height: 0;
    box-shadow: none;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
    margin-bottom: 0;
    border-radius: 20px;
    transition: transform 0.25s ease;
}

main > a:hover img,
main > a:focus-visible img {
    transform: scale(1.03);
}

@media (min-width: 768px) {
    main {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        align-items: start;
    }

    .hero-layout {
        grid-template-columns: 1.2fr 0.8fr;
        gap: 1.5rem;
    }

    .hero-portrait {
        align-self: stretch;
    }
}

@media (prefers-color-scheme: dark) {
    :root {
        color-scheme: dark;
        --page-bg: #1a1a1a;
        --surface: rgba(40, 40, 40, 0.95);
        --surface-strong: #2a2a2a;
        --surface-soft: #1a1a1a;
        --border: rgba(255, 255, 255, 0.1);
        --text: #e5e5e5;
        --muted: #999999;
    }

    body {
        background: #0f0f0f;
    }

    nav ul li a {
        background: rgba(50, 50, 50, 0.95);
        color: #e5e5e5;
        box-shadow: none;
    }

    nav ul li a:hover,
    nav ul li a:focus-visible {
        background: rgba(30, 30, 30, 1);
    }

    main {
        background: rgba(40, 40, 40, 0.9);
    }

    .link-card {
        background: #2a2a2a;
    }
    .hero-portrait {
        border: 1px solid rgba(255, 255, 255, 0.06);
        background: #2a2a2a;
        box-shadow: 0 18px 36px rgba(0, 0, 0, 0.28);
    }
}