/* ========== Tokens ========== */
:root {
    /* Base */
    --bg: #0a0c10;
    --bg-2: #0f1218;
    --panel: #141822;
    --panel-2: #1a1f2d;
    --panel-3: #222736;
    --border: #262b3a;
    --border-2: #323849;

    /* Text */
    --text: #e9ecf3;
    --text-2: #b4bacb;
    --muted: #7a8197;
    --dim: #525869;

    /* Accents — blue + red duotone */
    --accent: #3b82f6;
    --accent-hi: #60a5fa;
    --accent-lo: #1e40af;
    --accent-glow: rgba(59, 130, 246, 0.35);

    --red: #ef4444;
    --red-hi: #f87171;
    --red-lo: #7f1d1d;
    --red-glow: rgba(239, 68, 68, 0.35);

    --ok: #22c55e;
    --warn: #f59e0b;

    /* Intensity (session cards) */
    --light: #22c55e;
    --light-bg: rgba(34, 197, 94, 0.12);
    --medium: #f59e0b;
    --medium-bg: rgba(245, 158, 11, 0.12);
    --heavy: #ef4444;
    --heavy-bg: rgba(239, 68, 68, 0.14);

    /* Motion */
    --ease: cubic-bezier(0.4, 0, 0.2, 1);
    --dur-fast: 140ms;
    --dur: 220ms;
    --dur-slow: 420ms;

    /* Radii / shadows */
    --r-sm: 8px;
    --r: 12px;
    --r-lg: 16px;
    --r-xl: 20px;
    --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.35);
    --shadow-2: 0 10px 30px rgba(0, 0, 0, 0.45);
    --shadow-blue: 0 0 0 1px rgba(59, 130, 246, 0.22), 0 10px 40px -10px rgba(59, 130, 246, 0.45);
    --shadow-red:  0 0 0 1px rgba(239, 68, 68, 0.22), 0 10px 40px -10px rgba(239, 68, 68, 0.45);
}

* { box-sizing: border-box; }

@font-face {
    font-family: 'Inter var fallback';
    src: local('Inter'), local('Segoe UI'), local('Helvetica Neue');
    font-weight: 100 900;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 90px;
}
html, body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--text);
    font: 15px/1.6 'Inter', Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
    font-feature-settings: 'ss01', 'cv11';
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    overflow-x: hidden;
}

/* Ambient background — red/blue orbs + subtle grid */
body::before {
    content: '';
    position: fixed;
    inset: -20vmax -20vmax auto auto;
    width: 60vmax;
    height: 60vmax;
    background: radial-gradient(closest-side, var(--red-glow), transparent 70%);
    filter: blur(40px);
    pointer-events: none;
    z-index: 0;
    animation: orb-a 14s var(--ease) infinite alternate;
}
body::after {
    content: '';
    position: fixed;
    inset: auto auto -20vmax -20vmax;
    width: 60vmax;
    height: 60vmax;
    background: radial-gradient(closest-side, var(--accent-glow), transparent 70%);
    filter: blur(40px);
    pointer-events: none;
    z-index: 0;
    animation: orb-b 18s var(--ease) infinite alternate;
}

@keyframes orb-a {
    0%   { transform: translate3d(0, 0, 0) scale(1); opacity: .35; }
    100% { transform: translate3d(-6vmax, 8vmax, 0) scale(1.15); opacity: .55; }
}
@keyframes orb-b {
    0%   { transform: translate3d(0, 0, 0) scale(1); opacity: .30; }
    100% { transform: translate3d(6vmax, -6vmax, 0) scale(1.1); opacity: .50; }
}

a { color: var(--accent-hi); text-decoration: none; transition: color var(--dur-fast) var(--ease); }
a:hover { color: var(--red-hi); }

/* ========== Header / Nav ========== */
header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: linear-gradient(180deg, rgba(10, 12, 16, 0.88), rgba(10, 12, 16, 0.72));
    backdrop-filter: blur(16px) saturate(140%);
    -webkit-backdrop-filter: blur(16px) saturate(140%);
    border-bottom: 1px solid var(--border);
    padding: 14px 28px;
    display: flex;
    align-items: center;
    gap: 28px;
}
header::after {
    content: '';
    position: absolute;
    left: 0; right: 0; bottom: -1px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--red) 30%, var(--accent) 70%, transparent);
    opacity: .45;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    font-size: 17px;
    letter-spacing: -0.01em;
    color: var(--text);
    white-space: nowrap;
}
.brand .brand-mark {
    display: inline-grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--accent) 0%, var(--red) 100%);
    color: #fff;
    font-weight: 900;
    font-size: 13px;
    letter-spacing: 0;
    box-shadow: 0 6px 18px -6px var(--red-glow), 0 6px 18px -6px var(--accent-glow);
}
.brand:hover { color: var(--text); }

header nav {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    flex: 1;
}
header nav a {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text-2);
    font-size: 14px;
    font-weight: 500;
    padding: 8px 12px;
    border-radius: 8px;
    transition: color var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease);
}
header nav a:hover {
    color: var(--text);
    background: var(--panel-2);
}
header nav a.active {
    color: var(--text);
    background: var(--panel-2);
}
header nav a.active::after {
    content: '';
    position: absolute;
    left: 12px; right: 12px; bottom: 2px;
    height: 2px;
    background: linear-gradient(90deg, var(--accent), var(--red));
    border-radius: 2px;
}
header nav a svg {
    width: 16px; height: 16px;
    stroke-width: 2;
    opacity: .85;
}

.user-name {
    margin-left: auto;
    color: var(--muted);
    font-size: 13px;
    padding: 6px 12px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--panel);
}

/* ========== Main ========== */
main {
    position: relative;
    z-index: 1;
    max-width: 1100px;
    margin: 0 auto;
    padding: 44px 28px 100px;
    animation: page-in var(--dur-slow) var(--ease) both;
}
@keyframes page-in {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

h1 {
    font-size: clamp(28px, 3.2vw, 38px);
    line-height: 1.15;
    letter-spacing: -0.02em;
    margin: 0 0 20px;
    font-weight: 800;
}
h2 {
    font-size: 22px;
    letter-spacing: -0.01em;
    margin: 28px 0 14px;
    font-weight: 700;
}
h3 {
    font-size: 16px;
    margin: 16px 0 10px;
    font-weight: 700;
    letter-spacing: -0.005em;
}

.muted { color: var(--muted); font-size: 14px; }
.note { color: var(--accent-hi); margin: 4px 0 12px; }
.error { color: var(--red-hi); margin: 8px 0; }
.success { color: var(--ok); margin: 8px 0; }

.kicker {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--accent-hi);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    margin-bottom: 14px;
}
.kicker::before {
    content: '';
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--red);
    box-shadow: 0 0 12px var(--red-glow);
    animation: pulse 2.4s var(--ease) infinite;
}
@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50%      { transform: scale(1.35); opacity: .5; }
}

/* ========== Panel / Cards ========== */
.panel {
    position: relative;
    background: linear-gradient(180deg, var(--panel) 0%, var(--bg-2) 120%);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: 22px 26px;
    margin: 18px 0;
    box-shadow: var(--shadow-1);
    transition: border-color var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.panel:hover {
    border-color: var(--border-2);
}

.grid {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 10px 24px;
}
.grid dt { color: var(--muted); font-size: 14px; }
.grid dd { margin: 0; font-weight: 500; }

/* ========== Buttons ========== */
.btn, button, input[type=submit] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: linear-gradient(180deg, var(--accent) 0%, var(--accent-lo) 140%);
    color: #fff;
    border: 1px solid transparent;
    border-radius: 10px;
    padding: 11px 20px;
    font: inherit;
    font-weight: 600;
    letter-spacing: -0.005em;
    cursor: pointer;
    position: relative;
    transition: transform var(--dur-fast) var(--ease), box-shadow var(--dur) var(--ease), background var(--dur) var(--ease), filter var(--dur-fast) var(--ease);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.08) inset, 0 6px 18px -6px var(--accent-glow);
    text-decoration: none;
}
.btn:hover, button:hover, input[type=submit]:hover {
    transform: translateY(-1px);
    filter: brightness(1.06);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.1) inset, 0 0 0 1px rgba(239, 68, 68, 0.35), 0 10px 28px -6px var(--red-glow);
    text-decoration: none;
}
.btn:active, button:active { transform: translateY(0); }
.btn.secondary {
    background: var(--panel-2);
    color: var(--text);
    border: 1px solid var(--border);
    box-shadow: none;
}
.btn.secondary:hover {
    background: var(--panel-3);
    border-color: var(--red);
    box-shadow: 0 0 0 1px var(--red-glow);
}
.btn.danger {
    background: linear-gradient(180deg, var(--red) 0%, var(--red-lo) 140%);
    color: #fff;
    box-shadow: 0 6px 18px -6px var(--red-glow);
}

/* ========== Inputs ========== */
input[type=text], input[type=number], select {
    background: var(--bg-2);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 11px 14px;
    border-radius: 10px;
    font: inherit;
    min-width: 240px;
    transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease), background var(--dur) var(--ease);
}
input:focus, select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
    background: var(--panel);
}

form p { margin: 12px 0; }
label { display: inline-block; color: var(--text-2); font-size: 14px; margin-bottom: 6px; }

/* ========== Tabs (week stepper + section tabs) ========== */
.tabs {
    display: flex;
    gap: 6px;
    margin: 0 0 20px;
    flex-wrap: wrap;
    padding: 6px;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 12px;
    width: fit-content;
    max-width: 100%;
}
.tabs a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 16px;
    background: transparent;
    color: var(--text-2);
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}
.tabs a:hover { background: var(--panel-2); color: var(--text); }
.tabs a.active {
    background: linear-gradient(180deg, var(--accent) 0%, var(--accent-lo) 140%);
    color: #fff;
    box-shadow: 0 4px 12px -4px var(--accent-glow);
}

/* Week stepper — numbered */
.week-stepper {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin: 0 0 24px;
}
.week-stepper a {
    position: relative;
    display: grid;
    place-items: center;
    min-width: 54px;
    height: 54px;
    padding: 0 16px;
    background: var(--panel);
    color: var(--text-2);
    border: 1px solid var(--border);
    border-radius: 12px;
    font-weight: 700;
    font-size: 14px;
    letter-spacing: -0.01em;
    transition: all var(--dur) var(--ease);
}
.week-stepper a .w-num { font-size: 16px; }
.week-stepper a .w-lbl {
    position: absolute;
    top: -8px; right: -8px;
    background: var(--red);
    color: #fff;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0.08em;
    padding: 2px 6px;
    border-radius: 999px;
    box-shadow: 0 2px 8px -2px var(--red-glow);
}
.week-stepper a:hover {
    border-color: var(--accent);
    color: var(--text);
    transform: translateY(-1px);
}
.week-stepper a.active {
    background: linear-gradient(180deg, var(--accent) 0%, var(--accent-lo) 140%);
    color: #fff;
    border-color: var(--accent);
    box-shadow: 0 10px 26px -8px var(--accent-glow), 0 0 0 1px rgba(239, 68, 68, 0.3);
}
.week-stepper a.done {
    border-color: var(--border-2);
    color: var(--muted);
}
.week-stepper a.done::after {
    content: '';
    position: absolute;
    bottom: 6px; left: 50%;
    width: 14px; height: 2px;
    transform: translateX(-50%);
    background: var(--ok);
    border-radius: 2px;
}

/* ========== Session card ========== */
.session {
    position: relative;
    background: linear-gradient(180deg, var(--panel) 0%, var(--bg-2) 130%);
    border: 1px solid var(--border);
    border-left: 3px solid var(--accent);
    border-radius: var(--r-lg);
    padding: 20px 24px;
    margin: 14px 0;
    box-shadow: var(--shadow-1);
    transition: transform var(--dur) var(--ease), border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.session:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-2);
}
.session h3 {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin: 0 0 10px;
    font-size: 17px;
}

/* Intensity badge — colored by session type */
.session .intensity {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding: 4px 10px;
    border-radius: 999px;
    border: 1px solid currentColor;
}
.session .intensity::before {
    content: '';
    width: 6px; height: 6px;
    border-radius: 50%;
    background: currentColor;
    box-shadow: 0 0 8px currentColor;
}

/* Types */
.session.type-light  { border-left-color: var(--light); }
.session.type-medium { border-left-color: var(--medium); }
.session.type-heavy  { border-left-color: var(--heavy); box-shadow: 0 0 0 1px rgba(239, 68, 68, 0.14), var(--shadow-1); }

.session.type-light  .intensity { color: var(--light); background: var(--light-bg); }
.session.type-medium .intensity { color: var(--medium); background: var(--medium-bg); }
.session.type-heavy  .intensity { color: var(--heavy); background: var(--heavy-bg); }

.exercises {
    list-style: none;
    padding: 0;
    margin: 10px 0 0;
}
.exercises li {
    padding: 12px 0;
    border-bottom: 1px dashed var(--border);
    font-size: 14.5px;
    color: var(--text-2);
    transition: color var(--dur-fast) var(--ease), padding var(--dur-fast) var(--ease);
}
.exercises li:hover { color: var(--text); padding-left: 6px; }
.exercises li:last-child { border-bottom: none; }
.exercises li strong { color: var(--text); font-weight: 700; }

.week-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}
.week-head h2 { margin: 0; }

/* ========== Choice cards (goal, schedule) ========== */
.choices {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 12px;
    margin-top: 16px;
}
.btn.choice {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    text-align: left;
    padding: 18px 20px;
    background: var(--panel-2);
    color: var(--text);
    border: 1px solid var(--border);
    font-weight: 600;
    font-size: 15px;
    letter-spacing: -0.005em;
    box-shadow: none;
    line-height: 1.35;
    min-height: 70px;
    white-space: normal;
    transition: all var(--dur) var(--ease);
}
.btn.choice:hover {
    border-color: var(--accent);
    background: var(--panel-3);
    transform: translateY(-2px);
    box-shadow: 0 10px 24px -10px var(--accent-glow), 0 0 0 1px rgba(239, 68, 68, 0.22);
    filter: none;
}
.btn.choice .ico {
    display: inline-grid;
    place-items: center;
    width: 36px; height: 36px;
    min-width: 36px;
    border-radius: 10px;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(239, 68, 68, 0.2));
    border: 1px solid var(--border);
    font-size: 18px;
    transition: transform var(--dur) var(--ease);
}
.btn.choice:hover .ico { transform: scale(1.08) rotate(-4deg); }

/* ========== Progress indicator (anketa steps) ========== */
.steps {
    display: flex;
    gap: 6px;
    margin: 4px 0 24px;
    align-items: center;
}
.steps .dot {
    flex: 1;
    height: 4px;
    border-radius: 4px;
    background: var(--border);
    transition: background var(--dur) var(--ease);
}
.steps .dot.done { background: linear-gradient(90deg, var(--accent), var(--accent-hi)); }
.steps .dot.active {
    background: linear-gradient(90deg, var(--accent), var(--red));
    box-shadow: 0 0 10px var(--accent-glow);
}
.steps-label {
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 8px;
}

/* ========== Hero (home) ========== */
.hero {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(320px, 460px);
    gap: 48px;
    align-items: center;
    padding: 30px 0 50px;
    overflow: visible;
}
.hero-title {
    font-size: clamp(32px, 4.2vw, 50px);
    line-height: 1.08;
    font-weight: 800;
    letter-spacing: -0.035em;
    margin: 0 0 18px;
}
.hero-title .accent {
    background: linear-gradient(90deg, var(--accent-hi), var(--red-hi));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.hero-sub {
    color: var(--text-2);
    font-size: 17px;
    max-width: 52ch;
    margin: 0 0 28px;
    line-height: 1.55;
}
.hero-cta {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}
.hero-cta .btn {
    padding: 14px 26px;
    font-size: 15px;
}

/* Right-side visual — silhouette + orbital rings */
.hero-visual {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    max-width: 460px;
    margin-left: auto;
    justify-self: end;
}
.hero-visual svg { width: 100%; height: 100%; display: block; }
.hero-visual .orbit {
    position: absolute;
    inset: 0;
    animation: orbit-rot 40s linear infinite;
}
.hero-visual .orbit-r {
    position: absolute;
    inset: 0;
    animation: orbit-rot 60s linear infinite reverse;
}
@keyframes orbit-rot {
    to { transform: rotate(360deg); }
}
.hero-visual .chip {
    position: absolute;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 10px 14px;
    font-size: 12px;
    color: var(--text-2);
    box-shadow: var(--shadow-2);
    backdrop-filter: blur(10px);
}
.hero-visual .chip strong { color: var(--text); font-size: 15px; font-weight: 700; display: block; }
.hero-visual .chip.a { top: 14%; left: -6%; border-color: var(--red-lo); }
.hero-visual .chip.a strong { color: var(--red-hi); }
.hero-visual .chip.b { bottom: 14%; right: -6%; border-color: var(--accent-lo); }
.hero-visual .chip.b strong { color: var(--accent-hi); }

/* Hero background streaks */
.hero::before {
    content: '';
    position: absolute;
    top: -20%; left: -10%;
    width: 50%; height: 140%;
    background: radial-gradient(ellipse at center, var(--red-glow), transparent 60%);
    filter: blur(50px);
    opacity: .5;
    pointer-events: none;
    z-index: -1;
    animation: hero-glow 9s var(--ease) infinite alternate;
}
@keyframes hero-glow {
    from { opacity: .35; transform: scale(1); }
    to   { opacity: .55; transform: scale(1.08); }
}

/* Feature grid on home */
.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 14px;
    margin-top: 28px;
}
.feature {
    display: block;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: 20px 22px;
    transition: all var(--dur) var(--ease);
    color: var(--text);
}
.feature:hover {
    transform: translateY(-3px);
    border-color: var(--accent);
    box-shadow: 0 18px 36px -20px var(--accent-glow);
    text-decoration: none;
}
.feature .feature-ico {
    display: inline-grid;
    place-items: center;
    width: 38px; height: 38px;
    border-radius: 10px;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.25), rgba(239, 68, 68, 0.25));
    border: 1px solid var(--border);
    font-size: 18px;
    margin-bottom: 12px;
    transition: transform var(--dur) var(--ease);
}
.feature:hover .feature-ico { transform: scale(1.08) rotate(-5deg); }
.feature h3 { margin: 0 0 6px; color: var(--text); }
.feature p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.5; }

/* Section heading with red dot */
.section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 36px 0 14px;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--muted);
}
.section-title::before {
    content: '';
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--red);
    box-shadow: 0 0 12px var(--red-glow);
}
.section-title::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, var(--border), transparent);
}

/* ========== Progress bar ========== */
.progress-bar {
    position: relative;
    width: 100%;
    height: 8px;
    background: var(--panel-2);
    border-radius: 999px;
    overflow: hidden;
    margin: 12px 0 6px;
}
.progress-bar > i {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, var(--accent), var(--red));
    border-radius: 999px;
    box-shadow: 0 0 12px var(--accent-glow);
    width: var(--p, 0%);
    animation: bar-grow var(--dur-slow) var(--ease) both;
}
@keyframes bar-grow { from { width: 0; } }

.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    background: var(--panel-2);
    border: 1px solid var(--border);
    color: var(--text-2);
}
.badge.accent { color: var(--accent-hi); border-color: var(--accent-lo); background: rgba(59, 130, 246, 0.1); }
.badge.red { color: var(--red-hi); border-color: var(--red-lo); background: rgba(239, 68, 68, 0.1); }
.badge.ok { color: var(--ok); border-color: rgba(34, 197, 94, 0.4); background: rgba(34, 197, 94, 0.1); }

/* ========== Blocks & misc ========== */
pre.block {
    background: var(--panel-2);
    border: 1px solid var(--border);
    border-left: 3px solid var(--accent);
    border-radius: var(--r);
    padding: 18px 22px;
    white-space: pre-wrap;
    font: 14px/1.65 'JetBrains Mono', 'Consolas', 'Menlo', monospace;
    color: var(--text-2);
}

.intro {
    background: linear-gradient(180deg, rgba(59, 130, 246, 0.08), rgba(239, 68, 68, 0.04));
    border: 1px solid var(--border);
    border-left: 3px solid var(--red);
    padding: 16px 22px;
    border-radius: var(--r);
    margin: 0 0 24px;
    white-space: pre-wrap;
    color: var(--text-2);
    line-height: 1.55;
}

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--border); }
th { color: var(--muted); font-weight: 700; font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; }
tbody tr { transition: background var(--dur-fast) var(--ease); }
tbody tr:hover { background: var(--panel-2); }

.error-box {
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid var(--red);
    border-radius: var(--r);
    padding: 14px 18px;
    margin: 14px 0;
    color: var(--text);
    font-size: 14.5px;
}

/* ========== 1RM calc result ========== */
#result {
    margin-top: 16px;
    padding: 16px 20px;
    background: linear-gradient(180deg, rgba(59, 130, 246, 0.1), rgba(239, 68, 68, 0.06));
    border: 1px solid var(--border);
    border-left: 3px solid var(--accent);
    border-radius: var(--r);
    color: var(--text);
    font-size: 16px;
    animation: page-in var(--dur) var(--ease) both;
}

/* ========== Responsive ========== */
@media (max-width: 860px) {
    /* Шапка в две полосы: бренд сверху, навигация одной строкой снизу. */
    header {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        padding: 10px 14px 8px;
    }
    .brand { align-self: flex-start; }
    header nav {
        gap: 4px;
        flex-wrap: nowrap;
        overflow-x: auto;
        scrollbar-width: none;
        -ms-overflow-style: none;
        padding-bottom: 2px;
        margin: 0 -14px;
        padding-left: 14px;
        padding-right: 14px;
        scroll-snap-type: x proximity;
    }
    header nav::-webkit-scrollbar { display: none; }
    header nav a {
        flex-shrink: 0;
        padding: 8px 12px;
        font-size: 13px;
        scroll-snap-align: start;
    }
    header nav a svg { display: none; }
    .user-name { margin-left: 0; }
    main { padding: 28px 18px 80px; }
    .hero { grid-template-columns: 1fr; padding: 20px 0 40px; }
    .hero-visual { max-width: 320px; margin: 0 auto; }
    .grid { grid-template-columns: 1fr; gap: 4px 0; }
    .grid dt { margin-top: 10px; }
}
@media (max-width: 520px) {
    .hero-title { font-size: 32px; }
    .panel { padding: 18px 18px; }
    .week-stepper a { min-width: 44px; height: 44px; padding: 0 10px; }
}

/* ========== One-page flow sections ========== */
.flow-section {
    position: relative;
    padding: 90px 0 40px;
    scroll-margin-top: 90px;
}
.flow-section + .flow-section { padding-top: 70px; }

/* Soft gradient divider line between sections (blue → red fade) */
.flow-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: min(70%, 620px);
    height: 1px;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(59, 130, 246, 0.0) 10%,
        rgba(59, 130, 246, 0.55) 40%,
        rgba(239, 68, 68, 0.55) 60%,
        rgba(239, 68, 68, 0.0) 90%,
        transparent 100%);
    opacity: 0.5;
}
/* Hero doesn't need a top divider */
.hero.reveal::before, .hero::before { /* preserve any existing .hero::before (the halo) */ }

.flow-head { margin-bottom: 28px; }
.flow-head h2 {
    font-size: clamp(28px, 4vw, 38px);
    line-height: 1.1;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin: 10px 0 10px;
}
.flow-head .kicker { margin-bottom: 0; }

/* Sub-panel — used for article-style blocks inside a section */
.sub-panel {
    background: linear-gradient(180deg, var(--panel) 0%, var(--panel-2) 100%);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: 24px 26px;
    margin-top: 16px;
    position: relative;
    transition: border-color var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.sub-panel:hover { border-color: var(--border-2); }
.sub-panel h3 {
    margin: 0 0 12px;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--text);
}
.sub-panel p {
    margin: 0 0 12px;
    color: var(--text-2);
    font-size: 14.5px;
    line-height: 1.7;
}
.sub-panel p:last-child { margin-bottom: 0; }
.sub-panel p strong { color: var(--text); font-weight: 700; }
.sub-panel ul {
    margin: 0;
    padding-left: 20px;
    color: var(--text-2);
}
.sub-panel ul li { margin: 6px 0; }
.sub-panel a { color: var(--accent-hi); text-decoration: none; border-bottom: 1px dashed rgba(96, 165, 250, 0.4); }
.sub-panel a:hover { border-bottom-color: var(--accent-hi); }
.sub-panel code { background: var(--panel-3); padding: 1px 6px; border-radius: 6px; font-size: 13px; color: var(--accent-hi); }

/* ========== Scroll reveal ========== */
.reveal {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 900ms var(--ease), transform 900ms var(--ease);
    will-change: opacity, transform;
}
.reveal.is-visible {
    opacity: 1;
    transform: none;
}
/* Staggered sub-panel reveal within a visible section */
.reveal.is-visible .sub-panel {
    animation: sub-fade-in 700ms var(--ease) both;
}
.reveal.is-visible .sub-panel:nth-child(2) { animation-delay: 80ms; }
.reveal.is-visible .sub-panel:nth-child(3) { animation-delay: 160ms; }
.reveal.is-visible .sub-panel:nth-child(4) { animation-delay: 240ms; }
.reveal.is-visible .sub-panel:nth-child(5) { animation-delay: 320ms; }
.reveal.is-visible .sub-panel:nth-child(6) { animation-delay: 400ms; }

@keyframes sub-fade-in {
    from { opacity: 0; transform: translateY(18px); }
    to   { opacity: 1; transform: none; }
}

/* ========== Athlete — interactive pull-up ========== */
.hero-visual .athlete {
    cursor: grab;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    outline: none;
    touch-action: none;
}
.hero-visual .athlete:focus-visible { filter: drop-shadow(0 0 12px rgba(59, 130, 246, 0.45)); }
.hero-visual .athlete[data-state="pulling"],
.hero-visual .athlete[data-state="holding"] { cursor: grabbing; }

.athlete .swing,
.athlete .forearm-l,
.athlete .forearm-r,
.athlete .bicep-l,
.athlete .bicep-r,
.athlete .body,
.athlete .leg-l,
.athlete .leg-r {
    transform-box: view-box;
}

.athlete .forearm-l { transform-origin: 159px 82px; transition: transform 2.5s linear; will-change: transform; }
.athlete .forearm-r { transform-origin: 241px 82px; transition: transform 2.5s linear; will-change: transform; }
.athlete .bicep-l   { transform-origin: 167.5px 172px; transition: transform 2.5s linear; will-change: transform; }
.athlete .bicep-r   { transform-origin: 232.5px 172px; transition: transform 2.5s linear; will-change: transform; }
.athlete .body {
    transform-origin: 200px 82px;
    transition: transform 2.5s linear;
    will-change: transform;
}
.athlete .leg-l {
    transform-origin: 196px 292px;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.athlete .leg-r {
    transform-origin: 204px 292px;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.athlete .leg-gap {
    transition: opacity 0.3s;
}
.athlete .swing {
    transform-origin: 200px 80px;
    /* Постоянное лёгкое раскачивание. JS перехватит и уведёт в центр на hover/pull. */
    animation: athlete-dangle 3.2s ease-in-out infinite;
    /* transition вступит в силу, когда JS поставит inline-transform — для плавного увода в 0°. */
    transition: transform 0.45s ease-out;
}

/* Idle — straight arms, rest, legs spread with slight outward angle */
.athlete[data-state="idle"] .forearm-l,
.athlete[data-state="idle"] .forearm-r,
.athlete[data-state="idle"] .bicep-l,
.athlete[data-state="idle"] .bicep-r,
.athlete[data-state="idle"] .body { transform: none; }
.athlete[data-state="idle"] .leg-l { transform: rotate(3deg); }
.athlete[data-state="idle"] .leg-r { transform: rotate(-3deg); }

/* Hover — straight arms, legs together (parallel), body hanging */
.athlete[data-state="hover"] .forearm-l,
.athlete[data-state="hover"] .forearm-r,
.athlete[data-state="hover"] .bicep-l,
.athlete[data-state="hover"] .bicep-r,
.athlete[data-state="hover"] .body { transform: none; }
.athlete[data-state="hover"] .leg-l { transform: translateX(8px) scaleX(1.3); }
.athlete[data-state="hover"] .leg-r { transform: translateX(-8px) scaleX(1.3); }
.athlete[data-state="hover"] .leg-gap { opacity: 0.7; }

/* Pulling — forearms swing outward, biceps rotate to meet, body lifts up to clear bar */
.athlete[data-state="pulling"] .forearm-l { transform: rotate(52deg); }
.athlete[data-state="pulling"] .forearm-r { transform: rotate(-52deg); }
.athlete[data-state="pulling"] .bicep-l   { transform: rotate(-100deg); }
.athlete[data-state="pulling"] .bicep-r   { transform: rotate(100deg); }
.athlete[data-state="pulling"] .body { transform: translateY(-75px); }
.athlete[data-state="pulling"] .leg-l { transform: translateX(8px) scaleX(1.3); transition-duration: 0.3s; }
.athlete[data-state="pulling"] .leg-r { transform: translateX(-8px) scaleX(1.3); transition-duration: 0.3s; }
.athlete[data-state="pulling"] .leg-gap { opacity: 0.7; }

/* Holding — locked at top */
.athlete[data-state="holding"] .forearm-l { transform: rotate(52deg); transition: none; }
.athlete[data-state="holding"] .forearm-r { transform: rotate(-52deg); transition: none; }
.athlete[data-state="holding"] .bicep-l   { transform: rotate(-100deg); transition: none; }
.athlete[data-state="holding"] .bicep-r   { transform: rotate(100deg); transition: none; }
.athlete[data-state="holding"] .body { transform: translateY(-75px); transition: none; }
.athlete[data-state="holding"] .leg-l { transform: translateX(8px) scaleX(1.3); }
.athlete[data-state="holding"] .leg-r { transform: translateX(-8px) scaleX(1.3); }
.athlete[data-state="holding"] .leg-gap { opacity: 0.7; }

/* Plopping — quick straighten, body squish */
.athlete[data-state="plopping"] .forearm-l,
.athlete[data-state="plopping"] .forearm-r,
.athlete[data-state="plopping"] .bicep-l,
.athlete[data-state="plopping"] .bicep-r {
    transform: none;
    transition: transform 0.3s cubic-bezier(0.5, 0, 0.75, 0);
}
.athlete[data-state="plopping"] .body {
    transform: translateY(14px) scaleY(0.9);
    transition: transform 0.3s cubic-bezier(0.5, 0, 0.75, 0);
}
.athlete[data-state="plopping"] .leg-l {
    transform: translateX(-3px) rotate(-4deg);
    transition-duration: 0.3s;
}
.athlete[data-state="plopping"] .leg-r {
    transform: translateX(3px) rotate(4deg);
    transition-duration: 0.3s;
}

/* Settling — bouncy return to straight */
.athlete[data-state="settling"] .forearm-l,
.athlete[data-state="settling"] .forearm-r,
.athlete[data-state="settling"] .bicep-l,
.athlete[data-state="settling"] .bicep-r,
.athlete[data-state="settling"] .body {
    transform: none;
    transition: transform 0.42s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.athlete[data-state="settling"] .leg-l { transform: rotate(3deg); transition-duration: 0.42s; }
.athlete[data-state="settling"] .leg-r { transform: rotate(-3deg); transition-duration: 0.42s; }

/* Dangling — continuous sway, straight arms, legs spread with slight outward angle */
.athlete[data-state="dangling"] .forearm-l,
.athlete[data-state="dangling"] .forearm-r,
.athlete[data-state="dangling"] .bicep-l,
.athlete[data-state="dangling"] .bicep-r { transform: none; transition: transform 0.5s; }
.athlete[data-state="dangling"] .body { transform: none; transition: transform 0.5s; }
.athlete[data-state="dangling"] .leg-l { transform: rotate(3deg); }
.athlete[data-state="dangling"] .leg-r { transform: rotate(-3deg); }
@keyframes athlete-dangle {
    0%, 100% { transform: rotate(0deg); }
    25%      { transform: rotate(-2.5deg); }
    75%      { transform: rotate(2.5deg); }
}

/* ========== Reduced motion ========== */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
    }
    html { scroll-behavior: auto; }
    .reveal { opacity: 1; transform: none; }
    .athlete .forearm-l, .athlete .forearm-r, .athlete .bicep-l, .athlete .bicep-r, .athlete .body, .athlete .leg-l, .athlete .leg-r { transition: none !important; }
    .athlete .swing { animation: none !important; }
}
