/* The exercise library (exercises/, tr/exercises/): pages generated by
   scripts/build-exercise-pages.py. The homepage's tokens, nav and dark hero
   card, so the library reads as the same site. */

* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --bg-primary: #F4F5F9;
    --bg-card: #FFFFFF;
    --bg-elevated: #E9ECF4;
    --border: #E1E4ED;
    --text-primary: #1B1C28;
    --text-secondary: #5B6178;
    --text-tertiary: #6A7086;
    --accent-purple: #5B6AC0;
    --accent-blue: #2F7BD1;
    --accent-green: #1A874D;
    --shadow-sm: 0 1px 2px rgba(27, 28, 40, 0.05);
    --shadow-md: 0 4px 16px rgba(27, 28, 40, 0.07);
    /* The hero: the homepage's dark card, and the map's own tones on it (the
       app's dark volume ramp). */
    --hero-bg: #0E1020;
    --hero-text: #F5F1EA;
    --hero-muted: rgba(236, 237, 242, 0.74);
    --hero-faint: rgba(236, 237, 242, 0.5);
    --glass: rgba(255, 255, 255, 0.08);
    --glass-border: rgba(255, 255, 255, 0.14);
    --primary-muscle: #E77C67;
    --secondary-muscle: #7D8BCF;
    --ember: linear-gradient(95deg, #FFB27A 0%, #FF7A4D 55%, #F25F5C 100%);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Rounded', 'SF Pro Display', system-ui, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    background:
        radial-gradient(circle at 20% 20%, rgba(91, 106, 192, 0.06) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(26, 135, 77, 0.05) 0%, transparent 50%);
    pointer-events: none;
    z-index: -1;
}

.container { max-width: 1100px; margin: 0 auto; padding: 0 24px; }
.narrow { max-width: 780px; }
a { color: var(--accent-blue); }

/* ── Navigation (the homepage's) ── */

.site-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    padding: 8px 0;
    background: rgba(244, 245, 249, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(225, 228, 237, 0.9);
}

.site-nav .container { display: flex; align-items: center; justify-content: space-between; }

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.5px;
    text-decoration: none;
}

.logo img { width: 44px; height: 44px; border-radius: 11px; }
.logo-kas { color: var(--text-primary); }

.logo-maker {
    background: linear-gradient(135deg, var(--accent-purple), var(--accent-blue));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-links { display: flex; align-items: center; gap: 20px; }

.nav-links > a:not(.nav-cta) {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: color 0.2s;
}

.nav-links > a:not(.nav-cta):hover, .nav-links > a[aria-current="page"] { color: var(--text-primary); }

/* EN | TR. Each language is its own page, so the switch is two links;
   the current one is filled. */
.lang-toggle {
    display: inline-flex;
    gap: 2px;
    padding: 2px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.lang-toggle a {
    padding: 4px 8px;
    border-radius: 6px;
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.2s, background 0.2s;
}

.lang-toggle a:hover { color: var(--text-primary); }
.lang-toggle a[aria-current="page"] { background: var(--bg-elevated); color: var(--text-primary); }

.nav-cta { display: inline-flex; align-items: center; transition: transform 0.2s, opacity 0.2s; }
.nav-cta:hover { transform: translateY(-1px); opacity: 0.9; }
.nav-cta img { height: 40px; }

main { padding-top: 92px; }

/* ── Hero: the dark card, with the app's map beside the answer ── */

.hero-card {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
    grid-template-areas: "head map" "facts map";
    grid-template-rows: auto 1fr;
    column-gap: 40px;
    padding: 48px 52px;
    border-radius: 28px;
    color: var(--hero-text);
    background:
        radial-gradient(ellipse at 76% 45%, rgba(92, 107, 192, 0.26) 0%, transparent 58%),
        var(--hero-bg);
    box-shadow: 0 24px 60px rgba(14, 16, 32, 0.22);
}

.hero-head { grid-area: head; }
.hero-map { grid-area: map; align-self: center; }
.hero-facts { grid-area: facts; }

.breadcrumb ol {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    font-size: 13px;
    font-weight: 500;
    color: var(--hero-faint);
    margin-bottom: 16px;
}

.breadcrumb li:not(:last-child)::after { content: "›"; margin-left: 6px; }
.breadcrumb a { color: var(--hero-muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--hero-text); }

.hero-card h1 {
    font-size: clamp(32px, 4.2vw, 50px);
    font-weight: 800;
    letter-spacing: -1.2px;
    line-height: 1.06;
    margin-bottom: 20px;
}

.ember {
    display: block;
    background: var(--ember);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.answer { font-size: 17px; line-height: 1.65; color: var(--hero-muted); }
.answer + .answer { margin-top: 12px; }

.hero-map img, .hero-map svg { display: block; width: 100%; max-width: 440px; height: auto; margin: 0 auto; }

.map-sides {
    display: flex;
    justify-content: space-around;
    max-width: 440px;
    margin: 8px auto 0;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: var(--hero-faint);
}

.legend { display: grid; gap: 10px; margin-top: 28px; }
.legend > div { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }

.legend .key {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 108px;
    font-size: 13px;
    font-weight: 600;
    color: var(--hero-muted);
}

.legend .key::before { content: ""; width: 11px; height: 11px; border-radius: 4px; background: var(--swatch); }
.legend .plain::before { display: none; }
.legend .primary { --swatch: var(--primary-muscle); }
.legend .secondary { --swatch: var(--secondary-muscle); }
.legend .note { font-size: 13px; color: var(--hero-faint); }

.glass-chip {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 999px;
    background: var(--glass);
    border: 1px solid var(--glass-border);
    color: var(--hero-text);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.2s;
}

a.glass-chip:hover { background: rgba(255, 255, 255, 0.16); }

.specs {
    display: grid;
    grid-template-columns: repeat(4, auto);
    justify-content: start;
    gap: 18px 32px;
    margin-top: 28px;
    padding-top: 22px;
    border-top: 1px solid var(--glass-border);
}

.specs dt {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--hero-faint);
}

.specs dd { font-size: 15px; font-weight: 600; margin-top: 2px; }
.specs .stat dd { font-size: 26px; font-weight: 800; letter-spacing: -0.5px; }
.specs .stat dd.note { font-size: 13px; font-weight: 400; letter-spacing: 0; line-height: 1.5; color: var(--hero-faint); margin-top: 4px; max-width: 250px; }
.specs.stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.map-hint { text-align: center; font-size: 13px; color: var(--hero-faint); margin-top: 12px; }

/* The library's map: every muscle is a link to its list. */
.library-map a .zone { fill: #2A3358; transition: fill 0.15s; }
.library-map a:hover .zone, .library-map a:focus .zone, .library-map a.on .zone { fill: var(--primary-muscle); }
.library-map a:focus { outline: none; }

/* ── Content below the hero ── */

.block { margin-top: 56px; }

.block h2 {
    font-size: clamp(24px, 3vw, 30px);
    font-weight: 800;
    letter-spacing: -0.6px;
    line-height: 1.2;
    margin-bottom: 18px;
}

.block h2 a { color: inherit; text-decoration: none; }
.block h2 a:hover { color: var(--accent-blue); }

.lead { font-size: 17px; line-height: 1.75; color: var(--text-secondary); margin-bottom: 14px; }
.anatomy { font-size: 14px; color: var(--text-tertiary); }
.anatomy strong { color: var(--text-primary); }

.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 20px;
    box-shadow: var(--shadow-sm);
}

/* The exercise photo: one rep, start and finish side by side, labelled on the
   picture itself. */
.photo {
    position: relative;
    margin-bottom: 16px;
    border-radius: 20px;
    overflow: hidden;
    background: var(--hero-bg);
    box-shadow: var(--shadow-md);
}

.photo img { display: block; width: 100%; height: auto; }

.photo figcaption {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 14px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    padding: 0 14px;
    pointer-events: none;
}

.photo figcaption span {
    justify-self: start;
    padding: 4px 11px;
    border-radius: 999px;
    background: rgba(14, 16, 32, 0.55);
    border: 1px solid var(--glass-border);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    color: var(--hero-text);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.6px;
    text-transform: uppercase;
}

.steps { list-style: none; counter-reset: step; padding: 8px 28px; }

.steps li {
    counter-increment: step;
    display: grid;
    grid-template-columns: 34px 1fr;
    gap: 14px;
    padding: 18px 0;
    font-size: 16px;
    line-height: 1.7;
    color: var(--text-secondary);
}

.steps li + li { border-top: 1px solid var(--border); }

.steps li::before {
    content: counter(step);
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: rgba(91, 106, 192, 0.12);
    color: var(--accent-purple);
    font-size: 15px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tips { list-style: none; padding: 22px 28px; display: grid; gap: 14px; }

.tips li {
    display: grid;
    grid-template-columns: 24px 1fr;
    gap: 12px;
    font-size: 16px;
    line-height: 1.7;
    color: var(--text-secondary);
}

.tips li::before {
    content: "✓";
    width: 24px;
    height: 24px;
    margin-top: 2px;
    border-radius: 50%;
    background: rgba(26, 135, 77, 0.12);
    color: var(--accent-green);
    font-size: 13px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pick { padding: 22px 26px; }
.pick + .pick { margin-top: 12px; }

.rank {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    background: rgba(91, 106, 192, 0.12);
    color: var(--accent-purple);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.3px;
    margin-bottom: 8px;
}

.pick h3 { font-size: 17px; font-weight: 700; letter-spacing: -0.2px; }
.pick h3 a { color: var(--text-primary); text-decoration: none; }
.pick h3 a:hover { color: var(--accent-blue); }
.pick .meta { font-size: 13px; color: var(--text-tertiary); margin-top: 2px; }
.pick p { font-size: 15px; line-height: 1.7; color: var(--text-secondary); margin-top: 8px; }

/* A hub's ranked list: the rank as a big numeral beside each pick. */
.ranked { list-style: none; counter-reset: pick; }
.ranked .pick { counter-increment: pick; display: grid; grid-template-columns: 44px 1fr; gap: 16px; }

.ranked .pick::before {
    content: counter(pick);
    font-size: 30px;
    font-weight: 800;
    letter-spacing: -1px;
    line-height: 1;
    color: var(--accent-purple);
    opacity: 0.85;
    padding-top: 2px;
}

/* A ranked pick with a photo: the photo small on the right. */
.ranked .pick.has-thumb { grid-template-columns: 44px 1fr 168px; }
.pick .thumb { align-self: start; display: block; border-radius: 12px; overflow: hidden; background: var(--hero-bg); }
.pick .thumb img { display: block; width: 100%; height: auto; }

.related {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px;
    list-style: none;
}

.related a {
    display: block;
    height: 100%;
    padding: 16px 18px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: var(--shadow-sm);
    color: var(--text-primary);
    font-size: 15px;
    font-weight: 700;
    line-height: 1.35;
    text-decoration: none;
    transition: border-color 0.3s, transform 0.3s, box-shadow 0.3s;
}

.related a:hover { border-color: rgba(91, 106, 192, 0.35); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.related a span { display: block; font-size: 13px; font-weight: 500; color: var(--text-tertiary); margin-top: 4px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; }

.chip {
    display: inline-block;
    padding: 7px 14px;
    border-radius: 999px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: border-color 0.2s;
}

a.chip:hover { border-color: var(--accent-purple); }

/* A section heading with a control beside it (the essentials' Barbell | Dumbbells). */
.block-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px 20px;
    margin-bottom: 18px;
}

.block-head h2 { margin-bottom: 0; }

.set-switch {
    display: inline-flex;
    gap: 2px;
    padding: 3px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
}

.set-switch button {
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    padding: 7px 16px;
    border: 0;
    border-radius: 9px;
    background: none;
    color: var(--text-secondary);
    cursor: pointer;
    transition: color 0.2s, background 0.2s;
}

.set-switch button:hover { color: var(--text-primary); }
.set-switch button[aria-pressed="true"] { background: var(--bg-elevated); color: var(--text-primary); }
.set-switch button:focus-visible { outline: 2px solid var(--accent-purple); outline-offset: 1px; }
.essentials[hidden] { display: none; }

/* The library index: the essentials, two by two, each the photo of one rep. */
.essentials {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    list-style: none;
}

.essential {
    display: block;
    height: 100%;
    overflow: hidden;
    color: inherit;
    text-decoration: none;
    transition: border-color 0.3s, transform 0.3s, box-shadow 0.3s;
}

.essential:hover { border-color: rgba(91, 106, 192, 0.35); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.essential img { display: block; width: 100%; height: auto; background: var(--hero-bg); }
.essential .body { padding: 14px 20px 18px; }
.essential .pattern {
    display: block;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: var(--accent-purple);
    margin-bottom: 3px;
}

.essential h3 { font-size: 17px; font-weight: 700; letter-spacing: -0.2px; }
.essential p { font-size: 14px; color: var(--text-tertiary); margin-top: 2px; }

/* The library index: a card per muscle, its map on a dark tile. */
.muscle-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
    list-style: none;
}

.muscle-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
    color: inherit;
    text-decoration: none;
    transition: border-color 0.3s, transform 0.3s, box-shadow 0.3s;
}

.muscle-card:hover { border-color: rgba(91, 106, 192, 0.35); transform: translateY(-2px); box-shadow: var(--shadow-md); }

.muscle-card .thumb {
    background: radial-gradient(ellipse at 50% 45%, rgba(92, 107, 192, 0.22) 0%, transparent 65%), var(--hero-bg);
    padding: 18px 22px 12px;
}

.muscle-card .thumb img { display: block; width: 100%; max-width: 220px; height: auto; margin: 0 auto; }
.muscle-card .body { padding: 16px 20px 20px; }
.muscle-card h3 { font-size: 17px; font-weight: 700; letter-spacing: -0.2px; }
.muscle-card .count { font-size: 13px; color: var(--text-tertiary); margin: 2px 0 10px; }
.muscle-card ul { list-style: none; font-size: 14px; line-height: 1.5; color: var(--text-secondary); display: grid; gap: 4px; }

.az summary {
    display: inline-block;
    cursor: pointer;
    list-style: none;
    padding: 10px 18px;
    border-radius: 12px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    font-size: 15px;
    font-weight: 600;
}

.az summary::-webkit-details-marker { display: none; }
.az summary::after { content: " ▾"; color: var(--text-tertiary); }
.az[open] summary::after { content: " ▴"; }

.az ul {
    list-style: none;
    columns: 3 220px;
    column-gap: 28px;
    margin-top: 20px;
    font-size: 14px;
    line-height: 1.5;
}

.az li { break-inside: avoid; padding: 3px 0; }
.az a { color: var(--text-secondary); text-decoration: none; }
.az a:hover { color: var(--accent-blue); }

/* The closing pitch: dark like the hero, with the app's own screen. */
.cta-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 220px;
    gap: 40px;
    align-items: center;
    margin: 72px auto 0;
    padding: 44px 52px;
    border-radius: 28px;
    color: var(--hero-text);
    background:
        radial-gradient(ellipse at 85% 30%, rgba(255, 122, 77, 0.16) 0%, transparent 55%),
        var(--hero-bg);
    box-shadow: 0 24px 60px rgba(14, 16, 32, 0.18);
}

.cta-icon { width: 56px; height: 56px; border-radius: 14px; margin-bottom: 18px; }
.cta-card h2 { font-size: clamp(26px, 3vw, 34px); font-weight: 800; letter-spacing: -0.8px; line-height: 1.15; margin-bottom: 12px; }
.cta-card p { font-size: 16px; line-height: 1.65; color: var(--hero-muted); margin-bottom: 26px; max-width: 520px; }
.hero-cta { display: inline-flex; transition: transform 0.2s; }
.hero-cta:hover { transform: translateY(-2px); }
.hero-cta img { height: 54px; }

.phone-frame {
    aspect-ratio: 9 / 19.5;
    background: #13141E;
    border: 3px solid #1E2030;
    border-radius: 34px;
    overflow: hidden;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
}

.phone-frame img { display: block; width: 100%; height: 100%; object-fit: cover; }

footer {
    margin-top: 72px;
    padding: 32px 0;
    border-top: 1px solid var(--border);
    text-align: center;
}

footer p { font-size: 13px; color: var(--text-tertiary); margin-bottom: 6px; }
footer .links { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px 20px; margin-bottom: 12px; }
footer .links a { color: var(--text-secondary); font-size: 13px; font-weight: 600; text-decoration: none; }
footer .links a:hover { color: var(--text-primary); }

@media (max-width: 860px) {
    .hero-card {
        grid-template-columns: minmax(0, 1fr);
        grid-template-areas: "head" "map" "facts";
        grid-template-rows: auto;
        padding: 30px 24px 28px;
        border-radius: 24px;
    }

    .hero-map { margin-top: 24px; }
    .hero-map img, .hero-map svg { max-width: 360px; }
    .specs { grid-template-columns: repeat(2, auto); }
    .cta-card { grid-template-columns: minmax(0, 1fr); padding: 34px 26px; text-align: center; }
    .cta-card p { margin-left: auto; margin-right: auto; }
    .cta-shot { width: 200px; margin: 0 auto; }
}

@media (max-width: 768px) {
    .nav-links > a:not(.nav-cta) { display: none; }
}

@media (max-width: 700px) {
    .essentials { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 480px) {
    /* Logo, language switch and App Store badge share one row: on a phone they
       only fit tightened, the Turkish badge being the wider. */
    .container { padding: 0 16px; }
    .site-nav .container { padding: 0 14px; }
    .logo { gap: 8px; font-size: 19px; }
    .logo img { width: 40px; height: 40px; border-radius: 10px; }
    .nav-links { gap: 10px; }
    .nav-cta img { height: 34px; }
    main { padding-top: 76px; }
    .hero-card { padding: 26px 20px 24px; }
    .answer { font-size: 16px; }
    .legend .key { min-width: 92px; }
    .specs { gap: 14px 24px; }
    .specs.stats { grid-template-columns: minmax(0, 1fr); }
    .block { margin-top: 44px; }
    .photo { border-radius: 16px; }
    .photo figcaption { bottom: 8px; padding: 0 8px; }
    .photo figcaption span { font-size: 10px; padding: 3px 8px; }
    .steps { padding: 4px 18px; }
    .steps li { grid-template-columns: 30px 1fr; gap: 12px; font-size: 15px; }
    .steps li::before { width: 30px; height: 30px; font-size: 14px; }
    .tips { padding: 18px 18px; }
    .tips li { font-size: 15px; }
    .pick { padding: 18px 18px; }
    .ranked .pick { grid-template-columns: 34px 1fr; gap: 10px; }
    /* Two compact cards across: the thumbnail and the name are enough here. */
    .muscle-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .muscle-card .thumb { padding: 12px 12px 8px; }
    .muscle-card .body { padding: 12px 14px 14px; }
    .muscle-card h3 { font-size: 15px; line-height: 1.3; }
    .muscle-card .count { margin-bottom: 0; }
    .muscle-card ul { display: none; }
    .ranked .pick::before { font-size: 24px; }
    /* No room beside the note on a phone: the photo goes under it, full width. */
    .ranked .pick.has-thumb { grid-template-columns: 34px 1fr; }
    .pick .thumb { grid-column: 2; margin-top: 12px; border-radius: 10px; }
    .cta-card { padding: 30px 20px; border-radius: 24px; }
}
