:root {
    --bg: #0F172A;
    --bg-soft: #111827;
    --paper: rgba(17, 24, 39, 0.88);
    --paper-strong: #111827;
    --ink: #FFFFFF;
    --muted: rgba(229, 231, 235, 0.78);
    --line: rgba(229, 231, 235, 0.12);
    --line-strong: rgba(229, 231, 235, 0.24);
    --primary: #217346;
    --primary-strong: #33C481;
    --secondary: #3B82F6;
    --secondary-strong: #1E3A8A;
    --accent: #FACC15;
    --reward: #F97316;
    --info: #3B82F6;
    --danger: #EF4444;
    --shadow-soft: 0 14px 34px rgba(2, 6, 23, 0.42);
    --shadow-lg: 0 24px 70px rgba(2, 6, 23, 0.55);
    --radius-xl: 32px;
    --radius-lg: 24px;
    --radius-md: 18px;
    --radius-sm: 14px;
    --font-display: 'Syne', sans-serif;
    --font-body: 'Manrope', sans-serif;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

html,
body {
    overflow-x: hidden;
}

::selection {
    background: rgba(51, 196, 129, 0.3);
    color: #FFFFFF;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: var(--font-body);
    color: var(--ink);
    background:
    radial-gradient(circle at 0% 0%, rgba(33, 115, 70, 0.26), transparent 28%),
    radial-gradient(circle at 100% 12%, rgba(59, 130, 246, 0.24), transparent 26%),
    radial-gradient(circle at 85% 78%, rgba(249, 115, 22, 0.16), transparent 20%),
    linear-gradient(180deg, #0F172A 0%, #111827 100%);
}

body::before,
body::after {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
}

body::before {
    background-image:
        linear-gradient(rgba(229, 231, 235, 0.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(229, 231, 235, 0.025) 1px, transparent 1px);
    background-size: 30px 30px;
    opacity: 0.2;
}

body::after {
    background: radial-gradient(circle at center, transparent 50%, rgba(2, 6, 23, 0.42) 100%);
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
textarea {
    font: inherit;
}

button,
a,
input,
textarea {
    -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible {
    outline: 0;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.2);
}

* {
    scrollbar-width: thin;
    scrollbar-color: rgba(59, 130, 246, 0.55) rgba(255, 255, 255, 0.06);
}

*::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

*::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

*::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, rgba(59, 130, 246, 0.9), rgba(33, 115, 70, 0.9));
    border-radius: 999px;
    border: 2px solid rgba(15, 23, 42, 0.7);
}

img {
    max-width: 100%;
    display: block;
}

.page-shell {
    position: relative;
    z-index: 1;
    width: min(1400px, calc(100% - 32px));
    margin: 0 auto;
    padding: 20px 0 72px;
}

.page-shell--landing {
    padding-top: 24px;
}

.site-header,
.topbar,
.hero,
.feature-ribbon,
.auth-layout,
.dashboard-grid,
.play-layout,
.progress-section,
.curriculum-showcase,
.lesson-spotlight,
.dashboard-hero-grid,
.podium-grid {
    position: relative;
    z-index: 1;
}

.site-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 22px;
    padding: 14px 18px;
    border: 1px solid var(--line);
    border-radius: 24px;
    background: rgba(17, 24, 39, 0.76);
    backdrop-filter: blur(16px);
    box-shadow: var(--shadow-soft);
}

.site-header--landing {
    margin-bottom: 28px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 14px;
}

.brand__mark {
    width: 46px;
    height: 46px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    background: transparent;
    color: #FFFFFF;
    font-size: 1.15rem;
    box-shadow: none;
    overflow: hidden;
}

.brand__mark img {
    width: 46px;
    height: 46px;
    object-fit: contain;
}

.brand strong,
.site-nav a,
.button,
.pill,
.hero__chips span,
.metric-pill strong,
.level-card__number,
.stat-card strong,
.focus-ring span,
.podium-card__place {
    font-weight: 800;
}

.brand small {
    display: block;
    color: var(--muted);
}

.site-nav {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

.site-nav a {
    padding: 10px 14px;
    border-radius: 999px;
    color: var(--muted);
    transition: background-color 180ms ease, color 180ms ease, transform 180ms ease;
}

.site-nav a:hover {
    background: rgba(59, 130, 246, 0.14);
    color: var(--ink);
    transform: translateY(-1px);
}

.site-nav a:focus-visible,
.level-card__footer a:focus-visible,
.link-inline:focus-visible {
    border-radius: 999px;
}

.hero {
    display: grid;
    gap: 26px;
    margin-bottom: 28px;
}

.hero--enhanced {
    grid-template-columns: minmax(0, 1.12fr) minmax(320px, 0.88fr);
    align-items: stretch;
    position: relative;
}

.hero__copy,
.floating-panel,
.ribbon-card,
.curriculum-card,
.auth-card,
.stat-card,
.focus-card,
.levels-panel,
.side-panel section,
.prompt-card,
.answer-card,
.mini-stat-card,
.leaderboard-hero,
.leaderboard-table-card,
.excel-card,
.hint-card,
.lesson-spotlight__card,
.bottom-banner,
.podium-card {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--radius-xl);
    backdrop-filter: blur(18px);
    box-shadow: var(--shadow-lg);
}

.hero__copy,
.floating-panel,
.ribbon-card,
.curriculum-card,
.auth-card,
.stat-card,
.focus-card,
.levels-panel,
.side-panel section,
.prompt-card,
.answer-card,
.mini-stat-card,
.leaderboard-hero,
.leaderboard-table-card,
.excel-card,
.hint-card,
.lesson-spotlight__card,
.bottom-banner,
.podium-card,
.feature-list article,
.formula-example,
.focus-list li,
.lesson-spotlight__meta span {
    position: relative;
    overflow: hidden;
}

.hero__copy {
    overflow: visible;
}

.hero--enhanced {
    overflow: visible;
}

.hero__copy::after,
.floating-panel::after,
.ribbon-card::after,
.curriculum-card::after,
.auth-card::after,
.stat-card::after,
.focus-card::after,
.levels-panel::after,
.side-panel section::after,
.prompt-card::after,
.answer-card::after,
.mini-stat-card::after,
.leaderboard-hero::after,
.leaderboard-table-card::after,
.excel-card::after,
.hint-card::after,
.lesson-spotlight__card::after,
.bottom-banner::after,
.podium-card::after {
    content: '';
    position: absolute;
    inset: 0 0 auto;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    pointer-events: none;
}

.hero__copy,
.floating-panel,
.auth-card,
.focus-card,
.levels-panel,
.side-panel section,
.prompt-card,
.answer-card,
.mini-stat-card,
.leaderboard-hero,
.leaderboard-table-card,
.excel-card,
.hint-card,
.lesson-spotlight__card,
.bottom-banner {
    padding: 26px;
}

.side-panel section {
    padding: 30px;
}

.hero__copy h1,
.hero__copy h2,
.topbar h1,
.topbar h2,
.focus-card h2,
.curriculum-showcase h2,
.auth-card h2,
.prompt-card h2,
.lesson-spotlight__card h2,
.leaderboard-hero h2,
.level-card h3,
.podium-card h3,
.section-heading h2,
.hint-card h2,
.hint-card h3,
.answer-card h2,
.mini-stat-card h3 {
    margin: 0;
    font-family: var(--font-display);
    letter-spacing: -0.03em;
}

.hero__copy h1 {
    font-size: clamp(3rem, 7vw, 5.8rem);
    line-height: 0.92;
    max-width: 9ch;
    margin-bottom: 18px;
}

.hero__copy p,
.topbar__lead,
.hero__score span,
.hero__score small,
.section-heading--wide p,
.stat-card p,
.leaderboard-hero p,
.prompt-card p,
.hint-card li,
.level-card p,
.leaderboard-list span,
.mini-stat-card p,
.focus-card p,
.curriculum-card p,
.ribbon-card p,
.bottom-banner p,
.podium-card p,
.feature-list article p,
.auth-card__intro p {
    color: var(--muted);
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
    font-size: 0.77rem;
    font-weight: 800;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--accent);
}

.eyebrow::before {
    content: '';
    width: 32px;
    height: 2px;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--primary-strong), var(--secondary));
}

.hero__actions,
.hero__chips,
.hero__metrics,
.topbar__actions,
.auth-tabs,
.level-card__header,
.level-card__footer,
.section-heading,
.progress-labels,
.focus-card__actions,
.lesson-spotlight__meta {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.hero__actions {
    margin-top: 26px;
}

.hero__chips {
    margin-top: 26px;
}

.hero__chips span,
.pill,
.metric-pill,
.podium-card__place {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 999px;
}

.hero__chips span {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--line);
}

.hero__metrics {
    margin-top: 26px;
    position: relative;
}

.metrics-bg {
    position: absolute;
    inset: -60px -50px;
    pointer-events: none;
    z-index: 0;
    filter: blur(50px);
}

.metrics-blob {
    position: absolute;
    border-radius: 50%;
}

.metrics-blob--1 {
    width: 180px;
    height: 180px;
    left: 0;
    top: -50%;
    background: rgba(51, 196, 129, 0.45);
    animation: blob-drift-1 7s ease-in-out infinite alternate;
}

.metrics-blob--2 {
    width: 160px;
    height: 160px;
    left: 35%;
    top: -30%;
    background: rgba(59, 130, 246, 0.4);
    animation: blob-drift-2 9s ease-in-out infinite alternate;
}

.metrics-blob--3 {
    width: 150px;
    height: 150px;
    right: 0;
    top: -40%;
    background: rgba(250, 204, 21, 0.35);
    animation: blob-drift-3 8s ease-in-out infinite alternate;
}

@keyframes blob-drift-1 {
    0%   { transform: translate(0, 0) scale(1); }
    50%  { transform: translate(30px, 15px) scale(1.15); }
    100% { transform: translate(-10px, -10px) scale(0.9); }
}

@keyframes blob-drift-2 {
    0%   { transform: translate(0, 0) scale(1); }
    50%  { transform: translate(-25px, 10px) scale(1.2); }
    100% { transform: translate(20px, -15px) scale(0.85); }
}

@keyframes blob-drift-3 {
    0%   { transform: translate(0, 0) scale(1); }
    50%  { transform: translate(-20px, 20px) scale(1.1); }
    100% { transform: translate(15px, -5px) scale(0.95); }
}

.metric-pill {
    position: relative;
    z-index: 1;
}

.metric-pill {
    min-width: 140px;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    padding: 16px 18px;
    border-radius: 22px;
    background: rgba(15, 23, 42, 0.56);
    border: 1px solid var(--line);
    position: relative;
    overflow: hidden;
}

.metric-pill::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(51, 196, 129, 0.15), rgba(59, 130, 246, 0.12));
    opacity: 0;
    transition: opacity 400ms ease;
    pointer-events: none;
}

.metric-pill:hover::before {
    opacity: 1;
}

.metric-pill span {
    color: var(--muted);
    font-size: 0.92rem;
    transition: color 300ms ease;
}

.metric-pill:hover span {
    color: var(--ink);
}

.hero-stage {
    position: relative;
    min-height: 100%;
}

.floating-panel {
    position: relative;
    min-height: 100%;
    overflow: hidden;
    width: 100%;
    background: linear-gradient(145deg, rgba(17, 24, 39, 0.92), rgba(15, 23, 42, 0.96));
    border: 1px solid transparent;
    background-clip: padding-box;
    box-shadow:
        0 0 0 1px rgba(59, 130, 246, 0.15),
        0 0 40px rgba(59, 130, 246, 0.08),
        0 24px 70px rgba(2, 6, 23, 0.6),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
    padding: 32px 28px;
    transition: box-shadow 0.4s ease, transform 0.4s ease;
}

.floating-panel:hover {
    box-shadow:
        0 0 0 1px rgba(59, 130, 246, 0.22),
        0 0 60px rgba(59, 130, 246, 0.12),
        0 30px 80px rgba(2, 6, 23, 0.65),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

.floating-panel .auth-tabs {
    margin-bottom: 24px;
}

.floating-panel .auth-panel h2 {
    font-family: var(--font-display);
    font-size: 1.45rem;
    margin-bottom: 20px;
    background: linear-gradient(135deg, #FFFFFF 30%, rgba(59, 130, 246, 0.8));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.floating-panel .stacked-form {
    gap: 18px;
}

.floating-panel .stacked-form label span {
    font-size: 0.88rem;
    color: var(--muted);
    letter-spacing: 0.02em;
}

.floating-panel .stacked-form input {
    padding: 14px 16px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(8px);
    transition: border-color 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
}

.floating-panel .stacked-form input:hover {
    border-color: rgba(59, 130, 246, 0.3);
    background: rgba(15, 23, 42, 0.75);
}

.floating-panel .stacked-form input:focus {
    border-color: rgba(59, 130, 246, 0.7);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.12), 0 0 20px rgba(59, 130, 246, 0.08);
    background: rgba(15, 23, 42, 0.85);
}

.floating-panel .button {
    margin-top: 8px;
    width: 100%;
    padding: 16px 20px;
    font-size: 1.02rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    position: relative;
    overflow: hidden;
}

.floating-panel .button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.15), transparent);
    transition: left 0.5s ease;
}

.floating-panel .button:hover::before {
    left: 100%;
}

.floating-panel::before {
    content: '';
    position: absolute;
    inset: auto -10% -35% auto;
    width: 320px;
    height: 320px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.2) 0%, rgba(59, 130, 246, 0) 72%);
    animation: panel-glow-pulse 4s ease-in-out infinite alternate;
}

@keyframes panel-glow-pulse {
    0%   { opacity: 0.6; transform: scale(1); }
    100% { opacity: 1; transform: scale(1.1); }
}

.panel-accent {
    position: absolute;
    top: 0;
    left: 10%;
    right: 10%;
    height: 2px;
    border-radius: 0 0 4px 4px;
    background: linear-gradient(90deg, transparent, var(--secondary), var(--primary-strong), transparent);
    z-index: 2;
    animation: accent-shimmer 3s ease-in-out infinite;
}

@keyframes accent-shimmer {
    0%, 100% { opacity: 0.7; }
    50%      { opacity: 1; }
}

.hero__score strong {
    display: block;
    margin-top: 8px;
    font-family: var(--font-display);
    font-size: clamp(2.1rem, 4vw, 3rem);
}

.hero__progress {
    margin: 18px 0 8px;
}

.progress-labels {
    justify-content: space-between;
    margin-bottom: 10px;
    color: var(--muted);
    font-size: 0.92rem;
}

.progress-bar {
    width: 100%;
    height: 14px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(229, 231, 235, 0.08);
}

.progress-bar--large {
    height: 18px;
}

.progress-bar__fill {
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--primary), var(--primary-strong));
    box-shadow: 0 0 22px rgba(51, 196, 129, 0.32);
    transition: width 260ms ease;
}

.progress-bar--secondary .progress-bar__fill {
    background: linear-gradient(90deg, var(--secondary), var(--secondary-strong));
}

.hero__mini-grid {
    display: grid;
    gap: 12px;
    margin-top: 18px;
}

.hero__cell {
    padding: 16px 18px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.05);
    font-weight: 800;
    overflow-wrap: anywhere;
}

.hero__cell--accent {
    background: linear-gradient(135deg, rgba(33, 115, 70, 0.24), rgba(59, 130, 246, 0.18));
}

.feature-ribbon,
.curriculum-grid,
.overview-grid,
.progress-section,
.dashboard-grid,
.play-layout,
.auth-layout,
.podium-grid {
    display: grid;
    gap: 22px;
}

.side-panel {
    display: grid;
    gap: 28px;
}

.feature-ribbon {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-bottom: 28px;
}

.ribbon-card {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 22px;
}

.ribbon-card i {
    width: 48px;
    height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.18), rgba(51, 196, 129, 0.18));
    color: var(--accent);
}

.curriculum-showcase {
    margin-bottom: 28px;
}

.section-heading {
    justify-content: space-between;
    margin-bottom: 16px;
}

.section-heading--wide {
    display: grid;
    gap: 10px;
    margin-bottom: 20px;
}

.section-heading--wide p {
    max-width: 76ch;
    margin: 0;
}

.curriculum-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

.curriculum-card {
    padding: 22px;
}

.curriculum-card h3 {
    margin: 14px 0 10px;
    font-family: var(--font-display);
}

.auth-layout {
    grid-template-columns: minmax(0, 1.05fr) minmax(340px, 0.95fr);
    align-items: start;
}

.auth-card__intro {
    margin-bottom: 18px;
}

.feature-list {
    display: grid;
    gap: 16px;
}

.feature-list article {
    padding: 18px;
    border-radius: 20px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.04);
}

.auth-tabs {
    padding: 5px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    margin-bottom: 22px;
}

.auth-tab {
    flex: 1;
    appearance: none;
    border: 0;
    background: transparent;
    padding: 13px 18px;
    border-radius: 999px;
    color: var(--muted);
    font-weight: 800;
    font-size: 0.92rem;
    cursor: pointer;
    transition: color 0.25s ease, background 0.3s ease, box-shadow 0.3s ease, transform 0.2s ease;
    position: relative;
}

.auth-tab:hover:not(.is-active) {
    color: var(--ink);
    background: rgba(255, 255, 255, 0.04);
}

.auth-tab.is-active {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(30, 58, 138, 0.35));
    color: var(--ink);
    box-shadow: 0 8px 24px rgba(59, 130, 246, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.auth-panel {
    display: none;
}

.auth-panel.is-active {
    display: block;
}

.stacked-form {
    display: grid;
    gap: 16px;
}

.stacked-form label {
    display: grid;
    gap: 8px;
    font-weight: 700;
}

.stacked-form input {
    width: 100%;
    padding: 15px 16px;
    border: 1px solid var(--line-strong);
    border-radius: 18px;
    background: rgba(15, 23, 42, 0.78);
    color: var(--ink);
    outline: none;
    transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.stacked-form input::placeholder,
.chat-form textarea::placeholder {
    color: rgba(229, 231, 235, 0.44);
}

.stacked-form input:-webkit-autofill,
.stacked-form input:-webkit-autofill:hover,
.stacked-form input:-webkit-autofill:focus {
    -webkit-text-fill-color: var(--ink);
    -webkit-box-shadow: 0 0 0 1000px rgba(15, 23, 42, 0.95) inset;
    transition: background-color 9999s ease-in-out 0s;
}

.stacked-form input:focus {
    border-color: rgba(59, 130, 246, 0.68);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.16);
    transform: translateY(-1px);
}

/* ── OAuth Buttons ── */
.oauth-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 0;
}

.button--oauth {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 12px 16px;
    border-radius: 14px;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: transform 180ms ease, box-shadow 180ms ease, filter 180ms ease;
    border: 1px solid var(--border);
}

.button--oauth:hover {
    transform: translateY(-2px);
    filter: brightness(1.08);
}

.button--oauth svg {
    flex-shrink: 0;
}

.button--google {
    background: #fff;
    color: #3c4043;
}

.button--google:hover {
    box-shadow: 0 4px 16px rgba(66, 133, 244, 0.25);
}

.button--apple {
    background: #000;
    color: #fff;
}

.button--apple:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

/* ── Auth Divider ── */
.auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 16px 0;
    color: var(--text-secondary);
    font-size: 0.8rem;
    opacity: 0.6;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

/* ── Email verification banner ── */
.verification-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 12px;
    background: rgba(251, 191, 36, 0.1);
    border: 1px solid rgba(251, 191, 36, 0.3);
    color: #fbbf24;
    font-size: 0.85rem;
    margin-bottom: 1rem;
}

.verification-banner i {
    font-size: 1.1rem;
}

.verification-banner a {
    color: #fbbf24;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
    margin-left: auto;
    white-space: nowrap;
}

.verification-banner a:hover {
    color: #f59e0b;
}

.button {
    appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border: 0;
    border-radius: 18px;
    padding: 14px 20px;
    cursor: pointer;
    transition: transform 180ms ease, box-shadow 180ms ease, opacity 180ms ease;
}

.button:hover {
    transform: translateY(-2px);
}

.button:active {
    transform: translateY(0) scale(0.985);
}

.button:disabled {
    opacity: 0.76;
    cursor: wait;
}

.button--primary {
    color: #FFFFFF;
    background: linear-gradient(135deg, var(--secondary), var(--secondary-strong));
    box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.16), 0 18px 30px rgba(30, 58, 138, 0.34);
}

.button--secondary {
    color: #FFFFFF;
    background: linear-gradient(135deg, var(--primary-strong), var(--primary));
    box-shadow: 0 0 0 1px rgba(51, 196, 129, 0.12), 0 18px 30px rgba(33, 115, 70, 0.3);
}

.button--ghost {
    color: var(--ink);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--line);
}

.button--primary:hover {
    box-shadow: 0 0 22px rgba(59, 130, 246, 0.28), 0 22px 36px rgba(30, 58, 138, 0.4);
}

.button--secondary:hover {
    box-shadow: 0 0 20px rgba(51, 196, 129, 0.24), 0 22px 36px rgba(33, 115, 70, 0.34);
}

.button--ghost:hover {
    background: rgba(59, 130, 246, 0.1);
}

.button--wide {
    width: 100%;
}

.flash {
    margin: 0 0 24px;
    padding: 16px 18px;
    border-radius: 18px;
    font-weight: 800;
}

.flash--success {
    background: rgba(33, 115, 70, 0.2);
    color: var(--primary-strong);
}

.flash--error {
    background: rgba(239, 68, 68, 0.18);
    color: #FFFFFF;
}

.auth-msg {
    padding: 14px 18px;
    border-radius: 14px;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 18px;
    animation: auth-msg-in 0.35s ease-out;
    backdrop-filter: blur(6px);
}

.auth-msg--error {
    background: rgba(239, 68, 68, 0.14);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.2);
    box-shadow: 0 4px 16px rgba(239, 68, 68, 0.08);
}

.auth-msg--success {
    background: rgba(34, 197, 94, 0.12);
    color: #4ade80;
    border: 1px solid rgba(34, 197, 94, 0.2);
    box-shadow: 0 4px 16px rgba(34, 197, 94, 0.08);
}

@keyframes auth-msg-in {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.bottom-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-top: 30px;
}

.topbar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 24px;
}

.topbar--hero {
    padding: 6px 4px 0;
}

.topbar h1 {
    font-size: clamp(2rem, 5vw, 3.4rem);
}

.topbar__lead {
    max-width: 70ch;
    margin: 12px 0 0;
}

.dashboard-hero-grid,
.focus-card {
    margin-bottom: 22px;
}

.focus-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(220px, 280px);
    gap: 24px;
    background: linear-gradient(135deg, rgba(17, 24, 39, 0.98), rgba(15, 23, 42, 0.92));
    border: 1px solid rgba(51, 196, 129, 0.25);
    border-radius: var(--radius-xl);
    overflow: hidden;
    position: relative;
}

.focus-card::before {
    content: '';
    position: absolute;
    top: -60%;
    right: -20%;
    width: 340px;
    height: 340px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(51, 196, 129, 0.08), transparent 70%);
    pointer-events: none;
}

.focus-card__copy {
    display: grid;
    gap: 14px;
}

.focus-card__copy p {
    margin: 0;
}

.focus-card__rings {
    display: grid;
    gap: 18px;
    align-content: center;
    justify-items: center;
}

.focus-ring {
    --progress: 0%;
    width: 188px;
    aspect-ratio: 1;
    border-radius: 50%;
    position: relative;
    display: grid;
    place-items: center;
    padding: 14px;
    background:
        radial-gradient(circle at center, rgba(15, 23, 42, 0.95) 58%, transparent 59%),
        conic-gradient(from -90deg, var(--primary-strong) 0%, var(--primary) 42%, var(--accent) var(--progress), rgba(229, 231, 235, 0.1) var(--progress), rgba(229, 231, 235, 0.1) 100%);
    box-shadow: inset 0 0 0 1px rgba(229, 231, 235, 0.08), 0 0 30px rgba(51, 196, 129, 0.08);
}

.focus-ring::before {
    content: '';
    position: absolute;
    inset: 14px;
    border-radius: 50%;
    background: linear-gradient(180deg, rgba(17, 24, 39, 0.98), rgba(15, 23, 42, 0.94));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.focus-ring__inner {
    position: relative;
    z-index: 1;
    display: grid;
    gap: 4px;
    justify-items: center;
    text-align: center;
    padding: 18px;
}

.focus-ring__value {
    display: block;
    font-size: clamp(2.4rem, 5vw, 3.3rem);
    line-height: 0.9;
    font-family: var(--font-display);
    letter-spacing: -0.04em;
}

.focus-ring small {
    color: rgba(229, 231, 235, 0.92);
    font-size: 0.98rem;
    font-weight: 800;
}

.focus-ring__meta {
    color: var(--muted);
    font-size: 0.8rem;
    line-height: 1.3;
}

.focus-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 10px;
    width: 100%;
}

.focus-list li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.05);
}

/* ════════════════════════════════════════════════
   QUICK STATS — GAMING HUD BAR
   ════════════════════════════════════════════════ */

.quick-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 20px;
}

.quick-stat {
    position: relative;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px 20px;
    border-radius: 20px;
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.95), rgba(15, 23, 42, 0.95));
    border: 1px solid rgba(148, 163, 184, 0.12);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    transition: transform 220ms ease, box-shadow 220ms ease, border-color 220ms ease;
}

.quick-stat:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.2);
}

.quick-stat__icon {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 14px;
    font-size: 1.15rem;
    flex-shrink: 0;
}

.quick-stat--xp {
    border-left: 3px solid #FBBF24;
}

.quick-stat--xp .quick-stat__icon {
    background: rgba(250, 204, 21, 0.15);
    color: #FBBF24;
}

.quick-stat--levels {
    border-left: 3px solid #60A5FA;
}

.quick-stat--levels .quick-stat__icon {
    background: rgba(59, 130, 246, 0.15);
    color: #60A5FA;
}

.quick-stat--lives {
    border-left: 3px solid #F87171;
}

.quick-stat--lives .quick-stat__icon {
    background: rgba(239, 68, 68, 0.15);
    color: #F87171;
    animation: heartbeat 1.4s ease-in-out infinite;
}

.quick-stat--next {
    text-decoration: none;
    color: inherit;
    background: linear-gradient(135deg, rgba(33, 115, 70, 0.25), rgba(15, 23, 42, 0.95));
    border-color: rgba(51, 196, 129, 0.3);
    border-left: 3px solid #34D399;
    cursor: pointer;
}

.quick-stat--next:hover {
    border-color: rgba(51, 196, 129, 0.5);
    box-shadow: 0 12px 28px rgba(51, 196, 129, 0.15);
}

.quick-stat--next .quick-stat__icon {
    background: rgba(51, 196, 129, 0.2);
    color: #34D399;
}

.quick-stat__arrow {
    margin-left: auto;
    color: var(--muted);
    font-size: 0.9rem;
    transition: transform 220ms ease;
}

.quick-stat--next:hover .quick-stat__arrow {
    transform: translateX(3px);
    color: #34D399;
}

.quick-stat__body {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.quick-stat__label {
    font-size: 0.72rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--muted);
}

.quick-stat__value {
    font-size: 1.5rem;
    line-height: 1;
    font-family: var(--font-display);
}

.quick-stat__value small {
    font-size: 0.7em;
    color: var(--muted);
    font-weight: 400;
}

.quick-stat .lives-bar {
    margin: 4px 0 0;
}

.quick-stat .lives-bar__heart {
    font-size: 0.85rem;
}

.quick-stat .lives-timer {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    padding: 6px 12px;
    border-radius: 10px;
    font-size: 0.82rem;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    display: flex;
    align-items: center;
    gap: 6px;
    color: #FBBF24;
    font-family: var(--font-display);
    font-weight: 700;
}

.quick-stat .lives-timer i {
    color: #F97316;
    animation: pulse-glow 2s ease-in-out infinite;
}

/* ════════════════════════════════════════════════
   XP PROGRESS TRACK
   ════════════════════════════════════════════════ */

.xp-track {
    margin-bottom: 24px;
    padding: 16px 22px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--line);
}

.xp-track__row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.xp-track__label {
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
}

.xp-track__label i {
    color: #F97316;
    margin-right: 6px;
}

.xp-track__pct {
    font-family: var(--font-display);
    font-size: 1.1rem;
    color: var(--primary-strong);
}

.progress-bar--animated .progress-bar__fill {
    animation: bar-glow 2.5s ease-in-out infinite alternate;
}

@keyframes bar-glow {
    0% { box-shadow: 0 0 12px rgba(51, 196, 129, 0.25); }
    100% { box-shadow: 0 0 24px rgba(51, 196, 129, 0.5); }
}

/* ════════════════════════════════════════════════
   BUTTON GLOW — GAMING CTA
   ════════════════════════════════════════════════ */

.button--glow {
    animation: btn-pulse 2.5s ease-in-out infinite;
    position: relative;
}

.button--glow::after {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: inherit;
    background: linear-gradient(135deg, var(--primary-strong), var(--secondary));
    opacity: 0;
    z-index: -1;
    filter: blur(12px);
    transition: opacity 0.3s ease;
}

.button--glow:hover::after {
    opacity: 0.5;
}

@keyframes btn-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(51, 196, 129, 0.3); }
    50% { box-shadow: 0 0 0 8px rgba(51, 196, 129, 0); }
}

.button--lg {
    padding: 16px 32px;
    font-size: 1.05rem;
}

/* ════════════════════════════════════════════════
   LEADERBOARD LIST — GAMING STYLE
   ════════════════════════════════════════════════ */

.lb-rank {
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    font-size: 0.78rem;
    font-weight: 800;
    font-family: var(--font-display);
    background: rgba(255, 255, 255, 0.06);
    color: var(--muted);
    flex-shrink: 0;
}

.leaderboard-list li:nth-child(1) .lb-rank {
    background: linear-gradient(135deg, #FBBF24, #F59E0B);
    color: #0F172A;
}

.leaderboard-list li:nth-child(2) .lb-rank {
    background: linear-gradient(135deg, #94A3B8, #64748B);
    color: #0F172A;
}

.leaderboard-list li:nth-child(3) .lb-rank {
    background: linear-gradient(135deg, #F97316, #EA580C);
    color: #0F172A;
}

.lb-pts {
    font-family: var(--font-display);
    font-size: 0.9rem;
    color: #FBBF24;
    white-space: nowrap;
}

.overview-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 20px;
    margin-bottom: 28px;
}

.stat-card {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 228px;
    padding: 26px;
    background: linear-gradient(180deg, rgba(17, 24, 39, 0.98), rgba(15, 23, 42, 0.94));
    border: 1px solid var(--line);
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    left: 26px;
    top: 0;
    width: 64px;
    height: 4px;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--secondary), var(--primary-strong));
    pointer-events: none;
}

.stat-card__top {
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    margin-bottom: 18px;
}

.stat-card__label {
    display: block;
    color: var(--muted);
    font-size: 0.78rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.stat-card__value,
.stat-card strong {
    display: block;
    margin: 0 0 10px;
    font-size: clamp(2.2rem, 4vw, 3.2rem);
    line-height: 0.95;
    font-family: var(--font-display);
}

.stat-card p {
    margin: 0;
    max-width: 26ch;
    font-size: 1rem;
    line-height: 1.45;
}

.stat-card__cta {
    margin-top: 22px;
    align-self: flex-start;
}

.stat-card--highlight {
    color: #FFFFFF;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.96), rgba(30, 58, 138, 0.94));
    box-shadow: 0 0 24px rgba(59, 130, 246, 0.18), 0 24px 42px rgba(30, 58, 138, 0.34);
}

/* ── Lives card highlight ── */
.stat-card--lives {
    background: linear-gradient(160deg, rgba(239, 68, 68, 0.22), rgba(249, 115, 22, 0.10) 45%, rgba(17, 24, 39, 0.96) 85%);
    border-color: rgba(239, 68, 68, 0.35);
    box-shadow: 0 0 28px rgba(239, 68, 68, 0.12), 0 16px 36px rgba(0, 0, 0, 0.3);
}

.stat-card--lives::before {
    background: linear-gradient(90deg, #EF4444, #F97316);
    width: 80px;
    height: 4px;
}

.stat-card--lives .stat-card__label {
    color: #F87171;
    font-weight: 600;
}

.stat-card--lives .stat-card__label i {
    margin-right: 6px;
    animation: heartbeat 1.4s ease-in-out infinite;
}

.lives-bar {
    display: flex;
    gap: 8px;
    margin: 6px 0 14px;
}

.lives-bar__heart {
    font-size: 1.25rem;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.lives-bar__heart.is-full {
    color: #EF4444;
    filter: drop-shadow(0 0 6px rgba(239, 68, 68, 0.5));
}

.lives-bar__heart.is-empty {
    color: rgba(255, 255, 255, 0.12);
}

.lives-timer {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    padding: 10px 14px;
    border-radius: 12px;
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.18);
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.85);
}

.lives-timer i {
    color: #F97316;
    animation: pulse-glow 2s ease-in-out infinite;
}

.lives-timer strong {
    color: #FBBF24;
    font-size: 1.1rem;
    font-family: var(--font-display);
    letter-spacing: 0.04em;
}

@keyframes heartbeat {
    0%, 100% { transform: scale(1); }
    14% { transform: scale(1.2); }
    28% { transform: scale(1); }
    42% { transform: scale(1.15); }
    56% { transform: scale(1); }
}

@keyframes pulse-glow {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.stat-card--highlight .stat-card__label,
.stat-card--highlight p {
    color: rgba(255, 255, 255, 0.82);
}

.stat-card--highlight .stat-card__cta.button--primary {
    background: rgba(255, 255, 255, 0.14);
    color: #ffffff;
    box-shadow: none;
    border: 1px solid rgba(255, 255, 255, 0.14);
}

.progress-section {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-bottom: 24px;
}

.dashboard-grid {
    grid-template-columns: minmax(0, 1.5fr) minmax(320px, 0.64fr);
    align-items: start;
}

.levels-panel__heading {
    align-items: start;
}

.levels-panel__summary {
    margin: 8px 0 0;
    color: var(--muted);
    max-width: 54ch;
}

.levels-panel__toggle {
    min-width: 190px;
}

.levels-panel__viewport {
    position: relative;
    transition: max-height 240ms ease;
}

.levels-panel__viewport.is-collapsed {
    max-height: 640px;
    overflow: hidden;
}

.levels-panel__viewport.is-collapsed::after {
    content: '';
    position: absolute;
    inset: auto 0 0;
    height: 180px;
    pointer-events: none;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0) 0%, rgba(15, 23, 42, 0.92) 88%);
}

.levels-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.levels-panel__viewport.is-collapsed .level-card--preview-hidden {
    display: none;
}

.level-card {
    display: flex;
    flex-direction: column;
    padding: 20px;
    border-radius: 20px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.04);
    transition: transform 220ms ease, box-shadow 220ms ease, border-color 220ms ease, opacity 220ms ease, background 220ms ease;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.level-card::after {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.04), transparent 70%);
    transition: opacity 0.3s ease;
    opacity: 0;
    pointer-events: none;
}

.level-card:hover::after {
    opacity: 1;
}

.level-card:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    background: rgba(255, 255, 255, 0.07);
}

.level-card[aria-disabled="true"] {
    cursor: default;
    pointer-events: none;
}

.ribbon-card:hover,
.curriculum-card:hover,
.stat-card:hover,
.podium-card:hover,
.feature-list article:hover {
    transform: translateY(-3px);
    border-color: rgba(59, 130, 246, 0.22);
}

.level-card__footer {
    justify-content: space-between;
    margin-top: auto;
    padding-top: 14px;
    font-size: 0.88rem;
}

.level-card__category {
    color: var(--muted);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin: 2px 0 0;
}

.level-card__status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.82rem;
    font-weight: 600;
}

.level-card__status--done {
    color: #34D399;
    background: rgba(52, 211, 153, 0.12);
}

.level-card__status--open {
    color: #FBBF24;
    background: rgba(251, 191, 36, 0.12);
}

.level-card__status--locked {
    color: var(--muted);
    background: rgba(255, 255, 255, 0.05);
}

.level-card.is-completed {
    border-color: rgba(51, 196, 129, 0.34);
    background: linear-gradient(180deg, rgba(33, 115, 70, 0.18), rgba(17, 24, 39, 0.94));
}

.level-card.is-completed:hover {
    border-color: rgba(51, 196, 129, 0.5);
    box-shadow: 0 16px 30px rgba(33, 115, 70, 0.18);
}

.level-card.is-unlocked {
    border-color: rgba(251, 191, 36, 0.32);
    background: linear-gradient(180deg, rgba(251, 191, 36, 0.08), rgba(17, 24, 39, 0.96));
}

.level-card.is-unlocked:hover {
    border-color: rgba(251, 191, 36, 0.5);
    box-shadow: 0 16px 30px rgba(251, 191, 36, 0.12);
}

.level-card.is-locked {
    opacity: 0.5;
}

.leaderboard-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 6px;
}

.leaderboard-list li {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    padding: 12px 14px;
    border-bottom: none;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.03);
    transition: background 0.2s ease;
}

.leaderboard-list li:hover {
    background: rgba(255, 255, 255, 0.07);
}

.hint-card ul,
.mini-stat-card ul {
    margin: 14px 0 0;
    padding-left: 20px;
    display: grid;
    gap: 14px;
}

.hint-card__explanation {
    margin: 0;
    color: var(--muted);
    line-height: 1.6;
}

.formula-example {
    display: grid;
    gap: 10px;
    margin-top: 16px;
    padding: 16px 18px;
    border-radius: 18px;
    border: 1px solid rgba(59, 130, 246, 0.22);
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.12), rgba(33, 115, 70, 0.12));
}

.formula-example__label {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    color: var(--accent);
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.formula-example__value {
    overflow-wrap: anywhere;
    font-family: var(--font-display);
    font-size: 1.05rem;
    line-height: 1.35;
    color: var(--ink);
}

[data-study-chat].chat-widget {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 30;
    display: grid;
    justify-items: end;
    gap: 14px;
}

[data-study-chat].chat-widget > summary {
    list-style: none;
}

[data-study-chat].chat-widget > summary::-webkit-details-marker {
    display: none;
}

[data-study-chat] .chat-widget__toggle {
    appearance: none;
    border: 0;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 18px;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--secondary), var(--secondary-strong));
    color: #FFFFFF;
    font-weight: 800;
    box-shadow: 0 0 22px rgba(59, 130, 246, 0.2), 0 18px 32px rgba(30, 58, 138, 0.36);
    cursor: pointer;
    transition: transform 180ms ease, box-shadow 180ms ease;
    width: auto;
}

[data-study-chat] .chat-widget__toggle:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 24px rgba(59, 130, 246, 0.28), 0 22px 38px rgba(30, 58, 138, 0.42);
}

.chat-card {
    display: grid;
    gap: 18px;
    padding: 24px;
    border-radius: var(--radius-xl);
    background: linear-gradient(180deg, rgba(17, 24, 39, 0.98), rgba(15, 23, 42, 0.94));
    border: 1px solid var(--line);
    box-shadow: var(--shadow-lg);
}

[data-study-chat] .chat-card--floating {
    position: fixed;
    right: 24px;
    bottom: 92px;
    width: min(420px, calc(100vw - 32px));
    max-height: min(78vh, 720px);
    display: none;
    opacity: 0;
    transform: translateY(18px) scale(0.98);
    transform-origin: bottom right;
    pointer-events: none;
    transition: opacity 180ms ease, transform 180ms ease;
}

[data-study-chat].is-open .chat-card--floating,
[data-study-chat][open] .chat-card--floating {
    display: grid;
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.chat-card__header {
    display: grid;
    gap: 12px;
}

.chat-card__header--floating {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    gap: 16px;
}

.chat-card__controls {
    display: grid;
    gap: 10px;
    justify-items: end;
}

.chat-card__header h3 {
    margin: 0;
    font-family: var(--font-display);
}

.chat-card__intro {
    margin: 8px 0 0;
    color: var(--muted);
    line-height: 1.55;
}

.chat-thread {
    display: grid;
    gap: 12px;
    min-height: 180px;
    max-height: 340px;
    overflow-y: auto;
    padding-right: 4px;
}

.chat-message {
    display: grid;
    gap: 8px;
    padding: 14px 16px;
    border-radius: 18px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.04);
}

.chat-message strong {
    font-size: 0.82rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.chat-message p {
    margin: 0;
    color: var(--ink);
    line-height: 1.55;
}

.chat-message--assistant {
    border-color: rgba(59, 130, 246, 0.22);
    background: rgba(59, 130, 246, 0.08);
}

.chat-message--user {
    border-color: rgba(51, 196, 129, 0.22);
    background: rgba(33, 115, 70, 0.12);
}

.chat-form {
    display: grid;
    gap: 14px;
}

.chat-form label {
    display: grid;
    gap: 8px;
    font-weight: 700;
}

.chat-form textarea {
    width: 100%;
    min-height: 92px;
    resize: vertical;
    padding: 15px 16px;
    border: 1px solid var(--line-strong);
    border-radius: 18px;
    background: rgba(15, 23, 42, 0.78);
    color: var(--ink);
    outline: none;
    transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.chat-form textarea:focus {
    border-color: rgba(59, 130, 246, 0.68);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.16);
    transform: translateY(-1px);
}

[data-study-chat] .chat-card__close {
    appearance: none;
    width: 38px;
    height: 38px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--ink);
    cursor: pointer;
    transition: background-color 180ms ease, transform 180ms ease;
}

[data-study-chat] .chat-card__close:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-1px);
}

.lesson-spotlight {
    margin-bottom: 22px;
}

.lesson-spotlight__card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.lesson-spotlight__meta span {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 14px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.06);
}

.play-layout {
    grid-template-columns: minmax(0, 1.38fr) minmax(320px, 0.62fr);
    align-items: start;
    gap: 28px;
}

.play-panel,
.play-sidebar {
    display: flex;
    flex-direction: column;
    gap: 0;
    min-width: 0;
}

.play-layout > *,
.lesson-spotlight__card > *,
.topbar > *,
.excel-card,
.prompt-card {
    min-width: 0;
}

.play-panel > * + *,
.play-sidebar > * + * {
    margin-top: 24px;
}

.answer-card h2,
.mini-stat-card h3,
.hint-card h3,
.hint-card h2 {
    margin-bottom: 20px;
}

.leaderboard-card .section-heading,
.hint-card > h2 {
    margin-bottom: 18px;
}

.answer-card .stacked-form {
    gap: 18px;
}

.answer-card .stacked-form label {
    gap: 10px;
}

.answer-card .stacked-form input {
    min-height: 62px;
}

.answer-card .button,
.next-actions .button {
    min-height: 64px;
}

.mini-stat-card p,
.hint-card li,
.feedback-box {
    line-height: 1.55;
}

.mini-stat-card p {
    margin: 0 0 14px;
}

.mini-stat-card .progress-bar {
    margin-top: 10px;
}

.excel-card__header {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.excel-card__header h3,
.prompt-card h2,
.lesson-spotlight__card h2,
.topbar h1 {
    overflow-wrap: anywhere;
}

.excel-card__target {
    color: var(--muted);
    font-weight: 800;
}

.excel-grid-wrapper {
    position: relative;
    overflow-x: auto;
    border-radius: 18px;
    max-width: 100%;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
    border: 1px solid rgba(229, 231, 235, 0.08);
    background: rgba(15, 23, 42, 0.28);
}

.excel-grid-wrapper.has-overflow::after {
    content: 'Desliza para ver más columnas';
    position: sticky;
    right: 12px;
    bottom: 12px;
    display: inline-flex;
    margin-left: auto;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(17, 24, 39, 0.92);
    color: #FFFFFF;
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.04em;
}

.excel-grid,
.leaderboard-table {
    width: max-content;
    min-width: 100%;
    min-width: 720px;
    border-collapse: collapse;
}

.excel-grid th,
.excel-grid td,
.leaderboard-table th,
.leaderboard-table td {
    padding: 12px 14px;
    text-align: left;
    border: 1px solid var(--line);
    white-space: nowrap;
}

.excel-grid th:first-child,
.excel-grid td:first-child {
    position: sticky;
    left: 0;
    z-index: 2;
    background: #1b2436;
}

.excel-grid thead th:first-child {
    z-index: 3;
}

.excel-grid thead th,
.leaderboard-table thead th {
    position: sticky;
    top: 0;
    background: rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(8px);
}

.excel-grid td {
    background: rgba(255, 255, 255, 0.04);
}

.excel-grid td.is-target {
    background: linear-gradient(135deg, rgba(250, 204, 21, 0.18), rgba(249, 115, 22, 0.2));
    box-shadow: inset 0 0 0 2px rgba(250, 204, 21, 0.16);
    border-color: rgba(249, 115, 22, 0.34);
}

.feedback-box {
    min-height: 60px;
    margin-top: 18px;
    padding: 16px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.04);
    color: var(--muted);
}

.feedback-box.is-visible.is-success {
    background: rgba(33, 115, 70, 0.2);
    color: var(--primary-strong);
}

.feedback-box.is-visible.is-error {
    background: rgba(239, 68, 68, 0.18);
    color: #FFFFFF;
}

.next-actions {
    display: none;
    margin-top: 16px;
}

.next-actions.is-visible {
    display: block;
}

.leaderboard-hero {
    margin-bottom: 22px;
}

.podium-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-bottom: 22px;
}

.podium-card {
    padding: 22px;
    min-height: 150px;
    position: relative;
    overflow: hidden;
}

.podium-card::before {
    content: '';
    position: absolute;
    inset: auto -20px -45px auto;
    width: 140px;
    height: 140px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
}

.podium-card--1 {
    background: linear-gradient(135deg, rgba(250, 204, 21, 0.94), rgba(249, 115, 22, 0.9));
    color: #0F172A;
}

.podium-card--2 {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.92), rgba(30, 58, 138, 0.92));
}

.podium-card--3 {
    background: linear-gradient(135deg, rgba(249, 115, 22, 0.88), rgba(250, 204, 21, 0.74));
    color: #0F172A;
}

.podium-card__place {
    margin-bottom: 28px;
    background: rgba(255, 255, 255, 0.2);
}

.leaderboard-table-card {
    overflow: hidden;
}

.table-scroll {
    overflow-x: auto;
    border-radius: 24px;
}

.leaderboard-table {
    min-width: 760px;
}

.leaderboard-table tbody tr {
    transition: background-color 160ms ease;
}

.leaderboard-table tbody tr:hover {
    background: rgba(59, 130, 246, 0.08);
}

.leaderboard-table tbody tr:nth-child(odd) {
    background: rgba(255, 255, 255, 0.03);
}

.link-inline {
    color: var(--secondary);
}

.pill {
    background: rgba(255, 255, 255, 0.06);
}

.pill--neutral {
    background: rgba(59, 130, 246, 0.16);
    color: var(--info);
}

.difficulty-basic {
    background: rgba(33, 115, 70, 0.24);
    color: var(--primary-strong);
}

.difficulty-mid-1 {
    background: rgba(59, 130, 246, 0.16);
    color: var(--info);
}

.difficulty-mid-2 {
    background: rgba(250, 204, 21, 0.18);
    color: var(--accent);
}

.difficulty-adv-1 {
    background: rgba(249, 115, 22, 0.18);
    color: var(--reward);
}

.difficulty-adv-2 {
    background: rgba(255, 255, 255, 0.08);
    color: var(--ink);
}

.confetti-burst {
    position: fixed;
    inset: 0;
    z-index: 40;
    pointer-events: none;
    overflow: hidden;
}

.confetti-piece {
    position: absolute;
    left: var(--x);
    top: -5%;
    width: var(--w, 10px);
    height: var(--h, 16px);
    border-radius: var(--br, 3px);
    background: var(--clr, #fbbf24);
    opacity: 0;
    animation:
        confetti-fall var(--dur, 2.2s) cubic-bezier(.23,1,.32,1) forwards,
        confetti-sway var(--sway, 1.6s) ease-in-out infinite alternate;
    animation-delay: var(--delay), var(--delay);
    transform: rotate(var(--rotate));
}

@keyframes confetti-fall {
    0%   { opacity: 0; transform: translateY(-20px) rotate(0deg) scale(.6); }
    8%   { opacity: 1; transform: translateY(0) rotate(30deg) scale(1); }
    75%  { opacity: 1; }
    100% { opacity: 0; transform: translateY(var(--fall, 90vh)) rotate(var(--spin, 720deg)) scale(.4); }
}

@keyframes confetti-sway {
    0%   { margin-left: 0; }
    100% { margin-left: var(--drift, 30px); }
}

@media (max-width: 1240px) {
    .curriculum-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .overview-grid,
    .quick-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .feature-ribbon,
    .podium-grid,
    .progress-section,
    .dashboard-grid,
    .play-layout,
    .auth-layout,
    .hero--enhanced,
    .focus-card {
        grid-template-columns: 1fr;
    }

}

@media (max-width: 920px) {
    .site-header,
    .topbar,
    .lesson-spotlight__card,
    .bottom-banner {
        flex-direction: column;
        align-items: flex-start;
    }

    .curriculum-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .hero-stage {
        display: grid;
        gap: 12px;
    }

    .quick-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .site-nav,
    .topbar__actions,
    .hero__actions,
    .focus-card__actions,
    .lesson-spotlight__meta {
        width: 100%;
    }

    .levels-panel__heading {
        gap: 16px;
    }

    .levels-panel__toggle {
        width: 100%;
        min-width: 0;
    }

    /* Show hamburger, hide desktop nav */
    .nav-toggle {
        display: flex;
    }

    .site-nav {
        display: none;
        position: absolute;
        top: calc(100% + 8px);
        left: 0;
        right: 0;
        flex-direction: column;
        padding: 16px;
        background: rgba(17, 24, 39, 0.96);
        backdrop-filter: blur(20px);
        border: 1px solid var(--line);
        border-radius: 20px;
        box-shadow: var(--shadow-lg);
        gap: 4px;
        z-index: 20;
        animation: slideDown 250ms cubic-bezier(0.4, 0, 0.2, 1);
        overflow: hidden;
    }

    .site-nav.is-open {
        display: flex;
    }

    .site-nav a {
        width: 100%;
        padding: 14px 18px;
        border-radius: 14px;
    }

    .site-header {
        position: relative;
    }

    @keyframes slideDown {
        from {
            opacity: 0;
            transform: translateY(-8px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }
}

@media (max-width: 640px) {
    /* ────────────────────────────────────────────
       GLOBAL MOBILE LAYOUT
       ──────────────────────────────────────────── */

    body {
        padding-top: env(safe-area-inset-top, 0px);
        padding-bottom: env(safe-area-inset-bottom, 0px);
        -webkit-text-size-adjust: 100%;
    }

    .page-shell {
        width: min(100% - 12px, 1400px);
        padding: 12px 0 100px;
    }

    .level-page .page-shell {
        width: min(100% - 18px, 760px);
    }

    .page-shell--landing {
        padding-top: 12px;
    }

    /* ────────────────────────────────────────────
       HEADER MOBILE
       ──────────────────────────────────────────── */

    .site-header {
        padding: 12px 16px;
        border-radius: 20px;
        margin-bottom: 16px;
        flex-direction: row;
        align-items: center;
    }

    .site-header--landing {
        margin-bottom: 20px;
    }

    .brand__mark {
        width: 40px;
        height: 40px;
        border-radius: 13px;
        font-size: 1rem;
    }

    .brand strong {
        font-size: 0.95rem;
    }

    .brand small {
        font-size: 0.72rem;
    }

    .brand {
        gap: 10px;
    }

    /* ────────────────────────────────────────────
       BOTTOM NAVIGATION BAR
       ──────────────────────────────────────────── */

    .bottom-nav {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 40;
        justify-content: space-around;
        align-items: stretch;
        padding: 8px 8px calc(8px + env(safe-area-inset-bottom, 0px));
        background: rgba(15, 23, 42, 0.92);
        backdrop-filter: blur(24px) saturate(1.4);
        -webkit-backdrop-filter: blur(24px) saturate(1.4);
        border-top: 1px solid var(--line);
        box-shadow: 0 -8px 32px rgba(2, 6, 23, 0.5);
    }

    .bottom-nav__item {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 3px;
        flex: 1;
        padding: 8px 4px;
        border-radius: 14px;
        color: var(--muted);
        font-size: 0.65rem;
        font-weight: 700;
        letter-spacing: 0.02em;
        text-decoration: none;
        transition: color 180ms ease, background 180ms ease;
        -webkit-tap-highlight-color: transparent;
    }

    .bottom-nav__item i {
        font-size: 1.15rem;
        transition: transform 200ms ease;
    }

    .bottom-nav__item--active {
        color: var(--primary-strong);
        background: rgba(51, 196, 129, 0.1);
    }

    .bottom-nav__item--active i {
        transform: scale(1.1);
    }

    .bottom-nav__item:active {
        background: rgba(255, 255, 255, 0.06);
        transform: scale(0.94);
    }

    .table-scroll {
        border-radius: 18px;
    }

    /* ────────────────────────────────────────────
       CARDS & PANELS — GLASS MORPHISM MOBILE
       ──────────────────────────────────────────── */

    .site-header,
    .hero__copy,
    .floating-panel,
    .ribbon-card,
    .curriculum-card,
    .auth-card,
    .stat-card,
    .focus-card,
    .levels-panel,
    .side-panel section,
    .prompt-card,
    .answer-card,
    .mini-stat-card,
    .leaderboard-hero,
    .leaderboard-table-card,
    .excel-card,
    .hint-card,
    .lesson-spotlight__card,
    .bottom-banner,
    .podium-card {
        padding: 20px;
        border-radius: 22px;
    }

    .ribbon-card,
    .curriculum-card,
    .stat-card,
    .focus-card,
    .auth-card,
    .levels-panel,
    .prompt-card,
    .answer-card,
    .mini-stat-card,
    .hint-card,
    .lesson-spotlight__card,
    .podium-card {
        border-color: rgba(229, 231, 235, 0.08);
        box-shadow: 0 8px 24px rgba(2, 6, 23, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.04);
    }

    /* ────────────────────────────────────────────
       GRIDS STACK VERTICALLY
       ──────────────────────────────────────────── */

    .play-layout,
    .play-panel,
    .play-sidebar,
    .overview-grid,
    .progress-section,
    .dashboard-grid,
    .feature-ribbon,
    .curriculum-grid,
    .podium-grid,
    .levels-grid {
        gap: 14px;
    }

    .play-panel > * + *,
    .play-sidebar > * + * {
        margin-top: 14px;
    }

    .hero__chips,
    .hero__metrics,
    .feature-ribbon,
    .curriculum-grid,
    .overview-grid,
    .progress-section,
    .podium-grid,
    .levels-grid {
        grid-template-columns: 1fr;
    }

    .quick-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .quick-stat {
        padding: 14px 16px;
    }

    .quick-stat__icon {
        width: 38px;
        height: 38px;
        border-radius: 12px;
        font-size: 1rem;
    }

    .quick-stat__value {
        font-size: 1.3rem;
    }

    .quick-stat .lives-timer {
        position: static;
        transform: none;
        margin-top: 6px;
        width: fit-content;
    }

    .quick-stat--lives {
        flex-wrap: wrap;
    }

    .xp-track {
        padding: 14px 16px;
        margin-bottom: 16px;
    }

    .levels-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }

    .level-card {
        padding: 14px;
        border-radius: 16px;
    }

    .level-card h3 {
        font-size: 0.95rem;
        margin: 4px 0;
    }

    .level-card__category {
        font-size: 0.75rem;
    }

    .level-card__status {
        font-size: 0.74rem;
        padding: 4px 10px;
    }

    /* ────────────────────────────────────────────
       TYPOGRAPHY MOBILE
       ──────────────────────────────────────────── */

    .topbar {
        margin-bottom: 16px;
    }

    .topbar--hero {
        padding: 2px 0 0;
    }

    .lesson-spotlight {
        margin-bottom: 14px;
    }

    .hero__copy h1 {
        font-size: 2.2rem;
        max-width: 100%;
        line-height: 0.96;
    }

    .topbar h1 {
        font-size: 1.3rem;
        line-height: 1;
    }

    .topbar__lead {
        font-size: 0.92rem;
        margin-top: 8px;
    }

    .eyebrow {
        font-size: 0.7rem;
        margin-bottom: 10px;
    }

    .eyebrow::before {
        width: 24px;
    }

    .section-heading h2 {
        font-size: 1.3rem;
    }

    .hero__copy p {
        font-size: 0.95rem;
        line-height: 1.5;
    }

    /* ────────────────────────────────────────────
       BUTTONS AND NAVIGATION
       ──────────────────────────────────────────── */

    .site-nav,
    .hero__actions,
    .topbar__actions,
    .focus-card__actions,
    .auth-tabs {
        display: none;
        width: 100%;
    }

    .site-nav.is-open {
        display: flex;
    }

    .hero__actions {
        display: grid;
        width: 100%;
        margin-top: 20px;
    }

    .topbar__actions {
        display: grid;
        width: 100%;
    }

    .focus-card__actions {
        display: grid;
        width: 100%;
    }

    .auth-tabs {
        display: flex;
        width: 100%;
    }

    .button,
    .site-nav a,
    .auth-tab {
        width: 100%;
        min-height: 52px;
        font-size: 0.95rem;
    }

    .button {
        border-radius: 16px;
        padding: 14px 18px;
    }

    .button--primary,
    .button--secondary {
        font-weight: 800;
    }

    /* ────────────────────────────────────────────
       FORM INPUTS — TOUCH-FRIENDLY
       ──────────────────────────────────────────── */

    .stacked-form {
        gap: 14px;
    }

    .stacked-form label {
        gap: 6px;
        font-size: 0.88rem;
    }

    .stacked-form input {
        min-height: 56px;
        padding: 16px;
        border-radius: 16px;
        font-size: 1rem;
    }

    .stacked-form input:focus {
        border-color: rgba(59, 130, 246, 0.8);
        box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
        transform: none;
    }

    .answer-card h2,
    .mini-stat-card h3,
    .hint-card h3,
    .hint-card h2 {
        margin-bottom: 16px;
        font-size: 1.15rem;
    }

    .answer-card .stacked-form {
        gap: 14px;
    }

    .answer-card .stacked-form label {
        gap: 8px;
    }

    .answer-card .stacked-form input {
        min-height: 58px;
        padding: 16px;
        font-size: 1.05rem;
    }

    .answer-card .button,
    .next-actions .button {
        min-height: 58px;
        font-size: 1rem;
    }

    .feedback-box {
        margin-top: 14px;
        min-height: 64px;
        padding: 14px;
        font-size: 0.92rem;
        border-radius: 16px;
    }

    .next-actions {
        margin-top: 14px;
    }

    .mini-stat-card p {
        margin-bottom: 12px;
        font-size: 0.92rem;
    }

    .hint-card ul {
        margin-top: 10px;
        gap: 10px;
        padding-left: 20px;
    }

    .hint-card li {
        font-size: 0.9rem;
    }

    /* ────────────────────────────────────────────
       STAT CARDS MOBILE
       ──────────────────────────────────────────── */

    .stat-card {
        min-height: auto;
        padding: 20px;
    }

    .stat-card__value,
    .stat-card strong {
        font-size: 2.2rem;
    }

    .stat-card p {
        max-width: 100%;
        font-size: 0.9rem;
    }

    .stat-card__cta {
        width: 100%;
        align-self: stretch;
    }

    .stat-card__label {
        font-size: 0.72rem;
    }

    /* ────────────────────────────────────────────
       FOCUS CARD MOBILE
       ──────────────────────────────────────────── */

    .focus-card {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .focus-card__rings {
        order: -1;
        grid-template-columns: auto 1fr;
        align-items: center;
        gap: 16px;
    }

    .focus-ring {
        width: 120px;
        height: 120px;
    }

    .focus-ring__value {
        font-size: 1.8rem;
    }

    .focus-ring small {
        font-size: 0.75rem;
    }

    .focus-ring__meta {
        font-size: 0.7rem;
    }

    .focus-list {
        gap: 6px;
    }

    .focus-list li {
        padding: 10px 12px;
        border-radius: 12px;
        font-size: 0.88rem;
    }

    /* ────────────────────────────────────────────
       HERO LANDING MOBILE
       ──────────────────────────────────────────── */

    .hero--enhanced {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .hero__score strong {
        font-size: 1.8rem;
    }

    .hero__cell {
        padding: 14px;
        border-radius: 14px;
        font-size: 0.88rem;
    }

    .metric-pill {
        min-width: unset;
        flex-direction: row;
        align-items: center;
        justify-content: flex-start;
        gap: 10px;
        padding: 14px 16px;
        border-radius: 16px;
    }

    .metric-pill span {
        font-size: 0.85rem;
    }

    /* ────────────────────────────────────────────
       RIBBON CARDS MOBILE
       ──────────────────────────────────────────── */

    .ribbon-card {
        padding: 18px;
        gap: 14px;
    }

    .ribbon-card i {
        width: 42px;
        height: 42px;
        border-radius: 13px;
        font-size: 0.95rem;
        flex-shrink: 0;
    }

    .ribbon-card strong {
        font-size: 0.95rem;
    }

    .ribbon-card p {
        font-size: 0.85rem;
        margin: 4px 0 0;
    }

    /* ────────────────────────────────────────────
       CURRICULUM MOBILE
       ──────────────────────────────────────────── */

    .curriculum-showcase {
        margin-bottom: 20px;
    }

    .curriculum-card {
        padding: 18px;
    }

    .curriculum-card h3 {
        margin: 10px 0 8px;
        font-size: 1.1rem;
    }

    .curriculum-card p {
        font-size: 0.88rem;
    }

    /* ────────────────────────────────────────────
       AUTH LAYOUT MOBILE
       ──────────────────────────────────────────── */

    .auth-layout {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .auth-card {
        padding: 22px;
    }

    .auth-card--info {
        order: 1;
    }

    .auth-card--form {
        order: 0;
    }

    .auth-card h2 {
        font-size: 1.4rem;
    }

    .auth-card__intro h2 {
        font-size: 1.5rem;
        line-height: 1.1;
    }

    .auth-card__intro {
        margin-bottom: 16px;
    }

    .auth-card__intro p {
        font-size: 0.9rem;
    }

    .auth-tabs {
        padding: 6px;
        margin-bottom: 18px;
    }

    .auth-tab {
        padding: 12px 14px;
        font-size: 0.9rem;
        min-height: 46px;
    }

    .auth-panel h2 {
        font-size: 1.25rem;
        margin-bottom: 14px;
    }

    .feature-list {
        gap: 10px;
    }

    .feature-list article {
        padding: 14px;
        border-radius: 16px;
    }

    .feature-list article h3 {
        font-size: 0.95rem;
        margin: 0 0 4px;
    }

    .feature-list article p {
        font-size: 0.85rem;
        margin: 0;
    }

    /* ────────────────────────────────────────────
       LEVEL CARDS MOBILE
       ──────────────────────────────────────────── */

    .level-card {
        padding: 16px;
        border-radius: 18px;
    }

    .level-card h3 {
        font-size: 1rem;
        margin: 6px 0;
    }

    .level-card p {
        font-size: 0.82rem;
    }

    .level-card__footer {
        font-size: 0.82rem;
        margin-top: 10px;
    }

    .level-card__number {
        font-size: 0.85rem;
    }

    /* ────────────────────────────────────────────
       PROGRESS BARS MOBILE
       ──────────────────────────────────────────── */

    .progress-bar {
        height: 12px;
    }

    .progress-bar--large {
        height: 14px;
    }

    .progress-labels {
        font-size: 0.82rem;
    }

    /* ────────────────────────────────────────────
       EXCEL GRID — RESPONSIVE CARD LAYOUT
       ──────────────────────────────────────────── */

    .excel-card {
        padding: 10px;
    }

    .excel-grid-wrapper {
        overflow: visible;
        border: none;
        background: transparent;
        border-radius: 14px;
    }

    .excel-grid-wrapper.has-overflow::after {
        display: none;
    }

    .excel-grid {
        display: block;
        width: 100%;
        min-width: 0;
        border-collapse: separate;
    }

    .excel-grid thead {
        display: none;
    }

    .excel-grid tbody {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }

    .excel-grid__header-row {
        display: none;
    }

    .excel-grid tr {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
        border: 1px solid var(--line);
        border-radius: 14px;
        overflow: hidden;
        background: rgba(255, 255, 255, 0.02);
    }

    .excel-grid tr > th {
        grid-column: 1 / -1;
        position: static;
        background: rgba(255, 255, 255, 0.06);
        padding: 8px 14px;
        font-size: 0.72rem;
        font-weight: 800;
        color: var(--muted);
        text-align: left;
        border: none;
        border-bottom: 1px solid var(--line);
        min-width: 0;
        width: auto;
        letter-spacing: 0.06em;
    }

    .excel-grid tr > th::before {
        content: 'Fila ';
    }

    .excel-grid td {
        display: flex;
        flex-direction: column;
        gap: 3px;
        padding: 10px 12px;
        background: rgba(255, 255, 255, 0.03);
        border: none;
        border-bottom: 1px solid rgba(229, 231, 235, 0.06);
        border-right: 1px solid rgba(229, 231, 235, 0.06);
        min-width: 0;
        white-space: normal;
        word-break: break-word;
        font-size: 0.88rem;
        font-weight: 600;
    }

    .excel-grid td::before {
        content: attr(data-label);
        font-size: 0.62rem;
        font-weight: 800;
        color: var(--muted);
        letter-spacing: 0.06em;
        text-transform: uppercase;
    }

    .excel-grid td:first-child {
        position: static;
        background: rgba(255, 255, 255, 0.03);
        min-width: 0;
        width: auto;
        text-align: left;
        padding: 10px 12px;
    }

    .excel-grid td.is-target {
        background: linear-gradient(135deg, rgba(250, 204, 21, 0.14), rgba(249, 115, 22, 0.14));
        box-shadow: inset 0 0 0 2px rgba(250, 204, 21, 0.18);
    }

    .excel-card__header {
        margin-bottom: 10px;
        gap: 8px;
        align-items: flex-start;
    }

    .excel-card__header h3 {
        font-size: 0.95rem;
    }

    .excel-card__target {
        font-size: 0.72rem;
    }

    /* Leaderboard table keeps horizontal scroll */
    .leaderboard-table {
        min-width: 0;
    }

    .leaderboard-table th,
    .leaderboard-table td {
        padding: 9px 10px;
        font-size: 0.78rem;
        min-width: 64px;
        white-space: nowrap;
    }

    .prompt-card,
    .lesson-spotlight__card,
    .answer-card,
    .mini-stat-card,
    .hint-card {
        padding: 14px;
    }

    .prompt-card h2,
    .lesson-spotlight__card h2 {
        font-size: 0.98rem;
        line-height: 1.18;
    }

    .prompt-card p,
    .lesson-spotlight__card p,
    .topbar__lead {
        font-size: 0.78rem;
        line-height: 1.35;
    }

    .play-layout {
        gap: 12px;
    }

    .play-panel > * + *,
    .play-sidebar > * + * {
        margin-top: 12px;
    }

    .lesson-spotlight__meta span {
        border-radius: 14px;
        font-size: 0.74rem;
        padding: 8px 10px;
    }

    .answer-card .stacked-form input {
        min-height: 54px;
        border-radius: 14px;
    }

    .answer-card .button,
    .next-actions .button {
        min-height: 54px;
    }

    .feedback-box {
        min-height: 54px;
        font-size: 0.84rem;
    }

    .level-page .topbar,
    .level-page .lesson-spotlight {
        display: none;
    }

    .level-page .play-layout {
        display: flex;
        flex-direction: column;
        gap: 12px;
    }

    .level-page .play-sidebar {
        order: -1;
    }

    .level-page .play-sidebar .mini-stat-card,
    .level-page .play-sidebar .hint-card {
        display: none;
    }

    .level-page .answer-card {
        position: sticky;
        top: 8px;
        z-index: 5;
    }

    .level-page .prompt-card {
        margin-top: 2px;
    }

    .level-page .prompt-card h2 {
        font-size: 1.02rem;
        line-height: 1.2;
    }

    .level-page .prompt-card p {
        font-size: 0.8rem;
    }

    .level-page .excel-card {
        padding: 10px;
    }

    .level-page .excel-grid-wrapper {
        overflow: visible;
    }

    .level-page .play-panel,
    .level-page .excel-card,
    .level-page .prompt-card {
        width: 100%;
        max-width: 100%;
    }

    /* ────────────────────────────────────────────
       PODIUM MOBILE
       ──────────────────────────────────────────── */

    .podium-card {
        padding: 18px;
        min-height: auto;
    }

    .podium-card h3 {
        font-size: 1.1rem;
    }

    .podium-card p {
        font-size: 0.85rem;
    }

    .podium-card__place {
        margin-bottom: 14px;
        padding: 8px 14px;
        font-size: 0.85rem;
    }

    /* ────────────────────────────────────────────
       LEADERBOARD MOBILE
       ──────────────────────────────────────────── */

    .leaderboard-hero {
        padding: 20px;
    }

    .leaderboard-hero h2 {
        font-size: 1.3rem;
        line-height: 1.25;
    }

    .leaderboard-hero p {
        font-size: 0.88rem;
    }

    .leaderboard-list li {
        padding: 12px 0;
        font-size: 0.9rem;
    }

    /* ────────────────────────────────────────────
       LESSON SPOTLIGHT MOBILE
       ──────────────────────────────────────────── */

    .lesson-spotlight__card {
        flex-direction: column;
        align-items: flex-start;
        gap: 14px;
    }

    .lesson-spotlight__card h2 {
        font-size: 1.15rem;
    }

    .lesson-spotlight__meta {
        width: 100%;
        flex-direction: column;
    }

    .lesson-spotlight__meta span {
        padding: 10px 14px;
        font-size: 0.85rem;
        width: 100%;
    }

    /* ────────────────────────────────────────────
       FORMULA EXAMPLE MOBILE
       ──────────────────────────────────────────── */

    .formula-example {
        padding: 14px 16px;
        border-radius: 16px;
        margin-top: 12px;
    }

    .formula-example__value {
        font-size: 0.95rem;
    }

    /* ────────────────────────────────────────────
       CHAT WIDGET MOBILE
       ──────────────────────────────────────────── */

    [data-study-chat].chat-widget {
        right: 10px;
        left: 10px;
        bottom: calc(72px + env(safe-area-inset-bottom, 0px));
        justify-items: stretch;
    }

    [data-study-chat] .chat-widget__toggle {
        width: 100%;
        justify-content: center;
        border-radius: 16px;
        padding: 12px 16px;
    }

    [data-study-chat] .chat-card--floating {
        right: 10px;
        left: 10px;
        bottom: calc(136px + env(safe-area-inset-bottom, 0px));
        width: auto;
        max-height: min(60vh, 520px);
        transform-origin: bottom center;
        border-radius: 22px;
    }

    .chat-card {
        padding: 18px;
        border-radius: 22px;
    }

    .chat-card__header--floating {
        grid-template-columns: 1fr;
    }

    .chat-card__controls {
        width: 100%;
        grid-template-columns: 1fr auto;
        align-items: center;
    }

    .chat-thread {
        min-height: 140px;
        max-height: 240px;
    }

    .chat-message {
        padding: 12px 14px;
        border-radius: 16px;
        font-size: 0.9rem;
    }

    .chat-form textarea {
        min-height: 72px;
        padding: 14px;
        border-radius: 16px;
        font-size: 0.95rem;
    }

    /* ────────────────────────────────────────────
       FLASH MESSAGES MOBILE
       ──────────────────────────────────────────── */

    .flash {
        margin-bottom: 14px;
        padding: 14px 16px;
        border-radius: 16px;
        font-size: 0.9rem;
    }

    /* ────────────────────────────────────────────
       BOTTOM BANNER MOBILE
       ──────────────────────────────────────────── */

    .bottom-banner {
        flex-direction: column;
        align-items: flex-start;
        gap: 14px;
        margin-top: 20px;
        padding: 20px;
    }

    .bottom-banner p {
        font-size: 0.9rem;
    }

    /* ────────────────────────────────────────────
       SECTIONS SPACING MOBILE
       ──────────────────────────────────────────── */

    .dashboard-hero-grid,
    .focus-card {
        margin-bottom: 14px;
    }

    .curriculum-showcase,
    .feature-ribbon {
        margin-bottom: 16px;
    }

    .section-heading {
        margin-bottom: 12px;
    }

    .section-heading--wide {
        margin-bottom: 14px;
    }

    .section-heading--wide p {
        font-size: 0.9rem;
    }

    .overview-grid {
        margin-bottom: 16px;
    }

    .progress-section {
        margin-bottom: 16px;
    }

    .leaderboard-hero {
        margin-bottom: 14px;
    }

    .podium-grid {
        margin-bottom: 14px;
    }

    /* ────────────────────────────────────────────
       LEVELS PANEL MOBILE
       ──────────────────────────────────────────── */

    .levels-panel {
        padding: 18px;
    }

    .levels-panel__heading {
        gap: 12px;
        flex-direction: column;
        align-items: flex-start;
    }

    .levels-panel__summary {
        font-size: 0.85rem;
        margin-top: 4px;
    }

    .levels-panel__toggle {
        width: 100%;
        min-width: unset;
        min-height: 48px;
    }

    .levels-panel__viewport.is-collapsed {
        max-height: 480px;
    }

    .levels-panel__viewport.is-collapsed::after {
        height: 140px;
    }

    /* ────────────────────────────────────────────
       SIDE PANEL MOBILE (LEADERBOARD + HINTS)
       ──────────────────────────────────────────── */

    .side-panel {
        display: grid;
        gap: 14px;
    }

    .side-panel section {
        padding: 18px;
    }
}

@media (max-width: 380px) {
    .level-page .answer-card {
        position: static;
    }
}

.answer-card {
    background: linear-gradient(180deg, rgba(17, 24, 39, 0.98), rgba(15, 23, 42, 0.94));
}

.answer-card .button--primary,
.answer-card .button--secondary,
.next-actions .button {
    color: #ffffff;
    text-shadow: 0 1px 0 rgba(0, 0, 0, 0.12);
}

.answer-card .button--primary {
    background: linear-gradient(135deg, var(--secondary), var(--secondary-strong));
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.22), 0 18px 30px rgba(30, 58, 138, 0.34);
}

.answer-card .button--secondary,
.next-actions .button {
    background: linear-gradient(135deg, var(--primary-strong), var(--primary));
    box-shadow: 0 0 18px rgba(51, 196, 129, 0.18), 0 18px 30px rgba(33, 115, 70, 0.32);
}

.answer-card .button:disabled {
    opacity: 1;
    filter: saturate(0.92);
}

/* ────────────────────────────────────────────
   HAMBURGER MENU TOGGLE
   ──────────────────────────────────────────── */

.nav-toggle {
    display: none;
    appearance: none;
    border: 0;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 14px;
    width: 46px;
    height: 46px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    cursor: pointer;
    padding: 0;
    transition: background-color 180ms ease;
    -webkit-tap-highlight-color: transparent;
}

.nav-toggle:active {
    background: rgba(255, 255, 255, 0.12);
}

.nav-toggle__bar {
    display: block;
    width: 22px;
    height: 2px;
    border-radius: 999px;
    background: var(--ink);
    transition: transform 300ms cubic-bezier(0.4, 0, 0.2, 1), opacity 200ms ease;
}

.nav-toggle.is-open .nav-toggle__bar:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.nav-toggle.is-open .nav-toggle__bar:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}

.nav-toggle.is-open .nav-toggle__bar:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* ────────────────────────────────────────────
   BOTTOM NAVIGATION BAR (MOBILE)
   ──────────────────────────────────────────── */

.bottom-nav {
    display: none;
}

body.nav-open {
    overflow: hidden;
}

/* ────────────────────────────────────────────
   SCROLL FADE TOP (MOBILE STATUS BAR BLEND)
   ──────────────────────────────────────────── */

.page-shell::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: env(safe-area-inset-top, 0px);
    background: var(--bg);
    z-index: 50;
    pointer-events: none;
}

/* ────────────────────────────────────────────
   TOUCH ACTIVE STATES
   ──────────────────────────────────────────── */

@media (pointer: coarse) {
    .button:active,
    .auth-tab:active,
    .ribbon-card:active,
    .level-card:active,
    .stat-card:active,
    .curriculum-card:active,
    .podium-card:active {
        transform: scale(0.97);
        transition-duration: 80ms;
    }

    .site-nav a:active {
        background: rgba(59, 130, 246, 0.22);
        transform: scale(0.96);
    }
}

/* ═══════════════════════════════════════════════════
   EFECTOS VISUALES AVANZADOS
   ═══════════════════════════════════════════════════ */

/* ── Partículas flotantes en el hero ── */
.hero-particles {
    position: absolute;
    inset: -40px;
    pointer-events: none;
    overflow: visible;
    z-index: 0;
}

.hero-particle {
    position: absolute;
    border-radius: 50%;
    opacity: 0;
    animation: particle-float var(--dur, 8s) var(--delay, 0s) ease-in-out infinite;
}

.hero-particle--dot {
    width: var(--size, 4px);
    height: var(--size, 4px);
    background: var(--clr, rgba(51, 196, 129, 0.5));
}

.hero-particle--ring {
    width: var(--size, 18px);
    height: var(--size, 18px);
    border: 2px solid var(--clr, rgba(59, 130, 246, 0.3));
    background: transparent;
}

.hero-particle--cross {
    width: var(--size, 10px);
    height: var(--size, 10px);
    background: transparent;
}

.hero-particle--cross::before,
.hero-particle--cross::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    background: var(--clr, rgba(250, 204, 21, 0.4));
    border-radius: 1px;
}

.hero-particle--cross::before {
    width: 100%;
    height: 2px;
    transform: translate(-50%, -50%);
}

.hero-particle--cross::after {
    width: 2px;
    height: 100%;
    transform: translate(-50%, -50%);
}

@keyframes particle-float {
    0%, 100% {
        opacity: 0;
        transform: translateY(0) translateX(0) scale(0.5) rotate(0deg);
    }
    15% {
        opacity: var(--peak-opacity, 0.7);
    }
    50% {
        opacity: var(--peak-opacity, 0.7);
        transform: translateY(var(--dy, -80px)) translateX(var(--dx, 20px)) scale(1) rotate(180deg);
    }
    85% {
        opacity: var(--peak-opacity, 0.7);
    }
}

/* ── Órbitas decorativas ── */
.hero-orbit {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
}

.hero-orbit--1 {
    width: 340px;
    height: 340px;
    top: -60px;
    right: -80px;
    border: 1px solid rgba(59, 130, 246, 0.12);
    animation: orbit-spin 25s linear infinite;
}

.hero-orbit--2 {
    width: 220px;
    height: 220px;
    bottom: 10%;
    left: -40px;
    border: 1px dashed rgba(51, 196, 129, 0.1);
    animation: orbit-spin 18s linear infinite reverse;
}

.hero-orbit--3 {
    width: 120px;
    height: 120px;
    top: 35%;
    right: 15%;
    border: 1px solid rgba(250, 204, 21, 0.08);
    animation: orbit-spin 12s linear infinite;
}

.hero-orbit::after {
    content: '';
    position: absolute;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
}

.hero-orbit--1::after {
    background: rgba(59, 130, 246, 0.6);
    box-shadow: 0 0 12px rgba(59, 130, 246, 0.4);
}

.hero-orbit--2::after {
    background: rgba(51, 196, 129, 0.6);
    box-shadow: 0 0 12px rgba(51, 196, 129, 0.4);
    width: 6px;
    height: 6px;
}

.hero-orbit--3::after {
    background: rgba(250, 204, 21, 0.5);
    box-shadow: 0 0 10px rgba(250, 204, 21, 0.3);
    width: 5px;
    height: 5px;
}

@keyframes orbit-spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

/* ── Resplandor pulsante en el floating-panel ── */
.floating-panel {
    animation: panel-glow 4s ease-in-out infinite alternate;
}

@keyframes panel-glow {
    0%   { box-shadow: var(--shadow-lg), 0 0 40px rgba(59, 130, 246, 0.08); }
    100% { box-shadow: var(--shadow-lg), 0 0 60px rgba(51, 196, 129, 0.15), 0 0 120px rgba(59, 130, 246, 0.06); }
}

/* ── Borde gradiente animado en hero__copy ── */
.hero__copy {
    background-clip: padding-box;
}

.hero__copy::before {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: inherit;
    padding: 1px;
    background: linear-gradient(135deg, rgba(51, 196, 129, 0.3), rgba(59, 130, 246, 0.3), rgba(250, 204, 21, 0.2), rgba(51, 196, 129, 0.3));
    background-size: 300% 300%;
    animation: gradient-rotate 6s ease infinite;
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
    z-index: 1;
}

@keyframes gradient-rotate {
    0%   { background-position: 0% 50%; }
    50%  { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* ── Efecto shine en cards al hover ── */
.ribbon-card::before,
.curriculum-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -75%;
    width: 50%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.06), transparent);
    transform: skewX(-25deg);
    transition: none;
    z-index: 1;
    pointer-events: none;
}

.ribbon-card:hover::before,
.curriculum-card:hover::before {
    animation: card-shine 0.65s ease forwards;
}

@keyframes card-shine {
    from { left: -75%; }
    to   { left: 125%; }
}

/* ── Cards con transición más jugosa ── */
.ribbon-card,
.curriculum-card,
.metric-pill {
    transition: transform 320ms cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 320ms ease, border-color 320ms ease;
}

.ribbon-card:hover,
.curriculum-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg), 0 0 30px rgba(59, 130, 246, 0.1);
}

.metric-pill {
    cursor: default;
}

.metric-pill:hover {
    transform: translateY(-8px) scale(1.06);
    border-color: rgba(51, 196, 129, 0.45);
    box-shadow:
        0 16px 40px rgba(33, 115, 70, 0.25),
        0 0 20px rgba(51, 196, 129, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

/* ── Botones con pulso sutil ── */
.button--primary {
    position: relative;
    overflow: hidden;
}

.button--primary::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.15), transparent);
    opacity: 0;
    transition: opacity 300ms ease;
}

.button--primary:hover::before {
    opacity: 1;
}

.hero__actions .button--primary {
    animation: btn-breathe 3s ease-in-out infinite;
}

@keyframes btn-breathe {
    0%, 100% { box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.35); }
    50%      { box-shadow: 0 0 0 10px rgba(59, 130, 246, 0); }
}

/* ── Cursor parpadeante en h1 ── */
.hero__copy h1::after {
    content: '|';
    display: inline;
    margin-left: 4px;
    font-weight: 300;
    color: var(--primary-strong);
    animation: blink-cursor 1s step-end infinite;
}

@keyframes blink-cursor {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

/* ── Auth tabs transición suave ── */
.auth-tab {
    transition: background 280ms ease, color 280ms ease, transform 200ms ease;
}

.auth-tab:hover:not(.is-active) {
    background: rgba(255, 255, 255, 0.06);
    transform: scale(1.03);
}

.auth-tab.is-active {
    animation: tab-pop 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes tab-pop {
    0%   { transform: scale(0.92); }
    60%  { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* ── Inputs con glow animado al focus ── */
.stacked-form input:focus {
    animation: input-glow 1.5s ease-in-out infinite alternate;
}

@keyframes input-glow {
    0%   { box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.16); }
    100% { box-shadow: 0 0 0 6px rgba(59, 130, 246, 0.1), 0 0 20px rgba(59, 130, 246, 0.08); }
}

/* ── Eyebrow con línea animada ── */
.eyebrow::before {
    animation: eyebrow-grow 1.2s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes eyebrow-grow {
    from { width: 0; }
    to   { width: 32px; }
}

/* ── Ribbon card iconos con rebote ── */
.ribbon-card i {
    transition: transform 400ms cubic-bezier(0.34, 1.56, 0.64, 1), color 300ms ease;
}

.ribbon-card:hover i {
    transform: scale(1.25) rotate(-8deg);
    color: var(--primary-strong);
}

/* ── Scroll indicator ── */
.scroll-indicator {
    position: absolute;
    bottom: -40px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    color: var(--muted);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    opacity: 0.6;
    animation: scroll-bounce 2s ease-in-out infinite;
}

.scroll-indicator i {
    font-size: 1.1rem;
    animation: scroll-arrow 2s ease-in-out infinite;
}

@keyframes scroll-bounce {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50%      { transform: translateX(-50%) translateY(6px); }
}

@keyframes scroll-arrow {
    0%, 100% { opacity: 0.4; }
    50%      { opacity: 1; }
}

/* ── Tilt parallax sutil en el hero al mover mouse ── */
.hero--enhanced {
    perspective: 1200px;
}

/* ── Flash message animada ── */
.flash {
    animation: flash-slide 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes flash-slide {
    from { opacity: 0; transform: translateY(-16px) scale(0.96); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ── Número animado en metric-pill ── */
.metric-pill strong {
    display: inline-block;
    transition: transform 300ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

.metric-pill:hover strong {
    transform: scale(1.25);
    color: var(--primary-strong);
    text-shadow: 0 0 18px rgba(51, 196, 129, 0.5);
}

/* ── Navbar glassmorphism mejorada con hover glow ── */
.site-header--landing {
    transition: box-shadow 400ms ease, border-color 400ms ease;
}

.site-header--landing:hover {
    border-color: rgba(59, 130, 246, 0.18);
    box-shadow: var(--shadow-soft), 0 0 40px rgba(59, 130, 246, 0.06);
}

/* ── Brand mark rotación sutil al hover ── */
.brand__mark {
    transition: transform 400ms cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 400ms ease;
}

.brand:hover .brand__mark {
    transform: rotate(12deg) scale(1.1);
    box-shadow: 0 0 0 1px rgba(51, 196, 129, 0.2), 0 14px 28px rgba(33, 115, 70, 0.35), 0 0 20px rgba(51, 196, 129, 0.15);
}

/* ── Curriculum card pill colores vibrantes ── */
.curriculum-card .pill {
    transition: transform 300ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

.curriculum-card:hover .pill {
    transform: scale(1.08);
}

/* ══════════════════════════════════════════════════════════
   LEGAL PAGES (privacy / cookies)
   ══════════════════════════════════════════════════════════ */
.page-shell--legal {
    max-width: 820px;
    margin: 0 auto;
    padding: 0 clamp(1rem, 4vw, 2.5rem) 3rem;
}

.legal-content {
    margin-top: 2rem;
}

.legal-content h1 {
    font-family: var(--ff-display);
    font-size: clamp(1.8rem, 4vw, 2.6rem);
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.legal-updated {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.legal-content section {
    margin-bottom: 2rem;
}

.legal-content h2 {
    font-family: var(--ff-display);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.legal-content h3 {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 1rem 0 0.4rem;
}

.legal-content p,
.legal-content li {
    font-size: 0.95rem;
    line-height: 1.7;
    color: var(--text-secondary);
}

.legal-content ul {
    padding-left: 1.25rem;
    margin: 0.5rem 0;
}

.legal-content li {
    margin-bottom: 0.35rem;
}

.legal-content a {
    color: var(--accent);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.legal-content a:hover {
    color: var(--accent-hover);
}

/* Table for cookies listing */
.legal-table {
    width: 100%;
    border-collapse: collapse;
    margin: 0.75rem 0 1rem;
    font-size: 0.9rem;
}

.legal-table th,
.legal-table td {
    text-align: left;
    padding: 0.6rem 0.75rem;
    border-bottom: 1px solid var(--border);
}

.legal-table th {
    font-weight: 600;
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.03);
}

.legal-table td {
    color: var(--text-secondary);
}

.legal-table code {
    background: rgba(255, 255, 255, 0.06);
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    font-size: 0.85rem;
}

/* Footer */
.legal-footer {
    display: flex;
    flex-wrap: wrap;
    gap: 1.25rem;
    justify-content: center;
    padding: 2rem 0;
    border-top: 1px solid var(--border);
    font-size: 0.85rem;
}

.legal-footer a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 200ms;
}

.legal-footer a:hover {
    color: var(--accent);
}

/* Landing footer links */
.landing-legal-footer {
    display: flex;
    flex-wrap: wrap;
    gap: 1.25rem;
    justify-content: center;
    padding: 2rem 0 1rem;
    font-size: 0.8rem;
}

.landing-legal-footer a {
    color: var(--text-secondary);
    opacity: 0.6;
    text-decoration: none;
    transition: opacity 200ms, color 200ms;
}

.landing-legal-footer a:hover {
    opacity: 1;
    color: var(--accent);
}