/* ============================================================
   Interview Prep — José Miguel Calvente
   Dark theme, same design language as the portfolio.
   ============================================================ */

@font-face {
    font-family: 'Inter';
    src: url('../fonts/Inter-Variable-latin.woff2') format('woff2');
    font-weight: 400 700;
    font-display: swap;
}
@font-face {
    font-family: 'Space Grotesk';
    src: url('../fonts/SpaceGrotesk-Variable-latin.woff2') format('woff2');
    font-weight: 500 700;
    font-display: swap;
}

:root {
    --bg: #070b14;
    --bg-soft: #0b1120;
    --surface: rgba(255, 255, 255, 0.035);
    --surface-2: rgba(255, 255, 255, 0.07);
    --border: rgba(255, 255, 255, 0.08);
    --border-strong: rgba(255, 255, 255, 0.16);
    --text: #e9eef7;
    --muted: #8b9bb4;
    --accent: #38bdf8;
    --accent-2: #818cf8;
    --accent-3: #2dd4bf;
    --warn: #fbbf24;
    --danger: #fb7185;
    --grad: linear-gradient(135deg, var(--accent), var(--accent-2));
    --shadow: 0 18px 40px -20px rgba(0, 0, 0, 0.7);
    --shadow-lg: 0 30px 70px -30px rgba(0, 0, 0, 0.9);
    --radius: 16px;
    --radius-lg: 22px;
    --maxw: 1180px;
    --nav-h: 66px;
    --ease: cubic-bezier(0.2, 0.7, 0.3, 1);
    --spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

* { box-sizing: border-box; }

html {
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--nav-h) + 20px);
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.65;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: -2;
    background:
        radial-gradient(60vw 60vw at 82% -12%, rgba(56, 189, 248, 0.13), transparent 60%),
        radial-gradient(52vw 52vw at -10% 18%, rgba(129, 140, 248, 0.13), transparent 60%),
        radial-gradient(44vw 44vw at 50% 112%, rgba(45, 212, 191, 0.08), transparent 60%),
        var(--bg);
}

body::after {
    content: '';
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.022) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.022) 1px, transparent 1px);
    background-size: 72px 72px;
    mask-image: radial-gradient(circle at 50% 0%, #000 0%, transparent 78%);
    -webkit-mask-image: radial-gradient(circle at 50% 0%, #000 0%, transparent 78%);
}

h1, h2, h3 {
    font-family: 'Space Grotesk', 'Inter', sans-serif;
    line-height: 1.12;
    letter-spacing: -0.02em;
}

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

.accent {
    background: var(--grad);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
    border-radius: 6px;
}

.visually-hidden {
    position: absolute;
    width: 1px; height: 1px;
    margin: -1px; padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

.skip-link {
    position: absolute;
    left: -999px; top: 8px;
    background: var(--accent);
    color: #04121c;
    padding: 8px 14px;
    border-radius: 8px;
    z-index: 2000;
    font-weight: 600;
}
.skip-link:focus { left: 12px; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 clamp(18px, 4vw, 40px); }

/* ---------- Scroll progress ---------- */
.scroll-progress {
    position: fixed;
    top: 0; left: 0;
    height: 2px; width: 100%;
    transform: scaleX(0);
    transform-origin: 0 50%;
    background: linear-gradient(90deg, var(--accent), var(--accent-2), var(--accent-3));
    z-index: 1200;
    will-change: transform;
}

/* ---------- Navbar ---------- */
.navbar {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: var(--nav-h);
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 0 clamp(16px, 4vw, 40px);
    background: rgba(7, 11, 20, 0.72);
    backdrop-filter: blur(14px) saturate(140%);
    -webkit-backdrop-filter: blur(14px) saturate(140%);
    border-bottom: 1px solid var(--border);
}

.brand {
    display: flex;
    align-items: center;
    gap: 11px;
    color: var(--text);
    margin-right: auto;
    font-weight: 700;
}
.brand-mark {
    width: 34px; height: 34px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    background: var(--grad);
    color: #061018;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.95rem;
    font-weight: 700;
    flex: none;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.05; }
.brand-text small { font-weight: 500; font-size: 0.68rem; color: var(--muted); letter-spacing: 0.3px; }

.nav-links { display: flex; gap: 1px; }
.nav-links a {
    position: relative;
    color: var(--muted);
    font-weight: 500;
    font-size: 0.86rem;
    padding: 7px 11px;
    border-radius: 9px;
    white-space: nowrap;
    transition: color 0.2s, background 0.2s;
}
.nav-links a:hover { color: var(--text); background: var(--surface); }
.nav-links a.active { color: #fff; background: var(--surface-2); }
.nav-links a.active::after {
    content: '';
    position: absolute;
    left: 50%; bottom: 2px;
    width: 15px; height: 2px;
    border-radius: 2px;
    background: var(--grad);
    transform: translateX(-50%);
    animation: growIn 0.3s var(--spring);
}
@keyframes growIn { from { width: 0; } to { width: 15px; } }

/* ---------- Language switch ---------- */
.lang-switch {
    display: inline-flex;
    padding: 3px;
    border-radius: 999px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    flex: none;
}
.lang-switch button {
    font-family: inherit;
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: var(--muted);
    background: none;
    border: none;
    padding: 5px 11px;
    border-radius: 999px;
    cursor: pointer;
    transition: color 0.2s, background 0.25s var(--ease);
}
.lang-switch button[aria-pressed="true"] {
    color: #061018;
    background: var(--grad);
}

/* ---------- Mobile nav ---------- */
.nav-toggle {
    display: none;
    position: relative;
    width: 40px; height: 40px;
    padding: 0;
    border-radius: 11px;
    background: var(--surface);
    border: 1px solid var(--border-strong);
    color: var(--text);
    cursor: pointer;
    flex: none;
    transition: background 0.2s, border-color 0.2s;
}
.nav-toggle:hover { background: var(--surface-2); border-color: var(--accent); }
.nav-toggle .bar {
    position: absolute;
    top: 50%; left: 50%;
    width: 17px; height: 2px;
    margin: -1px 0 0 -8.5px;
    border-radius: 2px;
    background: currentColor;
    transition: transform 0.28s var(--spring), opacity 0.2s;
}
.nav-toggle .bar:nth-of-type(1) { transform: translateY(-6px); }
.nav-toggle .bar:nth-of-type(3) { transform: translateY(6px); }
.nav-toggle[aria-expanded="true"] .bar:nth-of-type(1) { transform: rotate(45deg); }
.nav-toggle[aria-expanded="true"] .bar:nth-of-type(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] .bar:nth-of-type(3) { transform: rotate(-45deg); }

.mobile-menu {
    position: fixed;
    inset: var(--nav-h) 0 auto 0;
    z-index: 999;
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 14px clamp(16px, 4vw, 40px) 22px;
    background: #070b14;
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: opacity 0.25s var(--ease), transform 0.25s var(--ease), visibility 0.25s;
}
.mobile-menu.open { opacity: 1; visibility: visible; transform: translateY(0); }
.mobile-menu a {
    color: var(--text);
    font-size: 1rem;
    font-weight: 500;
    padding: 11px 13px;
    border-radius: 11px;
    border: 1px solid transparent;
    transition: background 0.2s, border-color 0.2s;
}
.mobile-menu a:hover, .mobile-menu a.active { background: var(--surface); border-color: var(--border); }

/* ---------- Hero ---------- */
.hero {
    max-width: var(--maxw);
    margin: 0 auto;
    padding: calc(var(--nav-h) + 56px) clamp(18px, 4vw, 40px) 34px;
}
.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-size: 0.71rem;
    font-weight: 600;
    color: var(--accent);
    margin: 0 0 18px;
    padding: 6px 15px;
    border: 1px solid var(--border-strong);
    border-radius: 999px;
    background: var(--surface);
}
.hero h1 { font-size: clamp(2rem, 5vw, 3.1rem); margin: 0 0 14px; }
.lead { font-size: clamp(1rem, 2vw, 1.18rem); color: #cfd8e8; max-width: 660px; margin: 0 0 26px; }
.lead strong { color: #fff; font-weight: 600; }

/* ---------- Stat tiles ---------- */
.stats { display: flex; flex-wrap: wrap; gap: 12px; margin: 0 0 26px; padding: 0; list-style: none; }
.stats li {
    flex: 1 1 150px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 15px 18px;
    transition: transform 0.25s var(--ease), border-color 0.25s;
}
.stats li:hover { transform: translateY(-3px); border-color: var(--border-strong); }
.stats strong {
    display: block;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.7rem;
    background: var(--grad);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    font-variant-numeric: tabular-nums;
}
.stats span { color: var(--muted); font-size: 0.83rem; }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 11px 20px;
    border-radius: 999px;
    font-family: inherit;
    font-weight: 600;
    font-size: 0.92rem;
    border: 1px solid transparent;
    cursor: pointer;
    transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease),
        background 0.2s, border-color 0.2s, color 0.2s;
}
.btn-primary {
    background: var(--grad);
    color: #061018;
    box-shadow: 0 10px 24px -10px rgba(56, 189, 248, 0.7);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 16px 32px -12px rgba(56, 189, 248, 0.9); }
.btn-ghost { background: var(--surface); color: var(--text); border-color: var(--border-strong); }
.btn-ghost:hover { transform: translateY(-2px); border-color: var(--accent); color: #fff; background: var(--surface-2); }

/* ---------- Topic grid (home) ---------- */
.topics {
    max-width: var(--maxw);
    margin: 0 auto;
    padding: 10px clamp(18px, 4vw, 40px) clamp(60px, 9vw, 96px);
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
    gap: 18px;
}

.topic-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 24px;
    border-radius: var(--radius);
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);
    overflow: hidden;
    transition: transform 0.3s var(--ease), border-color 0.3s, box-shadow 0.3s;
}
.topic-card::before {
    content: '';
    position: absolute;
    inset: 0 0 auto 0;
    height: 2px;
    background: var(--grad);
    transform: scaleX(0);
    transform-origin: 0 50%;
    transition: transform 0.35s var(--ease);
}
.topic-card:hover { transform: translateY(-5px); border-color: var(--border-strong); box-shadow: var(--shadow); }
.topic-card:hover::before { transform: scaleX(1); }

.topic-icon {
    width: 42px; height: 42px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: rgba(56, 189, 248, 0.12);
    border: 1px solid rgba(56, 189, 248, 0.28);
    transition: transform 0.35s var(--spring);
}
.topic-card:hover .topic-icon { transform: scale(1.08) rotate(-4deg); }
.topic-icon svg { width: 21px; height: 21px; color: var(--accent); }

.topic-card h2 { margin: 0; font-size: 1.16rem; display: flex; align-items: center; gap: 8px; }
.topic-arrow { color: var(--accent); transition: transform 0.25s var(--ease); display: inline-block; }
.topic-card:hover .topic-arrow { transform: translateX(4px); }
.topic-card p { margin: 0; color: var(--muted); font-size: 0.92rem; }

.topic-meta { display: flex; flex-wrap: wrap; gap: 7px; margin-top: auto; padding-top: 6px; }

/* ---------- Progress ---------- */
.progress-track {
    height: 5px;
    border-radius: 999px;
    background: var(--surface-2);
    overflow: hidden;
}
.progress-fill {
    height: 100%;
    border-radius: 999px;
    background: var(--grad);
    width: 0;
    transition: width 0.7s var(--ease);
}
.progress-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.78rem;
    color: var(--muted);
    margin-bottom: 6px;
    font-variant-numeric: tabular-nums;
}

/* ---------- Pills ---------- */
.pill {
    font-size: 0.74rem;
    font-weight: 500;
    color: #d4dcec;
    background: var(--surface-2);
    border: 1px solid var(--border);
    padding: 4px 11px;
    border-radius: 999px;
    white-space: nowrap;
}
.pill-basic { color: #bbf7d0; border-color: rgba(45, 212, 191, 0.38); background: rgba(45, 212, 191, 0.12); }
.pill-mid { color: #fde68a; border-color: rgba(251, 191, 36, 0.38); background: rgba(251, 191, 36, 0.12); }
.pill-hard { color: #fecdd3; border-color: rgba(251, 113, 133, 0.38); background: rgba(251, 113, 133, 0.12); }

/* ---------- Toolbar ---------- */
.toolbar {
    position: sticky;
    top: var(--nav-h);
    z-index: 800;
    background: rgba(7, 11, 20, 0.88);
    backdrop-filter: blur(14px) saturate(140%);
    -webkit-backdrop-filter: blur(14px) saturate(140%);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    padding: 13px clamp(18px, 4vw, 40px);
}
.toolbar-inner {
    max-width: var(--maxw);
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.search { position: relative; flex: 1 1 250px; min-width: 0; display: flex; align-items: center; }
.search svg { position: absolute; left: 14px; width: 16px; height: 16px; color: var(--muted); pointer-events: none; }
.search input {
    width: 100%;
    font-family: inherit;
    font-size: 0.93rem;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: 999px;
    padding: 10px 40px 10px 39px;
    transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}
.search input::placeholder { color: var(--muted); }
.search input:focus {
    outline: none;
    border-color: var(--accent);
    background: var(--surface-2);
    box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.1);
}
.search input::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; }
.search-clear {
    position: absolute;
    right: 8px;
    width: 24px; height: 24px;
    display: grid;
    place-items: center;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: var(--surface-2);
    color: var(--muted);
    font-family: inherit;
    font-size: 0.8rem;
    cursor: pointer;
    transition: color 0.2s, background 0.2s;
}
.search-clear:hover { color: #fff; background: rgba(56, 189, 248, 0.22); }

.filters { display: flex; flex-wrap: wrap; gap: 7px; }
.filter {
    font-family: inherit;
    font-size: 0.81rem;
    font-weight: 500;
    color: #d4dcec;
    background: var(--surface-2);
    border: 1px solid var(--border);
    padding: 7px 13px;
    border-radius: 999px;
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s, background 0.2s, transform 0.15s;
}
.filter:hover { color: #fff; border-color: var(--accent); }
.filter:active { transform: scale(0.96); }
.filter[aria-pressed="true"] {
    color: #eaf7ff;
    font-weight: 600;
    border-color: rgba(56, 189, 248, 0.5);
    background: rgba(56, 189, 248, 0.16);
}
.filter-basic[aria-pressed="true"] { color: #bbf7d0; border-color: rgba(45,212,191,.5); background: rgba(45,212,191,.16); }
.filter-mid[aria-pressed="true"] { color: #fde68a; border-color: rgba(251,191,36,.5); background: rgba(251,191,36,.16); }
.filter-hard[aria-pressed="true"] { color: #fecdd3; border-color: rgba(251,113,133,.5); background: rgba(251,113,133,.16); }

.result-count { width: 100%; margin: 0; color: var(--muted); font-size: 0.81rem; font-variant-numeric: tabular-nums; }

/* ---------- Question list ---------- */
.qa-list {
    max-width: 900px;
    margin: 0 auto;
    padding: clamp(24px, 4vw, 38px) clamp(18px, 4vw, 40px) clamp(60px, 9vw, 96px);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.qa {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    overflow: hidden;
    transition: border-color 0.25s, box-shadow 0.25s, opacity 0.3s, transform 0.3s;
}
.qa:hover { border-color: var(--border-strong); }
.qa.open { border-color: rgba(56, 189, 248, 0.32); box-shadow: var(--shadow); }
.qa.done { border-color: rgba(45, 212, 191, 0.3); }
.qa.done .qa-q { opacity: 0.72; }

.qa-head {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px 18px;
}

.qa-q {
    flex: 1;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 0;
    margin: 0;
    background: none;
    border: none;
    color: var(--text);
    font-family: inherit;
    font-size: 1rem;
    font-weight: 500;
    line-height: 1.5;
    text-align: left;
    cursor: pointer;
    transition: color 0.2s, opacity 0.25s;
}
.qa-q:hover { color: #fff; }

.qa-num {
    flex: none;
    min-width: 26px;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--muted);
    padding-top: 2px;
    font-variant-numeric: tabular-nums;
}

.qa-chevron {
    flex: none;
    width: 18px; height: 18px;
    margin-top: 3px;
    color: var(--muted);
    transition: transform 0.3s var(--ease), color 0.2s;
}
.qa.open .qa-chevron { transform: rotate(180deg); color: var(--accent); }

.qa-side { display: flex; align-items: center; gap: 8px; flex: none; padding-top: 1px; }

.qa-mark {
    width: 30px; height: 30px;
    display: grid;
    place-items: center;
    padding: 0;
    border-radius: 50%;
    background: var(--surface-2);
    border: 1px solid var(--border);
    color: var(--muted);
    cursor: pointer;
    transition: color 0.2s, background 0.2s, border-color 0.2s, transform 0.2s var(--spring);
}
.qa-mark svg { width: 15px; height: 15px; }
.qa-mark:hover { color: var(--accent-3); border-color: var(--accent-3); transform: scale(1.12); }
.qa.done .qa-mark {
    color: #04211d;
    background: var(--accent-3);
    border-color: var(--accent-3);
}

/* Animated accordion: grid-template-rows 0fr -> 1fr animates smoothly */
.qa-body {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.38s var(--ease);
}
.qa.open .qa-body { grid-template-rows: 1fr; }
.qa-body > div { overflow: hidden; }
.qa-answer {
    padding: 0 18px 18px 56px;
    color: #c7d0e0;
    opacity: 0;
    transform: translateY(-6px);
    transition: opacity 0.3s var(--ease) 0.06s, transform 0.3s var(--ease) 0.06s;
}
.qa.open .qa-answer { opacity: 1; transform: none; }

.qa-answer > *:first-child { margin-top: 0; }
.qa-answer > *:last-child { margin-bottom: 0; }
.qa-answer p { margin: 0 0 13px; }
.qa-answer strong { color: #fff; font-weight: 600; }
.qa-answer ul, .qa-answer ol { margin: 0 0 14px; padding-left: 20px; }
.qa-answer li { margin-bottom: 6px; }
.qa-answer li::marker { color: var(--accent); }
.qa-answer code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.86em;
    color: #eaf7ff;
    background: var(--surface-2);
    border: 1px solid var(--border);
    padding: 1px 6px;
    border-radius: 6px;
}
.qa-answer pre {
    margin: 0 0 15px;
    padding: 15px 17px;
    overflow-x: auto;
    background: #0b1120;
    border: 1px solid var(--border);
    border-radius: 12px;
    line-height: 1.6;
}
.qa-answer pre code {
    background: none;
    border: none;
    padding: 0;
    font-size: 0.83rem;
    color: #d8e2f2;
    white-space: pre;
}
.qa-answer table { width: 100%; border-collapse: collapse; margin: 0 0 15px; font-size: 0.89rem; }
.qa-answer th, .qa-answer td { text-align: left; padding: 8px 12px; border-bottom: 1px solid var(--border); }
.qa-answer th { color: var(--text); font-weight: 600; }
.qa-answer blockquote {
    margin: 0 0 15px;
    padding: 2px 0 2px 16px;
    border-left: 2px solid var(--accent);
    color: var(--muted);
}

.qa-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.qa-tag {
    font-size: 0.72rem;
    color: var(--muted);
    background: var(--surface-2);
    border: 1px solid var(--border);
    padding: 3px 9px;
    border-radius: 999px;
}

/* ---------- Empty state ---------- */
.empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 10px;
    padding: clamp(40px, 7vw, 66px) 26px;
    border: 1px dashed var(--border-strong);
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.015);
}
.empty svg { width: 30px; height: 30px; color: var(--accent); opacity: 0.85; }
.empty h2 { margin: 4px 0 0; font-size: 1.1rem; }
.empty p { margin: 0; color: var(--muted); max-width: 420px; }

/* ---------- Footer ---------- */
.footer {
    border-top: 1px solid var(--border);
    background: var(--bg-soft);
    padding: 26px clamp(18px, 4vw, 40px);
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    align-items: center;
    justify-content: space-between;
}
.footer-brand { display: flex; align-items: center; gap: 11px; font-weight: 700; margin: 0; }
.footer-links { display: flex; gap: 16px; flex-wrap: wrap; }
.footer-links a { color: var(--muted); font-size: 0.89rem; transition: color 0.2s; }
.footer-links a:hover { color: var(--text); }
.footer-copy {
    color: var(--muted);
    font-size: 0.82rem;
    margin: 0;
    width: 100%;
    text-align: center;
    border-top: 1px solid var(--border);
    padding-top: 16px;
}

/* ---------- Back to top ---------- */
.to-top {
    position: fixed;
    right: 20px; bottom: 20px;
    width: 44px; height: 44px;
    display: grid;
    place-items: center;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: var(--grad);
    color: #061018;
    font-family: inherit;
    font-size: 1.15rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: var(--shadow);
    opacity: 0;
    pointer-events: none;
    transform: translateY(12px) scale(0.9);
    transition: opacity 0.3s, transform 0.3s var(--spring);
    z-index: 900;
}
.to-top.show { opacity: 1; pointer-events: auto; transform: none; }

/* ---------- Entrance animations ---------- */
.reveal {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 0.55s var(--ease), transform 0.55s var(--ease);
}
.reveal.in { opacity: 1; transform: none; }

@keyframes riseIn {
    from { opacity: 0; transform: translateY(14px); }
    to { opacity: 1; transform: none; }
}
.stagger > * { animation: riseIn 0.5s var(--ease) backwards; }
.stagger > *:nth-child(1) { animation-delay: 0.04s; }
.stagger > *:nth-child(2) { animation-delay: 0.08s; }
.stagger > *:nth-child(3) { animation-delay: 0.12s; }
.stagger > *:nth-child(4) { animation-delay: 0.16s; }
.stagger > *:nth-child(5) { animation-delay: 0.20s; }
.stagger > *:nth-child(6) { animation-delay: 0.24s; }
.stagger > *:nth-child(7) { animation-delay: 0.28s; }
.stagger > *:nth-child(8) { animation-delay: 0.32s; }

/* Filtering: fade the list out and back in so changes are not jarring */
.qa-list.filtering { opacity: 0.35; transition: opacity 0.12s linear; }

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
    .nav-links { display: none; }
    .nav-toggle { display: block; }
}
@media (max-width: 560px) {
    .brand-text small { display: none; }
    .qa-answer { padding-left: 18px; }
    .qa-head { padding: 14px 15px; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .reveal { opacity: 1; transform: none; transition: none; }
    *, *::before, *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
    }
}

/* Tag filters get their own row, visually quieter than the level filters
   so the hierarchy reads: search → level → technology. */
.filters-tags {
    width: 100%;
    padding-top: 9px;
    border-top: 1px solid var(--border);
}
.filter-tag {
    font-size: 0.77rem;
    padding: 5px 11px;
    color: var(--muted);
    background: transparent;
}
.filter-tag:hover { color: var(--text); }
.filter-tag[aria-pressed="true"] {
    color: #b9f0e6;
    font-weight: 600;
    border-color: rgba(45, 212, 191, 0.5);
    background: rgba(45, 212, 191, 0.14);
}

/* ============================================================
   Technology-first navigation: category indexes, technology
   cards, per-level coverage bars.
   ============================================================ */

/* ---------- Breadcrumb back to the category ---------- */
.crumb {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 18px;
    padding: 5px 12px 5px 7px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface);
    color: var(--muted);
    font-size: 0.8rem;
    text-decoration: none;
    transition: color 0.25s var(--ease), border-color 0.25s var(--ease), transform 0.25s var(--ease);
}
.crumb:hover {
    color: var(--text);
    border-color: var(--border-strong);
    transform: translateX(-2px);
}
.crumb svg { width: 16px; height: 16px; }

/* ---------- Hero extras ---------- */
.hero-tech h1 { word-break: break-word; }

.tech-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 22px;
}
.pill-skill { letter-spacing: 0.01em; }
.pill-proficient { color: #bbf7d0; border-color: rgba(45, 212, 191, 0.38); background: rgba(45, 212, 191, 0.12); }
.pill-used { color: #cbd5f5; border-color: rgba(129, 140, 248, 0.38); background: rgba(129, 140, 248, 0.12); }
.pill-learning { color: #fde68a; border-color: rgba(251, 191, 36, 0.32); background: rgba(251, 191, 36, 0.1); }
.pill-parent {
    text-decoration: none;
    transition: border-color 0.25s var(--ease), color 0.25s var(--ease);
}
.pill-parent:hover { color: var(--accent); border-color: rgba(56, 189, 248, 0.5); }

.progress-wrap { max-width: 460px; margin-top: 4px; }

/* ---------- Stat row (home + category heroes) ---------- */
.stat-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 0 0 24px;
}
.stat {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 12px 18px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface);
    min-width: 108px;
    transition: border-color 0.3s var(--ease), transform 0.3s var(--ease);
}
.stat:hover { border-color: var(--border-strong); transform: translateY(-2px); }
.stat-num {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.5rem;
    font-weight: 600;
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
}
.stat-label { font-size: 0.74rem; color: var(--muted); text-transform: lowercase; }

/* ---------- Per-level coverage (technology page) ---------- */
.coverage {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 12px;
    max-width: 620px;
    margin: 0 0 24px;
}
.coverage-item {
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface);
    transition: border-color 0.3s var(--ease);
}
.coverage-item.ok { border-color: rgba(45, 212, 191, 0.34); background: rgba(45, 212, 191, 0.06); }
.coverage-top {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 9px;
    font-size: 0.78rem;
}
.coverage-name { color: var(--muted); }
.coverage-num {
    margin-left: auto;
    font-variant-numeric: tabular-nums;
    font-weight: 600;
}
.dot { width: 7px; height: 7px; border-radius: 50%; flex: none; }
.dot-basic { background: var(--accent-3); }
.dot-mid { background: var(--warn); }
.dot-hard { background: var(--danger); }
.coverage-track {
    height: 4px;
    border-radius: 999px;
    background: var(--surface-2);
    overflow: hidden;
}
.coverage-fill {
    height: 100%;
    border-radius: 999px;
    width: 0;
    transition: width 0.8s var(--ease);
}
.fill-basic { background: linear-gradient(90deg, var(--accent-3), #6ee7b7); }
.fill-mid { background: linear-gradient(90deg, var(--warn), #fcd34d); }
.fill-hard { background: linear-gradient(90deg, var(--danger), #fda4af); }

/* ---------- Sections ---------- */
.cat-body, .home-body {
    width: min(100% - 40px, var(--maxw));
    margin: 0 auto;
    padding: 8px 0 40px;
}
.home-section, .tech-group { margin: 0 0 44px; }

.group-title {
    display: flex;
    align-items: center;
    gap: 11px;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.15rem;
    font-weight: 600;
    margin: 0 0 6px;
}
.group-count {
    font-family: 'Inter', sans-serif;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--muted);
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 2px 9px;
    font-variant-numeric: tabular-nums;
}
.section-lead { color: var(--muted); font-size: 0.9rem; margin: 0 0 18px; }
.muted { color: var(--muted); }

/* ---------- Technology cards ---------- */
.tech-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(268px, 1fr));
    gap: 14px;
    margin-top: 16px;
}
.tech-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    color: inherit;
    text-decoration: none;
    overflow: hidden;
    transition: transform 0.35s var(--ease), border-color 0.35s var(--ease), background 0.35s var(--ease);
}
.tech-card::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 2px;
    background: var(--grad);
    opacity: 0;
    transition: opacity 0.35s var(--ease);
}
.tech-card:hover {
    transform: translateY(-3px);
    border-color: var(--border-strong);
    background: var(--surface-2);
}
.tech-card:hover::before { opacity: 1; }
.tech-card.state-empty { opacity: 0.66; }
.tech-card.state-empty:hover { opacity: 1; }
.tech-card.state-ready { border-color: rgba(45, 212, 191, 0.26); }

.tech-card-top { display: flex; align-items: flex-start; gap: 10px; }
.tech-card-top h3 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.02rem;
    font-weight: 600;
    margin: 0;
    line-height: 1.3;
    word-break: break-word;
}
.chip {
    margin-left: auto;
    flex: none;
    font-size: 0.66rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    padding: 3px 9px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--surface-2);
    color: var(--muted);
    text-transform: lowercase;
}
.chip-ready { color: #bbf7d0; border-color: rgba(45, 212, 191, 0.4); background: rgba(45, 212, 191, 0.12); }
.chip-partial { color: #fde68a; border-color: rgba(251, 191, 36, 0.36); background: rgba(251, 191, 36, 0.1); }

.tech-card-summary {
    margin: 0;
    font-size: 0.86rem;
    color: var(--muted);
    line-height: 1.55;
    flex: 1;
}

/* Three tiny bars, one per level */
.mini-coverage { display: flex; gap: 8px; }
.mini { display: flex; align-items: center; gap: 5px; flex: 1; }
.mini-track {
    flex: 1;
    height: 3px;
    border-radius: 999px;
    background: var(--surface-2);
    overflow: hidden;
}
.mini-fill {
    display: block;
    height: 100%;
    border-radius: 999px;
    width: 0;
    transition: width 0.8s var(--ease);
}
.mini-num {
    font-size: 0.68rem;
    color: var(--muted);
    font-variant-numeric: tabular-nums;
    min-width: 12px;
    text-align: right;
}

.tech-card-foot {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-top: 4px;
    font-size: 0.76rem;
    color: var(--muted);
    font-variant-numeric: tabular-nums;
}
.studied { color: var(--accent-3); }
.card-arrow {
    width: 18px;
    height: 18px;
    margin-left: auto;
    flex: none;
    opacity: 0.45;
    transition: transform 0.35s var(--ease), opacity 0.35s var(--ease);
}
.tech-card:hover .card-arrow, .cat-card:hover .card-arrow {
    transform: translateX(4px);
    opacity: 1;
}

/* ---------- Category cards (home) ---------- */
.cat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
    margin-top: 18px;
}
.cat-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 9px;
    padding: 22px;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--surface);
    color: inherit;
    text-decoration: none;
    overflow: hidden;
    transition: transform 0.4s var(--ease), border-color 0.4s var(--ease), background 0.4s var(--ease);
}
.cat-card:hover {
    transform: translateY(-4px);
    border-color: var(--border-strong);
    background: var(--surface-2);
}
.cat-kicker {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    color: var(--accent);
}
.cat-card h3 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.2rem;
    font-weight: 600;
    margin: 0;
}
.cat-summary {
    margin: 0;
    font-size: 0.88rem;
    color: var(--muted);
    line-height: 1.6;
    flex: 1;
}
.cat-foot {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.78rem;
    color: var(--muted);
    font-variant-numeric: tabular-nums;
}
.progress-track.slim { height: 3px; }

.home-foot { margin: 8px 0 24px; }

/* ---------- Concept-tag filter row ---------- */
.filters-tags { gap: 6px; }
.filter-tag { font-size: 0.74rem; padding: 4px 11px; }

@media (max-width: 720px) {
    .coverage { grid-template-columns: 1fr; }
    .stat { flex: 1 1 calc(50% - 10px); min-width: 0; }
    .tech-grid, .cat-grid { grid-template-columns: 1fr; }
}
