:root {
  --ink: #07101c;
  --ink-2: #0d1a2c;
  --ink-3: #13253d;
  --fog: rgba(214, 230, 255, 0.78);
  --snow: #f4f7ff;
  --ice: #8fd0ff;
  --ice-deep: #3d8fd4;
  --gold: #e2b34a;
  --gold-soft: #f0d18a;
  --fire: #ff6b4a;
  --water: #4eb6ff;
  --wood: #6dce6a;
  --light: #ffd45a;
  --line: rgba(143, 208, 255, 0.18);
  --font-display: "Dela Gothic One", "Hiragino Sans", sans-serif;
  --font-body: "Zen Kaku Gothic New", "Hiragino Sans", sans-serif;
  --font-en: "Cormorant Garamond", Georgia, serif;
  --radius: 10px;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-spring: cubic-bezier(0.34, 1.45, 0.64, 1);
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--snow);
  font-family: var(--font-body);
  background: var(--ink);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 80;
  background:
    radial-gradient(circle at 20% 10%, rgba(143, 208, 255, 0.08), transparent 35%),
    radial-gradient(circle at 80% 80%, rgba(226, 179, 74, 0.06), transparent 40%);
  animation: atmosphere-shift 14s ease-in-out infinite alternate;
}

@keyframes atmosphere-shift {
  from { opacity: 0.7; transform: scale(1); }
  to { opacity: 1; transform: scale(1.05); }
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
.btn {
  font: inherit;
  cursor: pointer;
  border: 0;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--gold);
  color: var(--ink);
  padding: 0.75rem 1rem;
  z-index: 100;
}

.skip-link:focus {
  left: 1rem;
  top: 1rem;
}

/* ---------- Nav ---------- */
.site-nav {
  position: fixed;
  inset: 0 0 auto;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem clamp(1rem, 4vw, 2.5rem);
  transition: background 0.4s var(--ease-out), backdrop-filter 0.4s var(--ease-out), border-color 0.4s;
  border-bottom: 1px solid transparent;
}

.site-nav.is-scrolled {
  background: rgba(7, 16, 28, 0.72);
  backdrop-filter: blur(14px) saturate(1.2);
  border-bottom-color: var(--line);
}

.nav-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  font-family: var(--font-display);
  letter-spacing: 0.04em;
  font-size: 0.95rem;
}

.nav-brand img {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  animation: icon-pulse 3.6s ease-in-out infinite;
}

@keyframes icon-pulse {
  0%, 100% { transform: scale(1) rotate(0deg); filter: brightness(1); }
  50% { transform: scale(1.05) rotate(-2deg); filter: brightness(1.12); }
}

.nav-links {
  display: flex;
  align-items: center;
  gap: clamp(0.75rem, 2vw, 1.5rem);
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 0.92rem;
}

.nav-links a {
  position: relative;
  color: var(--fog);
  transition: color 0.25s;
}

.nav-links a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -0.3rem;
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, var(--ice), var(--gold));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.35s var(--ease-out);
}

.nav-links a:hover,
.nav-links a[aria-current="page"] {
  color: var(--snow);
}

.nav-links a:hover::after,
.nav-links a[aria-current="page"]::after {
  transform: scaleX(1);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 3rem;
  padding: 0.85rem 1.35rem;
  border-radius: var(--radius);
  transition: transform 0.35s var(--ease-spring), background 0.25s, color 0.25s, border-color 0.25s;
  will-change: transform;
}

.btn:hover {
  transform: translateY(-3px) scale(1.02);
}

.btn:active {
  transform: translateY(0) scale(0.98);
}

.btn-primary {
  background: linear-gradient(135deg, var(--gold-soft), var(--gold) 45%, #c9922f);
  color: #1a1205;
  font-weight: 700;
}

.btn-secondary {
  background: rgba(143, 208, 255, 0.08);
  border: 1px solid rgba(143, 208, 255, 0.35);
  color: var(--snow);
}

.btn-secondary:hover {
  background: rgba(143, 208, 255, 0.16);
  border-color: var(--ice);
}

.cta-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 100svh;
  display: grid;
  place-items: center;
  overflow: hidden;
  isolation: isolate;
}

.hero-bg {
  position: absolute;
  inset: -8%;
  background:
    linear-gradient(180deg, rgba(7, 16, 28, 0.35) 0%, rgba(7, 16, 28, 0.55) 45%, rgba(7, 16, 28, 0.92) 100%),
    url("../assets/hero-bg.jpg") center / cover no-repeat;
  transform: scale(1.08);
  animation: hero-kenburns 22s ease-in-out infinite alternate;
  z-index: -2;
}

@keyframes hero-kenburns {
  from { transform: scale(1.08) translate3d(0, 0, 0); }
  to { transform: scale(1.18) translate3d(-2%, -1.5%, 0); }
}

.hero-veil {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 70% 55% at 50% 42%, rgba(20, 48, 82, 0.15), transparent 70%),
    linear-gradient(180deg, transparent 55%, var(--ink) 100%);
  z-index: -1;
}

#orb-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

.hero-inner {
  position: relative;
  z-index: 1;
  width: min(1100px, 100%);
  padding: 6.5rem clamp(1.25rem, 5vw, 3rem) 4rem;
  display: grid;
  justify-items: center;
  text-align: center;
  gap: 1.35rem;
}

.hero-logo {
  width: min(720px, 92vw);
  margin: 0 auto;
  opacity: 0;
  transform: translateY(28px) scale(0.94);
  filter: blur(8px);
  animation: logo-enter 1.15s var(--ease-out) 0.15s forwards;
}

.hero-logo-wrap {
  position: relative;
  width: min(720px, 92vw);
}

.hero-logo-wrap::after {
  content: "";
  position: absolute;
  inset: 10% 5%;
  background: linear-gradient(
    105deg,
    transparent 35%,
    rgba(255, 255, 255, 0.18) 48%,
    transparent 62%
  );
  transform: translateX(-120%);
  animation: logo-shimmer 4.5s var(--ease-out) 1.4s infinite;
  pointer-events: none;
  mix-blend-mode: screen;
}

@keyframes logo-enter {
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
  }
}

@keyframes logo-shimmer {
  0%, 55% { transform: translateX(-120%); }
  100% { transform: translateX(120%); }
}

.hero-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.55rem, 4.2vw, 2.6rem);
  letter-spacing: 0.06em;
  line-height: 1.25;
  opacity: 0;
  transform: translateY(20px);
  animation: rise-in 0.9s var(--ease-out) 0.55s forwards;
}

.hero-lead {
  margin: 0;
  max-width: 34rem;
  color: var(--fog);
  font-size: clamp(0.98rem, 2.2vw, 1.15rem);
  line-height: 1.75;
  opacity: 0;
  transform: translateY(20px);
  animation: rise-in 0.9s var(--ease-out) 0.75s forwards;
}

.hero .cta-group {
  justify-content: center;
  margin-top: 0.35rem;
  opacity: 0;
  transform: translateY(20px);
  animation: rise-in 0.9s var(--ease-out) 0.95s forwards;
}

@keyframes rise-in {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero-orb-stage {
  position: absolute;
  right: clamp(4%, 8vw, 12%);
  bottom: 12%;
  width: min(220px, 28vw);
  aspect-ratio: 2 / 3;
  z-index: 2;
  pointer-events: none;
  opacity: 0;
  animation: rise-in 1s var(--ease-out) 1.1s forwards, orb-float 5.5s ease-in-out 2s infinite;
}

.hero-orb-stage img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 18px 30px rgba(0, 0, 0, 0.45));
}

@keyframes orb-float {
  0%, 100% { transform: translateY(0) rotate(-2deg); }
  50% { transform: translateY(-18px) rotate(3deg); }
}

.scroll-hint {
  position: absolute;
  left: 50%;
  bottom: 1.5rem;
  transform: translateX(-50%);
  display: grid;
  justify-items: center;
  gap: 0.4rem;
  color: var(--fog);
  font-size: 0.75rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  opacity: 0;
  animation: rise-in 0.8s var(--ease-out) 1.4s forwards;
}

.scroll-hint span {
  width: 1px;
  height: 2.2rem;
  background: linear-gradient(180deg, var(--ice), transparent);
  animation: scroll-line 1.8s ease-in-out infinite;
}

@keyframes scroll-line {
  0% { transform: scaleY(0); transform-origin: top; opacity: 0; }
  40% { transform: scaleY(1); transform-origin: top; opacity: 1; }
  100% { transform: scaleY(0); transform-origin: bottom; opacity: 0; }
}

/* ---------- Sections ---------- */
.section {
  position: relative;
  padding: clamp(4.5rem, 10vw, 7.5rem) clamp(1.25rem, 5vw, 3rem);
}

.section-inner {
  width: min(1100px, 100%);
  margin: 0 auto;
}

.section-kicker {
  margin: 0 0 0.75rem;
  font-family: var(--font-en);
  font-size: 0.95rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold-soft);
}

.section-title {
  margin: 0 0 1rem;
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 4vw, 2.6rem);
  letter-spacing: 0.04em;
  line-height: 1.3;
}

.section-copy {
  margin: 0;
  max-width: 36rem;
  color: var(--fog);
  font-size: 1.05rem;
  line-height: 1.85;
}

.reveal {
  opacity: 0;
  transform: translateY(36px);
  transition: opacity 0.9s var(--ease-out), transform 0.9s var(--ease-out);
}

.reveal.is-in {
  opacity: 1;
  transform: translateY(0);
}

.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }

/* Elements orbit */
.elements {
  background:
    radial-gradient(ellipse 60% 50% at 50% 0%, rgba(61, 143, 212, 0.18), transparent 65%),
    linear-gradient(180deg, var(--ink), var(--ink-2));
}

.orbit-stage {
  position: relative;
  width: min(420px, 86vw);
  aspect-ratio: 1;
  margin: 3rem auto 0;
}

.orbit-core {
  position: absolute;
  inset: 28%;
  border-radius: 22%;
  overflow: hidden;
  animation: core-breathe 4s ease-in-out infinite;
  box-shadow: inset 0 0 0 1px rgba(226, 179, 74, 0.35);
}

.orbit-core img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

@keyframes core-breathe {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.04); }
}

.orbit-ring {
  position: absolute;
  inset: 0;
  animation: orbit-spin 18s linear infinite;
}

.orbit-ring.reverse {
  animation-direction: reverse;
  animation-duration: 26s;
  inset: 8%;
}

@keyframes orbit-spin {
  to { transform: rotate(360deg); }
}

.orbit-item {
  position: absolute;
  width: 58px;
  height: 58px;
  margin: -29px;
  animation: orb-counter 18s linear infinite;
  filter: drop-shadow(0 8px 12px rgba(0, 0, 0, 0.35));
}

.orbit-ring.reverse .orbit-item {
  animation-name: orb-counter-rev;
  animation-duration: 26s;
  width: 46px;
  height: 46px;
  margin: -23px;
}

.orbit-item:nth-child(1) { top: 0; left: 50%; }
.orbit-item:nth-child(2) { top: 50%; left: 100%; }
.orbit-item:nth-child(3) { top: 100%; left: 50%; }
.orbit-item:nth-child(4) { top: 50%; left: 0; }

@keyframes orb-counter {
  to { transform: rotate(-360deg); }
}

@keyframes orb-counter-rev {
  to { transform: rotate(360deg); }
}

.element-labels {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
  margin-top: 2.5rem;
  text-align: center;
}

.element-labels li {
  list-style: none;
  padding: 0.85rem 0.5rem;
  border-top: 1px solid var(--line);
  color: var(--fog);
  font-size: 0.9rem;
  letter-spacing: 0.08em;
  transition: color 0.3s, border-color 0.3s, transform 0.35s var(--ease-spring);
}

.element-labels li:hover {
  color: var(--snow);
  border-color: currentColor;
  transform: translateY(-4px);
}

.element-labels li[data-el="fire"] { color: var(--fire); }
.element-labels li[data-el="water"] { color: var(--water); }
.element-labels li[data-el="wood"] { color: var(--wood); }
.element-labels li[data-el="light"] { color: var(--light); }

.element-labels {
  margin: 2.5rem 0 0;
  padding: 0;
}

/* Worlds */
.worlds {
  background: var(--ink);
}

.world-rail {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 2.5rem;
}

.world-panel {
  position: relative;
  min-height: 320px;
  overflow: hidden;
  border-radius: 4px;
  isolation: isolate;
}

.world-panel img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.08);
  transition: transform 1.2s var(--ease-out);
}

.world-panel:hover img {
  transform: scale(1.16);
}

.world-panel::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 35%, rgba(7, 16, 28, 0.88) 100%);
  z-index: 1;
}

.world-caption {
  position: absolute;
  left: 1.1rem;
  right: 1.1rem;
  bottom: 1.1rem;
  z-index: 2;
}

.world-caption h3 {
  margin: 0 0 0.35rem;
  font-family: var(--font-display);
  font-size: 1.15rem;
  letter-spacing: 0.06em;
}

.world-caption p {
  margin: 0;
  color: var(--fog);
  font-size: 0.9rem;
  line-height: 1.6;
}

/* Gameplay strip */
.gameplay {
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(7, 16, 28, 0.55), rgba(7, 16, 28, 0.88)),
    url("../assets/section-bg.jpg") center / cover no-repeat;
  background-attachment: fixed;
}

.gameplay-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: clamp(1.5rem, 4vw, 3rem);
  align-items: center;
}

.feature-list {
  list-style: none;
  margin: 2rem 0 0;
  padding: 0;
  display: grid;
  gap: 1rem;
}

.feature-list li {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.9rem;
  align-items: start;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--line);
}

.feature-index {
  font-family: var(--font-en);
  color: var(--gold);
  font-size: 1.2rem;
  line-height: 1;
  padding-top: 0.2rem;
}

.feature-list h3 {
  margin: 0 0 0.3rem;
  font-size: 1.05rem;
  letter-spacing: 0.04em;
}

.feature-list p {
  margin: 0;
  color: var(--fog);
  line-height: 1.7;
  font-size: 0.95rem;
}

.gameplay-visual {
  position: relative;
  border-radius: 4px;
  overflow: hidden;
  min-height: 380px;
}

.gameplay-visual img {
  width: 100%;
  height: 100%;
  min-height: 380px;
  object-fit: cover;
  animation: slow-pan 16s ease-in-out infinite alternate;
}

@keyframes slow-pan {
  from { transform: scale(1.05) translate3d(0, 0, 0); }
  to { transform: scale(1.12) translate3d(-2%, -2%, 0); }
}

/* Closing CTA */
.download {
  text-align: center;
  background:
    radial-gradient(ellipse 70% 60% at 50% 30%, rgba(226, 179, 74, 0.12), transparent 65%),
    var(--ink-2);
}

.download .section-copy {
  margin-inline: auto;
}

.download .cta-group {
  justify-content: center;
  margin-top: 1.75rem;
}

.store-note {
  margin: 1rem 0 0;
  color: rgba(214, 230, 255, 0.55);
  font-size: 0.88rem;
}

/* ---------- Footer ---------- */
.site-footer {
  padding: 2.5rem clamp(1.25rem, 5vw, 3rem) 3rem;
  border-top: 1px solid var(--line);
  background: var(--ink);
}

.footer-inner {
  width: min(1100px, 100%);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 2rem;
  justify-content: space-between;
  align-items: end;
}

.footer-brand {
  font-family: var(--font-display);
  letter-spacing: 0.06em;
}

.footer-brand small {
  display: block;
  margin-top: 0.4rem;
  font-family: var(--font-body);
  color: var(--fog);
  font-size: 0.85rem;
  font-weight: 400;
  letter-spacing: 0;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 1.5rem;
  color: var(--fog);
  font-size: 0.9rem;
}

.footer-links a:hover {
  color: var(--ice);
}

/* ---------- Subpages ---------- */
.page-hero {
  position: relative;
  padding: 8rem clamp(1.25rem, 5vw, 3rem) 3rem;
  overflow: hidden;
}

.page-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(7, 16, 28, 0.55), var(--ink)),
    url("../assets/section-bg.jpg") center / cover no-repeat;
  animation: hero-kenburns 24s ease-in-out infinite alternate;
  z-index: -1;
}

.page-hero h1 {
  margin: 0 0 0.75rem;
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3rem);
  letter-spacing: 0.06em;
  animation: rise-in 0.8s var(--ease-out) both;
}

.page-hero p {
  margin: 0;
  max-width: 36rem;
  color: var(--fog);
  line-height: 1.8;
  animation: rise-in 0.8s var(--ease-out) 0.15s both;
}

.content-wrap {
  width: min(820px, 100%);
  margin: 0 auto;
  padding: 0 clamp(1.25rem, 5vw, 3rem) 5rem;
}

.legal-body {
  color: var(--fog);
  line-height: 1.9;
  font-size: 0.98rem;
}

.legal-body h2 {
  margin: 2.2rem 0 0.7rem;
  color: var(--snow);
  font-family: var(--font-display);
  font-size: 1.15rem;
  letter-spacing: 0.04em;
}

.legal-body p,
.legal-body li {
  margin: 0 0 0.85rem;
}

.legal-body ol {
  padding-left: 1.2rem;
}

.support-panel {
  margin-top: 1.5rem;
  padding: 1.5rem 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.support-panel h2 {
  margin: 0 0 0.6rem;
  font-family: var(--font-display);
  font-size: 1.2rem;
  letter-spacing: 0.04em;
}

.support-panel p {
  margin: 0 0 1rem;
  color: var(--fog);
  line-height: 1.8;
}

.mail-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--ice);
  border-bottom: 1px solid rgba(143, 208, 255, 0.4);
  padding-bottom: 0.15rem;
  transition: color 0.25s, border-color 0.25s, transform 0.3s var(--ease-spring);
}

.mail-link:hover {
  color: var(--gold-soft);
  border-color: var(--gold-soft);
  transform: translateX(4px);
}

.faq {
  margin-top: 2.5rem;
  display: grid;
  gap: 0.75rem;
}

.faq details {
  border-bottom: 1px solid var(--line);
  padding: 0.4rem 0 0.9rem;
}

.faq summary {
  cursor: pointer;
  list-style: none;
  font-weight: 700;
  letter-spacing: 0.03em;
  padding: 0.6rem 0;
  transition: color 0.25s;
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary::before {
  content: "+";
  display: inline-block;
  width: 1.4rem;
  color: var(--gold);
  transition: transform 0.3s var(--ease-spring);
}

.faq details[open] summary::before {
  transform: rotate(45deg);
}

.faq summary:hover {
  color: var(--ice);
}

.faq p {
  margin: 0.2rem 0 0.4rem;
  color: var(--fog);
  line-height: 1.8;
  animation: faq-open 0.35s var(--ease-out);
}

@keyframes faq-open {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

.config-warning {
  margin-top: 1rem;
  padding: 0.85rem 1rem;
  border-left: 3px solid var(--gold);
  background: rgba(226, 179, 74, 0.08);
  color: var(--gold-soft);
  font-size: 0.9rem;
  line-height: 1.6;
}

/* Cursor orb (desktop) */
.cursor-orb {
  position: fixed;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #fff, var(--ice) 45%, transparent 70%);
  pointer-events: none;
  z-index: 90;
  mix-blend-mode: screen;
  opacity: 0;
  transition: opacity 0.3s;
  transform: translate(-50%, -50%);
}

body.has-pointer .cursor-orb {
  opacity: 0.7;
}

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

  .reveal {
    opacity: 1;
    transform: none;
  }
}

/* Responsive */
@media (max-width: 900px) {
  .gameplay-grid,
  .world-rail {
    grid-template-columns: 1fr;
  }

  .hero-orb-stage {
    display: none;
  }

  .gameplay {
    background-attachment: scroll;
  }

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

@media (max-width: 640px) {
  .nav-links .nav-hide-sm {
    display: none;
  }

  .world-panel {
    min-height: 240px;
  }
}
