/* ==========================================================
   ./n0shell — terminal minimal (con animaciones y ancho fluido)
   ========================================================== */

:root {
  --mono: 'JetBrains Mono', 'Fira Code', 'Roboto Mono', 'Courier New', monospace;
}

[data-theme="dark"] {
  --bg: #0a0a0a;
  --panel: #101211;
  --line: #262b28;
  --text: #eaeff4;
  --dim: #a8f7a5;
  --accent: #00ff41;
  --accent-dim: #0a8a2c;
  --accent-contrast: #000000;
  --danger: #ff6b6b;
  --link-path: #7fb3ff;
}

[data-theme="light"] {
  --bg: #f4f6f4;
  --panel: #ffffff;
  --line: #d3dbd4;
  --text: #101312;
  --dim: #5b6660;
  --accent: #067a25;
  --accent-dim: #9fd8ac;
  --accent-contrast: #ffffff;
  --danger: #c22a2a;
  --link-path: #1a5fb4;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--mono);
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
  transition: background 0.2s ease, color 0.2s ease;
}

::selection {
  background: var(--accent);
  color: var(--accent-contrast);
}

a {
  color: var(--text);
  text-decoration: none;
}

/* subtle CRT scanline overlay */
.crt-overlay {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 50;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.018) 0px,
    rgba(255, 255, 255, 0.018) 1px,
    transparent 1px,
    transparent 3px
  );
  mix-blend-mode: overlay;
}

[data-theme="light"] .crt-overlay {
  display: none;
}

/* ============ ANIMACIONES DE ENTRADA ============ */

@keyframes terminalEntrance {
  from {
    opacity: 0;
    transform: translateY(15px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInLinks {
  from {
    opacity: 0;
    transform: translateX(-10px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* ============ WINDOW (Adaptado a pantalla fluida) ============ */

.term-window {
  max-width: 1400px;
  width: 96vw;
  margin: 24px auto;
  border: 1px solid var(--line);
  background: var(--panel);
  animation: terminalEntrance 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@media (max-width: 640px) {
  .term-window { margin: 0; border-left: none; border-right: none; max-width: 100%; width: 100%; }
}

.term-titlebar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 18px;
  border-bottom: 1px solid var(--line);
  color: var(--dim);
  font-size: 13px;
  letter-spacing: 0.02em;
  flex-wrap: wrap;
}

.term-titlebar__path {
  white-space: nowrap;
}

.term-titlebar__controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.term-titlebar__clock {
  min-width: 66px;
  text-align: right;
}

.ctrl-btn {
  font-family: var(--mono);
  font-size: 12px;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--text);
  padding: 6px 10px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.ctrl-btn:hover,
.ctrl-btn:focus-visible {
  border-color: var(--accent);
  color: var(--accent);
}

.ctrl-sep {
  color: var(--dim);
}

.theme-icon { display: none; font-size: 13px; line-height: 1; }
[data-theme="dark"] .theme-icon--dark { display: inline; }
[data-theme="light"] .theme-icon--light { display: inline; }

.term-body {
  padding: 40px 32px;
  border-bottom: 1px solid var(--line);
}

.term-body:last-of-type,
.footer {
  border-bottom: none;
}

@media (max-width: 640px) {
  .term-body { padding: 32px 18px; }
  .term-titlebar { padding: 10px 14px; }
}

/* ============ PROMPT LINES ============ */

.prompt-line {
  margin: 0 0 20px 0;
  word-break: break-word;
}

.prompt-user { color: var(--accent); }
.prompt-sep,
.prompt-dollar { color: var(--dim); }
.prompt-path { color: var(--link-path); }
.prompt-dollar::before { content: " "; }
.prompt-dollar::after { content: " "; }

.cmd { color: var(--text); font-weight: 700; }

/* ============ HERO ============ */

.hero {
  padding-top: 48px;
}

.hero-output p {
  margin: 0 0 10px 0;
}

.hero-lead {
  color: var(--text);
  max-width: 70ch;
  font-size: 16px;
}

.dim { color: var(--dim); }

/* ============ CONTACTO / LISTA DE ENLACES ============ */

.link-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border: 1px solid var(--line);
}

.link-list li {
  border-bottom: 1px solid var(--line);
  opacity: 0;
  animation: fadeInLinks 0.4s ease forwards;
}

.link-list li:nth-child(1) { animation-delay: 0.1s; }
.link-list li:nth-child(2) { animation-delay: 0.2s; }
.link-list li:nth-child(3) { animation-delay: 0.3s; }
.link-list li:nth-child(4) { animation-delay: 0.4s; }

.link-list li:last-child { border-bottom: none; }

.link-list a {
  display: flex;
  justify-content: space-between;
  padding: 16px 20px;
  min-height: 50px;
  align-items: center;
  transition: background 0.15s ease, color 0.15s ease, padding-left 0.2s ease;
}

.link-list a:hover,
.link-list a:focus-visible {
  background: var(--accent);
  color: var(--accent-contrast);
  padding-left: 26px;
}

.link-list__key {
  color: var(--dim);
}

.link-list a:hover .link-list__key,
.link-list a:focus-visible .link-list__key {
  color: var(--accent-contrast);
}

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

/* ============ FOOTER ============ */

.footer {
  padding-top: 24px;
  padding-bottom: 24px;
  font-size: 12px;
}

/* ============ FOCUS STATE ============ */

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