/* ========================================================
   TOKENS
   ======================================================== */
:root {
  --black: #000000;
  --void: #030304;
  --panel: #08090c;
  --panel-2: #0c0e13;

  --edge: rgba(140, 190, 255, 0.16);
  --edge-strong: rgba(140, 190, 255, 0.4);

  --blue: #5ec8ff;
  --blue-soft: #8fdcff;
  --blue-glow: rgba(94, 200, 255, 0.55);

  --amber: #ffb454;
  --amber-glow: rgba(255, 180, 84, 0.5);

  --white: #f2f5f9;
  --dim: #7a8598;
  --dim-2: #4c5566;

  --font-display: 'Orbitron', sans-serif;
  --font-head: 'Rajdhani', sans-serif;
  --font-mono: 'Share Tech Mono', monospace;
  --font-body: 'Rajdhani', sans-serif;
}

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

html, body {
  height: 100%;
  overflow: hidden; /* no scroll, anywhere */
  background: var(--black);
}

body {
  font-family: var(--font-body);
  color: var(--white);
  position: relative;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; }

.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* ========================================================
   AMBIENT BACKGROUND — starfield + vignette + scanline
   ======================================================== */
#starfield {
  position: fixed; inset: 0;
  width: 100%; height: 100%;
  z-index: 0;
  background: radial-gradient(ellipse at 50% 40%, #050810 0%, var(--black) 70%);
}

body::before {
  /* vignette + faint blue rim glow, like cockpit glass */
  content: "";
  position: fixed; inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 50% 15%, rgba(94,200,255,0.10), transparent 55%),
    radial-gradient(ellipse at 50% 100%, rgba(255,180,84,0.06), transparent 60%),
    radial-gradient(ellipse at 50% 50%, transparent 40%, rgba(0,0,0,0.75) 100%);
}

.scanline {
  position: fixed; inset: 0;
  z-index: 2;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255,255,255,0.025) 0px,
    rgba(255,255,255,0.025) 1px,
    transparent 1px,
    transparent 3px
  );
  mix-blend-mode: overlay;
  opacity: 0.5;
}

/* ========================================================
   STAGE — the single, non-scrolling viewport
   ======================================================== */
.stage {
  position: relative;
  z-index: 3;
  height: 100dvh;
  height: 100vh;
  width: 100%;
  display: flex;
  flex-direction: column;
  padding: clamp(0.9rem, 2.4vh, 1.6rem) clamp(1rem, 3vw, 2.5rem);
}

/* ========================================================
   HUD BARS
   ======================================================== */
.hud-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: clamp(0.6rem, 1.1vw, 0.78rem);
  letter-spacing: 0.06em;
  color: var(--dim);
  flex-shrink: 0;
}

.hud-id { display: flex; align-items: center; gap: 0.5rem; color: var(--blue-soft); }
.hud-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--blue);
  box-shadow: 0 0 8px 2px var(--blue-glow);
  animation: pulseDot 2.4s ease-in-out infinite;
}
@keyframes pulseDot { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }

.hud-status { display: flex; align-items: center; gap: 0.5rem; }
.hud-sep { color: var(--dim-2); }

.hud-bar-bottom { padding-top: 0.4rem; }
.hud-socials { display: flex; gap: 0.9rem; font-size: 1.05rem; }
.hud-socials a { color: var(--dim); transition: color 0.25s, text-shadow 0.25s; }
.hud-socials a:hover { color: var(--blue-soft); text-shadow: 0 0 10px var(--blue-glow); }
.hud-copy { font-size: clamp(0.55rem, 1vw, 0.68rem); }

/* ========================================================
   CONSOLE — centered content
   ======================================================== */
.console {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(1rem, 3.2vh, 2.4rem);
  min-height: 0;
}

.boot-text { text-align: center; }
.eyebrow {
  font-family: var(--font-mono);
  font-size: clamp(0.6rem, 1vw, 0.72rem);
  letter-spacing: 0.35em;
  color: var(--dim);
  margin-bottom: 0.6rem;
  opacity: 0;
  animation: flickerIn 0.9s ease 0.1s forwards;
}
.callsign {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(1.6rem, 5.4vw, 3.4rem);
  letter-spacing: 0.04em;
  color: var(--white);
  text-shadow: 0 0 18px var(--blue-glow), 0 0 46px rgba(94,200,255,0.25);
  opacity: 0;
  animation: flickerIn 1s ease 0.35s forwards;
}
.role {
  margin-top: 0.5rem;
  font-family: var(--font-head);
  font-weight: 600;
  font-size: clamp(0.85rem, 1.6vw, 1.15rem);
  letter-spacing: 0.12em;
  color: var(--blue-soft);
  opacity: 0;
  animation: flickerIn 0.9s ease 0.7s forwards;
}
.role-dim { color: var(--dim); font-weight: 500; }

@keyframes flickerIn {
  0%   { opacity: 0; filter: blur(2px); }
  10%  { opacity: 0.4; }
  20%  { opacity: 0.05; }
  35%  { opacity: 0.8; }
  45%  { opacity: 0.2; }
  60%  { opacity: 1; filter: blur(0); }
  100% { opacity: 1; }
}

/* ========================================================
   PANEL GRID — the "quadrados"
   ======================================================== */
.panel-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(0.8rem, 1.8vw, 1.6rem);
  width: min(920px, 90vw);
}

.panel {
  position: relative;
  aspect-ratio: 1 / 1;
  background: linear-gradient(160deg, var(--panel), var(--panel-2));
  border: 1px solid var(--edge);
  border-radius: 6px;
  color: var(--white);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.8rem;
  text-align: center;
  overflow: hidden;
  opacity: 0;
  transform: translateY(10px);
  animation: panelIn 0.6s ease forwards;
  transition: border-color 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease, background 0.3s ease;
}
.panel:nth-child(1) { animation-delay: 0.9s; }
.panel:nth-child(2) { animation-delay: 1.02s; }
.panel:nth-child(3) { animation-delay: 1.14s; }
.panel:nth-child(4) { animation-delay: 1.26s; }

@keyframes panelIn { to { opacity: 1; transform: translateY(0); } }

.panel:hover, .panel:focus-visible {
  border-color: var(--edge-strong);
  box-shadow: 0 0 0 1px rgba(94,200,255,0.25), 0 0 30px rgba(94,200,255,0.18), inset 0 0 30px rgba(94,200,255,0.05);
  transform: translateY(-4px);
  background: linear-gradient(160deg, #0d1016, var(--panel-2));
  outline: none;
}

.panel-corner {
  position: absolute;
  width: 12px; height: 12px;
  border: 1.5px solid var(--blue);
  opacity: 0.55;
  transition: opacity 0.3s ease, width 0.3s ease, height 0.3s ease;
}
.panel:hover .panel-corner { opacity: 1; width: 16px; height: 16px; }
.panel-corner.tl { top: 6px; left: 6px; border-right: none; border-bottom: none; }
.panel-corner.tr { top: 6px; right: 6px; border-left: none; border-bottom: none; }
.panel-corner.bl { bottom: 6px; left: 6px; border-right: none; border-top: none; }
.panel-corner.br { bottom: 6px; right: 6px; border-left: none; border-top: none; }

.panel-icon {
  font-size: clamp(1.3rem, 2.6vw, 1.9rem);
  color: var(--blue-soft);
  text-shadow: 0 0 14px var(--blue-glow);
}
.panel-index {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.15em;
  color: var(--dim-2);
}
.panel h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(0.72rem, 1.3vw, 0.95rem);
  letter-spacing: 0.06em;
}
.panel p {
  font-size: clamp(0.62rem, 1.05vw, 0.78rem);
  color: var(--dim);
  font-weight: 500;
}

/* ========================================================
   OVERLAY / MODAL — holographic panel
   ======================================================== */
.overlay {
  position: fixed; inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(1rem, 4vw, 2.5rem);
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}
.overlay.open { opacity: 1; visibility: visible; }

.modal {
  position: relative;
  width: min(680px, 100%);
  max-height: 86vh;
  overflow-y: auto;
  background: linear-gradient(165deg, #0a0c11, #06070a);
  border: 1px solid var(--edge-strong);
  border-radius: 8px;
  box-shadow: 0 0 0 1px rgba(94,200,255,0.15), 0 0 60px rgba(94,200,255,0.15), 0 30px 80px rgba(0,0,0,0.6);
  padding: clamp(1.4rem, 4vw, 2.4rem);
  transform: scale(0.94) translateY(10px);
  transition: transform 0.32s cubic-bezier(.2,.8,.2,1);
}
.overlay.open .modal { transform: scale(1) translateY(0); }

.modal::-webkit-scrollbar { width: 6px; }
.modal::-webkit-scrollbar-thumb { background: var(--edge-strong); border-radius: 4px; }

.modal-close {
  position: absolute; top: 1rem; right: 1rem;
  width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  background: transparent;
  border: 1px solid var(--edge);
  border-radius: 4px;
  color: var(--dim);
  font-size: 1.2rem;
  transition: color 0.25s, border-color 0.25s, box-shadow 0.25s;
}
.modal-close:hover { color: var(--blue-soft); border-color: var(--edge-strong); box-shadow: 0 0 14px rgba(94,200,255,0.25); }

.modal-tag {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.15em;
  color: var(--blue-soft);
  margin-bottom: 0.4rem;
}
.modal-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.3rem, 3.4vw, 1.8rem);
  margin-bottom: 1.3rem;
  text-shadow: 0 0 16px var(--blue-glow);
}

.modal-body p { color: #c7d0dd; line-height: 1.65; font-size: 1rem; margin-bottom: 0.85rem; }

/* About modal */
.about-body { display: block; }

/* Dossier stats */
.about-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem 1.2rem;
  padding-bottom: 1rem;
  margin-bottom: 1.1rem;
  border-bottom: 1px solid var(--edge);
}
.about-stats div { display: flex; flex-direction: column; gap: 0.1rem; }
.about-stats span {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.12em;
  color: var(--dim-2);
}
.about-stats strong {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--white);
}
.status-active { display: flex; align-items: center; gap: 0.4rem; color: #7CFFB2 !important; }

.about-goal { display: flex; align-items: center; gap: 0.5rem; color: var(--amber) !important; font-weight: 600; }

@media (max-width: 560px) {
  .about-stats { grid-template-columns: 1fr 1fr; }
}

/* Skills modal */
.skill-group { margin-bottom: 1.3rem; }
.skill-group h3 {
  font-family: var(--font-head);
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  color: var(--dim);
  text-transform: uppercase;
  margin-bottom: 0.6rem;
}
.skill-chips { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.skill-chips span {
  display: flex; align-items: center; gap: 0.45rem;
  padding: 0.4rem 0.75rem;
  border: 1px solid var(--edge);
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--white);
  transition: border-color 0.25s, box-shadow 0.25s;
}
.skill-chips span:hover { border-color: var(--blue); box-shadow: 0 0 10px rgba(94,200,255,0.25); }
.skill-chips img { width: 16px; height: 16px; }

/* Projects modal */
.projects-body { display: flex; flex-direction: column; gap: 0.9rem; }
.project-card {
  border: 1px solid var(--edge);
  border-radius: 6px;
  padding: 1rem 1.1rem;
  position: relative;
  transition: border-color 0.25s;
}
.project-card:not(.locked):hover { border-color: var(--edge-strong); }
.project-card.locked { opacity: 0.55; }
.project-status {
  display: inline-flex; align-items: center; gap: 0.4rem;
  font-family: var(--font-mono);
  font-size: 0.62rem; letter-spacing: 0.1em;
  padding: 0.2rem 0.55rem; border-radius: 999px;
  margin-bottom: 0.55rem;
}
.project-status.live { color: #7CFFB2; border: 1px solid rgba(124,255,178,0.4); }
.project-status.pending { color: var(--dim); border: 1px solid var(--edge); }
.pulse {
  width: 6px; height: 6px; border-radius: 50%;
  background: #7CFFB2; box-shadow: 0 0 6px #7CFFB2;
  animation: pulseDot 1.6s ease-in-out infinite;
}
.project-card h3 { font-family: var(--font-head); font-weight: 700; font-size: 1.05rem; margin-bottom: 0.35rem; }
.project-card p { font-size: 0.9rem !important; margin-bottom: 0.6rem !important; }
.project-tags { display: flex; gap: 0.4rem; flex-wrap: wrap; margin-bottom: 0.6rem; }
.project-tags span {
  font-size: 0.68rem; color: var(--dim);
  border: 1px solid var(--edge);
  padding: 0.15rem 0.5rem; border-radius: 999px;
}
.project-link {
  display: inline-flex; align-items: center; gap: 0.3rem;
  font-size: 0.85rem; font-weight: 700; color: var(--blue-soft);
}
.project-link:hover { text-shadow: 0 0 10px var(--blue-glow); }

/* Contact modal */
.contact-body { display: flex; flex-direction: column; gap: 1.3rem; }
.form { display: grid; gap: 0.7rem; }
.form input, .form textarea {
  background: var(--void); color: var(--white);
  border: 1px solid var(--edge);
  border-radius: 6px; padding: 0.7rem 0.9rem;
  font-family: var(--font-body); font-size: 0.95rem;
  outline: none; width: 100%; resize: vertical;
  transition: border-color 0.25s, box-shadow 0.25s;
}
.form input::placeholder, .form textarea::placeholder { color: var(--dim-2); }
.form input:focus, .form textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(94,200,255,0.15); }

.btn-send {
  justify-self: start;
  font-family: var(--font-mono);
  letter-spacing: 0.1em;
  font-size: 0.85rem;
  color: var(--black);
  background: var(--blue-soft);
  border: none; border-radius: 6px;
  padding: 0.75rem 1.4rem;
  box-shadow: 0 0 20px rgba(94,200,255,0.35);
  transition: transform 0.25s, box-shadow 0.25s;
}
.btn-send:hover { transform: translateY(-2px); box-shadow: 0 0 30px rgba(94,200,255,0.5); }
.btn-loading { display: none; }
.form.submitting .btn-text { display: none; }
.form.submitting .btn-loading { display: inline; }
.form.submitting .btn-send { opacity: 0.7; pointer-events: none; }

.contact-links { display: flex; gap: 1rem; flex-wrap: wrap; }
.contact-links a {
  display: flex; align-items: center; gap: 0.45rem;
  font-size: 0.9rem; font-weight: 600; color: var(--dim);
  border: 1px solid var(--edge);
  padding: 0.5rem 1rem; border-radius: 999px;
  transition: color 0.25s, border-color 0.25s;
}
.contact-links a:hover { color: var(--blue-soft); border-color: var(--edge-strong); }

/* ========================================================
   RESPONSIVE — everything still fits one screen, no scroll
   ======================================================== */
@media (max-width: 640px) {
  .panel-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); width: min(360px, 84vw); }
  .panel p { display: none; } /* keep squares compact on small screens */
  .hud-status span:nth-child(3) { display: none; } /* hide location label, keep clock */
  .hud-sep { display: none; }
}

@media (max-height: 620px) {
  .boot-text { display: none; } /* short screens: prioritize the panels */
  .panel-grid { width: min(760px, 92vw); }
}

/* ========================================================
   REDUCED MOTION
   ======================================================== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  .eyebrow, .callsign, .role, .panel { opacity: 1 !important; transform: none !important; }
}
