@font-face {
  font-family: "Riffic";
  src: url("./assets/fonts/RifficFree-Bold.ttf") format("truetype");
  font-display: swap;
}

@font-face {
  font-family: "Aller";
  src: url("./assets/fonts/Aller_Rg.ttf") format("truetype");
  font-display: swap;
}

:root {
  --ink: #2f1b28;
  --muted: #8d6472;
  --paper: #fff6f8;
  --line: rgba(123, 69, 86, 0.2);
  --pink: #ff6f9f;
  --rose: #ffd5e2;
  --orange: #ffb15d;
  --cream: #fff5dc;
  --shadow: 0 28px 80px rgba(137, 47, 78, 0.2);
  --cursor-x: 50vw;
  --cursor-y: 50vh;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: #fffdfb;
}

body {
  position: relative;
  isolation: isolate;
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  font-family: "Aller", system-ui, sans-serif;
  background: #fffdfb url("./assets/ddlc/menu_bg.png") center top / 690px auto repeat;
  background-attachment: fixed;
  animation: bgDrift 38s linear infinite;
  overflow-x: hidden;
}

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

.cursor-orb {
  position: fixed;
  left: var(--cursor-x);
  top: var(--cursor-y);
  z-index: 30;
  width: 210px;
  height: 210px;
  border-radius: 50%;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, -50%);
  background:
    radial-gradient(circle, rgba(255, 255, 255, 0.74), rgba(255, 165, 204, 0.32) 38%, transparent 70%);
  filter: blur(7px);
  mix-blend-mode: screen;
  transition: opacity 180ms ease;
}

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

.pointer-spark {
  position: fixed;
  left: var(--spark-x);
  top: var(--spark-y);
  z-index: 31;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  pointer-events: none;
  background: rgba(255, 111, 159, 0.72);
  box-shadow: 0 0 16px rgba(255, 255, 255, 0.85);
  transform: translate(-50%, -50%) scale(0.8);
  animation: sparkFade 720ms ease-out forwards;
}

.paper-noise {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.1;
  background-image:
    repeating-linear-gradient(0deg, rgba(62, 22, 39, 0.11), rgba(62, 22, 39, 0.11) 1px, transparent 1px, transparent 5px),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.4), rgba(255, 255, 255, 0.4) 1px, transparent 1px, transparent 7px);
  mix-blend-mode: soft-light;
}

.aurora-layer {
  position: fixed;
  inset: -18%;
  z-index: 2;
  pointer-events: none;
  background:
    linear-gradient(115deg, rgba(255, 142, 190, 0.42), transparent 34%, rgba(255, 191, 105, 0.36) 66%, transparent),
    linear-gradient(180deg, rgba(255, 255, 255, 0.58), rgba(255, 219, 233, 0.22) 54%, rgba(255, 239, 208, 0.34));
  filter: blur(14px);
  mix-blend-mode: multiply;
  animation: auroraBreath 18s ease-in-out infinite alternate;
}

.menu-shell {
  position: relative;
  z-index: 8;
  width: min(1180px, calc(100% - 36px));
  margin: 0 auto;
  padding: 34px 0 44px;
}

.hero {
  position: relative;
  display: grid;
  min-height: calc(100vh - 170px);
  grid-template-columns: minmax(0, 0.9fr) minmax(360px, 1.1fr);
  gap: 42px;
  align-items: center;
}

.hero-copy {
  position: relative;
  z-index: 12;
}

.hero-copy::before {
  content: "";
  position: absolute;
  inset: -30px -26px -18px -30px;
  z-index: -1;
  pointer-events: none;
  background: linear-gradient(90deg, rgba(255, 253, 251, 0.78), rgba(255, 253, 251, 0.48) 64%, transparent);
  filter: blur(20px);
}

.chapter {
  margin: 0 0 16px;
  color: #da3f7b;
  font: 800 13px/1 "Aller", sans-serif;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

h1 {
  position: relative;
  z-index: 13;
  margin: 0;
  font-family: "Riffic", "Aller", system-ui, sans-serif;
  font-size: clamp(64px, 10vw, 154px);
  line-height: 0.84;
  letter-spacing: 0;
  text-shadow:
    3px 3px 0 rgba(255, 255, 255, 0.65),
    10px 16px 34px rgba(147, 48, 82, 0.2);
}

.tagline {
  max-width: 610px;
  margin: 30px 0 0;
  color: var(--muted);
  font-size: clamp(18px, 2.4vw, 25px);
  line-height: 1.8;
}

.menu-card {
  position: relative;
  z-index: 14;
  width: min(570px, 100%);
  margin-top: 42px;
  padding: 14px;
  border: 1px solid rgba(131, 75, 91, 0.22);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(255, 248, 239, 0.54)),
    rgba(255, 255, 255, 0.48);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.menu-link {
  position: relative;
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 16px;
  min-height: 84px;
  align-items: center;
  padding: 14px 18px;
  border-radius: 6px;
  overflow: hidden;
  transition: transform 180ms ease, background 180ms ease, color 180ms ease;
}

.menu-link + .menu-link {
  border-top: 1px dashed rgba(141, 100, 114, 0.24);
}

.menu-link::before {
  content: "";
  position: absolute;
  inset: 10px auto 10px 10px;
  width: 4px;
  border-radius: 999px;
  background: linear-gradient(var(--pink), var(--orange));
  opacity: 0;
  transform: translateX(-10px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.menu-link::after {
  content: "";
  position: absolute;
  inset: 8px;
  z-index: 0;
  pointer-events: none;
  border-radius: 5px;
  opacity: 0;
  background:
    linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.72), transparent),
    linear-gradient(180deg, rgba(255, 117, 162, 0.12), rgba(255, 183, 97, 0.08));
  transform: translateX(-36%);
}

.menu-link:hover {
  color: #271520;
  background: rgba(255, 221, 233, 0.7);
  transform: translateX(8px);
}

.menu-link:hover::before {
  opacity: 1;
  transform: translateX(0);
}

.menu-link.is-switching::after {
  animation: menuSwitch 360ms ease-out;
}

.menu-link > * {
  position: relative;
  z-index: 1;
}

.menu-index {
  color: #e84f86;
  font-family: "Riffic", sans-serif;
  font-size: 26px;
}

.menu-link strong {
  display: block;
  font-family: "Riffic", sans-serif;
  font-size: 34px;
  letter-spacing: 0;
}

.menu-link small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 15px;
}

.stage {
  position: relative;
  z-index: 6;
  min-height: 650px;
  isolation: isolate;
}

.stage::before {
  content: "";
  position: absolute;
  inset: 9% 0 5% 12%;
  z-index: 0;
  border: 1px solid rgba(255, 159, 194, 0.2);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.52), rgba(255, 239, 246, 0.24));
  box-shadow:
    0 30px 80px rgba(177, 79, 112, 0.15),
    inset 0 0 80px rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(2px);
  animation: stageGlow 9s ease-in-out infinite alternate;
}

.sayori-art {
  position: absolute;
  right: 7%;
  bottom: 0;
  z-index: 3;
  width: min(75vw, 500px);
  max-height: 92%;
  object-fit: contain;
  object-position: bottom right;
  filter: drop-shadow(0 34px 40px rgba(126, 55, 77, 0.24));
  animation: sayoriFloat 5s ease-in-out infinite;
}

.particle {
  position: absolute;
  z-index: 2;
  width: 56px;
  opacity: 0.72;
  animation: petalDrift 9s ease-in-out infinite;
}

.particle-a {
  right: 64%;
  top: 17%;
}

.particle-b {
  right: 15%;
  top: 10%;
  width: 42px;
  animation-delay: -3s;
}

.note-card {
  position: absolute;
  left: 0;
  bottom: 12%;
  z-index: 4;
  width: min(330px, 80vw);
  padding: 18px;
  border: 1px solid rgba(115, 67, 84, 0.22);
  border-radius: 8px;
  background: rgba(255, 252, 244, 0.72);
  box-shadow: 0 22px 68px rgba(123, 69, 86, 0.18);
  backdrop-filter: blur(14px);
  transform: rotate(-2deg);
}

.note-card span {
  color: #e84f86;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.note-card p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.console-strip {
  position: relative;
  z-index: 10;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.console-strip div {
  min-height: 92px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.48);
}

.console-strip span {
  display: block;
  color: #e84f86;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.console-strip strong {
  display: block;
  margin-top: 10px;
  font-size: 16px;
  line-height: 1.45;
}

@keyframes sayoriFloat {
  0%,
  100% {
    transform: translateY(0) rotate(0.5deg);
  }
  50% {
    transform: translateY(-12px) rotate(-1deg);
  }
}

@keyframes bgDrift {
  from {
    background-position: 0 0;
  }
  to {
    background-position: 690px 660px;
  }
}

@keyframes auroraBreath {
  0% {
    opacity: 0.78;
    transform: translate3d(-1%, -1%, 0) scale(1);
  }
  100% {
    opacity: 1;
    transform: translate3d(1%, 1%, 0) scale(1.035);
  }
}

@keyframes stageGlow {
  from {
    opacity: 0.62;
    transform: translate3d(0, 0, 0);
  }
  to {
    opacity: 0.9;
    transform: translate3d(-10px, 8px, 0);
  }
}

@keyframes sparkFade {
  0% {
    opacity: 0.92;
    transform: translate(-50%, -50%) scale(0.8);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -70%) scale(2.6);
  }
}

@keyframes petalDrift {
  0%,
  100% {
    transform: translate3d(0, 0, 0) rotate(0deg);
  }
  50% {
    transform: translate3d(16px, 30px, 0) rotate(18deg);
  }
}

@keyframes menuSwitch {
  0%,
  100% {
    opacity: 0;
    transform: translateX(-36%);
  }
  40% {
    opacity: 0.72;
  }
  70% {
    opacity: 0.18;
    transform: translateX(34%);
  }
}

@media (max-width: 900px) {
  .menu-shell {
    width: min(100% - 28px, 680px);
    padding-top: 22px;
  }

  .hero {
    min-height: auto;
    grid-template-columns: 1fr;
    gap: 28px;
  }

  h1 {
    font-size: clamp(46px, 16vw, 70px);
    line-height: 0.92;
  }

  .stage {
    min-height: 520px;
  }

  .stage::before {
    inset: 4% 0 3% 0;
  }

  .sayori-art {
    right: 0;
    width: min(94vw, 410px);
  }

  .note-card {
    left: 4px;
    bottom: 4%;
  }

  .console-strip {
    grid-template-columns: 1fr;
    margin-top: 22px;
  }
}

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

  body,
  .aurora-layer,
  .stage::before {
    animation: none !important;
  }
}
