:root {
	--bg: #15161c;
	--bg-2: #1b1d25;
	--panel: #1e2028;
	--line: #33353f;
	--line-soft: #292b34;
	--ink: #f1efe8;
	--muted: #9a9cab;
	--muted-2: #6c6e7c;
	--accent: #e0a63f;
	--accent-ink: #1a1409;
	--ok: #5fb083;
	--bad: #e2695a;
	--warn: #e0a63f;
	--active: #6ea8d8;
	--radius: 3px;
	--body: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	--mono: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;
	--display: "Newsreader", Georgia, "Times New Roman", serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; color-scheme: dark; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 1rem/1.6 var(--body); min-height: 100vh; display: flex; flex-direction: column; }
h1, h2, h3 { font-family: var(--display); line-height: 1.15; margin: 0 0 .5rem; font-weight: 600; letter-spacing: -.01em; }
h1 { font-size: clamp(2rem, 5vw, 3.1rem); font-weight: 600; }
h2 { font-size: 1.4rem; }
h3 { font-size: 1.1rem; }
a { color: var(--accent); }
.skip { position: absolute; left: -999px; top: 0; background: var(--accent); color: var(--accent-ink); padding: .5rem 1rem; z-index: 10; font-weight: 600; }
.skip:focus { left: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }

/* ---------- Cabecera / pie ---------- */
.site-header { display: flex; justify-content: space-between; align-items: center; padding: 1.1rem clamp(1rem, 4vw, 3rem); border-bottom: 1px solid var(--line-soft); background: var(--bg-2); }
.brand { font: 600 1.2rem var(--display); color: var(--ink); text-decoration: none; display: inline-flex; gap: .6rem; align-items: center; letter-spacing: -.01em; }
.logo { display: inline-grid; place-items: center; width: 1.6rem; height: 1.6rem; border-radius: 50%; border: 1.5px solid var(--accent); color: var(--accent); font-size: .65rem; background: transparent; }
.site-header nav a { color: var(--muted); font-weight: 500; text-decoration: none; font-size: .92rem; }
.site-header nav a:hover { color: var(--ink); }
main { flex: 1; width: 100%; max-width: 1080px; margin: 0 auto; padding: clamp(2rem, 5vw, 3.5rem) clamp(1rem, 4vw, 2rem) 4rem; outline: none; }
.site-footer { border-top: 1px solid var(--line-soft); padding: 1.4rem clamp(1rem, 4vw, 3rem); color: var(--muted-2); font-size: .85rem; background: var(--bg-2); }
.site-footer p { margin: .2rem 0; }
.site-footer a { color: var(--muted); }

/* ---------- Portada ---------- */
.hero { margin-bottom: 2.75rem; max-width: 40rem; }
.hero p { font-size: 1.1rem; color: var(--muted); margin: .85rem 0 0; }
.grid { display: grid; gap: 2rem; grid-template-columns: 1fr; }
@media (min-width: 900px) { .grid.two { grid-template-columns: 1.4fr 1fr; align-items: start; } }

/* ---------- Panel "en cuadro": el motivo del visor ---------- */
.card, .video-wrap {
	position: relative;
	background: var(--panel);
	border: 1px solid var(--line);
	border-radius: var(--radius);
	padding: 1.6rem;
}
.video-wrap { padding: 0; overflow: hidden; background: #000; }
.card::before, .card::after, .video-wrap::before, .video-wrap::after {
	content: ""; position: absolute; width: .85rem; height: .85rem; pointer-events: none;
	border-color: var(--accent); opacity: .8;
}
.card::before, .video-wrap::before { top: -1px; left: -1px; border-top: 2px solid var(--accent); border-left: 2px solid var(--accent); }
.card::after, .video-wrap::after { bottom: -1px; right: -1px; border-bottom: 2px solid var(--accent); border-right: 2px solid var(--accent); }
.card + .card { margin-top: 1.5rem; }

.field { margin-bottom: 1.15rem; }
label, .label { display: block; font-weight: 600; margin-bottom: .4rem; font-size: .95rem; }
.hint { color: var(--muted-2); font-size: .85rem; margin: .35rem 0 0; }
input[type=text], input[type=number], input[type=password], select, textarea {
	width: 100%; font: inherit; color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); padding: .65rem .8rem;
}
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
textarea { min-height: 7.5rem; resize: vertical; }
textarea.big { min-height: 14rem; }
.row { display: grid; gap: 1rem; grid-template-columns: 1fr; }
@media (min-width: 560px) { .row.two { grid-template-columns: 1fr 1fr; } .row.three { grid-template-columns: repeat(3, 1fr); } }

.segmented { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.segmented label { margin: 0; padding: .7rem .5rem; text-align: center; cursor: pointer; font-weight: 500; background: var(--bg); color: var(--muted); }
.segmented label + label { border-left: 1px solid var(--line); }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented label:has(input:checked) { background: var(--accent); color: var(--accent-ink); font-weight: 600; }
.segmented label:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: -2px; }
.duration { display: flex; gap: 1rem; align-items: center; }
.duration input[type=range] { flex: 1; accent-color: var(--accent); }
.duration output { min-width: 5.5rem; text-align: right; font: 600 1rem var(--mono); color: var(--ink); }

/* ---------- Botones ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; font: 600 .95rem var(--body); padding: .7rem 1.25rem; border: 1px solid var(--line); border-radius: var(--radius); background: transparent; color: var(--ink); cursor: pointer; text-decoration: none; transition: border-color .15s, background .15s; }
.btn:hover { border-color: var(--muted); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger { color: var(--bad); border-color: var(--line); }
.btn.danger:hover { border-color: var(--bad); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn.block { width: 100%; }
.actions { display: flex; flex-wrap: wrap; gap: .7rem; margin-top: 1.15rem; }

/* ---------- Avisos ---------- */
.notice { border: 1px solid var(--line); border-left: 3px solid var(--warn); border-radius: var(--radius); padding: .8rem 1rem; background: var(--bg-2); font-size: .9rem; margin: 1rem 0; color: var(--muted); }
.notice.error { border-left-color: var(--bad); color: #f2c9c3; }
.notice.ok { border-left-color: var(--ok); color: #cfe9da; }
[hidden] { display: none !important; }

/* ---------- Lista de videos ---------- */
.list { list-style: none; margin: 0; padding: 0; display: grid; gap: .75rem; }
.item { display: block; text-decoration: none; color: inherit; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg); padding: .85rem 1rem; transition: border-color .15s; }
.item:hover { border-color: var(--muted-2); }
.item .top { display: flex; justify-content: space-between; gap: .75rem; align-items: baseline; }
.item strong { overflow-wrap: anywhere; font-weight: 600; }
.meta { color: var(--muted-2); font: .85rem var(--mono); margin-top: .3rem; }

.chip { flex: none; display: inline-flex; align-items: center; gap: .4rem; font: 500 .78rem var(--body); padding: .1rem 0; color: var(--muted); }
.chip::before { content: ""; width: .5rem; height: .5rem; border-radius: 50%; background: currentColor; flex: none; }
.chip.done { color: var(--ok); } .chip.error, .chip.cancelled { color: var(--bad); } .chip.queued { color: var(--warn); } .chip.writing, .chip.rendering { color: var(--active); }
.chip.writing::before, .chip.rendering::before { animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }

progress { width: 100%; height: 4px; margin-top: .6rem; appearance: none; border: none; border-radius: 999px; background: var(--line); overflow: hidden; }
progress::-webkit-progress-bar { background: var(--line); }
progress::-webkit-progress-value { background: var(--accent); }
progress::-moz-progress-bar { background: var(--accent); }
.empty { color: var(--muted-2); }

/* ---------- Video / estado grande ---------- */
video { display: block; width: 100%; max-height: 70vh; background: #000; }
.status-big { display: flex; flex-direction: column; gap: .4rem; }
.status-big .pct { font: 500 3rem var(--mono); color: var(--ink); letter-spacing: -.02em; }
.back { display: inline-block; margin-bottom: 1.25rem; font-weight: 500; color: var(--muted); text-decoration: none; }
.back:hover { color: var(--ink); }
.copybox { font: .85rem/1.5 var(--mono); min-height: 9rem; }
.steps { padding-left: 1.2rem; margin: 0; color: var(--muted); font-size: .95rem; }
.steps li::marker { color: var(--accent); font-family: var(--mono); font-size: .85em; }
.steps li + li { margin-top: .4rem; }