:root {
  --bg: #03060d;
  --panel: rgba(255, 255, 255, 0.045);
  --line: rgba(255, 255, 255, 0.10);
  --text: #f5f7fb;
  --muted: rgba(245, 247, 251, 0.74);
  --blue: #5bb8ff;
  --orange: #ff8c42;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.48);
  --radius: 28px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  background:
    radial-gradient(circle at top, rgba(91, 184, 255, 0.12), transparent 28%),
    radial-gradient(circle at bottom right, rgba(255, 140, 66, 0.08), transparent 22%),
    linear-gradient(180deg, #02050b 0%, #040914 100%);
  color: var(--text);
  overflow-x: hidden;
}

body.mode-engaged {
  background:
    radial-gradient(circle at top, rgba(91, 184, 255, 0.15), transparent 28%),
    radial-gradient(circle at bottom right, rgba(255, 140, 66, 0.11), transparent 22%),
    linear-gradient(180deg, #02050b 0%, #050b17 100%);
}

body.mode-judgment {
  background:
    radial-gradient(circle at top, rgba(91, 184, 255, 0.16), transparent 28%),
    radial-gradient(circle at bottom right, rgba(255, 140, 66, 0.18), transparent 20%),
    linear-gradient(180deg, #02050b 0%, #08111e 100%);
}

body.mode-restricted {
  background:
    radial-gradient(circle at top, rgba(91, 184, 255, 0.18), transparent 26%),
    radial-gradient(circle at bottom right, rgba(255, 140, 66, 0.15), transparent 18%),
    linear-gradient(180deg, #01040a 0%, #040a15 100%);
}

.fx-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}

#observer {
  position: fixed;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  pointer-events: none;
  background: radial-gradient(circle, rgba(91,184,255,0.12), transparent 70%);
  transform: translate(-50%, -50%);
  z-index: 1;
  transition:
    width 0.25s ease,
    height 0.25s ease,
    background 0.25s ease,
    opacity 0.25s ease;
  opacity: 0.95;
  filter: blur(6px);
}

.site-header,
main,
.site-footer {
  position: relative;
  z-index: 2;
}

#entry-gate {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background:
    radial-gradient(circle at center, rgba(91, 184, 255, 0.08), transparent 25%),
    linear-gradient(180deg, #010308 0%, #000000 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.8s ease, visibility 0.8s ease;
}

#entry-gate.hidden {
  opacity: 0;
  visibility: hidden;
}

.gate-shell {
  width: min(700px, calc(100% - 40px));
  padding: 44px 32px;
  text-align: center;
  border: 1px solid var(--line);
  border-radius: 34px;
  background: rgba(255,255,255,0.03);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.gate-brand {
  margin-top: 22px;
  font-size: 34px;
  font-weight: 900;
  letter-spacing: 0.32em;
}

.gate-copy {
  margin-top: 16px;
  font-size: 20px;
  color: var(--text);
}

.gate-subcopy {
  margin-top: 10px;
  color: var(--muted);
  font-size: 14px;
  letter-spacing: 0.06em;
}

.enter-button {
  margin-top: 26px;
  border: none;
  padding: 14px 22px;
  border-radius: 18px;
  background: #ffffff;
  color: #000000;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.enter-button:hover {
  transform: translateY(-1px);
  opacity: 0.94;
}

.site-header {
  padding: 24px;
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.brand {
  font-size: 30px;
  font-weight: 900;
  letter-spacing: 0.28em;
}

.tagline {
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.30em;
}

.resonance-toggle {
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.04);
  color: var(--text);
  padding: 10px 14px;
  border-radius: 14px;
  cursor: pointer;
  font-size: 13px;
}

main {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0 90px;
}

.hero {
  display: grid;
  grid-template-columns: 1.02fr 0.98fr;
  gap: 28px;
  align-items: center;
  min-height: 78vh;
}

.hero-copy,
.panel,
.hero-visual,
.image-panel,
.terminal-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.hero-copy {
  padding: 42px;
}

.eyebrow {
  color: var(--orange);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.30em;
  text-transform: uppercase;
}

h1, h2 {
  margin: 14px 0 0;
  line-height: 1.03;
}

h1 {
  font-size: clamp(42px, 7vw, 84px);
  max-width: 800px;
}

h2 {
  font-size: clamp(28px, 4vw, 48px);
}

p {
  color: var(--muted);
  font-size: 18px;
  line-height: 1.8;
  margin: 18px 0 0;
}

.hero-visual {
  position: relative;
  padding: 16px;
  overflow: hidden;
}

.hero-visual::before,
.hero-visual::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  border-radius: 999px;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.hero-visual::before {
  width: 320px;
  height: 320px;
  border: 1px solid rgba(255, 140, 66, 0.16);
  animation: spinA 24s linear infinite;
}

.hero-visual::after {
  width: 440px;
  height: 440px;
  border: 1px solid rgba(91, 184, 255, 0.12);
  animation: spinB 36s linear infinite;
}

.hero-visual img {
  width: 100%;
  display: block;
  border-radius: 20px;
  position: relative;
  z-index: 1;
  animation: corePulse 6s ease-in-out infinite;
  box-shadow:
    0 0 30px rgba(91, 184, 255, 0.22),
    0 0 90px rgba(91, 184, 255, 0.12);
}

.status-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin-top: 28px;
}

.status-card {
  padding: 14px 12px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255,255,255,0.03);
}

.status-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--muted);
}

.status-value {
  margin-top: 8px;
  font-size: 14px;
  font-weight: 700;
}

.terminal-panel {
  margin-top: 24px;
  padding: 22px;
}

.terminal-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.terminal-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.terminal-state {
  color: var(--orange);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.2em;
}

.terminal-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 22px;
  margin-top: 18px;
}

.terminal-line {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  padding-bottom: 8px;
}

.terminal-key {
  color: var(--muted);
  font-size: 14px;
}

.terminal-val {
  font-weight: 700;
  font-size: 14px;
}

.terminal-rotator {
  margin-top: 18px;
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(0,0,0,0.22);
  color: var(--blue);
  font-size: 15px;
  letter-spacing: 0.05em;
  min-height: 50px;
  display: flex;
  align-items: center;
}

.panel {
  padding: 36px;
  margin-top: 24px;
}

.intro-panel {
  margin-top: 30px;
}

.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.image-panel {
  margin-top: 24px;
  padding: 16px;
  overflow: hidden;
}

.image-panel img {
  width: 100%;
  display: block;
  border-radius: 20px;
}

.narrow {
  max-width: 900px;
}

.restricted-panel {
  display: none;
  margin-top: 24px;
  border-color: rgba(91,184,255,0.22);
  box-shadow:
    0 24px 70px rgba(0,0,0,0.48),
    0 0 40px rgba(91,184,255,0.10);
}

.restricted-panel.visible {
  display: block;
}

.restricted-header {
  display: flex;
  gap: 18px;
  align-items: center;
}

.restricted-grid {
  margin-top: 20px;
}

.restricted-note {
  margin-top: 18px;
  color: var(--blue);
  letter-spacing: 0.04em;
}

.site-footer {
  padding: 24px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
}

.site-footer > :last-child {
  text-align: right;
}

.footer-center {
  display: flex;
  justify-content: center;
}

.footer-glyph-trigger {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 999px;
  width: 42px;
  height: 42px;
  cursor: pointer;
  display: grid;
  place-items: center;
}

.sigil-main {
  width: 110px;
  height: 110px;
  object-fit: contain;
  display: block;
  margin: 0 auto 20px;
  filter: drop-shadow(0 0 18px rgba(91,184,255,0.35));
  animation: sigilPulse 6s ease-in-out infinite;
}

.sigil-footer {
  width: 20px;
  height: 20px;
  object-fit: contain;
  opacity: 0.7;
  filter: drop-shadow(0 0 10px rgba(91,184,255,0.25));
}

.sigil-restricted {
  width: 80px;
  display: block;
  margin-bottom: 16px;
  filter: drop-shadow(0 0 25px rgba(91,184,255,0.5));
}

.sigil-terminal {
  width: 18px;
  height: 18px;
  object-fit: contain;
  filter: drop-shadow(0 0 8px rgba(91,184,255,0.3));
}

.spark,
.ember,
.drip,
.arc {
  position: absolute;
}

.spark {
  height: 2px;
  width: 120px;
  background: linear-gradient(to right, transparent, var(--orange), transparent);
  opacity: 0.8;
  filter: blur(0.3px);
  animation: sparkMove linear infinite;
}

.ember {
  width: 6px;
  height: 6px;
  background: var(--orange);
  border-radius: 50%;
  filter: blur(1px);
  opacity: 0.7;
  animation: emberRise ease-out infinite;
}

.drip {
  top: 0;
  width: 3px;
  background: linear-gradient(to bottom, rgba(0,0,0,0.95), rgba(120,120,120,0.42), transparent);
  border-radius: 999px;
  animation: dripFall ease-in infinite;
}

.arc {
  height: 2px;
  background: linear-gradient(to right, transparent, rgba(91, 184, 255, 0.95), transparent);
  opacity: 0.55;
  filter: blur(0.4px);
  animation: arcFlash ease-in-out infinite;
}

.watch-zone {
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.watch-zone.zone-active {
  border-color: rgba(91,184,255,0.20);
  box-shadow:
    var(--shadow),
    0 0 30px rgba(91,184,255,0.08);
}

.watch-zone.zone-judgment.zone-active {
  border-color: rgba(255,140,66,0.26);
  box-shadow:
    var(--shadow),
    0 0 40px rgba(255,140,66,0.10);
}

@keyframes sparkMove {
  from { transform: translateX(-180px) translateY(0) rotate(-8deg); opacity: 0; }
  15% { opacity: 0.9; }
  to { transform: translateX(120vw) translateY(-40px) rotate(10deg); opacity: 0; }
}

@keyframes emberRise {
  from { transform: translateY(60px) scale(0.8); opacity: 0; }
  15% { opacity: 0.7; }
  to { transform: translateY(-180px) scale(1.15); opacity: 0; }
}

@keyframes dripFall {
  from { transform: translateY(-20px) scaleY(0.4); opacity: 0; }
  20% { opacity: 0.45; }
  to { transform: translateY(140px) scaleY(1.2); opacity: 0; }
}

@keyframes arcFlash {
  0%, 100% { opacity: 0; transform: scaleX(0.85); }
  25% { opacity: 0.2; }
  50% { opacity: 0.75; transform: scaleX(1); }
  75% { opacity: 0.15; }
}

@keyframes spinA {
  from { transform: translate(-50%, -50%) rotate(0deg); }
  to { transform: translate(-50%, -50%) rotate(360deg); }
}

@keyframes spinB {
  from { transform: translate(-50%, -50%) rotate(360deg); }
  to { transform: translate(-50%, -50%) rotate(0deg); }
}

@keyframes corePulse {
  0%, 100% {
    transform: scale(1);
    filter: brightness(1) saturate(1);
  }
  50% {
    transform: scale(1.012);
    filter: brightness(1.08) saturate(1.08);
  }
}

@keyframes sigilPulse {
  0%,100% {
    transform: scale(1);
    filter: drop-shadow(0 0 18px rgba(91,184,255,0.35));
  }
  50% {
    transform: scale(1.05);
    filter: drop-shadow(0 0 30px rgba(91,184,255,0.6));
  }
}

.restricted-header-bar {
  border-bottom-color: rgba(91,184,255,0.18);
}

.restricted-arrival h1 {
  max-width: 900px;
}

.return-link {
  display: inline-block;
  margin-top: 20px;
  padding: 14px 20px;
  border-radius: 18px;
  background: #ffffff;
  color: #000000;
  text-decoration: none;
  font-weight: 700;
}

.return-link:hover {
  opacity: 0.94;
}

.restricted-return-panel {
  margin-bottom: 8px;
}

@media (max-width: 980px) {
  .status-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .terminal-grid {
    grid-template-columns: 1fr;
  }

  .site-header {
    flex-direction: column;
    text-align: center;
  }
}

@media (max-width: 900px) {
  .hero,
  .split {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
  }

  h1 {
    font-size: 46px;
  }

  p {
    font-size: 16px;
  }

  .brand {
    font-size: 22px;
    letter-spacing: 0.18em;
  }

  .hero-copy,
  .panel {
    padding: 28px;
  }

  .site-footer {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .site-footer > :last-child {
    text-align: center;
  }

  #observer {
    width: 220px;
    height: 220px;
  }
}