:root {
  color-scheme: dark;
  --bg: #04020a;
  --bg-2: #07041a;
  --surface: rgba(18, 12, 38, 0.72);
  --surface-raised: rgba(28, 18, 56, 0.82);
  --ink: #e9e6ff;
  --ink-strong: #ffffff;
  --muted: #9a8fc7;
  --cyan: #2af6ff;
  --magenta: #ff3df0;
  --violet: #8a5bff;
  --line: rgba(138, 91, 255, 0.30);
  --line-strong: rgba(42, 246, 255, 0.55);
  --glow-cyan: 0 0 18px rgba(42, 246, 255, 0.55);
  --glow-magenta: 0 0 18px rgba(255, 61, 240, 0.45);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
}

body {
  position: relative;
  min-height: 100vh;
  overflow-x: hidden;
  background:
    radial-gradient(120% 80% at 50% -10%, rgba(138, 91, 255, 0.18), transparent 60%),
    linear-gradient(180deg, var(--bg-2) 0%, var(--bg) 55%);
  color: var(--ink);
  font-family:
    system-ui, -apple-system, "Hiragino Sans", "Yu Gothic", YuGothic, sans-serif;
}

/* ---------- background fx ---------- */
.bg-grid {
  position: fixed;
  inset: -2px;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(42, 246, 255, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(138, 91, 255, 0.06) 1px, transparent 1px);
  background-size: 46px 46px;
  -webkit-mask-image: radial-gradient(120% 90% at 50% 0%, #000 35%, transparent 85%);
  mask-image: radial-gradient(120% 90% at 50% 0%, #000 35%, transparent 85%);
  animation: gridDrift 22s linear infinite;
}

@keyframes gridDrift {
  to { background-position: 0 460px, 460px 0; }
}

.bg-glow {
  position: fixed;
  z-index: 0;
  width: 46vw;
  height: 46vw;
  max-width: 560px;
  max-height: 560px;
  border-radius: 50%;
  filter: blur(90px);
  pointer-events: none;
  opacity: 0.5;
}

.bg-glow--a {
  top: -8%;
  left: -6%;
  background: var(--magenta);
  animation: floatGlow 14s ease-in-out infinite alternate;
}

.bg-glow--b {
  bottom: -12%;
  right: -8%;
  background: var(--cyan);
  animation: floatGlow 18s ease-in-out infinite alternate-reverse;
}

@keyframes floatGlow {
  to { transform: translate3d(40px, 30px, 0) scale(1.12); }
}

.scanlines {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: repeating-linear-gradient(
    180deg,
    rgba(0, 0, 0, 0) 0px,
    rgba(0, 0, 0, 0) 2px,
    rgba(0, 0, 0, 0.16) 3px
  );
  mix-blend-mode: overlay;
  opacity: 0.4;
}

/* ---------- layout ---------- */
.home-shell {
  position: relative;
  z-index: 2;
  width: min(960px, 100%);
  min-height: 100vh;
  display: grid;
  align-content: center;
  gap: 30px;
  margin: 0 auto;
  padding: 40px 28px;
}

.home-header {
  display: grid;
  gap: 16px;
}

.eyebrow,
h1 {
  margin: 0;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  width: fit-content;
  color: var(--cyan);
  font-family: "Orbitron", system-ui, sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
  text-shadow: var(--glow-cyan);
}

.eyebrow .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: var(--glow-cyan);
  animation: pulse 1.6s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.35; transform: scale(0.7); }
}

/* ---------- glitch title ---------- */
h1.glitch {
  position: relative;
  max-width: 820px;
  color: var(--ink-strong);
  font-family: "Kaisei Opti", "Orbitron", Georgia, serif;
  font-size: clamp(32px, 6.4vw, 62px);
  font-weight: 500;
  line-height: 1.04;
  white-space: nowrap;
  text-shadow:
    0 0 14px rgba(42, 246, 255, 0.35),
    0 0 30px rgba(138, 91, 255, 0.25);
}

h1.glitch::before,
h1.glitch::after {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  pointer-events: none;
}

h1.glitch::before {
  color: var(--magenta);
  mix-blend-mode: screen;
  animation: glitchA 3.4s steps(2, end) infinite;
}

h1.glitch::after {
  color: var(--cyan);
  mix-blend-mode: screen;
  animation: glitchB 2.7s steps(2, end) infinite;
}

@keyframes glitchA {
  0%, 92%, 100% { transform: translate(0, 0); opacity: 0; clip-path: none; }
  93% { transform: translate(-3px, 1px); opacity: 0.85; clip-path: inset(0 0 62% 0); }
  96% { transform: translate(3px, -1px); opacity: 0.85; clip-path: inset(58% 0 0 0); }
}

@keyframes glitchB {
  0%, 90%, 100% { transform: translate(0, 0); opacity: 0; clip-path: none; }
  91% { transform: translate(3px, -1px); opacity: 0.8; clip-path: inset(0 0 70% 0); }
  94% { transform: translate(-3px, 1px); opacity: 0.8; clip-path: inset(66% 0 0 0); }
}

.tagline {
  margin: 0;
  max-width: 560px;
  color: var(--muted);
  font-size: clamp(14px, 2.4vw, 16px);
  line-height: 1.7;
}

/* ---------- hero visual ---------- */
.hero-visual {
  position: relative;
  overflow: hidden;
  width: 100%;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  aspect-ratio: 16 / 9;
  background: var(--surface);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55), 0 0 40px rgba(138, 91, 255, 0.18);
}

.hero-visual img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  filter: saturate(1.15) contrast(1.05);
}

.hero-frame {
  position: absolute;
  inset: 10px;
  border: 1px solid rgba(42, 246, 255, 0.4);
  border-radius: 8px;
  pointer-events: none;
  box-shadow: inset 0 0 30px rgba(42, 246, 255, 0.12);
}

.hero-tag {
  position: absolute;
  left: 18px;
  bottom: 16px;
  padding: 5px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: rgba(4, 2, 10, 0.66);
  color: var(--cyan);
  font-family: "Orbitron", system-ui, sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2px;
  text-shadow: var(--glow-cyan);
  backdrop-filter: blur(4px);
}

/* ---------- hero console ---------- */
.hero-console {
  position: absolute;
  top: 19%;
  left: 7%;
  z-index: 2;
  width: min(42%, 340px);
  pointer-events: none;
}

.hero-console__screen {
  margin: 0;
  min-height: 8.4em;
  color: var(--cyan);
  font-family: "SF Mono", "Cascadia Code", Menlo, Consolas, monospace;
  font-size: 13px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
  text-shadow:
    0 0 8px rgba(42, 246, 255, 0.5),
    0 1px 4px rgba(0, 0, 0, 0.9);
}

.hero-console__cursor {
  display: inline-block;
  margin-left: 1px;
  color: var(--cyan);
  text-shadow: 0 0 10px rgba(42, 246, 255, 0.7);
  animation: consoleBlink 1s steps(1, end) infinite;
}

@keyframes consoleBlink {
  0%, 50% { opacity: 1; }
  50.01%, 100% { opacity: 0; }
}

/* ---------- link cards ---------- */
.link-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.link-card {
  position: relative;
  overflow: hidden;
  min-height: 156px;
  display: grid;
  align-content: end;
  gap: 7px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background:
    linear-gradient(135deg, rgba(42, 246, 255, 0.08), transparent 50%),
    var(--surface-raised);
  color: var(--ink);
  text-decoration: none;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.45);
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.link-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 30%, rgba(42, 246, 255, 0.16) 50%, transparent 70%);
  transform: translateX(-120%);
  transition: transform 0.55s ease;
  pointer-events: none;
}

.link-card:hover::before {
  transform: translateX(120%);
}

.link-card[href]:not([aria-disabled="true"]):hover {
  transform: translateY(-4px);
  border-color: var(--line-strong);
  box-shadow: 0 20px 48px rgba(42, 246, 255, 0.22), 0 0 24px rgba(255, 61, 240, 0.18);
}

.link-card--live {
  border-color: rgba(42, 246, 255, 0.45);
  background:
    linear-gradient(135deg, rgba(42, 246, 255, 0.16), rgba(255, 61, 240, 0.08) 60%, transparent),
    var(--surface-raised);
}

.link-card[aria-disabled="true"] {
  opacity: 0.5;
  cursor: not-allowed;
}

.link-card__kicker {
  color: var(--cyan);
  font-family: "Orbitron", system-ui, sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.link-card strong {
  color: var(--ink-strong);
  font-size: 19px;
  line-height: 1.25;
}

.link-card__meta {
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.5px;
}

.link-card__arrow {
  position: absolute;
  top: 16px;
  right: 18px;
  color: var(--cyan);
  font-size: 20px;
  text-shadow: var(--glow-cyan);
  transition: transform 0.25s ease;
}

.link-card--live:hover .link-card__arrow {
  transform: translate(3px, -3px);
}

/* ---------- guide page ---------- */
.guide-shell {
  align-content: start;
  padding-top: 34px;
}

.guide-header {
  gap: 14px;
}

.guide-back {
  width: fit-content;
  color: var(--cyan);
  font-family: "Orbitron", system-ui, sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2px;
  text-decoration: none;
  text-transform: uppercase;
  text-shadow: var(--glow-cyan);
}

.guide-back::before {
  content: "← ";
}

.guide-panel,
.guide-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  background:
    linear-gradient(135deg, rgba(42, 246, 255, 0.08), transparent 55%),
    var(--surface-raised);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.45);
}

.guide-panel {
  display: grid;
  gap: 12px;
  padding: 24px;
}

.guide-panel--intro {
  border-color: rgba(42, 246, 255, 0.42);
  background:
    linear-gradient(135deg, rgba(42, 246, 255, 0.14), rgba(255, 61, 240, 0.08) 62%, transparent),
    var(--surface-raised);
}

.guide-panel--contact {
  scroll-margin-top: 28px;
}

.guide-kicker {
  margin: 0;
  color: var(--cyan);
  font-family: "Orbitron", system-ui, sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.guide-panel h2,
.guide-card h2 {
  margin: 0;
  color: var(--ink-strong);
  font-size: 22px;
  line-height: 1.35;
}

.guide-panel p,
.guide-card p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.85;
}

.guide-install {
  display: grid;
  gap: 12px;
  margin-top: 4px;
  padding: 16px;
  border: 1px solid rgba(42, 246, 255, 0.26);
  border-radius: 10px;
  background: rgba(4, 2, 10, 0.36);
}

.guide-install__title {
  color: var(--ink);
}

.guide-install__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.guide-install__grid p {
  padding: 12px;
  border: 1px solid rgba(138, 91, 255, 0.3);
  border-radius: 8px;
  background: rgba(18, 12, 38, 0.48);
}

.guide-install__grid span {
  display: block;
  margin-bottom: 5px;
  color: var(--cyan);
  font-family: "Orbitron", system-ui, sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.guide-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.guide-card {
  display: grid;
  align-content: start;
  gap: 12px;
  min-height: 220px;
  padding: 20px;
}

.guide-step {
  color: var(--cyan);
  font-family: "Orbitron", system-ui, sans-serif;
  font-size: 26px;
  font-weight: 900;
  letter-spacing: 2px;
  opacity: 0.72;
  text-shadow: var(--glow-cyan);
}

.guide-contact-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding-top: 4px;
}

.guide-contact-link {
  display: inline-flex;
  justify-self: start;
  align-items: center;
  min-height: 42px;
  padding: 10px 16px;
  border: 1px solid rgba(42, 246, 255, 0.58);
  border-radius: 8px;
  color: var(--ink-strong);
  font-family: "Orbitron", system-ui, sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-decoration: none;
  text-transform: uppercase;
  background: linear-gradient(135deg, rgba(42, 246, 255, 0.20), rgba(255, 61, 240, 0.13));
  box-shadow: 0 0 24px rgba(42, 246, 255, 0.12);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.guide-contact-link:hover,
.guide-contact-link:focus-visible {
  border-color: rgba(42, 246, 255, 0.92);
  box-shadow: 0 0 30px rgba(42, 246, 255, 0.22);
  transform: translateY(-1px);
}

.guide-contact-list span {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 6px 12px;
  border: 1px solid rgba(42, 246, 255, 0.34);
  border-radius: 999px;
  color: var(--ink);
  font-size: 12px;
  line-height: 1.4;
  background: rgba(4, 2, 10, 0.42);
}

/* ---------- footer ---------- */
.home-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px 18px;
  margin-top: 4px;
  color: var(--muted);
  font-family: "Orbitron", system-ui, sans-serif;
  font-size: 11px;
  letter-spacing: 1.5px;
}

.home-footer__brand {
  margin-right: auto;
}

.home-footer__sys {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--cyan);
  text-decoration: none;
  text-transform: uppercase;
  transition: color 0.2s ease, text-shadow 0.2s ease;
}

.home-footer__sys:hover,
.home-footer__sys:focus-visible {
  color: var(--ink-strong);
  text-shadow: var(--glow-cyan);
}

.home-footer__sys::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: var(--glow-cyan);
  animation: pulse 1.6s ease-in-out infinite;
}

/* ---------- responsive ---------- */
@media (max-width: 760px) {
  .home-shell {
    align-content: start;
    padding: 30px 16px 40px;
  }

  .link-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hero-console {
    top: 19%;
    left: 7%;
    width: min(60%, 320px);
  }

  .hero-console__screen {
    font-size: 12px;
    min-height: 7.8em;
  }

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

  .guide-install__grid {
    grid-template-columns: 1fr;
  }

  .guide-card {
    min-height: auto;
  }
}

@media (max-width: 480px) {
  .hero-console {
    display: none;
  }
}

@media (max-width: 420px) {
  .link-grid {
    grid-template-columns: 1fr;
  }

  .link-card {
    min-height: 120px;
  }

  .guide-panel {
    padding: 20px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .bg-grid,
  .bg-glow,
  .eyebrow .dot,
  .home-footer__sys::before,
  .hero-console__cursor,
  h1.glitch::before,
  h1.glitch::after {
    animation: none;
  }
  h1.glitch::before,
  h1.glitch::after { opacity: 0; }
}
