:root {
    --bg: #fafaf9;
    --fg: #1c1917;
    --muted: #78716c;
    --line: #e7e5e4;
    --accent: #4f46e5;
    --accent-fg: #ffffff;
    --error: #b91c1c;
}
@media (prefers-color-scheme: dark) {
    :root {
        --bg: #0c0c0b;
        --fg: #f5f5f4;
        --muted: #a8a29e;
        --line: #292524;
        --accent: #818cf8;
        --accent-fg: #0c0c0b;
        --error: #f87171;
    }
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
    margin: 0;
    padding: 1.75rem clamp(1.25rem, 5vw, 3rem) 2.5rem;
    background: var(--bg);
    color: var(--fg);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 1rem;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

.skip {
    position: absolute;
    left: 1rem;
    top: -4rem;
    padding: 0.5rem 0.9rem;
    border-radius: 6px;
    background: var(--fg);
    color: var(--bg);
    font-size: 0.875rem;
    text-decoration: none;
    z-index: 10;
}
.skip:focus { top: 1rem; }

.top {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.wordmark {
    font-size: 0.9375rem;
    font-weight: 600;
    letter-spacing: 0.01em;
}

.lang {
    color: var(--muted);
    font-size: 0.8125rem;
    letter-spacing: 0.06em;
    text-decoration: none;
    transition: color 0.2s;
}
.lang:hover { color: var(--fg); }

main {
    width: 100%;
    max-width: 40rem;
    margin: 0 auto;
}

/* Pantalla principal */
.hero {
    min-height: calc(100vh - 6rem);
    min-height: calc(100dvh - 6rem);
    display: flex;
    flex-direction: column;
    padding-top: clamp(2rem, 8vh, 5rem);
}
.hero-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding-bottom: 3rem;
}

h1 {
    margin: 0 0 1.5rem;
    font-size: clamp(2.1rem, 6.5vw, 3.5rem);
    font-weight: 500;
    line-height: 1.1;
    letter-spacing: -0.03em;
    text-wrap: balance;
}
h1 span { display: block; color: var(--muted); }

.lead {
    margin: 0 0 2.5rem;
    max-width: 32rem;
    color: var(--muted);
    font-size: 1.125rem;
}

.open {
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0;
    border: 0;
    border-bottom: 1px solid var(--fg);
    background: none;
    color: var(--fg);
    font: inherit;
    font-weight: 500;
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s;
}
.open:hover { color: var(--accent); border-color: var(--accent); }
.open .arrow { transition: transform 0.2s; }
.open:hover .arrow { transform: translateX(3px); }
.open[hidden] { display: none; }
.hero .open[aria-expanded="true"] { display: none; }

/* Formulario */
form {
    display: grid;
    gap: 1.25rem;
    animation: rise 0.35s ease both;
}
form[hidden] { display: none; }

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

label {
    display: block;
    margin-bottom: 0.25rem;
    color: var(--muted);
    font-size: 0.8125rem;
}

input, textarea {
    width: 100%;
    padding: 0.5rem 0;
    border: 0;
    border-bottom: 1px solid var(--line);
    border-radius: 0;
    background: transparent;
    color: var(--fg);
    font: inherit;
    transition: border-color 0.2s;
}
textarea { resize: vertical; min-height: 6rem; }
input:focus, textarea:focus { outline: none; border-color: var(--accent); }
input[aria-invalid="true"], textarea[aria-invalid="true"] { border-color: var(--error); }

.trap {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.actions {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    margin-top: 0.5rem;
}

.send {
    padding: 0.7rem 1.5rem;
    border: 0;
    border-radius: 999px;
    background: var(--accent);
    color: var(--accent-fg);
    font: inherit;
    font-weight: 500;
    cursor: pointer;
    transition: opacity 0.2s;
}
.send:hover { opacity: 0.88; }
.send:disabled { opacity: 0.5; cursor: default; }

.status {
    margin: 0;
    font-size: 0.875rem;
    color: var(--muted);
}
.status.error { color: var(--error); }

.done {
    margin: 0;
    font-size: 1.125rem;
    animation: rise 0.35s ease both;
}
.done[hidden] { display: none; }

/* Tecnologías */
.stack {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 1.25rem;
    margin: 0;
    padding: 0;
    list-style: none;
    color: var(--muted);
    font-size: 0.8125rem;
}
.stack + .stack { margin-top: 0.75rem; }
.stack .label { color: var(--fg); }

/* Secciones */
.block {
    padding-block: 3rem;
    border-top: 1px solid var(--line);
}
.block h2 {
    margin: 0 0 1.5rem;
    color: var(--muted);
    font-size: 0.8125rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.plain {
    display: grid;
    gap: 1.5rem;
    margin: 0;
    padding: 0;
    list-style: none;
}
.plain strong { display: block; font-weight: 500; }
.plain span { color: var(--muted); }

.steps {
    display: grid;
    gap: 1.25rem;
    margin: 0;
    padding: 0;
    list-style: none;
    counter-reset: step;
}
.steps li {
    display: grid;
    grid-template-columns: 2.25rem 1fr;
    counter-increment: step;
}
.steps li::before {
    content: counter(step, decimal-leading-zero);
    padding-top: 0.2rem;
    color: var(--muted);
    font-size: 0.8125rem;
}
.steps strong { display: block; font-weight: 500; }
.steps span { color: var(--muted); }

details {
    padding: 0.9rem 0;
    border-bottom: 1px solid var(--line);
}
details:first-of-type { border-top: 1px solid var(--line); }
summary {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    font-weight: 500;
    list-style: none;
    cursor: pointer;
}
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; color: var(--muted); }
details[open] summary::after { content: "\2013"; }
details p { margin: 0.6rem 0 0; color: var(--muted); }

.closing { padding-block: 2.5rem 1rem; }

.copy {
    margin: 2rem 0 0;
    color: var(--muted);
    font-size: 0.75rem;
}

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

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { animation: none !important; transition: none !important; }
}
