/* ============================================================
   TERMINAL 88 // Cyber Noodle Bar
   CRT verde-fósforo · neon · monospace
   Nested CSS
   ============================================================ */

:root {
  --bg:    #05070a;
  --panel: #0a0f14;
  --green: #39ff14;
  --cyan:  #00e5ff;
  --mag:   #ff2e97;
  --amber: #ffcc33;
  --text:  #b8ffcf;
  --muted: #4f7a63;
  --line:  rgba(57,255,20,0.28);

  --font-crt:  "VT323", monospace;
  --font-mono: "Share Tech Mono", monospace;

  --maxw: 900px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font-mono);
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  overflow-x: hidden;
  /* faint vignette + scan tint */
  background-image:
    radial-gradient(120% 90% at 50% 0%, rgba(57,255,20,0.06), transparent 55%),
    radial-gradient(100% 80% at 50% 100%, rgba(0,229,255,0.05), transparent 55%);

  &.is-loading { overflow: hidden; }
}

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

h1, h2, h3 { margin: 0; font-weight: 400; line-height: 1; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; margin: 0; padding: 0; }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; }
::selection { background: var(--green); color: var(--bg); }

/* ---------- CRT overlay: scanlines + flicker ---------- */
.crt {
  position: fixed;
  inset: 0;
  z-index: 400;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    rgba(0,0,0,0) 0 2px,
    rgba(0,0,0,0.22) 2px 4px
  );
  mix-blend-mode: multiply;
  animation: flicker 4s steps(60) infinite;
}
@keyframes flicker {
  0%, 96%, 100% { opacity: 1; }
  97% { opacity: 0.82; }
  98% { opacity: 1; }
  99% { opacity: 0.9; }
}

/* neon glow helper */
.glow { text-shadow: 0 0 6px currentColor, 0 0 16px currentColor; }

/* ---------- Reveal ---------- */
.win, .console {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
  &.is-visible { opacity: 1; transform: none; }
}

/* ============================================================
   Boot sequence
   ============================================================ */
.boot {
  position: fixed;
  inset: 0;
  z-index: 800;
  background: var(--bg);
  padding: clamp(1.5rem, 6vw, 4rem);
  transition: opacity 0.5s ease, visibility 0.5s;

  &.is-done { opacity: 0; visibility: hidden; }

  & .boot__log {
    font-family: var(--font-mono);
    font-size: clamp(0.8rem, 2.4vw, 1rem);
    color: var(--green);
    text-shadow: 0 0 6px rgba(57,255,20,0.7);
    white-space: pre-wrap;
    margin: 0;
  }
}

/* blinking caret */
.caret {
  display: inline-block;
  color: var(--green);
  animation: blink 1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* ============================================================
   Header
   ============================================================ */
.head {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem clamp(1rem, 4vw, 2.5rem);
  border-bottom: 1px solid transparent;
  transition: background 0.4s ease, border-color 0.4s, padding 0.4s;

  &.is-scrolled {
    background: rgba(5,7,10,0.85);
    backdrop-filter: blur(6px);
    border-bottom-color: var(--line);
    padding-block: 0.6rem;
  }

  & .logo {
    font-family: var(--font-crt);
    font-size: 1.7rem;
    color: var(--green);
    text-shadow: 0 0 8px rgba(57,255,20,0.6);
    letter-spacing: 0.04em;
    & span { color: var(--mag); text-shadow: 0 0 8px rgba(255,46,151,0.6); }
  }

  & .nav {
    display: flex;
    gap: clamp(0.8rem, 2.5vw, 1.6rem);
    & a {
      font-size: 0.9rem;
      color: var(--muted);
      transition: color 0.25s, text-shadow 0.25s;
      &:hover { color: var(--cyan); text-shadow: 0 0 8px rgba(0,229,255,0.7); }
    }
  }

  & .status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.78rem;
    color: var(--muted);
    & .dot {
      width: 8px; height: 8px;
      border-radius: 50%;
      background: var(--green);
      box-shadow: 0 0 8px var(--green);
      animation: pulse 1.6s ease-in-out infinite;
    }
  }
}
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.3; } }

/* ============================================================
   Hero
   ============================================================ */
.hero {
  max-width: var(--maxw);
  margin-inline: auto;
  padding: clamp(8rem, 18vh, 12rem) clamp(1.2rem, 5vw, 2rem) 4rem;

  & .hero__path {
    font-size: clamp(0.9rem, 2.6vw, 1.15rem);
    color: var(--green);
    margin: 0 0 1.2rem;
    & .hero__cmd { color: var(--cyan); }
  }

  & .hero__title {
    font-family: var(--font-crt);
    font-size: clamp(4rem, 20vw, 11rem);
    color: var(--cyan);
    text-shadow: 0 0 10px rgba(0,229,255,0.6), 0 0 30px rgba(0,229,255,0.35);
    line-height: 0.9;
    letter-spacing: 0.02em;
  }

  & .hero__sub { color: var(--mag); margin: 0.6rem 0 0; font-size: 1rem; text-shadow: 0 0 8px rgba(255,46,151,0.4); }
  & .hero__lede { max-width: 34rem; margin: 1.4rem 0 2rem; color: var(--text); opacity: 0.85; }
}

/* ---------- Glitch effect ---------- */
.glitch { position: relative; }
.glitch::before, .glitch::after {
  content: attr(data-text);
  position: absolute;
  left: 0; top: 0;
  width: 100%;
  overflow: hidden;
}
.glitch::before { color: var(--mag); clip-path: inset(0 0 55% 0); animation: gl1 3.4s infinite steps(2); }
.glitch::after  { color: var(--green); clip-path: inset(55% 0 0 0); animation: gl2 2.8s infinite steps(2); }
@keyframes gl1 { 0%,92%,100% { transform: none; opacity: 0; } 93% { transform: translate(-3px,-2px); opacity: .8; } 96% { transform: translate(2px,1px); } }
@keyframes gl2 { 0%,90%,100% { transform: none; opacity: 0; } 91% { transform: translate(3px,2px); opacity: .8; } 95% { transform: translate(-2px,-1px); } }

/* ---------- Button ---------- */
.btn {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 1rem;
  color: var(--green);
  padding: 0.7rem 1.6rem;
  border: 1px solid var(--green);
  background: rgba(57,255,20,0.06);
  transition: background 0.25s, color 0.25s, box-shadow 0.25s;
  &:hover {
    background: var(--green);
    color: var(--bg);
    box-shadow: 0 0 20px rgba(57,255,20,0.6);
  }
}

/* ============================================================
   Terminal windows (menu)
   ============================================================ */
.win, .console {
  max-width: var(--maxw);
  margin: clamp(2rem, 5vw, 3.5rem) auto;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 0 30px -18px rgba(57,255,20,0.6), inset 0 0 60px -50px var(--cyan);
}

.win__bar {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.6rem 1rem;
  background: rgba(57,255,20,0.06);
  border-bottom: 1px solid var(--line);
  font-size: 0.85rem;
  color: var(--muted);

  & .win__dots { display: flex; gap: 6px; }
  & .win__dots i {
    width: 11px; height: 11px; border-radius: 50%;
    background: var(--muted); display: block;
  }
  & .win__dots i:nth-child(1) { background: var(--mag); }
  & .win__dots i:nth-child(2) { background: var(--amber); }
  & .win__dots i:nth-child(3) { background: var(--green); }
}

.lines { padding: 0.6rem 1.1rem 1.2rem; }

.ln {
  padding: 0.8rem 0;
  border-bottom: 1px dashed rgba(79,122,99,0.35);
  &:last-child { border-bottom: 0; }

  & .ln__row {
    display: flex;
    align-items: baseline;
    gap: 0.6rem;
  }
  & .ln__name {
    color: var(--cyan);
    font-size: 1.15rem;
    text-shadow: 0 0 8px rgba(0,229,255,0.3);
    &::before { content: "> "; color: var(--green); }
  }
  & .ln__dots {
    flex: 1;
    border-bottom: 1px dotted var(--muted);
    transform: translateY(-4px);
  }
  & .ln__price {
    color: var(--amber);
    font-size: 1.1rem;
    &::after { content: "€"; color: var(--muted); margin-left: 2px; }
  }
  & .ln__desc { margin: 0.3rem 0 0; color: var(--muted); font-size: 0.9rem; }

  &--hot .ln__name { color: var(--mag); text-shadow: 0 0 8px rgba(255,46,151,0.5); }

  transition: background 0.2s;
  &:hover { background: rgba(0,229,255,0.04); }
  &:hover .ln__name { text-shadow: 0 0 12px currentColor; }
}

/* ============================================================
   Interactive console
   ============================================================ */
.console__body { padding: 1rem 1.1rem 1.3rem; }
.console__hint { color: var(--muted); font-size: 0.85rem; margin: 0 0 0.8rem;
  & code { color: var(--amber); }
}
.console__out {
  display: block;
  white-space: pre-wrap;
  color: var(--green);
  font-size: 0.92rem;
  min-height: 1em;
  margin-bottom: 0.6rem;
}
.console__prompt {
  display: flex;
  align-items: center;
  gap: 0.5rem;

  & label { color: var(--green); white-space: nowrap; }
  & .console__input {
    flex: 1;
    background: none;
    border: 0;
    color: var(--cyan);
    font-family: var(--font-mono);
    font-size: 1rem;
    caret-color: transparent;
    &:focus { outline: none; }
  }
}

/* ============================================================
   Footer
   ============================================================ */
.foot {
  max-width: var(--maxw);
  margin: 3rem auto 0;
  padding: 2.5rem clamp(1.2rem, 5vw, 2rem) 3rem;
  border-top: 1px solid var(--line);
  text-align: center;

  & .foot__mark { font-family: var(--font-crt); font-size: 1.8rem; color: var(--green); text-shadow: 0 0 8px rgba(57,255,20,0.6); margin: 0 0 0.4rem; }
  & .foot__tag { color: var(--muted); margin: 0; font-size: 0.9rem; }
  & .foot__note { margin-top: 1.2rem; color: rgba(79,122,99,0.7); font-size: 0.8rem; }
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 640px) {
  .head .status { display: none; }
  .head .nav { gap: 0.7rem; font-size: 0.85rem; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .win, .console { opacity: 1; transform: none; }
  .crt { animation: none; }
  .glitch::before, .glitch::after { display: none; }
}
