* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg: #0d1117;
    --surface: #161b22;
    --surface2: #21262d;
    --primary: #7c3aed;
    --primary-light: #a78bfa;
    --green: #22c55e;
    --yellow: #eab308;
    --red: #ef4444;
    --cyan: #06b6d4;
    --text: #e6edf3;
    --muted: #8b949e;
    --border: #30363d;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
}

/* ── NAV ── */
nav {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 999;
    background: rgba(13, 17, 23, .95);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    padding: .75rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--primary-light);
}

.logo span {
    color: var(--green);
}

.nav-links {
    display: flex;
    gap: .25rem;
    flex-wrap: wrap;
}

.nav-links a {
    color: var(--muted);
    text-decoration: none;
    padding: .4rem .75rem;
    border-radius: 6px;
    font-size: .82rem;
    transition: all .2s;
}

.nav-links a:hover {
    color: var(--text);
    background: var(--surface2);
}

.ham {
    display: none;
    background: none;
    border: none;
    color: var(--text);
    font-size: 1.3rem;
    cursor: pointer;
}

/* ── HERO ── */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 6rem 1.5rem 3rem;
    background: radial-gradient(ellipse 80% 60% at 50% 0%, rgba(124, 58, 237, .18), transparent);
}

.hero-inner {
    max-width: 780px;
}

.hero-badges {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.badge {
    padding: .3rem .9rem;
    border-radius: 50px;
    font-size: .75rem;
    font-weight: 600;
    border: 1px solid;
}

.badge-purple {
    background: rgba(124, 58, 237, .15);
    border-color: rgba(124, 58, 237, .5);
    color: var(--primary-light);
}

.badge-green {
    background: rgba(34, 197, 94, .1);
    border-color: rgba(34, 197, 94, .4);
    color: var(--green);
}

.badge-cyan {
    background: rgba(6, 182, 212, .1);
    border-color: rgba(6, 182, 212, .4);
    color: var(--cyan);
}

.badge-yellow {
    background: rgba(234, 179, 8, .1);
    border-color: rgba(234, 179, 8, .4);
    color: var(--yellow);
}

.hero h1 {
    font-size: clamp(2rem, 5vw, 3.2rem);
    font-weight: 800;
    line-height: 1.15;
    margin-bottom: 1rem;
}

.hero h1 em {
    font-style: normal;
    color: var(--primary-light);
}

.hero p {
    color: var(--muted);
    font-size: 1.05rem;
    max-width: 580px;
    margin: 0 auto 2rem;
}

.btn-row {
    display: flex;
    gap: .75rem;
    justify-content: center;
    flex-wrap: wrap;
}

.btn {
    padding: .7rem 1.6rem;
    border-radius: 8px;
    font-size: .9rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    text-decoration: none;
    transition: all .25s;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
}

.btn-primary:hover {
    background: #6d28d9;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(124, 58, 237, .4);
}

.btn-ghost {
    background: transparent;
    color: var(--primary-light);
    border: 1.5px solid var(--primary);
}

.btn-ghost:hover {
    background: rgba(124, 58, 237, .1);
}

/* ── SECTIONS ── */
section {
    padding: 4rem 1.5rem;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
}

.sec-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.sec-header h2 {
    font-size: 1.8rem;
    font-weight: 800;
}

.sec-header h2 em {
    font-style: normal;
    color: var(--primary-light);
}

.sec-header p {
    color: var(--muted);
    margin-top: .4rem;
}

/* ── BLOQUE TABS ── */
.bloque-tabs {
    display: flex;
    gap: .4rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: .75rem;
}

.btab {
    padding: .5rem 1.1rem;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    font-size: .85rem;
    font-weight: 600;
    transition: all .2s;
}

.btab.active,
.btab:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.bpanel {
    display: none;
}

.bpanel.active {
    display: block;
    animation: fadeUp .3s ease;
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(8px)
    }

    to {
        opacity: 1;
        transform: translateY(0)
    }
}

/* ── CONTENT BLOCKS ── */
.content-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

@media(max-width:700px) {
    .content-grid {
        grid-template-columns: 1fr;
    }
}

.info-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
}

.info-card h3 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: .75rem;
    display: flex;
    align-items: center;
    gap: .5rem;
}

.info-card h3 .icon {
    font-size: 1.1rem;
}

.info-card p,
.info-card li {
    color: var(--muted);
    font-size: .88rem;
    line-height: 1.7;
}

.info-card ul {
    list-style: none;
    padding: 0;
}

.info-card ul li::before {
    content: "▸ ";
    color: var(--primary-light);
}

.full-card {
    grid-column: 1/-1;
}

/* ── TABLE ── */
.tbl-wrap {
    overflow-x: auto;
    margin-top: .5rem;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: .82rem;
}

th {
    background: var(--surface2);
    color: var(--primary-light);
    padding: .6rem .8rem;
    text-align: left;
    border: 1px solid var(--border);
}

td {
    padding: .55rem .8rem;
    border: 1px solid var(--border);
    color: var(--muted);
    vertical-align: top;
}

tr:nth-child(even) td {
    background: rgba(255, 255, 255, .02);
}

/* ── CODE ── */
.code-block {
    background: #0d1117;
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
    margin: .75rem 0;
}

.code-header {
    background: var(--surface2);
    padding: .5rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: .78rem;
    color: var(--muted);
}

.code-header .lang {
    color: var(--primary-light);
    font-weight: 700;
}

.code-body {
    padding: 1rem 1.2rem;
    overflow-x: auto;
}

.code-body pre {
    font-family: 'Courier New', monospace;
    font-size: .82rem;
    line-height: 1.75;
    white-space: pre;
}

.kw {
    color: #ff79c6;
}

.fn {
    color: #50fa7b;
}

.str {
    color: #f1fa8c;
}

.cm {
    color: #6272a4;
}

.var {
    color: #8be9fd;
}

.num {
    color: #bd93f9;
}

.op {
    color: #ff79c6;
}

.copy-btn {
    background: rgba(124, 58, 237, .2);
    border: 1px solid rgba(124, 58, 237, .4);
    color: var(--primary-light);
    padding: .2rem .6rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: .72rem;
    transition: all .2s;
}

.copy-btn:hover {
    background: var(--primary);
    color: #fff;
}

/* ── GHERKIN ── */
.gherkin {
    background: #0a1628;
    border: 1px solid rgba(6, 182, 212, .3);
    border-radius: 10px;
    padding: 1rem 1.2rem;
    margin: .75rem 0;
}

.gherkin pre {
    font-family: 'Courier New', monospace;
    font-size: .82rem;
    line-height: 1.8;
}

.gk-feature {
    color: #ff79c6;
    font-weight: 700;
}

.gk-scenario {
    color: #8be9fd;
    font-weight: 700;
}

.gk-given {
    color: #50fa7b;
}

.gk-when {
    color: #f1fa8c;
}

.gk-then {
    color: #bd93f9;
}

.gk-and {
    color: #ffb86c;
}

.gk-str {
    color: #f1fa8c;
}

/* ── STEPS ── */
.steps {
    display: flex;
    flex-direction: column;
    gap: .75rem;
}

.step {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    background: var(--surface);
    border: 1px solid var(--border);
    border-left: 3px solid var(--primary);
    border-radius: 10px;
    padding: 1rem 1.2rem;
}

.step-n {
    background: var(--primary);
    color: #fff;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: .85rem;
    flex-shrink: 0;
}

.step h4 {
    color: var(--text);
    font-size: .9rem;
    margin-bottom: .2rem;
}

.step p {
    color: var(--muted);
    font-size: .83rem;
}

/* ── RUBRICA ── */
.rubrica-section {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.rubrica-section h3 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--primary-light);
}

.score-row {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .6rem 0;
    border-bottom: 1px solid var(--border);
}

.score-row:last-child {
    border-bottom: none;
}

.score-label {
    flex: 1;
    font-size: .85rem;
    color: var(--text);
}

.score-bars {
    display: flex;
    gap: .3rem;
}

.score-bar {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .7rem;
    font-weight: 700;
    cursor: default;
}

.s5 {
    background: rgba(34, 197, 94, .2);
    color: var(--green);
    border: 1px solid rgba(34, 197, 94, .4);
}

.s4 {
    background: rgba(6, 182, 212, .15);
    color: var(--cyan);
    border: 1px solid rgba(6, 182, 212, .3);
}

.s3 {
    background: rgba(234, 179, 8, .15);
    color: var(--yellow);
    border: 1px solid rgba(234, 179, 8, .3);
}

.s1 {
    background: rgba(239, 68, 68, .15);
    color: var(--red);
    border: 1px solid rgba(239, 68, 68, .3);
}

.score-desc {
    flex: 2;
    font-size: .78rem;
    color: var(--muted);
}

.puntaje-box {
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1rem 1.5rem;
    margin-top: 1rem;
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.puntaje-item {
    text-align: center;
}

.puntaje-num {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--primary-light);
}

.puntaje-label {
    font-size: .75rem;
    color: var(--muted);
}

.interp-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: .5rem;
    margin-top: .75rem;
}

.interp-item {
    background: var(--surface2);
    border-radius: 8px;
    padding: .6rem .8rem;
    text-align: center;
    border: 1px solid var(--border);
}

.interp-range {
    font-size: .9rem;
    font-weight: 700;
    color: var(--primary-light);
}

.interp-label {
    font-size: .72rem;
    color: var(--muted);
    margin-top: .2rem;
}

/* ── FOOTER ── */
footer {
    background: var(--surface);
    border-top: 1px solid var(--border);
    text-align: center;
    padding: 2rem;
    color: var(--muted);
    font-size: .82rem;
}

footer span {
    color: var(--primary-light);
}

/* ── SCROLL TOP ── */
#st {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 42px;
    height: 42px;
    font-size: 1rem;
    cursor: pointer;
    display: none;
    box-shadow: 0 4px 15px rgba(124, 58, 237, .5);
    transition: transform .2s;
}

#st:hover {
    transform: scale(1.1);
}

@media(max-width:768px) {
    .nav-links {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 56px;
        left: 0;
        width: 100%;
        background: var(--bg);
        padding: 1rem 1.5rem;
        border-bottom: 1px solid var(--border);
    }

    .nav-links.open {
        display: flex;
    }

    .ham {
        display: block;
    }
}