/* PS1-style title screen */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: #0a0818;
  color: #dfe6ff;
  font-family: "Arial Black", "Arial Bold", Gadget, "Helvetica Neue", Arial, sans-serif;
  font-weight: 900;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
}

#scene { position: fixed; inset: 0; width: 100%; height: 100%; display: block; image-rendering: pixelated; }
.no-webgl #scene { display: none; }
.no-webgl body { background: radial-gradient(ellipse at 70% 60%, #2c2a5e, #0a0818 70%); }

/* faint scanlines + vignette, between the scene and the UI */
.crt {
  position: fixed; inset: 0; pointer-events: none;
  background:
    repeating-linear-gradient(to bottom, rgba(0, 0, 0, .16) 0 1px, transparent 1px 3px),
    radial-gradient(ellipse at center, transparent 55%, rgba(0, 0, 0, .6) 100%);
}

.ui {
  position: fixed; inset: 0;
  display: grid; grid-template-rows: auto 1fr auto;
  padding: clamp(20px, 6vh, 64px) clamp(20px, 6vw, 88px);
  pointer-events: none;
}
.ui > * { pointer-events: auto; }

/* --- logo */
.logo { justify-self: start; }
.logo-title {
  position: relative;
  width: min-content;
  margin: 0;
  padding-right: .12em;
  font-size: clamp(44px, 7.5vw, 108px);
  font-style: italic;
  line-height: .9;
  letter-spacing: -.01em;
  text-transform: uppercase;
  color: transparent;
  background: linear-gradient(180deg, #fff 0%, #d6e4ff 38%, #7393ff 49%, #1d2f9e 51%, #7aa0ff 72%, #f4f8ff 100%);
  -webkit-background-clip: text;
  background-clip: text;
}
.logo-title::before {
  content: attr(data-text);
  position: absolute; inset: 0; z-index: -1;
  padding-right: inherit;
  color: #0d0a33;
  -webkit-text-stroke: .14em #0d0a33;
  text-shadow: .06em .07em 0 #000;
}
.logo-sub {
  margin: .9em 0 0 .3em;
  font-size: clamp(12px, 1.4vw, 17px);
  font-style: italic;
  letter-spacing: .45em;
  text-transform: uppercase;
  color: #ffd34d;
  text-shadow: 2px 2px 0 #000;
}

/* --- menus */
.menu { align-self: end; justify-self: start; margin-bottom: clamp(12px, 4vh, 40px); transition: opacity .15s; }
.menu.is-dimmed { opacity: .3; }
.menu-list { list-style: none; margin: 0; padding: 0; }
.menu .menu-list { padding-left: 1.6em; font-size: clamp(24px, 3.3vw, 38px); }

.menu-item {
  position: relative;
  display: inline-block;
  padding: .02em .15em;
  color: #8d97c9;
  font-style: italic;
  line-height: 1.3;
  text-decoration: none;
  text-transform: uppercase;
  text-shadow: .08em .08em 0 #000;
  outline: none;
  cursor: pointer;
}
.menu-item.is-selected { color: #fff; text-shadow: .08em .08em 0 #000, 0 0 .45em rgba(110, 160, 255, .9); }
.menu-item:focus-visible { outline: 2px dashed #ffd34d; }
.has-cursor .menu-item:focus-visible { outline: none; }
.menu-item.is-confirm { animation: confirm .1s steps(1) 4; }
@keyframes confirm { 50% { color: #ffd34d; } }

/* fallback cursor when WebGL isn't around */
.no-3d-cursor .menu-item.is-selected::before {
  content: "\25B6"; position: absolute; left: -1.2em; color: #ffd34d; font-style: normal;
}

#cursor {
  position: fixed; left: -100px; top: -100px; z-index: 5;
  width: 32px; height: 32px;
  image-rendering: pixelated;
  cursor: pointer;
}
.no-3d-cursor #cursor { display: none; }

/* --- PS1-style menu window */
.panel {
  position: fixed; left: 50%; top: 50%; z-index: 4;
  width: min(680px, calc(100vw - 32px));
  max-height: min(74vh, 620px);
  display: none; flex-direction: column;
  padding: 18px 22px 20px;
  transform: translate(-50%, -50%);
  background: linear-gradient(180deg, rgba(52, 74, 196, .95) 0%, rgba(20, 28, 116, .95) 50%, rgba(8, 10, 62, .95) 100%);
  border: 3px solid #eef0ff;
  border-radius: 10px;
  box-shadow: 0 0 0 3px #0b0d33, 10px 10px 0 rgba(0, 0, 0, .55), inset 0 2px 0 rgba(255, 255, 255, .35);
}
.panel.is-open, .panel:target { display: flex; }
.panel.is-open { animation: panel-open .16s steps(4); }
@keyframes panel-open { from { transform: translate(-50%, -50%) scaleY(0); } }
.panel-title {
  margin: 0 0 .5em;
  font-size: clamp(18px, 2.2vw, 24px);
  font-style: italic;
  text-transform: uppercase;
  color: #ffd34d;
  text-shadow: .08em .08em 0 #000;
}
.panel .menu-list {
  overflow-y: auto;
  padding-left: 1.7em;
  font-size: clamp(15px, 1.8vw, 19px);
  scrollbar-width: thin;
  scrollbar-color: #8d97c9 transparent;
}
.panel .menu-item { font-style: normal; text-transform: none; color: #b9c2ee; line-height: 1.55; }
.panel .menu-item.is-selected { color: #fff; }
.panel .menu-text { padding: .02em .15em; line-height: 1.55; color: #eef0ff; text-shadow: .08em .08em 0 #000; }
.panel .date { margin-right: .6em; font: 700 .78em ui-monospace, Menlo, Consolas, monospace; letter-spacing: .04em; color: #ffd34d; }
.panel [data-back] { margin-top: .35em; font-style: italic; text-transform: uppercase; }

/* --- footer */
.footer {
  display: flex; justify-content: space-between; align-items: end; gap: 1em;
  font: 700 11px/1.4 ui-monospace, Menlo, Consolas, monospace;
  letter-spacing: .18em; text-transform: uppercase;
  color: #8d97c9; text-shadow: 1px 1px 0 #000;
}
.footer p { margin: 0; }
.hint span + span { margin-left: 2.2em; }
@media (hover: none) { .hint { visibility: hidden; } }
