/* ============================================================
   TOKENS DE MARCA — CODEA SEGURO
   Si falta un color, usar #FF00FF: se nota enseguida en el render.
   ============================================================ */
:root {
  --primary: #81b234;
  --secondary: #ad75f1;
  --accent: #FFC857;
  --background: #12101C;
  --surface: #1E1B2E;
  --text-primary: #F5F3FA;
  --text-muted: #B1ABC6;
  --incorrect: #FF5A5F;

  --line: color-mix(in srgb, var(--text-muted) 22%, transparent);
  --font-brand: 'Bebas Neue', Impact, 'Arial Narrow', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  color-scheme: dark;
}

@font-face {
  font-family: 'JetBrains Mono';
  src: url('assets/fonts/JetBrainsMono-Regular.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: 'JetBrains Mono';
  src: url('assets/fonts/JetBrainsMono-Bold.woff2') format('woff2');
  font-weight: 700;
  font-display: swap;
}

@font-face {
  font-family: 'Bebas Neue';
  src: url('assets/fonts/BebasNeue-Regular.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}

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

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

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  padding: 16px;
  background: var(--background);
  color: var(--text-primary);
  font: 400 1rem/1.6 var(--font-mono);
}

::selection { background: var(--primary); color: var(--background); }

/* --- Ventana --- */
.terminal {
  width: 100%;
  max-width: 640px;
  margin: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
}

.titlebar {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  color: var(--text-muted);
  font-size: 0.8125rem;
}

.dots {
  position: absolute;
  left: 14px;
  display: flex;
  gap: 7px;
}

.dots i {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--incorrect);
}
.dots i:nth-child(2) { background: var(--accent); }
.dots i:nth-child(3) { background: var(--primary); }

.screen { padding: 20px 18px 18px; }

@media (min-width: 560px) {
  .screen { padding: 28px 28px 24px; }
}

/* --- Líneas de comando --- */
.line { margin: 0; overflow-wrap: anywhere; }
.ps1 { color: var(--primary); font-weight: 700; }
.cmd { color: var(--secondary); }

.identity {
  display: flex;
  align-items: center;
  gap: 20px;
  margin: 10px 0 24px;
}

/* El PNG trae un 11% de margen transparente: el margen negativo lo compensa */
.logo {
  flex-shrink: 0;
  width: 136px;
  height: 136px;
  margin: -15px;
}

@media (max-width: 599px) {
  .identity {
    flex-direction: column;
    align-items: flex-start;
  }
}

.brand {
  margin: 0;
  color: var(--secondary);
  font: 400 clamp(3.25rem, 15vw, 5rem)/1 var(--font-brand);
  letter-spacing: 0.02em;
}

.tagline {
  margin: 4px 0 0;
  color: var(--text-muted);
}

/* --- Links --- */
.links {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
}

.links a {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 6px 10px;
  border-bottom: 1px solid var(--line);
  color: var(--primary);
  text-decoration: none;
}

.links li:last-child a { border-bottom: 0; }

.link-name { font-weight: 700; }

.link-host {
  margin-left: auto;
  overflow: hidden;
  color: var(--text-muted);
  font-size: 0.8125rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.links a:hover,
.links a:focus-visible {
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  color: var(--accent);
}

.links a:hover .arrow,
.links a:focus-visible .arrow { transform: translateX(3px); }

.arrow {
  flex-shrink: 0;
  white-space: nowrap;
  transition: transform 120ms ease-out;
}

/* En pantallas muy angostas, el dominio no cabe junto a nombres largos */
@media (max-width: 359px) {
  .link-host { display: none; }
  .arrow { margin-left: auto; }
}

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

/* --- Salida de comandos --- */
.output { margin-top: 12px; }
.output:empty { display: none; }
.output p { margin: 0; overflow-wrap: anywhere; }
.output .links { margin: 0 0 8px; }
.muted { color: var(--text-muted); }
.error { color: var(--incorrect); }
.output .warning { margin-top: 10px; color: var(--accent); }
.output .entry { margin-top: 10px; }
.output .entry:first-child { margin-top: 0; }

.row {
  display: grid;
  grid-template-columns: 14ch 1fr;
  column-gap: 1ch;
}
.row .muted { min-width: 0; }

@media (max-width: 479px) {
  .row { display: block; margin-bottom: 6px; }
  .row .cmd, .row .muted { display: block; }
}

/* --- Prompt --- */
.prompt {
  display: flex;
  align-items: center;
  gap: 1ch;
  margin-top: 12px;
  border-bottom: 1px solid transparent;
}
.prompt[hidden] { display: none; }
.prompt:focus-within { border-bottom-color: var(--accent); }

.prompt input {
  flex: 1;
  min-width: 0;
  min-height: 44px;
  padding: 0;
  border: 0;
  border-radius: 0;
  outline: 0;
  background: transparent;
  color: var(--text-primary);
  caret-color: var(--accent);
  font: inherit;
  font-size: 16px; /* evita el zoom automático de iOS */
}

.prompt input::placeholder { color: var(--text-muted); opacity: 1; }

/* --- Animación de arranque --- */
.booting [data-boot]:not(.shown) { visibility: hidden; }

.cursor {
  display: inline-block;
  width: 0.6em;
  height: 1.1em;
  margin-left: 2px;
  background: var(--accent);
  vertical-align: text-bottom;
}

@media (prefers-reduced-motion: reduce) {
  .arrow { transition: none; }
  .links a:hover .arrow,
  .links a:focus-visible .arrow { transform: none; }
}
