/* ==========================================================
   SM. // TERMINAL — consola interactiva (easter egg)
   ========================================================== */
.term-launch {
  position: fixed;
  right: 18px;
  bottom: 15px;
  z-index: 25;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 12px;
  border: 1px solid #34edff66;
  background: #061018ed;
  color: var(--signal, #34edff);
  font-family: var(--mono, monospace);
  font-size: 9px;
  letter-spacing: 1.5px;
  cursor: pointer;
  clip-path: polygon(0 0, 100% 0, 100% 70%, calc(100% - 8px) 100%, 0 100%);
  transition:
    border-color 0.2s,
    color 0.2s,
    box-shadow 0.2s;
}
.term-launch:hover,
.term-launch:focus-visible {
  border-color: var(--signal, #34edff);
  box-shadow: 0 0 18px #34edff40;
  color: #fff;
}
.term-launch .term-launch-caret {
  color: var(--acid, #f1ff28);
  animation: term-blink 1s steps(1) infinite;
}
.term-launch kbd {
  font: inherit;
  padding: 1px 5px;
  border: 1px solid #34edff44;
  color: var(--muted, #a7b8c9);
}

.term-dialog {
  width: min(860px, calc(100vw - 24px));
  height: min(560px, calc(100dvh - 40px));
  max-width: none;
  max-height: none;
  padding: 0;
  border: 1px solid #34edff80;
  background: #03060ef5;
  color: #d8f6f2;
  box-shadow:
    0 0 0 1px #000,
    0 0 50px #34edff2b,
    0 30px 90px #000c;
  overflow: hidden;
}
.term-dialog[open] {
  display: flex;
  flex-direction: column;
  animation: term-in 0.22s ease-out;
}
.term-dialog::backdrop {
  background: #02040acc;
  backdrop-filter: blur(3px);
}
.term-dialog::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    0deg,
    #ffffff05 0 1px,
    transparent 1px 3px
  );
}
.term-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid #34edff33;
  background: linear-gradient(90deg, #0a1a24, #070d18);
  font-family: var(--mono, monospace);
  font-size: 11px;
  letter-spacing: 1px;
  color: var(--muted, #a7b8c9);
}
.term-lights {
  display: flex;
  gap: 6px;
}
.term-lights i {
  width: 9px;
  height: 9px;
  background: var(--pink, #ff468c);
}
.term-lights i:nth-child(2) {
  background: var(--acid, #f1ff28);
}
.term-lights i:nth-child(3) {
  background: var(--signal, #34edff);
}
.term-title {
  flex: 1;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.term-close {
  border: 1px solid #ffffff22;
  background: transparent;
  color: var(--text, #f1f4f1);
  font: inherit;
  padding: 4px 9px;
  cursor: pointer;
}
.term-close:hover,
.term-close:focus-visible {
  border-color: var(--pink, #ff468c);
  color: var(--pink, #ff468c);
}
.term-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 18px 8px;
  font-family: var(--mono, monospace);
  font-size: 13px;
  line-height: 1.6;
  scrollbar-color: #34edff55 transparent;
}
.term-out {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
}
.term-line {
  min-height: 1.6em;
}
.term-line a {
  color: var(--signal, #34edff);
  text-underline-offset: 3px;
}
.term-line a:hover {
  color: var(--acid, #f1ff28);
}
.t-acid {
  color: var(--acid, #f1ff28);
}
.t-cyan {
  color: var(--signal, #34edff);
}
.t-pink {
  color: var(--pink, #ff468c);
}
.t-muted {
  color: var(--muted, #a7b8c9);
}
.t-ok {
  color: #5dff9b;
}
.t-strong {
  color: #fff;
  font-weight: 700;
}
.term-input-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px 16px;
  font-family: var(--mono, monospace);
  font-size: 13px;
}
.term-prompt {
  flex: none;
  white-space: nowrap;
}
.term-input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: #fff;
  font: inherit;
  caret-color: var(--acid, #f1ff28);
}
.term-hints {
  display: none;
  gap: 6px;
  flex-wrap: wrap;
  padding: 0 18px 14px;
}
.term-hints button {
  border: 1px solid #34edff44;
  background: #34edff0d;
  color: var(--signal, #34edff);
  font-family: var(--mono, monospace);
  font-size: 12px;
  padding: 6px 10px;
  cursor: pointer;
}
@keyframes term-blink {
  50% {
    opacity: 0;
  }
}
@keyframes term-in {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }
}
@media (max-width: 760px) {
  .term-launch {
    right: 12px;
    bottom: 12px;
  }
  .term-launch kbd {
    display: none;
  }
  .term-dialog {
    width: calc(100vw - 16px);
    height: calc(100dvh - 24px);
  }
  .term-body,
  .term-input-row {
    font-size: 12px;
  }
  /* 16px evita el zoom automático de iOS al enfocar el input */
  .term-input {
    font-size: 16px;
  }
  .term-hints {
    display: flex;
  }
  .t-note {
    display: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  .term-launch .term-launch-caret,
  .term-dialog[open] {
    animation: none;
  }
}
.motion-paused .term-launch .term-launch-caret {
  animation: none;
}
