/* ==========================================================================
   Boot gate: a start screen modelled on the PS2's own (towers of light, then
   a black menu with a ring of blue lights and two stacked options). It picks
   between the two sides of the site. Only shown when <html> has .has-gate.
   ========================================================================== */

.gate { display: none; }
.has-gate, .has-gate body { background: #000; overflow: hidden; }
.has-gate .preloader { visibility: hidden; }
.has-gate .cursor { display: none; }
.has-gate .gate, .has-gate .gate * { cursor: default; }
.has-gate .gate__option, .has-gate .gate__lang { cursor: pointer; }

.has-gate .gate {
  position: fixed; inset: 0; z-index: 400; display: block; overflow: hidden;
  background: #000; color: #dcecff;
  font-family: "Michroma", "Segoe UI", Tahoma, sans-serif;
}

.gate__stage { position: absolute; inset: 0; width: 100%; height: 100%; }
.gate__title { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* ----- First beat: the logo over the towers ----- */
.gate__logo {
  position: absolute; left: 0; right: 0; top: 46%; text-align: center; pointer-events: none; opacity: 0;
  font-size: clamp(0.8rem, 2.6vmin, 1.4rem); letter-spacing: 0.08em; color: #eaf4ff;
  text-shadow: 0 0 10px #6fb0ff, 0 0 34px #2f7bff;
}
.gate--boot .gate__logo { animation: gate-logo 3.2s ease 0.4s both; }
@keyframes gate-logo {
  0% { opacity: 0; filter: blur(12px); letter-spacing: 0.3em; }
  34% { opacity: 1; filter: blur(0); letter-spacing: 0.08em; }
  78% { opacity: 1; filter: blur(0); }
  100% { opacity: 0; filter: blur(5px); }
}

/* ----- The menu ----- */
.gate__menu {
  position: absolute; left: 44%; top: 46%; transform: translateY(-50%); width: min(50%, 620px);
  opacity: 0; visibility: hidden; transition: opacity 1.1s ease 0.25s, visibility 0s linear 0.25s;
}
.gate--menu .gate__menu { opacity: 1; visibility: visible; }

.gate__options { display: flex; flex-direction: column; align-items: flex-start; gap: clamp(10px, 2.4vh, 22px); }
.gate__option {
  appearance: none; background: none; border: 0; padding: 0; margin: 0; font: inherit; color: inherit; text-align: left; outline: none; width: 100%;
}
.gate__name {
  display: block; font-size: clamp(1.15rem, 3.8vmin, 2.1rem); line-height: 1.2;
  color: rgba(126, 160, 214, 0.42); transition: color 0.35s ease, text-shadow 0.35s ease, transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}
.gate__option.is-selected .gate__name {
  color: #eef7ff; transform: translateX(6px);
  animation: gate-glow 2.6s ease-in-out infinite;
}
@keyframes gate-glow {
  0%, 100% { text-shadow: 0 0 6px #7db8ff, 0 0 20px #2f7bff; }
  50% { text-shadow: 0 0 10px #a9d2ff, 0 0 38px #2f7bff, 0 0 70px rgba(47, 123, 255, 0.55); }
}

.gate__legend {
  position: absolute; left: 0; right: 0; bottom: clamp(26px, 8vh, 70px); display: flex; justify-content: center; align-items: center; gap: clamp(26px, 9vw, 120px);
  font-size: clamp(0.62rem, 1.6vmin, 0.8rem); color: #a9c4ea;
  opacity: 0; visibility: hidden; transition: opacity 1.1s ease 0.4s, visibility 0s linear 0.4s;
}
.gate--menu .gate__legend { opacity: 1; visibility: visible; }
.gate__legend b { font-weight: 400; margin-right: 0.7em; font-family: Verdana, Tahoma, sans-serif; }
.gate__key-x { color: #7fb0ff; }
.gate__key-t { color: #7fe0a8; }
.gate__lang { appearance: none; background: none; border: 0; padding: 6px 4px; font: inherit; color: inherit; }
.gate__lang:hover, .gate__lang:focus-visible { color: #fff; outline: none; text-shadow: 0 0 12px #2f7bff; }

/* ----- Leaving: the console reads the chosen disc ----- */
.gate__reading {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 26px; background: #000;
  opacity: 0; visibility: hidden; transition: opacity 0.35s ease;
}
.gate--reading .gate__reading { opacity: 1; visibility: visible; }
.gate__disc { display: none; width: clamp(130px, 30vmin, 230px); height: auto; border-radius: 50%; filter: drop-shadow(0 0 26px rgba(70, 140, 255, 0.55)); animation: gate-spin 0.9s linear infinite; }
.gate[data-disc="portfolio"] .gate__disc--portfolio, .gate[data-disc="patches"] .gate__disc--patches { display: block; }
.gate__reading span { font-size: clamp(0.6rem, 1.6vmin, 0.78rem); color: #a9c4ea; letter-spacing: 0.1em; animation: gate-blink 0.9s steps(2) infinite; }
@keyframes gate-spin { to { transform: rotate(360deg); } }
@keyframes gate-blink { 50% { opacity: 0.35; } }
.gate--gone { opacity: 0; transition: opacity 0.35s ease; }

@media (max-width: 719px) {
  .gate__menu { left: 24px; right: 24px; width: auto; top: 46%; transform: none; }
  .gate__logo { top: 44%; padding: 0 16px; }
}

@media (prefers-reduced-motion: reduce) {
  .gate *, .gate *::before { animation: none !important; transition: none !important; }
}
