:root {
  --bg: #02040d;
  --ink: #f4fbff;
  --soft: #a8b8d8;
  --cyan: #3df7ff;
  --cyan-dark: #0aa7ff;
  --pink: #ff3edb;
  --purple: #8d5cff;
  --green: #7cffc4;
  --orange: #ffb14a;
  --glass: rgba(8, 18, 39, 0.7);
  --glass-strong: rgba(10, 24, 55, 0.88);
  --line: rgba(111, 238, 255, 0.22);
  --line-strong: rgba(111, 238, 255, 0.5);
  --shadow: 0 22px 70px rgba(0, 0, 0, 0.38), 0 0 46px rgba(61, 247, 255, 0.12);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body.gate-page {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  font-family: "Segoe UI", "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, sans-serif;
  background:
    radial-gradient(circle at 12% 18%, rgba(61, 247, 255, 0.26), transparent 28rem),
    radial-gradient(circle at 88% 16%, rgba(255, 62, 219, 0.24), transparent 28rem),
    radial-gradient(circle at 48% 105%, rgba(141, 92, 255, 0.3), transparent 32rem),
    linear-gradient(140deg, #02040d 0%, #07112c 46%, #14051f 100%);
}

body.gate-page::before,
body.gate-page::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
}

body.gate-page::before {
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 84px 84px;
  mask-image: linear-gradient(to bottom, transparent, #000 16%, #000 78%, transparent);
  transform: perspective(620px) rotateX(56deg) scale(1.45) translateY(15vh);
  transform-origin: center bottom;
  animation: gateFloorMove 14s linear infinite;
  opacity: 0.72;
}

body.gate-page::after {
  background:
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.035) 0 1px, transparent 1px 5px),
    radial-gradient(circle at center, transparent 0%, rgba(0, 0, 0, 0.55) 100%);
  mix-blend-mode: screen;
  opacity: 0.42;
}

@keyframes gateFloorMove {
  from { background-position: 0 0, 0 0; }
  to { background-position: 0 84px, 84px 0; }
}

.gate-shell {
  position: relative;
  z-index: 1;
  width: min(1180px, calc(100% - 28px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 28px 0 34px;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 22px;
}

.gate-topbar,
.gate-stage,
.glass-card {
  border: 1px solid rgba(106, 233, 255, 0.28);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.1), transparent 34%),
    var(--glass);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.06) inset,
    var(--shadow);
  backdrop-filter: blur(18px);
}

.gate-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-width: 0;
  padding: 12px 16px;
  border-radius: 999px;
}

.gate-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  color: var(--ink);
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.gate-brand-mark {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border-radius: 12px;
  background: conic-gradient(from 180deg, var(--cyan), var(--pink), var(--purple), var(--cyan));
  box-shadow: 0 0 24px rgba(61, 247, 255, 0.42);
}

.gate-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--soft);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.1em;
  white-space: nowrap;
}

.gate-label::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 12px var(--green);
}

.gate-heading {
  margin: 0;
  font-size: clamp(34px, 5vw, 64px);
  line-height: 1;
  letter-spacing: -0.055em;
  text-shadow: 0 0 30px rgba(61, 247, 255, 0.26);
}

.gate-copy {
  margin: 12px 0 0;
  color: var(--soft);
  font-size: 15px;
  line-height: 1.8;
}

.gate-stage {
  position: relative;
  align-self: center;
  overflow: hidden;
  min-width: 0;
  padding: clamp(22px, 4vw, 48px);
  border-radius: 38px;
}

.home-link,
.museum-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 11px 18px;
  border: 1px solid rgba(61, 247, 255, 0.34);
  border-radius: 999px;
  color: var(--ink);
  background:
    linear-gradient(135deg, rgba(61, 247, 255, 0.18), rgba(255, 62, 219, 0.12)),
    rgba(255, 255, 255, 0.07);
  box-shadow: 0 0 22px rgba(61, 247, 255, 0.1) inset;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-decoration: none;
  transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease, background 0.22s ease;
}

.home-link:hover,
.home-link:focus-visible,
.museum-button:hover,
.museum-button:focus-visible {
  transform: translateY(-3px);
  border-color: rgba(61, 247, 255, 0.68);
  background:
    linear-gradient(135deg, rgba(61, 247, 255, 0.28), rgba(255, 62, 219, 0.18)),
    rgba(255, 255, 255, 0.1);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.26), 0 0 24px rgba(61, 247, 255, 0.18);
  outline: none;
}

.home-link:active,
.museum-button:active {
  transform: translateY(0) scale(0.97);
}

.museum-field {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 16px;
  color: var(--ink);
  background: rgba(2, 8, 24, 0.68);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.04) inset;
  font: inherit;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.museum-field:hover {
  border-color: rgba(61, 247, 255, 0.36);
}

.museum-field:focus {
  border-color: rgba(61, 247, 255, 0.72);
  background: rgba(3, 11, 31, 0.88);
  box-shadow: 0 0 0 3px rgba(61, 247, 255, 0.1), 0 0 24px rgba(61, 247, 255, 0.12);
  outline: none;
}

@media (max-width: 720px) {
  .gate-shell {
    width: min(100% - 18px, 1180px);
    padding: 10px 0 18px;
    gap: 10px;
  }

  .gate-topbar {
    padding: 10px;
    border-radius: 24px;
  }

  .gate-brand {
    font-size: 11px;
    letter-spacing: 0.08em;
  }

  .gate-brand-mark {
    width: 30px;
    height: 30px;
    border-radius: 10px;
  }

  .gate-label {
    display: none;
  }

  .home-link,
  .museum-button {
    min-height: 42px;
    padding: 10px 14px;
    font-size: 12px;
  }

  .gate-stage {
    border-radius: 28px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
