/* Landing hero: animated pixel-art diorama (drawn by /js/diorama.js) */

.diorama-hero {
  position: relative;
  overflow: hidden;
  background-color: #0a0a0a;
}

.diorama-canvas {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 0;
  display: block;
  image-rendering: crisp-edges;
  image-rendering: pixelated;
  touch-action: pan-y;
  -webkit-user-select: none;
  user-select: none;
}

.diorama-canvas.is-draggable {
  cursor: grab;
}

/* keep the navbar readable over the sky and melt the hero into the page below */
.diorama-hero::before,
.diorama-hero::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  z-index: 1;
  pointer-events: none;
}

.diorama-hero::before {
  top: 0;
  height: 96px;
  background: linear-gradient(rgba(10, 10, 10, 0.85), rgba(10, 10, 10, 0));
}

.diorama-hero::after {
  bottom: 0;
  height: 48px;
  background: linear-gradient(rgba(10, 10, 10, 0), #0a0a0a);
}

.diorama-hero .hero-head {
  position: relative;
  z-index: 3;
}

/* the body only holds the terminal window; clicks elsewhere reach the canvas */
.hero.is-fullheight.diorama-hero .hero-body {
  position: relative;
  z-index: 2;
  align-items: flex-start;
  pointer-events: none;
  padding-top: 1.25rem;
  padding-bottom: 4.5rem;
}

/* the vertical offset is set by diorama.js to centre the terminal in the free sky */
.diorama-term {
  pointer-events: auto;
  margin-top: var(--diorama-term-offset, 0px);
  width: min(32vw, 440px);
  min-width: 340px;
  background: rgba(10, 10, 10, 0.88);
  border: 3px solid #fff;
  box-shadow: 6px 6px 0 #d6579a;
}

.diorama-term .term-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  background: #d6579a;
  border-bottom: 3px solid #fff;
  font-size: 11px;
  line-height: 1;
  color: #fff;
}

.diorama-term .term-dots {
  display: inline-flex;
  gap: 4px;
}

.diorama-term .term-dots i {
  display: block;
  width: 8px;
  height: 8px;
  background: #fff;
}

.diorama-term .term-dots i:nth-child(2) {
  background: #ffd0ea;
}

.diorama-term .term-dots i:nth-child(3) {
  background: #4a1638;
}

.diorama-term .term-body {
  padding: 18px 20px 16px;
}

.diorama-term .term-cmd {
  margin-bottom: 14px;
  font-size: 11px;
  line-height: 1.6;
  color: #4dff88;
}

.diorama-term .term-cmd .term-prompt {
  color: #ff86c8;
}

/* readable minimums: Press Start 2P gets hard to read below ~11px */
.diorama-term .main-titled {
  font-size: clamp(20px, calc(12px + 1.1vw), 30px) !important;
  line-height: 1.35 !important;
  margin-bottom: 1.1rem !important;
}

.diorama-term .main-subtitled {
  font-size: clamp(12px, calc(8px + 0.4vw), 15px) !important;
  line-height: 1.6 !important;
  margin-bottom: 0.9rem !important;
}

.diorama-term .buttons {
  margin: 1.2rem 0 0.4rem;
}

/* fecha y sedes como árbol de terminal: el padre en un h4 y sus elementos
   en una lista con conectores ├ └ dibujados con bordes (Press Start 2P no
   trae caracteres de caja) */
.diorama-term #date h4 {
  margin-bottom: 0.3rem !important;
}

.diorama-term .term-tree li {
  position: relative;
  padding-left: 1.9em;
}

.diorama-term .term-tree li + li {
  margin-top: 0.3em;
}

.diorama-term .term-tree li::before,
.diorama-term .term-tree li:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 0.5em;
  border-left: 2px solid #ff86c8;
}

.diorama-term .term-tree li::before {
  top: 0;
  height: 0.8em;
  width: 0.8em;
  border-bottom: 2px solid #ff86c8;
}

.diorama-term .term-tree li:not(:last-child)::after {
  top: 0.8em;
  bottom: -0.3em;
}

/* horarios algo más pequeños para que "Formación: 9:30h a 14:00h" quepa en
   una línea (~27 caracteres de ancho con la sangría del árbol) */
.diorama-term .term-hours {
  font-size: clamp(10px, calc(6.5px + 0.4vw), 14px) !important;
}

.pixel-btn.button {
  height: auto;
  padding: 11px 13px;
  font-size: 12px;
  line-height: 1.2;
  color: #0a0a0a;
  background: #fff;
  border: 0;
  border-radius: 0;
  box-shadow: 4px 4px 0 #d6579a;
  transition: transform 0.08s, box-shadow 0.08s, background-color 0.08s;
}

.pixel-btn.button:hover,
.pixel-btn.button:focus-visible {
  color: #0a0a0a;
  background: #ffd0ea;
}

.pixel-btn.button:active {
  transform: translate(3px, 3px);
  box-shadow: 1px 1px 0 #d6579a;
}

.diorama-term #status {
  min-height: 1.6em;
}

.diorama-term #status .main-subtitled {
  margin: 0.6rem 0 0 !important;
  color: #ff86c8 !important;
}

.diorama-hud {
  position: absolute;
  right: 14px;
  bottom: 14px;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 10px;
  line-height: 1;
  color: rgba(255, 255, 255, 0.75);
}

.diorama-hud button {
  width: 30px;
  height: 30px;
  padding: 0;
  font-family: inherit;
  font-size: 10px;
  color: #fff;
  background: rgba(10, 10, 10, 0.75);
  border: 2px solid #fff;
  cursor: pointer;
}

.diorama-hud button:hover,
.diorama-hud button:focus-visible {
  background: #d6579a;
}

/* narrow screens: the scene takes the top, the terminal sits underneath */
@media (orientation: portrait), (max-width: 700px) {
  .hero.is-fullheight.diorama-hero .hero-body {
    align-items: flex-start;
    padding-top: var(--diorama-scene-bottom, 62vh);
    padding-bottom: 3.5rem;
  }

  .diorama-term {
    width: 100%;
    min-width: 0;
    max-width: 560px;
    margin: 0 auto;
  }

  /* el ancho útil del terminal en móvil es ~100vw - 100px */
  .diorama-term .term-hours {
    font-size: min(12px, calc(3.6vw - 3.7px)) !important;
  }

  .diorama-hud {
    right: 10px;
    bottom: 10px;
  }
}

/* short phones: a tighter terminal so all of it fits in the first screen */
@media (orientation: portrait) and (max-height: 700px) {
  .diorama-term .term-body {
    padding: 14px 16px 12px;
  }

  .diorama-term .term-cmd {
    margin-bottom: 10px;
  }

  .diorama-term .main-titled {
    margin-bottom: 0.8rem !important;
  }

  .diorama-term .main-subtitled {
    margin-bottom: 0.6rem !important;
  }

  .diorama-term .buttons {
    margin: 0.8rem 0 0.2rem;
  }
}

@media (orientation: portrait) and (max-height: 600px) {
  .diorama-term .term-cmd {
    display: none;
  }
}

@media (max-height: 560px) and (orientation: landscape) {
  .diorama-term .term-cmd,
  .diorama-term #status {
    display: none;
  }

  .diorama-term .term-body {
    padding: 12px 14px;
  }

  .hero.is-fullheight.diorama-hero .hero-body {
    padding-bottom: 1.5rem;
  }
}
