/* ═══════════════════════════════════════════════════════
 *  CSS Custom Properties — Temas oscuro y claro
 * ═══════════════════════════════════════════════════════ */

:root {
  --font-mono: "JetBrains Mono", "Fira Code", "Cascadia Code", monospace;
  --font-heading: "Space Grotesk", "Inter", system-ui, sans-serif;
  --transition-speed: 0.3s;
}

html.dark {
  --bg-0: #000000;
  --bg-1: #0a0a0a;
  --bg-2: #111111;
  --bg-3: #1a1a1a;
  --bg-4: #242424;
  --bg-hover: #1e1e1e;
  --border: #2a2a2a;
  --border-focus: #50fa7b;
  --text-0: #f8f8f2;
  --text-1: #cccccc;
  --text-2: #888888;
  --text-3: #555555;
  --accent: #50fa7b;
  --accent-dim: #2a6e3f;
  --accent-bg: #0d2818;
  --ok: #50fa7b;
  --error: #ff5555;
  --error-bg: #2d0f0f;
  --warn: #f1fa8c;
  --info: #8be9fd;
  --flag-bg: #1a1a2e;
  --glow: rgba(80, 250, 123, 0.15);
  --glow-strong: rgba(80, 250, 123, 0.3);
  --selection-bg: #50fa7b;
  --selection-text: #0a0a0a;
}

html.light {
  --bg-0: #f5f5f0;
  --bg-1: #ffffff;
  --bg-2: #f0f0ea;
  --bg-3: #e8e8e2;
  --bg-4: #ddddd6;
  --bg-hover: #ececec;
  --border: #c8c8c0;
  --border-focus: #1a8a3e;
  --text-0: #1a1a2e;
  --text-1: #333333;
  --text-2: #6b6b6b;
  --text-3: #9a9a9a;
  --accent: #1a8a3e;
  --accent-dim: #aadbb8;
  --accent-bg: #e0f5e6;
  --ok: #1a8a3e;
  --error: #d32f2f;
  --error-bg: #ffeaea;
  --warn: #7a7c0c;
  --info: #0277bd;
  --flag-bg: #eef0ff;
  --glow: rgba(26, 138, 62, 0.08);
  --glow-strong: rgba(26, 138, 62, 0.15);
  --selection-bg: #1a8a3e;
  --selection-text: #ffffff;
}

/* ═══════════════════════════════════════════════════════
 *  Reset & Base
 * ═══════════════════════════════════════════════════════ */

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-mono);
  background-color: var(--bg-0);
  color: var(--text-1);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  line-height: 1.6;
  transition: background-color var(--transition-speed),
    color var(--transition-speed);
}

::selection {
  background: var(--selection-bg);
  color: var(--selection-text);
}

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

a:hover {
  text-decoration: underline;
}

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

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

/* ═══════════════════════════════════════════════════════
 *  Boot Overlay
 * ═══════════════════════════════════════════════════════ */

.boot-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: #000000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  cursor: pointer;
  transition: opacity 0.5s ease;
  /* Reset <output> default styles */
  unicode-bidi: unset;
}

.boot-overlay.fade-out {
  opacity: 0;
  pointer-events: none;
}

.boot-container {
  max-width: 720px;
  width: 100%;
}

.boot-log {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  line-height: 1.8;
  color: #b0b0b0;
  max-height: 80vh;
  overflow-y: auto;
}

.boot-line {
  animation: bootLineIn 0.15s ease-out both;
}

.boot-line .ts {
  color: #555555;
  margin-right: 0.5rem;
}

.boot-log .ok {
  color: #50fa7b;
  font-weight: 700;
}

.boot-skip-hint {
  text-align: center;
  color: #444;
  font-size: 0.7rem;
  margin-top: 2rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* ═══════════════════════════════════════════════════════
 *  Gateway Layout
 * ═══════════════════════════════════════════════════════ */

.gateway {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.gateway.fade-in {
  animation: fadeIn 0.5s ease both;
}

.gateway.slide-up-out {
  opacity: 0;
  transform: translateY(-30px);
  pointer-events: none;
}

/* Header */
.gateway-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.8rem 1.5rem;
  background: var(--bg-2);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
}

.hostname-text {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1rem;
  color: var(--text-0);
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.hostname-prompt {
  font-family: var(--font-mono);
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 400;
  opacity: 0.6;
  margin-left: 0.75rem;
  letter-spacing: 0;
  text-transform: none;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.header-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--bg-3);
  border: 1px solid var(--border);
  color: var(--text-2);
  font-family: var(--font-mono);
  font-size: 0.65rem;
  padding: 0.35rem 0.6rem;
  cursor: pointer;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  transition: all var(--transition-speed);
}

.header-btn:hover {
  background: var(--bg-hover);
  color: var(--accent);
  border-color: var(--accent-dim);
}

.theme-icon {
  font-size: 0.85rem;
}

#live-clock {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--text-3);
  letter-spacing: 0.05em;
}

/* Main Panel */
.gateway-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
}

.gateway-panel {
  display: grid;
  grid-template-columns: 1fr;
  max-width: 900px;
  width: 100%;
  border: 1px solid var(--border);
  background: var(--bg-1);
}

@media (min-width: 768px) {
  .gateway-panel {
    grid-template-columns: 7fr 5fr;
  }
}

/* Terminal Log (left) */

/* ═══════════════════════════════════════════════════════
 *  Hints Panel (Sidebar)
 * ═══════════════════════════════════════════════════════ */

.hints-btn span:first-child {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border: 1.5px solid var(--accent);
  border-radius: 50%;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
}

.hints-btn:hover span:first-child {
  background: var(--accent);
  color: var(--bg-0);
}

.hints-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: 380px;
  max-width: 90vw;
  height: 100vh;
  background: var(--bg-1);
  border-left: 1px solid var(--border);
  z-index: 200;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  box-shadow: -4px 0 30px rgba(0, 0, 0, 0.3);
  animation: hintsSlideIn 0.3s ease both;
}

.hints-panel[hidden] {
  display: none !important;
}

.hints-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.2rem 1.5rem;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--bg-1);
  z-index: 1;
}

.hints-panel-title {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--accent);
}

.hints-close-btn {
  background: var(--bg-3);
  border: 1px solid var(--border);
  color: var(--text-2);
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  cursor: pointer;
  transition: all var(--transition-speed);
}

.hints-close-btn:hover {
  background: var(--error);
  color: #fff;
  border-color: var(--error);
}

.hints-panel-desc {
  padding: 1rem 1.5rem;
  font-size: 0.72rem;
  color: var(--text-2);
  line-height: 1.7;
  border-bottom: 1px solid var(--border);
}

.hints-content {
  padding: 1rem 1.5rem;
  flex: 1;
}

/* Phase accordion */
.hints-phase {
  border: 1px solid var(--border);
  margin-bottom: 0.75rem;
}

.hints-phase-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.8rem 1rem;
  background: var(--bg-2);
  cursor: pointer;
  border: none;
  width: 100%;
  text-align: left;
  color: var(--text-0);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  transition: background var(--transition-speed);
}

.hints-phase-header:hover {
  background: var(--bg-3);
}

.hints-phase-header .phase-label {
  font-size: 0.62rem;
  color: var(--accent);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  display: block;
  margin-bottom: 0.2rem;
}

.hints-phase-header .chevron {
  color: var(--text-3);
  font-size: 0.8rem;
  transition: transform var(--transition-speed);
}

.hints-phase.open .chevron {
  transform: rotate(90deg);
}

.hints-phase-body {
  display: none;
  padding: 0;
}

.hints-phase.open .hints-phase-body {
  display: block;
}

.hint-item {
  padding: 0.6rem 1rem;
  border-top: 1px solid var(--border);
  font-size: 0.72rem;
  line-height: 1.7;
  color: var(--text-2);
  cursor: pointer;
  position: relative;
  transition: background var(--transition-speed);
}

.hint-item:hover {
  background: var(--bg-2);
}

.hint-item.revealed {
  color: var(--text-1);
}

.hint-item:not(.revealed)::before {
  content: "▸ Click para revelar pista";
  color: var(--text-3);
  font-size: 0.62rem;
  font-style: italic;
  letter-spacing: 0.05em;
}

.hint-item:not(.revealed) .hint-text {
  display: none;
}

.hint-item.revealed .hint-text code {
  background: var(--bg-3);
  padding: 0.1rem 0.35rem;
  font-size: 0.68rem;
  color: var(--accent);
}

.hint-number {
  color: var(--accent-dim);
  font-weight: 700;
  margin-right: 0.4rem;
  font-size: 0.65rem;
}

@keyframes hintsSlideIn {
  from {
    transform: translateX(100%);
  }
  to {
    transform: translateX(0);
  }
}

@media (max-width: 480px) {
  .hints-panel {
    width: 100vw;
    max-width: 100vw;
  }
}

/* ═══════════════════════════════════════════════════════ */

.terminal-side {
  background: var(--bg-2);
  padding: 2rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 420px;
  border-bottom: 1px solid var(--border);
}

@media (min-width: 768px) {
  .terminal-side {
    border-bottom: none;
    border-right: 1px solid var(--border);
  }
}

.terminal-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.terminal-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.terminal-dot.red { background: var(--error); }
.terminal-dot.yellow { background: var(--warn); }
.terminal-dot.green { background: var(--ok); }

.terminal-title {
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: var(--text-3);
  text-transform: uppercase;
  margin-left: 0.75rem;
}

.terminal-log-content {
  font-size: 0.72rem;
  line-height: 1.9;
  color: var(--text-2);
  white-space: pre-wrap;
  word-break: break-word;
}

.terminal-log-content .ok {
  color: var(--ok);
  font-weight: 500;
}

.terminal-log-content .prompt-line {
  color: var(--accent);
  font-weight: 500;
}

.vault-title-section {
  margin-top: 2.5rem;
}

.vault-title-section h1 {
  font-family: var(--font-heading);
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 700;
  color: var(--text-0);
  line-height: 1;
  letter-spacing: -0.03em;
}

.vault-title-section h1 .accent {
  color: var(--accent);
}

.vault-title-section .protocol {
  font-size: 0.6rem;
  color: var(--text-3);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin-top: 0.75rem;
}

/* Login Panel (right) */
.login-panel {
  padding: 2.5rem 2rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: var(--bg-1);
  transition: opacity var(--transition-speed);
}

.login-panel.unlocking .login-form-content {
  opacity: 0.3;
  pointer-events: none;
}

.login-panel.unlocking.two-factor-active .login-form-content {
  opacity: 1;
  pointer-events: auto;
}

.login-status {
  font-size: 0.6rem;
  font-family: var(--font-heading);
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.3em;
  text-transform: uppercase;
  margin-bottom: 0.25rem;
}

.login-heading {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-0);
  letter-spacing: -0.02em;
  margin-bottom: 2rem;
}

/* Form Fields */
.field {
  margin-bottom: 1.5rem;
}

.field-label {
  display: block;
  font-size: 0.6rem;
  color: var(--text-3);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-weight: 700;
  margin-bottom: 0.4rem;
}

.field-static {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-0);
  padding: 0.6rem 0.5rem;
  border-bottom: 2px solid var(--border);
  background: var(--bg-2);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.field-static .verified {
  color: var(--accent);
  font-size: 0.7rem;
}

.input-wrapper {
  position: relative;
}

.input-wrapper input {
  width: 100%;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-0);
  background: var(--bg-2);
  border: none;
  border-bottom: 2px solid var(--border);
  padding: 0.7rem 2.5rem 0.7rem 0.5rem;
  outline: none;
  transition: border-color var(--transition-speed);
}

.input-wrapper input::placeholder {
  color: var(--text-3);
  opacity: 0.5;
}

.input-wrapper input:focus {
  border-color: var(--accent);
}

.input-wrapper input[aria-invalid="true"] {
  border-color: var(--error);
}

.toggle-vis-btn {
  position: absolute;
  right: 0.4rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-3);
  cursor: pointer;
  padding: 0.3rem;
  display: flex;
  align-items: center;
  transition: color var(--transition-speed);
}

.toggle-vis-btn:hover {
  color: var(--accent);
}

.toggle-vis-btn svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Auth Button */
.auth-btn {
  width: 100%;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  padding: 1rem;
  margin-top: 1rem;
  background: var(--accent);
  color: var(--bg-0);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  transition: all var(--transition-speed);
}

.auth-btn:hover {
  filter: brightness(1.1);
  box-shadow: 0 0 20px var(--glow);
}

.auth-btn:active {
  transform: scale(0.98);
}

.auth-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  filter: none;
  box-shadow: none;
}

.auth-btn svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform var(--transition-speed);
}

.auth-btn:hover svg {
  transform: translateX(3px);
}

/* Error Message */
.error-msg {
  font-size: 0.75rem;
  color: var(--error);
  margin-top: 0.8rem;
  padding: 0.5rem;
  background: var(--error-bg);
  border-left: 3px solid var(--error);
  animation: errorSlide 0.3s ease both;
}

.error-msg[hidden] {
  display: none;
}

/* Disclaimer text */
.login-disclaimer {
  font-size: 0.6rem;
  color: var(--text-3);
  text-align: center;
  line-height: 1.7;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-top: 1.5rem;
}

/* ═══════════════════════════════════════════════════════
 *  Unlock Sequence
 * ═══════════════════════════════════════════════════════ */

.unlock-log {
  margin-top: 1rem;
  font-size: 0.75rem;
  line-height: 1.8;
  color: var(--text-1);
}

.unlock-log[hidden] {
  display: none;
}

.unlock-log pre {
  white-space: pre-wrap;
  word-break: break-word;
}

.unlock-log .ok {
  color: var(--ok);
}

.unlock-line {
  animation: bootLineIn 0.2s ease-out both;
}

.unlock-progress {
  margin-top: 0.5rem;
  height: 4px;
  background: var(--bg-4);
  overflow: hidden;
}

.unlock-progress[hidden] {
  display: none;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: var(--accent);
  transition: width 0.08s linear;
}

/* ═══════════════════════════════════════════════════════
 *  Two-Factor Authentication Panel
 * ═══════════════════════════════════════════════════════ */

.two-factor-panel {
  margin-top: 1.25rem;
  padding: 1.25rem;
  border: 1px solid var(--accent-dim);
  border-radius: 6px;
  background: var(--accent-bg);
  animation: bootLineIn 0.3s ease-out both;
}

.two-factor-panel[hidden] {
  display: none;
}

.two-factor-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.two-factor-header h3 {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.05em;
}

.two-factor-icon {
  font-size: 1.1rem;
}

.two-factor-desc {
  font-size: 0.75rem;
  color: var(--text-2);
  margin-bottom: 1rem;
  line-height: 1.6;
}

.cipher-display {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1rem;
  margin-bottom: 0.75rem;
}

.cipher-label {
  display: block;
  font-size: 0.65rem;
  color: var(--text-3);
  margin-bottom: 0.5rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.cipher-text {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--warn);
  letter-spacing: 0.15em;
  word-break: break-all;
  line-height: 1.8;
}

.cipher-hint {
  font-size: 0.7rem;
  color: var(--text-2);
  line-height: 1.6;
  font-style: italic;
}

/* ═══════════════════════════════════════════════════════
 *  Vault (Secret Content)
 * ═══════════════════════════════════════════════════════ */

.vault {
  position: fixed;
  inset: 0;
  background: var(--bg-0);
  padding: 3rem 1.5rem;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 100;
}

/* Smooth custom scrollbar for the vault */
.vault::-webkit-scrollbar {
  width: 6px;
}

.vault::-webkit-scrollbar-track {
  background: var(--bg-1);
}

.vault::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

.vault::-webkit-scrollbar-thumb:hover {
  background: var(--accent-dim);
}

.vault.slide-up-in {
  animation: slideUpIn 0.6s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.vault-header {
  max-width: 800px;
  width: 100%;
  margin: 0 auto 3rem;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--bg-0);
  z-index: 10;
  padding-top: 0.5rem;
}

.vault-header-text h2 {
  font-family: var(--font-heading);
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 700;
  color: var(--text-0);
  letter-spacing: -0.03em;
}

.vault-header-text h2 .accent {
  color: var(--accent);
}

.vault-header-text .vault-filepath {
  font-size: 0.7rem;
  color: var(--accent);
  letter-spacing: 0.15em;
  margin-top: 0.5rem;
}

.vault-close-btn {
  background: var(--bg-3);
  border: 1px solid var(--border);
  color: var(--text-2);
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  cursor: pointer;
  flex-shrink: 0;
  transition: all var(--transition-speed);
}

.vault-close-btn:hover {
  background: var(--error);
  color: #ffffff;
  border-color: var(--error);
}

/* Vault Body */
.vault-body {
  max-width: 800px;
  width: 100%;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

@media (min-width: 768px) {
  .vault-body {
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
  }
}

.vault-letter {
  background: var(--bg-2);
  border-left: 4px solid var(--accent);
  padding: 2rem;
  max-height: 65vh;
  overflow-y: auto;
}

/* Scrollbar for the letter */
.vault-letter::-webkit-scrollbar {
  width: 4px;
}

.vault-letter::-webkit-scrollbar-track {
  background: var(--bg-3);
}

.vault-letter::-webkit-scrollbar-thumb {
  background: var(--accent-dim);
  border-radius: 2px;
}

.vault-letter::-webkit-scrollbar-thumb:hover {
  background: var(--accent);
}

.vault-letter blockquote {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  line-height: 1.9;
  color: var(--text-1);
  font-style: italic;
}

.vault-letter blockquote em {
  color: var(--accent);
  font-style: normal;
}

.vault-letter blockquote code {
  background: var(--bg-3);
  padding: 0.1rem 0.35rem;
  font-size: 0.78rem;
  color: var(--text-0);
}

.vault-flag-box {
  background: var(--flag-bg);
  border: 1px solid var(--border);
  padding: 1.2rem;
  margin-top: 1.5rem;
}

.vault-flag-label {
  font-size: 0.65rem;
  color: var(--text-3);
  font-weight: 700;
  margin-bottom: 0.5rem;
  display: block;
}

.vault-flag-value {
  font-family: var(--font-mono);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: -0.02em;
  word-break: break-all;
}

/* Right column */
.vault-right {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.vault-clue-box {
  background: var(--bg-2);
  padding: 1.5rem;
  border: 1px solid var(--border);
}

.vault-clue-box h3 {
  font-family: var(--font-heading);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 0.75rem;
}

.vault-clue-box p {
  font-size: 0.82rem;
  line-height: 1.8;
  color: var(--text-1);
}

.vault-clue-box strong {
  color: var(--warn);
}

.vault-clue-box em {
  color: var(--accent);
  font-style: normal;
}

/* Book / Kindle illustration */
.vault-illustration {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-2);
  border: 1px solid var(--border);
  padding: 2rem;
  min-height: 180px;
}

.vault-illustration svg {
  width: 80px;
  height: 100px;
  stroke: var(--accent);
  fill: none;
  stroke-width: 1.5;
  opacity: 0.6;
}

/* Integration level bar */
.vault-integration {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.vault-integration-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-3);
}

.vault-integration-bar {
  height: 3px;
  background: var(--bg-4);
  overflow: hidden;
}

.vault-integration-fill {
  height: 100%;
  width: 100%;
  background: var(--accent);
}

/* ═══════════════════════════════════════════════════════
 *  Vault Timeline
 * ═══════════════════════════════════════════════════════ */

.vault-timeline {
  max-width: 800px;
  width: 100%;
  margin: 3rem auto 0;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.vault-timeline-title {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--accent);
  margin-bottom: 1.5rem;
  letter-spacing: 0.02em;
}

.timeline-entries {
  display: flex;
  flex-direction: column;
  gap: 0;
  border-left: 2px solid var(--border);
  margin-left: 0.5rem;
}

.timeline-entry {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 1rem;
  padding: 0.6rem 0 0.6rem 1.2rem;
  position: relative;
  font-size: 0.78rem;
  line-height: 1.6;
  transition: background-color var(--transition-speed);
}

.timeline-entry::before {
  content: "";
  position: absolute;
  left: -5px;
  top: 1rem;
  width: 8px;
  height: 8px;
  background: var(--bg-3);
  border: 2px solid var(--text-3);
  border-radius: 50%;
  transition: all var(--transition-speed);
}

.timeline-entry:hover {
  background: var(--glow);
}

.timeline-entry:hover::before {
  border-color: var(--accent);
  background: var(--accent);
  box-shadow: 0 0 8px var(--glow-strong);
}

.timeline-entry.highlight::before {
  border-color: var(--accent);
  background: var(--accent-dim);
}

.timeline-entry.error::before {
  border-color: var(--error);
  background: var(--error-bg);
}

.timeline-date {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-3);
  font-weight: 500;
  white-space: nowrap;
  letter-spacing: 0.03em;
}

.timeline-entry.highlight .timeline-date {
  color: var(--accent);
}

.timeline-entry.error .timeline-date {
  color: var(--error);
}

.timeline-text {
  color: var(--text-1);
}

.timeline-entry.error .timeline-text {
  color: var(--text-2);
  font-style: italic;
}

@media (max-width: 480px) {
  .timeline-entry {
    grid-template-columns: 1fr;
    gap: 0.2rem;
    padding-left: 1rem;
  }

  .timeline-date {
    font-size: 0.62rem;
  }

  .vault-timeline {
    margin-top: 2rem;
    padding-top: 1.5rem;
  }
}

/* ═══════════════════════════════════════════════════════
 *  Footer
 * ═══════════════════════════════════════════════════════ */

.gateway-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  padding: 0.8rem 1.5rem;
  font-size: 0.6rem;
  font-weight: 700;
  color: var(--text-3);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  border-top: 1px solid var(--border);
  gap: 0.5rem;
}

.footer-left {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.status-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  background: var(--ok);
  border-radius: 50%;
  margin-right: 0.3rem;
  animation: pulse 2s infinite;
}

.footer-sep {
  color: var(--border);
}

/* ═══════════════════════════════════════════════════════
 *  Blink Cursor
 * ═══════════════════════════════════════════════════════ */

.blink {
  animation: blinker 1s step-start infinite;
  color: var(--accent);
}

/* ═══════════════════════════════════════════════════════
 *  Keyframes
 * ═══════════════════════════════════════════════════════ */

@keyframes blinker {
  50% { opacity: 0; }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

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

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

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  10%, 30%, 50%, 70%, 90% { transform: translateX(-4px); }
  20%, 40%, 60%, 80% { transform: translateX(4px); }
}

.shake {
  animation: shake 0.5s ease;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* ═══════════════════════════════════════════════════════
 *  Reduced Motion
 * ═══════════════════════════════════════════════════════ */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .blink {
    animation: none;
    opacity: 1;
  }
}

/* ═══════════════════════════════════════════════════════
 *  Responsive
 * ═══════════════════════════════════════════════════════ */

@media (max-width: 767px) {
  .gateway-header {
    padding: 0.6rem 1rem;
  }

  .hostname-prompt {
    display: none;
  }

  .terminal-side {
    min-height: auto;
    padding: 1.5rem;
  }

  .vault-title-section h1 {
    font-size: 1.8rem;
  }

  .login-panel {
    padding: 2rem 1.5rem;
  }

  .gateway-footer {
    flex-direction: column;
    text-align: center;
  }

  .vault {
    padding: 2rem 1rem;
  }

  .vault-header {
    flex-direction: column;
    gap: 1rem;
  }

  .vault-header-text h2 {
    font-size: 1.6rem;
  }
}

@media (max-width: 480px) {
  body {
    font-size: 14px;
  }

  .gateway-panel {
    border: none;
  }

  .terminal-side {
    display: none;
  }

  .login-panel {
    padding: 1.5rem 1rem;
  }
}

/* ═══════════════════════════════════════════════════════
 *  Hidden utility
 * ═══════════════════════════════════════════════════════ */

[hidden] {
  display: none !important;
}
