@import url("https://fonts.googleapis.com/css2?family=DM+Mono:wght@400;500&family=Manrope:wght@400;600;700;800&display=swap");

:root {
  --paper: #f5ead5;
  --paper-light: #fff9ee;
  --ink: #102c4b;
  --blue: #1459d9;
  --coral: #f05b3f;
  --gold: #f2b735;
  --line: rgba(16, 44, 75, 0.2);
  --shadow: 0 28px 65px rgba(16, 44, 75, 0.18);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  background:
    radial-gradient(circle at 74% 14%, rgba(242, 183, 53, 0.24), transparent 18rem),
    linear-gradient(rgba(16, 44, 75, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(16, 44, 75, 0.035) 1px, transparent 1px),
    var(--paper);
  background-size: auto, 40px 40px, 40px 40px, auto;
  font-family: "Manrope", Arial, sans-serif;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  content: "";
  opacity: 0.38;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.82' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.18'/%3E%3C/svg%3E");
  mix-blend-mode: multiply;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 5px;
}

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

.topbar {
  display: flex;
  width: min(1200px, calc(100% - 48px));
  margin: 0 auto;
  padding: 30px 0 18px;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  gap: 11px;
  align-items: center;
  color: var(--ink);
  font-size: 0.84rem;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 39px;
  height: 39px;
  color: var(--paper-light);
  background: var(--ink);
  border-radius: 50%;
  place-items: center;
  font: 500 0.72rem "DM Mono", monospace;
  transform: rotate(-8deg);
}

.status {
  display: flex;
  gap: 9px;
  margin: 0;
  align-items: center;
  font: 500 0.7rem "DM Mono", monospace;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.status span {
  width: 9px;
  height: 9px;
  background: #28a76c;
  border: 2px solid var(--paper-light);
  border-radius: 50%;
  box-shadow: 0 0 0 1px #28a76c;
  animation: pulse 2s ease-in-out infinite;
}

.hero {
  display: grid;
  width: min(1200px, calc(100% - 48px));
  min-height: calc(100vh - 160px);
  margin: 0 auto;
  padding: 52px 0 34px;
  grid-template-columns: minmax(0, 0.92fr) minmax(420px, 0.78fr);
  gap: clamp(48px, 8vw, 112px);
  align-items: center;
}

.hero-copy {
  z-index: 2;
}

.eyebrow {
  display: flex;
  gap: 13px;
  margin: 0 0 30px;
  align-items: center;
  color: rgba(16, 44, 75, 0.72);
  font: 500 0.7rem "DM Mono", monospace;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.eyebrow span {
  color: var(--coral);
}

h1 {
  max-width: 690px;
  margin: 0;
  font-size: clamp(3.7rem, 7vw, 7.6rem);
  font-weight: 800;
  letter-spacing: -0.075em;
  line-height: 0.88;
}

h1 > span {
  display: block;
  color: var(--blue);
}

.accent {
  color: var(--coral);
}

.lede {
  max-width: 520px;
  margin: 33px 0 0;
  color: rgba(16, 44, 75, 0.78);
  font-size: clamp(1rem, 1.6vw, 1.25rem);
  line-height: 1.65;
}

.actions {
  display: flex;
  gap: 30px;
  margin-top: 37px;
  align-items: center;
}

.celebrate-button {
  display: inline-flex;
  min-height: 58px;
  padding: 0 7px 0 23px;
  gap: 22px;
  align-items: center;
  color: white;
  background: var(--ink);
  border: 0;
  border-radius: 999px;
  box-shadow: 0 10px 0 rgba(16, 44, 75, 0.1);
  cursor: pointer;
  font: 700 0.93rem "Manrope", sans-serif;
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.celebrate-button:hover {
  background: var(--blue);
  box-shadow: 0 6px 0 rgba(16, 44, 75, 0.1);
  transform: translateY(4px);
}

.celebrate-button:active {
  transform: translateY(7px);
}

.button-icon {
  display: grid;
  width: 44px;
  height: 44px;
  color: var(--ink);
  background: var(--gold);
  border-radius: 50%;
  place-items: center;
  transition: transform 400ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.celebrate-button:hover .button-icon {
  transform: rotate(135deg) scale(1.05);
}

.hint {
  margin: 0;
  color: rgba(16, 44, 75, 0.58);
  font: 500 0.74rem "DM Mono", monospace;
}

.hint span {
  display: inline-block;
  margin-right: 6px;
  color: var(--coral);
  font-size: 1.1rem;
  transform: rotate(-15deg);
}

.code-note {
  display: flex;
  width: fit-content;
  margin-top: 50px;
  padding: 15px 18px;
  gap: 7px;
  align-items: center;
  background: rgba(255, 249, 238, 0.58);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 8px 30px rgba(16, 44, 75, 0.06);
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.dot.coral { background: var(--coral); }
.dot.gold { background: var(--gold); }
.dot.blue { background: var(--blue); }

.code-note code {
  margin-left: 10px;
  font: 500 0.74rem "DM Mono", monospace;
}

.portrait-side {
  position: relative;
  display: grid;
  min-height: 650px;
  place-items: center;
}

.portrait-side::before {
  position: absolute;
  width: 92%;
  aspect-ratio: 1;
  content: "";
  background: var(--coral);
  border-radius: 49% 51% 63% 37% / 39% 36% 64% 61%;
  opacity: 0.1;
  animation: blob 12s ease-in-out infinite alternate;
}

.character {
  position: relative;
  z-index: 3;
  display: block;
  width: min(100%, 450px);
  padding: 0;
  background: none;
  border: 0;
  cursor: pointer;
  perspective: 1000px;
}

.portrait-frame {
  position: relative;
  display: block;
  overflow: hidden;
  aspect-ratio: 2 / 3;
  background: var(--paper-light);
  border: 3px solid var(--ink);
  border-radius: 46% 46% 28px 28px;
  box-shadow: var(--shadow), 14px 14px 0 var(--blue);
  transform-origin: 50% 90%;
  transition: transform 700ms cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 700ms ease;
}

.portrait-frame img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  user-select: none;
}

.character:hover .portrait-frame,
.character:focus-visible .portrait-frame,
.character.is-performing .portrait-frame {
  box-shadow: var(--shadow), 8px 10px 0 var(--blue);
  transform: rotateX(13deg) rotateZ(1.5deg) translateY(14px) scaleY(0.97);
}

.hat {
  position: absolute;
  z-index: 5;
  top: -4.5%;
  left: 50%;
  display: block;
  width: 33%;
  aspect-ratio: 1.35;
  pointer-events: none;
  filter: drop-shadow(0 12px 12px rgba(16, 44, 75, 0.25));
  transform: translateX(-50%) rotate(-4deg);
  transform-origin: 80% 85%;
  transition: transform 650ms cubic-bezier(0.2, 1.25, 0.2, 1);
}

.hat-top {
  position: absolute;
  top: 0;
  left: 21%;
  width: 58%;
  height: 78%;
  background: var(--ink);
  border: 3px solid #07192c;
  border-radius: 15% 15% 9% 9%;
}

.hat-band {
  position: absolute;
  z-index: 2;
  top: 53%;
  left: 20%;
  width: 60%;
  height: 18%;
  background: var(--coral);
  transform: rotate(-1deg);
}

.hat-brim {
  position: absolute;
  z-index: 3;
  bottom: 4%;
  left: 2%;
  width: 96%;
  height: 20%;
  background: var(--ink);
  border: 3px solid #07192c;
  border-radius: 50%;
}

.character:hover .hat,
.character:focus-visible .hat,
.character.is-performing .hat {
  transform: translate(-20%, -75%) rotate(24deg) scale(1.04);
}

.speech {
  position: absolute;
  z-index: 7;
  top: 11%;
  left: -15%;
  display: grid;
  min-width: 136px;
  padding: 13px 17px;
  color: var(--ink);
  background: var(--paper-light);
  border: 2px solid var(--ink);
  border-radius: 18px 18px 3px 18px;
  box-shadow: 5px 6px 0 var(--gold);
  opacity: 0;
  transform: translate(10px, 10px) rotate(-5deg) scale(0.82);
  transition: opacity 250ms ease, transform 450ms cubic-bezier(0.2, 1.4, 0.2, 1);
}

.speech strong {
  font-size: 1.05rem;
}

.speech small {
  margin-top: 2px;
  font: 500 0.65rem "DM Mono", monospace;
}

.character:hover .speech,
.character:focus-visible .speech,
.character.is-performing .speech {
  opacity: 1;
  transform: translate(0) rotate(-5deg) scale(1);
}

.tap-label {
  position: absolute;
  z-index: 6;
  right: -45px;
  bottom: 15%;
  display: grid;
  color: var(--ink);
  font: 500 0.65rem "DM Mono", monospace;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transform: rotate(-8deg);
}

.tap-label span:last-child {
  font-size: 1.65rem;
  animation: tap 1.5s ease-in-out infinite;
}

.caption {
  position: absolute;
  z-index: 6;
  right: -7%;
  bottom: 4%;
  display: flex;
  margin: 0;
  padding: 15px 18px;
  gap: 11px;
  align-items: center;
  background: var(--gold);
  border: 2px solid var(--ink);
  border-radius: 4px;
  box-shadow: 6px 7px 0 var(--ink);
  font-size: 0.82rem;
  font-weight: 800;
  line-height: 1.25;
  transform: rotate(3deg);
}

.caption > span:first-child {
  font-size: 1.6rem;
}

.orbit {
  position: absolute;
  z-index: 2;
  display: grid;
  width: 48px;
  height: 48px;
  color: var(--paper-light);
  background: var(--blue);
  border: 2px solid var(--ink);
  border-radius: 50%;
  box-shadow: 4px 5px 0 var(--ink);
  place-items: center;
  font-size: 1.3rem;
  animation: float 4s ease-in-out infinite;
}

.orbit-one {
  top: 5%;
  right: -2%;
}

.orbit-two {
  bottom: 19%;
  left: -6%;
  width: 40px;
  height: 40px;
  color: var(--ink);
  background: var(--gold);
  animation-delay: -1.3s;
}

.orbit-three {
  top: 35%;
  right: -9%;
  width: 35px;
  height: 35px;
  background: var(--coral);
  animation-delay: -2.1s;
}

footer {
  display: flex;
  width: min(1200px, calc(100% - 48px));
  margin: 0 auto;
  padding: 20px 0 30px;
  justify-content: space-between;
  border-top: 1px solid var(--line);
  font: 500 0.67rem "DM Mono", monospace;
  text-transform: uppercase;
}

footer p {
  margin: 0;
}

footer span {
  color: var(--coral);
}

@keyframes pulse {
  50% { transform: scale(0.65); opacity: 0.6; }
}

@keyframes float {
  50% { transform: translateY(-12px) rotate(8deg); }
}

@keyframes tap {
  50% { transform: translateY(-5px) rotate(-8deg); }
}

@keyframes blob {
  to {
    border-radius: 59% 41% 39% 61% / 58% 60% 40% 42%;
    transform: rotate(10deg) scale(1.04);
  }
}

@media (max-width: 980px) {
  .hero {
    padding-top: 44px;
    grid-template-columns: 1fr;
    gap: 60px;
  }

  .hero-copy {
    text-align: center;
  }

  .eyebrow,
  .actions {
    justify-content: center;
  }

  h1,
  .lede {
    margin-right: auto;
    margin-left: auto;
  }

  .code-note {
    margin-right: auto;
    margin-left: auto;
  }

  .portrait-side {
    width: min(100%, 570px);
    margin: 0 auto;
  }
}

@media (max-width: 620px) {
  .topbar,
  .hero,
  footer {
    width: min(100% - 30px, 1200px);
  }

  .topbar {
    padding-top: 18px;
  }

  .status {
    display: none;
  }

  .hero {
    min-height: 0;
    padding-top: 36px;
    gap: 42px;
  }

  .eyebrow {
    margin-bottom: 23px;
    font-size: 0.6rem;
  }

  h1 {
    font-size: clamp(3.25rem, 16.5vw, 5rem);
  }

  .lede {
    margin-top: 24px;
    font-size: 0.98rem;
  }

  .actions {
    flex-direction: column;
    gap: 17px;
    margin-top: 29px;
  }

  .code-note {
    margin-top: 32px;
    padding: 12px 13px;
  }

  .code-note code {
    font-size: 0.62rem;
  }

  .portrait-side {
    min-height: 560px;
  }

  .character {
    width: min(88vw, 370px);
  }

  .portrait-frame {
    box-shadow: var(--shadow), 9px 10px 0 var(--blue);
  }

  .speech {
    top: 7%;
    left: -2%;
    min-width: 115px;
    padding: 10px 12px;
  }

  .caption {
    right: 0;
    bottom: -1%;
    font-size: 0.7rem;
  }

  .tap-label,
  .orbit-three {
    display: none;
  }

  .orbit-one {
    right: 0;
  }

  .orbit-two {
    left: 0;
  }

  footer {
    gap: 20px;
    line-height: 1.45;
  }
}

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