:root {
  --ink: #17223b;
  --muted: #5d6981;
  --paper: #fffaf0;
  --sun: #ffd166;
  --leaf: #2f8c67;
  --berry: #c84c5d;
  --blue: #204c85;
  --sky: #cbe7f7;
  --night: #101a31;
  --line: rgba(23, 34, 59, 0.16);
  --shadow: 0 22px 60px rgba(25, 31, 54, 0.18);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scrollbar-gutter: stable;
}

body {
  position: relative;
  margin: 0;
  min-height: 100vh;
  font-family: ui-rounded, "Avenir Next", "Segoe UI", system-ui, sans-serif;
  color: var(--ink);
  background: #f8fbff;
  overflow-x: hidden;
}

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

body::before {
  z-index: -2;
  background: url("image.png") center / cover no-repeat;
  filter: blur(30px) saturate(1.08);
  transform: scale(1.1);
}

body::after {
  z-index: -1;
  background:
    radial-gradient(circle at 18% 25%, rgba(255, 209, 102, 0.14), transparent 26rem),
    radial-gradient(circle at 58% 14%, rgba(23, 34, 59, 0.46), transparent 28rem),
    linear-gradient(135deg, rgba(248, 251, 255, 0.48) 0%, rgba(255, 250, 240, 0.34) 48%, rgba(231, 245, 236, 0.44) 100%),
    rgba(23, 34, 59, 0.34);
}

button,
a {
  font: inherit;
}

button {
  cursor: pointer;
}

#sky {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 3;
}

.hero {
  position: relative;
  z-index: 1;
  width: min(100%, 92rem);
  margin: 0 auto;
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(20rem, 0.95fr) minmax(20rem, 1.05fr);
  align-items: center;
  gap: clamp(1.5rem, 5vw, 5rem);
  padding: clamp(3rem, 8vh, 6rem) clamp(1.25rem, 4vw, 4rem);
}

.hero::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 8rem;
  background: linear-gradient(transparent, rgba(47, 140, 103, 0.13));
  pointer-events: none;
}

.hero-copy {
  justify-self: start;
  max-width: 41rem;
}

.kicker {
  margin: 0 0 0.8rem;
  color: var(--berry);
  font-size: 0.82rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  margin: 0;
  color: var(--blue);
  font-size: clamp(4rem, 12vw, 10rem);
  line-height: 0.86;
  letter-spacing: 0;
}

h2 {
  margin: 0;
  font-size: clamp(2.15rem, 5vw, 4.75rem);
  line-height: 0.95;
  letter-spacing: 0;
}

h3 {
  margin: 1rem 0 0.5rem;
  font-size: 1.35rem;
}

.intro {
  max-width: 34rem;
  margin: 1.4rem 0 0;
  color: #3f4b63;
  font-size: clamp(1.18rem, 2vw, 1.5rem);
  line-height: 1.45;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 2rem;
  flex-wrap: wrap;
}

.primary-action,
.music-action {
  min-height: 3rem;
  border: 0;
  color: white;
  background: var(--blue);
  box-shadow: 0 12px 30px rgba(32, 76, 133, 0.28);
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.primary-action {
  padding: 0 1.3rem;
  border-radius: 999px;
  font-weight: 900;
  white-space: nowrap;
}

.music-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-width: 8.6rem;
  padding: 0 1rem;
  border-radius: 999px;
  font-weight: 900;
}

.music-action span:first-child {
  font-size: 1.25rem;
  line-height: 1;
}

.music-action.active {
  background: var(--leaf);
  box-shadow: 0 12px 30px rgba(47, 140, 103, 0.3);
}

.primary-action:hover,
.music-action:hover {
  transform: translateY(-2px);
  background: #183c6d;
  box-shadow: 0 18px 36px rgba(32, 76, 133, 0.32);
}

.music-action.active:hover {
  background: #267555;
}

.music-box {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.85rem;
  align-items: center;
  width: min(100%, 28rem);
  max-height: 0;
  margin-top: 0;
  padding: 0 0.8rem;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-0.45rem) scale(0.98);
  border: 0 solid rgba(255, 255, 255, 0.72);
  border-radius: 8px;
  background: rgba(255, 250, 240, 0.58);
  box-shadow: 0 14px 30px rgba(25, 31, 54, 0.08);
  backdrop-filter: blur(14px);
  transition:
    max-height 420ms ease,
    margin-top 260ms ease,
    padding 260ms ease,
    opacity 220ms ease,
    transform 320ms ease,
    border-width 260ms ease;
}

.music-box.open {
  max-height: 34rem;
  margin-top: 1rem;
  padding: 0.8rem;
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
  border-width: 1px;
}

.music-top {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.play-toggle {
  display: inline-grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  border: 0;
  border-radius: 50%;
  color: white;
  background: var(--blue);
  box-shadow: 0 10px 24px rgba(32, 76, 133, 0.22);
  font-size: 1rem;
  line-height: 1;
}

.play-toggle.active {
  background: var(--leaf);
}

.music-bars {
  display: grid;
  grid-template-columns: repeat(4, 0.42rem);
  align-items: end;
  gap: 0.22rem;
  height: 2.5rem;
  padding: 0.45rem;
  border-radius: 8px;
  background: rgba(32, 76, 133, 0.1);
}

.music-bars span {
  display: block;
  height: 28%;
  border-radius: 999px;
  background: var(--blue);
  opacity: 0.55;
  transition: height 180ms ease, opacity 180ms ease, background 180ms ease;
}

.music-box.playing .music-bars span {
  opacity: 1;
  background: var(--leaf);
  animation: music-bounce 720ms ease-in-out infinite;
}

.music-box.playing .music-bars span:nth-child(2) {
  animation-delay: 120ms;
}

.music-box.playing .music-bars span:nth-child(3) {
  animation-delay: 240ms;
}

.music-box.playing .music-bars span:nth-child(4) {
  animation-delay: 360ms;
}

.music-modes {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.35rem;
}

.mode-button {
  min-height: 2rem;
  padding: 0 0.55rem;
  border: 1px solid rgba(32, 76, 133, 0.18);
  border-radius: 999px;
  color: var(--blue);
  background: rgba(255, 255, 255, 0.62);
  font-size: 0.82rem;
  font-weight: 900;
}

.mode-button.active {
  color: white;
  background: var(--blue);
  border-color: var(--blue);
}

.tempo-control {
  grid-column: 2;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.7rem;
  align-items: center;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 900;
}

.tempo-control input {
  width: 100%;
  accent-color: var(--blue);
}

.note-pads,
.composer-controls {
  grid-column: 1 / -1;
  display: grid;
  gap: 0.35rem;
}

.note-pads {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.composer-controls {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.note-pads button,
.composer-controls button {
  min-height: 2.35rem;
  border: 1px solid rgba(32, 76, 133, 0.18);
  border-radius: 8px;
  color: var(--blue);
  background: rgba(255, 255, 255, 0.66);
  font-size: 0.84rem;
  font-weight: 900;
  transition: transform 140ms ease, background 140ms ease, color 140ms ease;
}

.note-pads button:hover,
.note-pads button.active,
.composer-controls button:hover,
.composer-controls button.active {
  color: white;
  background: var(--leaf);
  transform: translateY(-1px);
}

.song-status {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  line-height: 1.35;
}

@keyframes music-bounce {
  0%,
  100% {
    height: 24%;
  }
  45% {
    height: 92%;
  }
}

.portrait-stage {
  position: relative;
  margin: 0;
  justify-self: center;
  width: min(100%, 34rem);
  transform: rotate(1.5deg);
}

.portrait-stage img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1122 / 1402;
  object-fit: cover;
  border: 10px solid rgba(255, 255, 255, 0.9);
  border-radius: 1.4rem;
  box-shadow: var(--shadow);
}

.portrait-stage::before {
  content: "";
  position: absolute;
  inset: -1.1rem;
  z-index: -1;
  border: 2px dashed rgba(47, 140, 103, 0.45);
  border-radius: 2rem;
  transform: rotate(-3deg);
}

figcaption {
  position: absolute;
  right: 1.1rem;
  bottom: 1.1rem;
  max-width: calc(100% - 2.2rem);
  padding: 0.6rem 0.85rem;
  color: var(--ink);
  background: rgba(255, 250, 240, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 999px;
  font-size: 0.86rem;
  font-weight: 900;
  backdrop-filter: blur(12px);
}

.easter-egg {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 8;
  width: min(22rem, calc(100vw - 2rem));
  padding: 1.1rem 3rem 1.1rem 1.1rem;
  color: white;
  background: var(--night);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  box-shadow: 0 20px 60px rgba(16, 26, 49, 0.38);
  transform: translateY(calc(100% + 2rem));
  transition: transform 260ms ease;
}

.easter-egg.visible {
  transform: translateY(0);
}

.easter-egg button {
  position: absolute;
  top: 0.55rem;
  right: 0.55rem;
  width: 2rem;
  height: 2rem;
  border: 0;
  border-radius: 50%;
  color: white;
  background: rgba(255, 255, 255, 0.14);
  font-size: 1.2rem;
}

.easter-egg p {
  margin: 0;
  line-height: 1.45;
}

.egg-label {
  color: var(--sun);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.firefly {
  position: fixed;
  z-index: 4;
  width: 0.7rem;
  height: 0.7rem;
  pointer-events: none;
  border-radius: 50%;
  background: var(--sun);
  box-shadow: 0 0 18px 6px rgba(255, 209, 102, 0.72);
  animation: float-away 1500ms ease-out forwards;
}

.shooting-wish,
.wish-sparkle {
  position: fixed;
  z-index: 4;
  pointer-events: none;
  border-radius: 50%;
  background: var(--sun);
}

.shooting-wish {
  width: 2rem;
  height: 2rem;
  box-shadow: 0 0 34px 14px rgba(255, 209, 102, 0.78);
  animation: shoot-wish 2600ms cubic-bezier(0.18, 0.72, 0.08, 1) forwards;
}

.shooting-wish::after {
  content: "";
  position: absolute;
  right: 50%;
  top: 50%;
  width: 8.5rem;
  height: 0.34rem;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, rgba(255, 209, 102, 0.88));
  transform: translateY(-50%) rotate(-18deg);
  transform-origin: right center;
}

.wish-sparkle {
  width: 0.8rem;
  height: 0.8rem;
  box-shadow: 0 0 26px 9px rgba(255, 209, 102, 0.68);
  opacity: 0;
  animation: wish-burst 1900ms ease-out forwards;
}

@keyframes float-away {
  from {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.3);
  }
  18% {
    opacity: 1;
  }
  to {
    opacity: 0;
    transform: translate(calc(-50% + var(--dx)), calc(-50% - 8rem)) scale(1.15);
  }
}

@keyframes shoot-wish {
  from {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.4);
  }
  15% {
    opacity: 1;
  }
  to {
    opacity: 0;
    transform: translate(calc(-50% + var(--tx)), calc(-50% + var(--ty))) scale(1.1);
  }
}

@keyframes wish-burst {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.2);
  }
  25% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(1.2);
  }
}

@media (max-width: 820px) {
  .hero {
    grid-template-columns: 1fr;
    min-height: auto;
    padding-top: clamp(2rem, 7vw, 3.5rem);
    text-align: center;
  }

  .hero-copy {
    justify-self: center;
  }

  .hero-actions {
    justify-content: center;
  }

  .music-box {
    margin-inline: auto;
    text-align: left;
  }

  .portrait-stage {
    width: min(100%, 28rem);
    transform: none;
  }
}

@media (max-width: 520px) {
  h1 {
    font-size: clamp(3.5rem, 22vw, 5.4rem);
  }

  .hero-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: stretch;
    gap: 0.75rem;
  }

  .primary-action {
    width: 100%;
    min-width: 0;
    padding-inline: 0.8rem;
  }

  .music-action {
    width: 100%;
    min-width: 0;
    padding-inline: 0.8rem;
  }

  figcaption {
    position: static;
    margin-top: 0.75rem;
    border-radius: 8px;
  }

  .music-box {
    grid-template-columns: 1fr;
  }

  .music-top {
    justify-content: center;
  }

  .music-bars {
    grid-template-columns: repeat(4, 0.5rem);
    justify-self: center;
    width: auto;
  }

  .tempo-control {
    grid-column: auto;
  }

  .note-pads {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

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