/* ── Reset & Base ───────────────────────────────────────────── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --bg:        #06060b;
    --bg-alt:    #0d0d14;
    --surface:   #13131e;
    --border:    #1e1e30;
    --text:      #e8e8f0;
    --text-dim:  #7a7a95;
    --accent:    #7c6aff;
    --accent-2:  #00e0b0;
    --accent-glow: rgba(124, 106, 255, 0.15);
    --accent-2-glow: rgba(0, 224, 176, 0.12);
    --gradient:  linear-gradient(135deg, #7c6aff 0%, #00e0b0 100%);
    --font:      'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --mono:      'JetBrains Mono', monospace;
    --radius:    14px;
    --shadow:    0 8px 32px rgba(0, 0, 0, 0.4);
    --glow:      0 0 60px rgba(124, 106, 255, 0.08);
}

html { scroll-behavior: smooth; scroll-padding-top: 130px; }

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    /* offset for the fixed nav so site-tabs sits correctly at top:64px */
    padding-top: 64px;
}

::selection { background: rgba(124, 106, 255, 0.3); color: white; }

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

/* ── Navigation ────────────────────────────────────────────── */
.nav {
    position: fixed; top: 0; left: 0; right: 0; z-index: 100;
    background: rgba(6, 6, 11, 0.8);
    backdrop-filter: blur(20px) saturate(1.5);
    border-bottom: 1px solid transparent;
    transition: border-color 0.3s, background 0.3s;
}
.nav.scrolled {
    border-bottom-color: var(--border);
    background: rgba(6, 6, 11, 0.95);
}

.nav-container {
    max-width: 1100px; margin: 0 auto; padding: 0 24px;
    display: flex; align-items: center; justify-content: space-between;
    height: 64px;
}

.nav-logo {
    font-size: 1.5rem; font-weight: 800; text-decoration: none;
    background: var(--gradient); -webkit-background-clip: text;
    -webkit-text-fill-color: transparent; background-clip: text;
    letter-spacing: -0.5px;
}

/* nav-links, nav-toggle, and nav-mobile removed — site-tabs is the sole nav */

/* ── Hero ──────────────────────────────────────────────────── */
.hero {
    min-height: 100vh; display: flex; align-items: center;
    justify-content: center; position: relative; overflow: hidden;
    /* reduced from 120px — body already offsets 64px for fixed nav */
    padding: 56px 24px 80px;
}

.hero-bg-grid {
    position: absolute; inset: 0;
    background-image:
        linear-gradient(rgba(124, 106, 255, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(124, 106, 255, 0.04) 1px, transparent 1px);
    background-size: 60px 60px;
    mask-image: radial-gradient(ellipse 80% 70% at 50% 50%, black 30%, transparent 100%);
    -webkit-mask-image: radial-gradient(ellipse 80% 70% at 50% 50%, black 30%, transparent 100%);
}

.hero::before {
    content: ''; position: absolute;
    width: 600px; height: 600px; border-radius: 50%;
    background: radial-gradient(circle, rgba(124, 106, 255, 0.08) 0%, transparent 70%);
    top: 10%; left: 50%; transform: translateX(-50%);
    pointer-events: none;
}

.hero-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 48px;
    align-items: center;
    max-width: 1120px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

@media (min-width: 960px) {
    .hero-layout {
        grid-template-columns: 1fr minmax(280px, 380px);
        gap: 56px;
    }
}

.hero-content {
    text-align: center;
    position: relative;
    z-index: 1;
}

@media (min-width: 960px) {
    .hero-content { text-align: left; }
    .hero-cta { justify-content: flex-start; }
}

.hero-greeting {
    font-size: 1rem; color: var(--accent); font-weight: 500;
    margin-bottom: 12px; letter-spacing: 2px; text-transform: uppercase;
}

.hero-name {
    font-size: clamp(2.8rem, 8vw, 5rem); font-weight: 800;
    letter-spacing: -3px; line-height: 1.05; margin-bottom: 16px;
    background: var(--gradient); -webkit-background-clip: text;
    -webkit-text-fill-color: transparent; background-clip: text;
}

.hero-title {
    font-size: clamp(1.1rem, 3vw, 1.35rem); color: var(--text-dim);
    font-weight: 400; margin-bottom: 16px;
}

.hero-pills {
    display: flex; flex-wrap: wrap; gap: 8px;
    justify-content: center; margin-bottom: 22px;
}

@media (min-width: 960px) {
    .hero-pills { justify-content: flex-start; }
}

.hero-pill {
    font-family: var(--mono);
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 6px 12px;
    border-radius: 6px;
    background: rgba(124, 106, 255, 0.1);
    border: 1px solid rgba(124, 106, 255, 0.22);
    color: var(--accent);
}

.hero-desc {
    max-width: 560px;
    margin: 0 auto 32px;
    color: var(--text-dim);
    font-size: 1.02rem;
    line-height: 1.8;
}

.hero-desc strong { color: var(--text); font-weight: 600; }

@media (min-width: 960px) {
    .hero-desc { margin-left: 0; margin-right: 0; }
}

.hero-cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* Hero: decorative “analytics panel” */
.hero-visual { max-width: 400px; margin: 0 auto; width: 100%; }

@media (min-width: 960px) {
    .hero-visual { margin: 0; }
}

.mini-dashboard {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px 18px 14px;
    box-shadow: var(--shadow), 0 0 0 1px rgba(124, 106, 255, 0.06) inset;
    text-align: left;
}

.mini-dash-header {
    display: flex; align-items: center; gap: 6px;
    margin-bottom: 16px; padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.mini-dash-dot {
    width: 8px; height: 8px; border-radius: 50%;
    background: var(--border);
}
.mini-dash-dot:nth-child(1) { background: #ff5f57; }
.mini-dash-dot:nth-child(2) { background: #febc2e; }
.mini-dash-dot:nth-child(3) { background: #28c840; }

.mini-dash-title {
    margin-left: auto;
    font-family: var(--mono);
    font-size: 0.7rem;
    color: var(--text-dim);
    opacity: 0.85;
}

.mini-dash-kpis {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 18px;
}

.mini-kpi {
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 10px 10px 8px;
}

.mini-kpi-label {
    display: block;
    font-family: var(--mono);
    font-size: 0.62rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-dim);
    margin-bottom: 4px;
}

.mini-kpi-value {
    font-family: var(--mono);
    font-size: 1.15rem;
    font-weight: 600;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.mini-dash-chart {
    background: rgba(0, 0, 0, 0.25);
    border-radius: 10px;
    padding: 12px 12px 10px;
    border: 1px solid var(--border);
}

.mini-chart-label {
    font-family: var(--mono);
    font-size: 0.65rem;
    color: var(--accent-2);
    display: block;
    margin-bottom: 10px;
    letter-spacing: 0.02em;
}

.mini-bars {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 6px;
    height: 100px;
    padding: 0 4px;
}

.mini-bar {
    flex: 1;
    min-width: 0;
    height: var(--h);
    border-radius: 4px 4px 2px 2px;
    background: linear-gradient(180deg, var(--accent) 0%, rgba(124, 106, 255, 0.35) 100%);
    opacity: 0.9;
    animation: bar-grow 1.2s cubic-bezier(0.22, 1, 0.36, 1) forwards;
    transform-origin: bottom;
    transform: scaleY(0);
}

.mini-bar:nth-child(2) { animation-delay: 0.08s; }
.mini-bar:nth-child(3) { animation-delay: 0.16s; }
.mini-bar:nth-child(4) { animation-delay: 0.24s; }
.mini-bar:nth-child(5) { animation-delay: 0.32s; }
.mini-bar:nth-child(6) { animation-delay: 0.4s; }

@keyframes bar-grow {
    to { transform: scaleY(1); }
}

@media (prefers-reduced-motion: reduce) {
    .mini-bar {
        animation: none;
        transform: scaleY(1);
    }
}

.mini-dash-footnote {
    margin-top: 12px;
    font-size: 0.68rem;
    color: var(--text-dim);
    opacity: 0.75;
    line-height: 1.4;
    font-style: italic;
}

.btn {
    display: inline-flex; align-items: center; padding: 13px 30px;
    border-radius: 10px; font-size: 0.95rem; font-weight: 600;
    text-decoration: none; transition: all 0.3s ease; cursor: pointer; border: none;
}
.btn-primary {
    background: var(--gradient); color: white;
    box-shadow: 0 4px 20px rgba(124, 106, 255, 0.3);
}
.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(124, 106, 255, 0.45);
}
.btn-outline {
    background: transparent; color: var(--text);
    border: 1px solid var(--border);
}
.btn-outline:hover {
    border-color: var(--accent); color: var(--accent);
    box-shadow: 0 0 20px var(--accent-glow);
}

.scroll-indicator {
    position: absolute; bottom: 36px; left: 50%; transform: translateX(-50%);
}
.scroll-line {
    width: 2px; height: 40px; background: var(--border); position: relative;
    overflow: hidden; border-radius: 2px;
}
.scroll-line::after {
    content: ''; position: absolute; top: -40px; left: 0; width: 100%; height: 40px;
    background: var(--gradient); animation: scroll-anim 2s ease infinite;
}
@keyframes scroll-anim { 0% { top: -40px; } 100% { top: 40px; } }

/* ── Sections ──────────────────────────────────────────────── */
.section { padding: 100px 0; position: relative; }
.section-alt { background: var(--bg-alt); }

.section-title {
    font-size: clamp(1.8rem, 4vw, 2.5rem); font-weight: 800;
    letter-spacing: -1px; margin-bottom: 12px; text-align: center;
}

.section-subtitle {
    color: var(--text-dim); text-align: center; max-width: 580px;
    margin: 0 auto 52px; font-size: 1.02rem;
}

/* ── About ─────────────────────────────────────────────────── */
.about-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 48px; align-items: start; }
.about-text p { color: var(--text-dim); margin-bottom: 16px; font-size: 1.02rem; }
.about-text strong { color: var(--text); }

.about-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.stat-card {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 24px; text-align: center;
    transition: all 0.4s ease; position: relative; overflow: hidden;
}
.stat-card::before {
    content: ''; position: absolute; inset: 0;
    background: var(--gradient); opacity: 0;
    transition: opacity 0.4s; z-index: 0;
}
.stat-card:hover {
    border-color: transparent; transform: translateY(-4px);
    box-shadow: 0 8px 30px var(--accent-glow);
}
.stat-card:hover::before { opacity: 0.06; }
.stat-card > * { position: relative; z-index: 1; }

.stat-number {
    font-size: 2.2rem; font-weight: 800; background: var(--gradient);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.stat-suffix {
    font-size: 1.4rem; font-weight: 700; background: var(--gradient);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.stat-label { display: block; color: var(--text-dim); font-size: 0.85rem; margin-top: 6px; }

@media (max-width: 768px) {
    .about-grid { grid-template-columns: 1fr; }
}

/* ── How I work / approach ─────────────────────────────────── */
.approach-steps {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 18px;
    max-width: 1000px;
    margin: 0 auto 48px;
    padding: 0;
}

.approach-step {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px 22px;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.approach-step:hover {
    border-color: rgba(124, 106, 255, 0.35);
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.25);
}

.approach-num {
    font-family: var(--mono);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--accent-2);
    letter-spacing: 0.08em;
    display: block;
    margin-bottom: 8px;
}

.approach-step h3 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text);
}

.approach-step p {
    font-size: 0.9rem;
    color: var(--text-dim);
    line-height: 1.65;
    margin: 0;
}

.focus-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 18px;
    max-width: 1000px;
    margin: 0 auto;
}

.focus-card {
    background: linear-gradient(145deg, rgba(124, 106, 255, 0.06), transparent 55%);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px 22px 20px;
    transition: transform 0.35s ease, border-color 0.35s;
}

.focus-card:hover {
    transform: translateY(-4px);
    border-color: rgba(0, 224, 176, 0.25);
}

.focus-card h3 {
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--text);
}

.focus-card p {
    font-size: 0.88rem;
    color: var(--text-dim);
    line-height: 1.6;
    margin: 0;
}

.focus-card em {
    color: var(--accent);
    font-style: normal;
    font-weight: 500;
}

/* ── Projects ──────────────────────────────────────────────── */
.projects-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 24px; }

.project-card {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 28px;
    transition: all 0.4s ease; display: flex; flex-direction: column;
    position: relative; overflow: hidden;
}
.project-card::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
    background: var(--gradient); transform: scaleX(0); transform-origin: left;
    transition: transform 0.4s ease;
}
.project-card:hover::before { transform: scaleX(1); }
.project-card:hover {
    border-color: rgba(124, 106, 255, 0.3); transform: translateY(-6px);
    box-shadow: 0 16px 48px rgba(124, 106, 255, 0.1);
}

.project-type {
    display: inline-block;
    font-family: var(--mono);
    font-size: 0.65rem;
    font-weight: 500;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--accent-2);
    margin-bottom: 14px;
    padding: 4px 10px;
    border-radius: 6px;
    background: rgba(0, 224, 176, 0.08);
    border: 1px solid rgba(0, 224, 176, 0.2);
}

.project-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.project-icon { font-size: 2rem; }
.project-links a { color: var(--text-dim); transition: color 0.3s; }
.project-links a:hover { color: var(--accent); }

.project-title { font-size: 1.2rem; font-weight: 700; margin-bottom: 12px; }
.project-desc { color: var(--text-dim); font-size: 0.95rem; flex: 1; margin-bottom: 16px; }

.project-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.project-tags span {
    background: rgba(124, 106, 255, 0.08); color: var(--accent);
    padding: 5px 14px; border-radius: 20px; font-size: 0.78rem; font-weight: 500;
    border: 1px solid rgba(124, 106, 255, 0.15);
    transition: all 0.3s;
}
.project-card:hover .project-tags span {
    border-color: rgba(124, 106, 255, 0.3);
}

.project-insight {
    background: rgba(0, 224, 176, 0.06); border-left: 3px solid var(--accent-2);
    padding: 10px 14px; border-radius: 0 8px 8px 0; font-size: 0.88rem;
    color: var(--text-dim);
}
.project-insight strong { color: var(--accent-2); }

/* ── Timeline ──────────────────────────────────────────────── */
.timeline { max-width: 720px; margin: 0 auto; position: relative; padding-left: 44px; }
.timeline::before {
    content: ''; position: absolute; left: 15px; top: 0; bottom: 0;
    width: 2px;
    background: linear-gradient(to bottom, var(--accent), var(--accent-2), var(--border));
}

.timeline-item { position: relative; margin-bottom: 36px; }
.timeline-item:last-child { margin-bottom: 0; }

.timeline-marker {
    position: absolute; left: -44px; top: 6px; width: 12px; height: 12px;
    border-radius: 50%; background: var(--accent); border: 3px solid var(--bg);
    box-shadow: 0 0 0 3px var(--accent);
    z-index: 1; transition: all 0.3s;
}
.timeline-item:hover .timeline-marker {
    box-shadow: 0 0 0 3px var(--accent), 0 0 16px var(--accent-glow);
}
.timeline-marker::after {
    content: ''; position: absolute; inset: -6px;
    border-radius: 50%; background: rgba(124, 106, 255, 0.12);
}

.timeline-content {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 22px 26px;
    transition: all 0.4s ease;
}
.timeline-content:hover {
    border-color: rgba(124, 106, 255, 0.3);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
}

.timeline-year {
    font-family: var(--mono); font-size: 0.82rem; color: var(--accent);
    font-weight: 500; letter-spacing: 0.5px;
}
.timeline-content h3 { font-size: 1.1rem; font-weight: 700; margin: 4px 0 8px; }
.timeline-content p { color: var(--text-dim); font-size: 0.95rem; }
.timeline-location {
    font-size: 0.82rem; color: var(--text-dim); opacity: 0.6;
    margin-bottom: 8px !important;
}
.timeline-highlights {
    list-style: none; padding: 0; margin: 10px 0 0 0;
}
.timeline-highlights li {
    color: var(--text-dim); font-size: 0.92rem; padding: 5px 0 5px 18px;
    position: relative; transition: color 0.3s;
}
.timeline-highlights li::before {
    content: ''; position: absolute; left: 0; top: 50%;
    width: 6px; height: 6px; border-radius: 50%;
    background: var(--accent-2); transform: translateY(-50%);
}
.timeline-highlights li:hover { color: var(--text); }
.timeline-highlights strong { color: var(--text); }
.timeline-awards {
    margin-top: 12px; padding: 10px 14px;
    background: linear-gradient(135deg, rgba(124, 106, 255, 0.06), rgba(0, 224, 176, 0.04));
    border: 1px solid rgba(124, 106, 255, 0.12);
    border-radius: 8px; font-size: 0.85rem; color: var(--accent);
}
.timeline-marker.active {
    background: var(--accent-2); box-shadow: 0 0 0 3px var(--accent-2);
    animation: pulse 2s ease infinite;
}
@keyframes pulse {
    0%, 100% { box-shadow: 0 0 0 3px var(--accent-2); }
    50% { box-shadow: 0 0 0 6px rgba(0, 224, 176, 0.2), 0 0 20px rgba(0, 224, 176, 0.1); }
}

/* ── Skills ────────────────────────────────────────────────── */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}
.skill-category {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 26px;
    transition: all 0.4s ease; position: relative; overflow: hidden;
}
.skill-category::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
    background: var(--gradient); transform: scaleX(0);
    transform-origin: left; transition: transform 0.4s;
}
.skill-category:hover::before { transform: scaleX(1); }
.skill-category:hover {
    border-color: rgba(124, 106, 255, 0.3);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}
.skill-category h3 {
    font-size: 0.8rem; text-transform: uppercase; letter-spacing: 2px;
    color: var(--accent); margin-bottom: 18px; font-weight: 600;
}

.skill-items { display: flex; flex-direction: column; gap: 12px; }
.skill-item {
    display: flex; align-items: center; gap: 12px; font-size: 0.95rem;
    color: var(--text-dim); transition: color 0.3s;
}
.skill-item:hover { color: var(--text); }
.skill-dot {
    width: 7px; height: 7px; border-radius: 50%; background: var(--accent-2);
    flex-shrink: 0; transition: box-shadow 0.3s;
}
.skill-item:hover .skill-dot {
    box-shadow: 0 0 8px var(--accent-2-glow);
}

/* ── Contact ───────────────────────────────────────────────── */
.contact-container { text-align: center; }
.contact-links { display: flex; justify-content: center; gap: 20px; flex-wrap: wrap; }

.contact-card {
    display: flex; flex-direction: column; align-items: center; gap: 10px;
    padding: 28px 36px; background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); text-decoration: none; color: var(--text-dim);
    transition: all 0.4s ease; min-width: 130px; position: relative;
    overflow: hidden;
}
.contact-card::before {
    content: ''; position: absolute; inset: 0;
    background: var(--gradient); opacity: 0;
    transition: opacity 0.4s; z-index: 0;
}
.contact-card:hover {
    border-color: transparent; color: white;
    transform: translateY(-6px);
    box-shadow: 0 12px 36px var(--accent-glow);
}
.contact-card:hover::before { opacity: 0.08; }
.contact-card > * { position: relative; z-index: 1; }
.contact-card span { font-size: 0.9rem; font-weight: 600; }

/* ── Footer ────────────────────────────────────────────────── */
.footer {
    padding: 36px 0; text-align: center; border-top: 1px solid var(--border);
    color: var(--text-dim); font-size: 0.85rem;
    background: linear-gradient(to top, rgba(124, 106, 255, 0.02), transparent);
}
.footer-rev-wrap { white-space: nowrap; }
.footer-revision {
    font-size: 0.78rem; font-family: var(--mono); font-weight: 500;
    padding: 2px 7px; border-radius: 5px;
    border: 1px solid var(--border);
    background: rgba(124, 106, 255, 0.09);
    color: var(--text);
}
[data-theme="light"] .footer-revision {
    background: rgba(124, 106, 255, 0.06);
}

/* ── Animations ────────────────────────────────────────────── */
.fade-up {
    opacity: 0; transform: translateY(28px);
    animation: fadeUp 0.8s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
.delay-1 { animation-delay: 0.15s; }
.delay-2 { animation-delay: 0.3s; }
.delay-3 { animation-delay: 0.5s; }
.delay-4 { animation-delay: 0.7s; }

@keyframes fadeUp {
    to { opacity: 1; transform: translateY(0); }
}

.reveal {
    opacity: 0; transform: translateY(30px);
    transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1),
                transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}
.reveal.visible {
    opacity: 1; transform: translateY(0);
}

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 480px) {
    .hero-name { letter-spacing: -1.5px; }
    .projects-grid { grid-template-columns: 1fr; }
    .skills-grid { grid-template-columns: 1fr; }
    .contact-links { flex-direction: column; align-items: center; }
    .timeline { padding-left: 36px; }
    .timeline-marker { left: -36px; }
}

/* ── Site tabs & view panels ───────────────────────────────── */
.site-tabs {
    position: sticky; top: 64px; z-index: 99;
    background: rgba(6, 6, 11, 0.97);
    backdrop-filter: blur(20px) saturate(1.4);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
}
.site-tabs-inner {
    display: flex; gap: 2px;
    padding: 8px 20px; max-width: 1100px; margin: 0 auto;
    align-items: center; overflow-x: auto;
    scrollbar-width: none;
}
.site-tabs-inner::-webkit-scrollbar { display: none; }

/* Vertical divider between tab groups */
.tab-sep {
    width: 1px; align-self: stretch;
    background: var(--border);
    margin: 4px 10px; flex-shrink: 0;
}

.site-tab {
    appearance: none; border: none;
    background: transparent; color: var(--text-dim);
    font-family: var(--font); font-size: 0.82rem; font-weight: 500;
    padding: 7px 13px; cursor: pointer; white-space: nowrap;
    letter-spacing: 0.02em;
    display: inline-flex; align-items: center; gap: 6px;
    border-radius: 8px;
    transition: color 0.18s, background 0.18s, box-shadow 0.18s;
    position: relative; flex-shrink: 0;
}
.site-tab svg { flex-shrink: 0; opacity: 0.65; transition: opacity 0.18s; }
.site-tab:hover {
    color: var(--text);
    background: rgba(255, 255, 255, 0.05);
}
.site-tab:hover svg { opacity: 1; }
.site-tab:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-radius: 8px;
}
.site-tab.active {
    color: #fff;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
    box-shadow: 0 2px 14px rgba(124, 106, 255, 0.38);
    font-weight: 600;
}
.site-tab.active svg { opacity: 1; }

.main-views { min-height: 40vh; }
.view-panel[hidden] { display: none !important; }

/* Smooth fade when switching views */
.view-panel {
    animation: view-fade 0.18s ease;
}
@keyframes view-fade {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

@media (max-width: 600px) {
    .site-tabs-inner { padding: 6px 8px; gap: 1px; }
    .site-tab { font-size: 0.75rem; padding: 6px 10px; gap: 4px; }
    .tab-sep { margin: 4px 6px; }
}

/* ── Free tools ───────────────────────────────────────────── */
.tools-hero {
    padding: 56px 0 28px;
    text-align: center;
    border-bottom: 1px solid var(--border);
    background: linear-gradient(180deg, rgba(124, 106, 255, 0.06), transparent);
}
.tools-hero h2 { font-size: 1.75rem; margin-bottom: 12px; }
.tools-hero p { color: var(--text-dim); max-width: 56ch; margin: 0 auto; font-size: 0.98rem; }
.tools-badge {
    display: inline-block; margin-top: 14px; font-size: 0.75rem; font-weight: 600;
    letter-spacing: 0.06em; text-transform: uppercase;
    color: var(--accent-2); border: 1px solid rgba(0, 224, 176, 0.35);
    padding: 6px 12px; border-radius: 8px;
}

.tool-switcher {
    display: flex; flex-wrap: wrap; gap: 8px; justify-content: center;
    padding: 24px 24px 8px; max-width: 900px; margin: 0 auto;
}
.tool-switch {
    font-family: var(--font); font-size: 0.88rem; font-weight: 600;
    padding: 10px 20px; border-radius: 10px; cursor: pointer;
    border: 1px solid var(--border); background: var(--surface); color: var(--text-dim);
    transition: all 0.25s;
}
.tool-switch:hover { color: var(--text); border-color: rgba(124, 106, 255, 0.35); }
.tool-switch.active {
    color: white; border-color: var(--accent);
    background: rgba(124, 106, 255, 0.15);
}

.tool-panels-wrap { max-width: 900px; margin: 0 auto; padding: 0 24px 64px; }
.tool-panel[hidden] { display: none !important; }
.tool-panel {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 28px; margin-top: 16px;
}
.tool-panel h3 { font-size: 1.1rem; margin-bottom: 10px; }
.tool-panel > p.tool-hint { color: var(--text-dim); font-size: 0.88rem; margin-bottom: 20px; line-height: 1.6; }

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px; margin-bottom: 20px;
    align-items: end;
}
.form-field {
    display: flex; flex-direction: column;
}
.form-field label {
    display: block; font-size: 0.78rem; font-weight: 600; text-transform: uppercase;
    letter-spacing: 0.06em; color: var(--accent); margin-bottom: 6px;
    min-height: 2.4em; line-height: 1.2;
}
.form-field input, .form-field select {
    width: 100%; padding: 10px 12px; border-radius: 8px;
    border: 1px solid var(--border); background: var(--bg); color: var(--text);
    font-family: var(--mono); font-size: 0.9rem;
    height: 42px;
}
.form-field input:focus, .form-field select:focus {
    outline: none; border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-glow);
}
@media (max-width: 480px) {
    .form-grid { grid-template-columns: 1fr 1fr; }
}

.btn-tool {
    font-family: var(--font); font-weight: 600; font-size: 0.9rem;
    padding: 12px 22px; border-radius: 10px; cursor: pointer; border: none;
    background: var(--gradient); color: white; margin-right: 10px; margin-bottom: 10px;
}
.btn-tool.secondary {
    background: transparent; border: 1px solid var(--border); color: var(--text);
}

.ab-divider {
    margin: 36px 0 32px;
    border: none; height: 1px;
    background: linear-gradient(90deg, transparent, var(--border) 20%, var(--border) 80%, transparent);
}

.ab-results, .tool-error {
    margin-top: 20px; padding: 18px; border-radius: 10px;
    background: var(--bg-alt); border: 1px solid var(--border);
    font-family: var(--mono); font-size: 0.85rem; line-height: 1.65;
}
.tool-error { border-color: rgba(255, 100, 100, 0.35); color: #ff9b9b; }
.ab-results dl { display: grid; grid-template-columns: auto 1fr; gap: 8px 20px; }
.ab-results dt { color: var(--text-dim); }
.ab-results dd { color: var(--text); }

.file-drop-label {
    position: relative;
    display: block; border: 2px dashed var(--border); border-radius: var(--radius);
    padding: 28px; text-align: center; cursor: pointer; color: var(--text-dim);
    transition: border-color 0.25s, background 0.25s; margin-bottom: 20px;
}
.file-drop-label:hover { border-color: var(--accent); background: var(--accent-glow); }
.file-drop-label input { position: absolute; width: 0; height: 0; opacity: 0; }

.cohort-table-wrap { overflow-x: auto; margin-top: 16px; border-radius: 10px; border: 1px solid var(--border); }
.cohort-table { width: 100%; border-collapse: collapse; font-size: 0.8rem; font-family: var(--mono); }
.cohort-table th, .cohort-table td { padding: 10px 12px; text-align: right; border-bottom: 1px solid var(--border); }
.cohort-table th:first-child, .cohort-table td:first-child { text-align: left; position: sticky; left: 0; background: var(--surface); z-index: 1; }
.cohort-table thead th { background: var(--bg-alt); color: var(--accent); font-weight: 600; }

.sql-io { display: grid; gap: 16px; }
@media (min-width: 800px) {
    .sql-io { grid-template-columns: 1fr 1fr; }
}
.sql-io textarea {
    width: 100%; min-height: 260px; padding: 16px; border-radius: 10px;
    border: 1px solid var(--border); background: var(--bg); color: var(--text);
    font-family: var(--mono); font-size: 0.82rem; line-height: 1.6; resize: vertical;
}
.sql-io pre {
    min-height: 260px; padding: 16px; border-radius: 10px; overflow: auto;
    border: 1px solid rgba(124, 106, 255, 0.25);
    background: #09090f; /* slightly darker than --bg for contrast */
    font-family: var(--mono); font-size: 0.82rem; line-height: 1.6;
    white-space: pre; word-break: normal; overflow-x: auto; tab-size: 4;
}
/* ── SQL syntax highlight tokens ──────────────────────────── */
.sql-kw   { color: #7c6aff; font-weight: 600; }     /* keywords   — purple  */
.sql-fn   { color: #a78bfa; }                         /* functions  — soft purple */
.sql-str  { color: #f0a868; }                         /* strings    — amber   */
.sql-num  { color: #00e0b0; }                         /* numbers    — teal    */
.sql-cmt  { color: #555570; font-style: italic; }     /* comments   — dim     */
.sql-ident { color: #9ed0e6; }                        /* quoted ids — ice blue */

/* ── JSON syntax highlight tokens ─────────────────────────── */
/* Keys: cool blue (structural labels). Values: json-val + type — warm / literal hues. */
.json-key { color: #82aaff; font-weight: 600; }
.json-val { font-weight: 400; }
.json-val.json-str  { color: #ffcb6b; }
.json-val.json-num  { color: #c3e88d; }
.json-val.json-bool { color: #f78c6c; font-weight: 500; }
.json-val.json-null { color: #6b6d85; font-style: italic; }
[data-theme="light"] .json-key { color: #1565c0; }
[data-theme="light"] .json-val.json-str  { color: #b45309; }
[data-theme="light"] .json-val.json-num  { color: #2e7d32; }
[data-theme="light"] .json-val.json-bool { color: #c2410c; }
[data-theme="light"] .json-val.json-null { color: #787891; }

.sql-hints-block {
    margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--border);
}
.sql-hints-block h4 { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--accent); margin-bottom: 12px; }
.sql-hints-list { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.sql-hints-list li {
    font-size: 0.88rem; color: var(--text-dim); padding-left: 14px; border-left: 2px solid var(--accent-2);
}
.sql-hints-list code { color: var(--text); font-family: var(--mono); font-size: 0.85em; }

.home-teaser { padding: 80px 0; }
.home-teaser .about-grid { margin-top: 32px; }
@media (max-width: 768px) {
    .site-tabs-inner { overflow-x: auto; flex-wrap: nowrap; -webkit-overflow-scrolling: touch; }
}

/* ── Impact strip (Home) ─────────────────────────────────── */
.impact-strip { padding: 80px 0; }
.impact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 18px; max-width: 1000px; margin: 0 auto;
}
.impact-card {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 28px 24px; text-align: center;
    display: flex; flex-direction: column; gap: 6px;
    transition: transform 0.35s, border-color 0.35s, box-shadow 0.35s;
}
.impact-card:hover {
    transform: translateY(-5px); border-color: rgba(124, 106, 255, 0.35);
    box-shadow: 0 12px 36px rgba(124, 106, 255, 0.08);
}
.impact-metric {
    font-size: 1.9rem; font-weight: 800; line-height: 1.1;
    background: var(--gradient); -webkit-background-clip: text;
    -webkit-text-fill-color: transparent; background-clip: text;
}
.impact-label { font-size: 0.92rem; font-weight: 600; color: var(--text); }
.impact-where {
    font-size: 0.78rem; color: var(--text-dim); font-style: italic; margin-top: 2px;
}

/* ── Theme toggle ─────────────────────────────────────────── */
.theme-toggle {
    appearance: none; border: 1px solid var(--border);
    background: var(--surface); border-radius: 50%;
    width: 36px; height: 36px; display: flex; align-items: center; justify-content: center;
    cursor: pointer; color: var(--text-dim); margin-left: 8px;
    transition: color 0.2s, border-color 0.2s, background 0.2s;
}
.theme-toggle:hover { color: var(--text); border-color: var(--accent); }
.theme-icon-moon { display: none; }
[data-theme="light"] .theme-icon-sun  { display: none; }
[data-theme="light"] .theme-icon-moon { display: block; }

/* ── Light theme ──────────────────────────────────────────── */
[data-theme="light"] {
    --bg:        #f5f5fa;
    --bg-alt:    #eeeef4;
    --surface:   #ffffff;
    --border:    #d4d4e0;
    --text:      #1a1a2e;
    --text-dim:  #5a5a78;
    --accent:    #5b4cd4;
    --accent-2:  #009e7a;
    --accent-glow: rgba(91, 76, 212, 0.12);
    --accent-2-glow: rgba(0, 158, 122, 0.10);
    --shadow:    0 8px 32px rgba(0, 0, 0, 0.08);
    --glow:      0 0 60px rgba(91, 76, 212, 0.06);
}
[data-theme="light"] body { background: var(--bg); color: var(--text); }
[data-theme="light"] .nav {
    background: rgba(245, 245, 250, 0.85);
}
[data-theme="light"] .nav.scrolled {
    background: rgba(245, 245, 250, 0.97);
}
[data-theme="light"] .site-tabs {
    background: rgba(245, 245, 250, 0.97);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
}
[data-theme="light"] .site-tab:hover {
    background: rgba(0, 0, 0, 0.05);
}
[data-theme="light"] .site-tab.active {
    color: #fff;
    box-shadow: 0 2px 12px rgba(91, 76, 212, 0.32);
}
[data-theme="light"] .mini-dashboard {
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
}
[data-theme="light"] .sql-io pre {
    background: #f0f0f8; border-color: var(--border);
}
[data-theme="light"] .sql-kw  { color: #5b4cd4; }
[data-theme="light"] .sql-fn  { color: #7c6aff; }
[data-theme="light"] .sql-str { color: #c06020; }
[data-theme="light"] .sql-num { color: #009e7a; }
[data-theme="light"] .sql-cmt { color: #9090a8; }
[data-theme="light"] .sql-ident { color: #2070a0; }
[data-theme="light"] .hero-name {
    background: linear-gradient(135deg, #5b4cd4, #009e7a);
    -webkit-background-clip: text; background-clip: text;
}
[data-theme="light"] .cohort-table td[style] { color: #1a1a2e !important; }

[data-theme="light"] .hero-bg-grid {
    background-image:
        linear-gradient(rgba(91, 76, 212, 0.06) 1px, transparent 1px),
        linear-gradient(90deg, rgba(91, 76, 212, 0.06) 1px, transparent 1px);
}
[data-theme="light"] ::selection { background: rgba(91, 76, 212, 0.2); color: #1a1a2e; }

/* ── Coming Soon panels (Blogs / Fun) ──────────────────────── */
.coming-soon-wrap {
    display: flex; justify-content: center; padding: 60px 0;
}
.coming-soon-card {
    text-align: center; max-width: 480px; padding: 56px 40px;
    border: 1px solid var(--border); border-radius: 18px;
    background: rgba(124, 106, 255, 0.04);
}
.coming-soon-icon { font-size: 3rem; display: block; margin-bottom: 20px; }
.coming-soon-card h3 {
    font-size: 1.6rem; font-weight: 700; margin-bottom: 14px;
    background: var(--gradient); -webkit-background-clip: text;
    -webkit-text-fill-color: transparent; background-clip: text;
}
.coming-soon-card p { color: var(--text-dim); line-height: 1.7; font-size: 0.95rem; }

/* ── SQL quiz (Fun tab) ───────────────────────────────────── */
.sql-quiz-app {
    max-width: 640px; margin: 0 auto; padding: 8px 0 48px;
}
.sql-quiz-panel {
    border: 1px solid var(--border); border-radius: 16px;
    padding: 28px 24px 32px;
    background: rgba(124, 106, 255, 0.04);
}
.sql-quiz-header { margin-bottom: 14px; text-align: center; }
.sql-quiz-title {
    margin: 0 0 8px; font-size: 0; /* children set visual size */
    font-weight: 800; letter-spacing: -0.03em; line-height: 1.15;
}
.sql-quiz-title-main {
    font-size: clamp(1.45rem, 4vw, 1.85rem);
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: inline-block;
}
.sql-quiz-monikers {
    margin: 0; font-size: 0.72rem; font-weight: 500;
    letter-spacing: 0.14em; text-transform: uppercase;
    color: var(--text-dim); font-family: var(--mono);
}
.sql-quiz-mid-dot { letter-spacing: 0; opacity: 0.85; }
.sql-quiz-lead, .sql-quiz-privacy {
    font-size: 0.88rem; color: var(--text-dim); line-height: 1.65; margin-bottom: 18px;
}
.sql-quiz-privacy { font-size: 0.78rem; margin-top: 8px; margin-bottom: 16px; opacity: 0.9; }
.sql-quiz-reg-form .btn-tool { margin-top: 8px; }
.sql-quiz-progress-row {
    display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px;
    margin-bottom: 16px;
}
.sql-quiz-progress-label {
    font-size: 0.8rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em;
    color: var(--accent);
}
.sql-quiz-timer {
    font-size: 1rem; font-weight: 700; font-variant-numeric: tabular-nums;
    padding: 6px 14px; border-radius: 8px; border: 1px solid var(--border);
    background: rgba(0, 0, 0, 0.22); color: var(--text);
}
[data-theme="light"] .sql-quiz-timer { background: rgba(0, 0, 0, 0.06); }
.sql-quiz-timer.is-low { color: #ffb86c; border-color: rgba(255, 184, 108, 0.45); }
.sql-quiz-timer.is-critical {
    color: #f78c6c; border-color: rgba(247, 140, 108, 0.5);
    animation: sql-quiz-timer-pulse 0.9s ease-in-out infinite;
}
@keyframes sql-quiz-timer-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.55; }
}
/* Discourage copying question text (not foolproof — see site notice). */
#sql-quiz-play.sql-quiz-play-locked,
#sql-quiz-play.sql-quiz-play-locked * {
    -webkit-user-select: none;
    user-select: none;
    -moz-user-select: none;
}
/* ── Question type badge ──────────────────────────────────────────────── */
.sql-quiz-q-type-badge {
    display: inline-block;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    padding: 2px 9px;
    border-radius: 5px;
    margin-bottom: 10px;
    line-height: 1.8;
}
.sql-quiz-q-type-badge.is-concept {
    background: rgba(124, 106, 255, 0.14);
    color: var(--accent);
    border: 1px solid rgba(124, 106, 255, 0.32);
}
.sql-quiz-q-type-badge.is-query {
    background: rgba(46, 213, 115, 0.11);
    color: #2ed573;
    border: 1px solid rgba(46, 213, 115, 0.28);
}
[data-theme="light"] .sql-quiz-q-type-badge.is-query {
    color: #1a9e4a;
    border-color: rgba(26, 158, 74, 0.3);
    background: rgba(26, 158, 74, 0.07);
}
/* Inline validation message */
.sql-quiz-inline-err {
    color: #f78c6c;
    font-size: 0.82rem;
    margin-top: 8px;
}
.sql-quiz-q-wrap { margin-bottom: 24px; }
.sql-quiz-q-text {
    font-size: 1.02rem; line-height: 1.55; margin-bottom: 18px; color: var(--text);
}
.sql-quiz-q-text.sql-quiz-q-code {
    font-family: var(--mono);
    font-size: 0.86rem;
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-word;
    padding: 14px 16px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: rgba(0, 0, 0, 0.2);
}
[data-theme="light"] .sql-quiz-q-text.sql-quiz-q-code {
    background: rgba(0, 0, 0, 0.04);
}
.sql-quiz-options { display: flex; flex-direction: column; gap: 10px; }
.sql-quiz-opt {
    display: flex; align-items: flex-start; gap: 10px; cursor: pointer;
    padding: 12px 14px; border-radius: 10px; border: 1px solid var(--border);
    background: rgba(0, 0, 0, 0.12); transition: border-color 0.15s, background 0.15s;
}
[data-theme="light"] .sql-quiz-opt { background: rgba(255, 255, 255, 0.6); }
.sql-quiz-opt:hover { border-color: var(--accent); }
.sql-quiz-opt input { margin-top: 3px; accent-color: var(--accent); }
.sql-quiz-opt span { font-size: 0.9rem; line-height: 1.45; }
.sql-quiz-nav { display: flex; gap: 12px; flex-wrap: wrap; justify-content: flex-end; }
.sql-quiz-score-line { font-size: 1.15rem; font-weight: 600; margin: 12px 0; }
.sql-quiz-tier-msg { color: var(--text-dim); line-height: 1.65; margin-bottom: 20px; }
.sql-quiz-subh { font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.07em; color: var(--accent); margin-bottom: 8px; }
.sql-quiz-topics-intro { font-size: 0.88rem; color: var(--text-dim); margin-bottom: 10px; }
.sql-quiz-topics-list {
    margin: 0; padding-left: 20px; color: var(--text); line-height: 1.7; font-size: 0.92rem;
}
.sql-quiz-email-status { font-size: 0.85rem; color: var(--text-dim); margin: 20px 0 12px; min-height: 1.4em; }
.sql-quiz-email-status.is-ok { color: var(--accent-2); }
.sql-quiz-email-status.is-err { color: #f78c6c; }
.sql-quiz-share-row {
    display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 18px; align-items: center;
}
.sql-quiz-copy-hint {
    font-size: 0.82rem; color: var(--accent-2); margin: -8px 0 16px;
}
.sql-quiz-pro-card {
    text-align: center; padding: 32px 24px; margin-bottom: 28px;
    border-radius: 16px; border: 2px solid var(--accent);
    background: linear-gradient(145deg, rgba(124, 106, 255, 0.15), rgba(0, 224, 176, 0.08));
    box-shadow: 0 8px 32px rgba(124, 106, 255, 0.2);
}
.sql-quiz-pro-badge {
    display: inline-block; font-size: 0.75rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.1em; padding: 6px 12px; border-radius: 999px;
    background: var(--gradient); color: #fff; margin-bottom: 14px;
}
.sql-quiz-pro-card h3 {
    font-size: 1.75rem; margin-bottom: 12px;
    background: var(--gradient); -webkit-background-clip: text;
    -webkit-text-fill-color: transparent; background-clip: text;
}
.sql-quiz-pro-card p { color: var(--text-dim); line-height: 1.65; font-size: 0.95rem; }

/* ── Fun games grid ──────────────────────────────────────────── */
.fun-games-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-top: 40px;
}
@media (max-width: 720px) { .fun-games-row { grid-template-columns: 1fr; } }

.fun-game-card {
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 28px 24px;
    display: flex;
    flex-direction: column;
}
.fun-game-badge {
    display: inline-block;
    width: fit-content;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    padding: 3px 9px;
    border-radius: 999px;
    background: rgba(124,106,255,0.14);
    color: var(--accent);
    margin-bottom: 10px;
}
.fun-game-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0 0 6px;
}
.fun-game-desc {
    font-size: 0.875rem;
    color: var(--text-dim);
    margin: 0 0 20px;
    line-height: 1.5;
}

/* ── SQL Word (Wordle) ───────────────────────────────────────── */
.sw-grid {
    display: grid;
    grid-template-rows: repeat(6, 50px);
    grid-template-columns: repeat(5, 50px);
    gap: 6px;
    margin: 0 auto 18px;
    width: fit-content;
}
.sw-cell {
    width: 50px;
    height: 50px;
    border: 2px solid var(--border);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 21px;
    font-weight: 700;
    color: var(--text);
    text-transform: uppercase;
    user-select: none;
    transition: border-color 0.12s, background 0.15s;
}
.sw-cell[data-letter] { border-color: rgba(255,255,255,0.3); }
.sw-cell.sw-correct { background: #1f8c3b; border-color: #1f8c3b; color: #fff; }
.sw-cell.sw-present { background: #b5850c; border-color: #b5850c; color: #fff; }
.sw-cell.sw-absent  { background: #252530; border-color: #252530; color: #666; }
.sw-cell.sw-pop { animation: sw-pop 0.14s ease; }
@keyframes sw-pop { 50% { transform: scale(1.14); } }

.sw-keyboard {
    display: flex;
    flex-direction: column;
    gap: 7px;
    width: fit-content;
    margin: 0 auto 14px;
}
.sw-key-row { display: flex; gap: 5px; justify-content: center; }
.sw-key {
    height: 40px;
    min-width: 34px;
    padding: 0 4px;
    border: none;
    border-radius: 4px;
    background: rgba(255,255,255,0.1);
    color: var(--text);
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    text-transform: uppercase;
    transition: background 0.12s, color 0.12s;
}
.sw-key.wide { min-width: 56px; font-size: 10px; }
.sw-key:hover:not(:disabled) { background: rgba(255,255,255,0.18); }
.sw-key.sw-correct { background: #1f8c3b; color: #fff; }
.sw-key.sw-present { background: #b5850c; color: #fff; }
.sw-key.sw-absent  { background: rgba(255,255,255,0.04); color: var(--text-dim); }
[data-theme="light"] .sw-key { background: #d3d6da; color: #1a1a1a; }
[data-theme="light"] .sw-cell { border-color: #d3d6da; color: #1a1a1a; }

.sw-message {
    text-align: center;
    font-size: 0.88rem;
    color: var(--text-dim);
    min-height: 1.3em;
    margin-bottom: 10px;
}
.sw-share-btn { margin: 0 auto; display: block; }

/* ── Metric Blitz ────────────────────────────────────────────── */
.mb-state { flex: 1; }
.mb-hdr {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
}
.mb-qnum { font-size: 0.82rem; color: var(--text-dim); }
.mb-timer {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--accent);
    font-variant-numeric: tabular-nums;
    min-width: 2.4em;
    text-align: right;
}
.mb-timer.mb-hurry { color: #f78c6c; }
.mb-question {
    font-size: 0.95rem;
    font-weight: 500;
    line-height: 1.55;
    margin-bottom: 14px;
}
.mb-options { display: flex; flex-direction: column; gap: 8px; }
.mb-opt {
    padding: 10px 14px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: rgba(0,0,0,0.12);
    cursor: pointer;
    font-size: 0.875rem;
    text-align: left;
    color: var(--text);
    width: 100%;
    transition: border-color 0.12s, background 0.12s;
}
.mb-opt:hover:not(:disabled) { border-color: var(--accent); }
.mb-opt:disabled { cursor: default; }
.mb-opt.mb-correct { border-color: #1f8c3b; background: rgba(31,140,59,0.15); }
.mb-opt.mb-wrong   { border-color: #cf6679; background: rgba(207,102,121,0.12); }
.mb-score-line {
    font-size: 1.3rem;
    font-weight: 700;
    margin: 24px 0 10px;
    text-align: center;
    line-height: 1.4;
}
