:root {
  --bg: #fff9f3;
  --bg-soft: #fff4ea;
  --panel: rgba(255, 255, 255, 0.72);
  --panel-strong: rgba(255, 255, 255, 0.9);
  --stroke: rgba(126, 92, 255, 0.14);
  --text: #24163f;
  --muted: #6d6386;
  --shadow: 0 28px 70px rgba(143, 112, 255, 0.12);
  --radius-xl: 34px;
  --radius-lg: 26px;
  --radius-md: 18px;
  --container: min(1180px, calc(100vw - 48px));
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Inter", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 12% 8%, rgba(255, 179, 210, 0.7), transparent 22%),
    radial-gradient(circle at 88% 14%, rgba(138, 229, 255, 0.7), transparent 22%),
    radial-gradient(circle at 75% 70%, rgba(255, 214, 126, 0.45), transparent 22%),
    linear-gradient(180deg, #fffdf9 0%, #fff8ef 42%, #fffdf9 100%);
  overflow-x: hidden;
}

.page-noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.12)),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180' viewBox='0 0 180 180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='1.1' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)' opacity='0.2'/%3E%3C/svg%3E");
  opacity: 0.09;
  mix-blend-mode: multiply;
  z-index: -4;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
a,
input,
textarea {
  font: inherit;
}

.progress-line {
  position: fixed;
  top: 0;
  left: 0;
  height: 4px;
  width: 0;
  background: linear-gradient(90deg, #ff7cbf, #8c79ff, #48d8ff, #ffba53);
  z-index: 60;
}

.site-shell {
  position: relative;
  isolation: isolate;
}

.floating-bubbles {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -2;
}

.bubble {
  position: absolute;
  border-radius: 999px;
  filter: blur(1px);
  opacity: 0.65;
  animation: bob 9s ease-in-out infinite;
}

.topbar,
main {
  width: var(--container);
  margin: 0 auto;
}

.topbar {
  position: sticky;
  top: 18px;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 16px 24px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  width: 46px;
  aspect-ratio: 1;
  border-radius: 16px;
  display: grid;
  place-items: center;
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700;
  background: linear-gradient(135deg, #ff89c7, #7fe0ff);
  color: #2a1640;
}

.brand-copy {
  display: grid;
  gap: 2px;
}

.brand-copy strong,
.nav a,
.button,
.section-tag,
.filter-chip,
.work-badge,
.mini-label,
.stat-label {
  letter-spacing: 0.02em;
}

.brand-copy small,
.hero-text,
.section-copy,
.service-copy,
.story-card p:not(.story-lead),
.timeline-copy,
.contact-links a,
.mini-list a {
  color: var(--muted);
}

.nav {
  display: flex;
  align-items: center;
  gap: 22px;
}

.nav a {
  font-size: 0.95rem;
  transition: color 160ms ease;
}

.nav a:hover {
  color: #7e5cff;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 20px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-weight: 700;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.button:hover {
  transform: translateY(-2px);
}

.button,
.filter-chip.active {
  background: linear-gradient(135deg, #8c79ff, #4ad7ff);
  color: #ffffff;
  box-shadow: 0 18px 35px rgba(111, 124, 255, 0.22);
}

.button-soft {
  background: linear-gradient(135deg, #ff94cb, #ffbd70);
  color: #41274f;
}

.button-ghost,
.filter-chip {
  background: rgba(255, 255, 255, 0.68);
  color: var(--text);
  border-color: rgba(111, 93, 170, 0.12);
}

main {
  padding: 42px 0 72px;
}

.hero {
  min-height: calc(100vh - 110px);
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 32px;
  align-items: center;
  padding: 52px 0 20px;
}

.eyebrow,
.section-tag,
.mini-label,
.work-badge,
.stat-label {
  text-transform: uppercase;
  font-size: 0.74rem;
  font-weight: 700;
}

.eyebrow {
  display: inline-flex;
  padding: 10px 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow);
}

h1,
h2,
.service-title,
.work-title {
  font-family: "Space Grotesk", sans-serif;
  margin: 0;
}

h1 {
  margin-top: 20px;
  max-width: 10ch;
  font-size: clamp(3.2rem, 9vw, 6.5rem);
  line-height: 0.94;
}

.hero-text {
  max-width: 52ch;
  margin: 22px 0 0;
  font-size: 1.05rem;
  line-height: 1.75;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 28px;
}

.hero-stats {
  margin: 30px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.stat-card,
.hero-visual,
.mini-panel,
.work-card,
.service-card,
.story-card,
.info-card,
.contact-card {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-xl);
  background: var(--panel);
  border: 1px solid rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
}

.stat-card {
  padding: 20px 18px;
}

.stat-value {
  display: block;
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.75rem;
  line-height: 1;
  margin-bottom: 8px;
}

.stat-label {
  color: var(--muted);
}

.hero-visual {
  min-height: 620px;
  padding: 22px;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 18px;
  align-items: stretch;
  transform-style: preserve-3d;
}

.photo-stage {
  grid-row: 1 / -1;
}

.photo-stage {
  position: relative;
  min-height: 100%;
  border-radius: 30px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.86), rgba(255, 255, 255, 0.52)),
    linear-gradient(145deg, #ffdde9, #dff8ff 58%, #fff1cf);
  border: 1px solid rgba(255, 255, 255, 0.9);
  overflow: hidden;
}

.photo-stage::before,
.photo-stage::after {
  content: "";
  position: absolute;
  border-radius: 999px;
}

.photo-stage::before {
  width: 300px;
  height: 300px;
  right: -80px;
  top: -70px;
  background: rgba(140, 121, 255, 0.18);
}

.photo-stage::after {
  width: 250px;
  height: 250px;
  left: -70px;
  bottom: -80px;
  background: rgba(255, 137, 199, 0.2);
}

.hero-photo {
  width: 100%;
  height: 100%;
  min-height: 500px;
  object-fit: cover;
  display: block;
}

.photo-ring {
  position: absolute;
  inset: auto;
  border-radius: 999px;
  border: 1px dashed rgba(122, 102, 210, 0.35);
  animation: spinSlow 18s linear infinite;
}

.photo-ring-one {
  width: 120px;
  height: 120px;
  top: 28px;
  right: 24px;
}

.photo-ring-two {
  width: 160px;
  height: 160px;
  bottom: 36px;
  left: 20px;
  animation-direction: reverse;
}

.floating-tag {
  position: absolute;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid rgba(255, 255, 255, 0.95);
  font-size: 0.78rem;
  font-weight: 700;
  box-shadow: 0 14px 30px rgba(111, 91, 170, 0.12);
  animation: bob 7s ease-in-out infinite;
}

.floating-tag-one {
  top: 26px;
  left: 22px;
}

.floating-tag-two {
  right: 18px;
  bottom: 120px;
  animation-delay: -2s;
}

.floating-tag-three {
  bottom: 24px;
  left: 42px;
  animation-delay: -4s;
}

.mini-panel {
  padding: 18px;
}

.behance-panel {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.mini-list {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.mini-list a {
  padding: 12px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.86);
  font-size: 0.92rem;
  line-height: 1.45;
}

.tag-panel {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 100%;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0.72)),
    linear-gradient(135deg, rgba(255, 143, 184, 0.18), rgba(127, 224, 255, 0.22), rgba(255, 214, 126, 0.18));
}

.tag-panel::before,
.tag-panel::after {
  content: "";
  position: absolute;
  border-radius: 999px;
  pointer-events: none;
}

.tag-panel::before {
  width: 180px;
  height: 180px;
  top: -50px;
  right: -40px;
  background: rgba(154, 124, 255, 0.16);
}

.tag-panel::after {
  width: 140px;
  height: 140px;
  bottom: -40px;
  left: -20px;
  background: rgba(255, 198, 112, 0.2);
}

.tag-panel-copy {
  position: relative;
  z-index: 1;
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.65;
  font-size: 0.92rem;
}

.tag-cloud,
.tool-pills {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 18px;
}

.hero-skill-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 16px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--tag-a), var(--tag-b));
  color: #ffffff;
  font-size: 0.86rem;
  font-weight: 700;
  box-shadow: 0 12px 24px rgba(111, 91, 170, 0.16);
  animation: tagPop 700ms ease both;
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.hero-skill-tag:hover {
  transform: translateY(-3px) scale(1.03);
  box-shadow: 0 16px 30px rgba(111, 91, 170, 0.22);
}

.tool-pills span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.9);
  font-size: 0.84rem;
  font-weight: 600;
}

.marquee-strip {
  margin: 20px 0 10px;
  padding: 14px 0;
  border-top: 1px solid rgba(111, 93, 170, 0.12);
  border-bottom: 1px solid rgba(111, 93, 170, 0.12);
  overflow: hidden;
}

.marquee-track {
  display: flex;
  gap: 18px;
  width: max-content;
  animation: marquee 22s linear infinite;
}

.marquee-item {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.88);
  font-weight: 700;
}

.marquee-item::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(135deg, #ff7dbd, #53d7ff);
}

.section {
  padding-top: 52px;
}

.section-head {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 18px;
  align-items: end;
  margin-bottom: 22px;
}

.section-tag {
  display: inline-flex;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.86);
}

h2 {
  margin-top: 12px;
  font-size: clamp(2rem, 5vw, 3.8rem);
  line-height: 0.98;
}

.section-copy {
  max-width: 30ch;
  line-height: 1.75;
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
}

.filter-chip {
  min-height: 42px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid rgba(111, 93, 170, 0.12);
  cursor: pointer;
  font-weight: 700;
  transition: transform 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.filter-chip:hover {
  transform: translateY(-2px);
}

.works-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 18px;
}

.work-card {
  grid-column: span 4;
  min-height: 360px;
  transition: transform 200ms ease, box-shadow 200ms ease;
  transform-style: preserve-3d;
}

.work-card:hover {
  box-shadow: 0 30px 55px rgba(109, 84, 180, 0.18);
}

.work-card.size-wide {
  grid-column: span 8;
}

.work-card.size-tall .work-media {
  min-height: 420px;
}

.work-card a {
  display: grid;
  height: 100%;
}

.work-media {
  position: relative;
  min-height: 300px;
  overflow: hidden;
}

.work-media img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  transition: transform 500ms ease;
}

.work-card:hover .work-media img {
  transform: scale(1.05);
}

.work-info {
  padding: 18px 20px 20px;
  display: grid;
  gap: 12px;
}

.work-topline,
.work-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.work-badge {
  display: inline-flex;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.96);
}

.work-title {
  font-size: 1.35rem;
  line-height: 1.08;
}

.work-copy {
  color: var(--muted);
  line-height: 1.65;
}

.work-meta {
  font-size: 0.88rem;
  color: var(--muted);
}

.service-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}

.service-card {
  padding: 22px;
  min-height: 210px;
  display: grid;
  align-content: start;
  gap: 18px;
}

.service-icon {
  width: 58px;
  height: 58px;
  border-radius: 20px;
  display: grid;
  place-items: center;
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  color: #ffffff;
}

.service-title {
  font-size: 1.18rem;
}

.service-copy {
  line-height: 1.65;
}

.story-grid {
  display: grid;
  grid-template-columns: 1fr 0.92fr;
  gap: 18px;
}

.story-card,
.info-card,
.contact-card {
  padding: 26px;
}

.story-lead {
  margin: 18px 0 0;
  font-size: 1.08rem;
  line-height: 1.75;
  color: var(--text);
}

.story-card p:not(.story-lead) {
  margin-top: 16px;
  line-height: 1.8;
  color: var(--muted);
}

.stack-column {
  display: grid;
  gap: 18px;
}

.timeline {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.timeline-item {
  padding: 16px 18px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.88);
}

.timeline-period {
  display: inline-flex;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(140, 121, 255, 0.12);
  color: #5a46b4;
  font-size: 0.76rem;
  font-weight: 700;
}

.timeline-title {
  margin-top: 10px;
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.02rem;
}

.timeline-copy {
  margin-top: 8px;
  line-height: 1.65;
}

.accent-card {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.78), rgba(255, 240, 219, 0.9));
}

.contact-card {
  display: grid;
  grid-template-columns: 1fr 0.95fr;
  gap: 20px;
  align-items: center;
}

.contact-links {
  display: grid;
  gap: 12px;
}

.contact-links a {
  display: block;
  padding: 16px 18px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.9);
  transition: transform 160ms ease, border-color 160ms ease;
}

.contact-links a:hover {
  transform: translateX(4px);
  border-color: rgba(126, 92, 255, 0.24);
}

.project-page main {
  padding-top: 28px;
}

.project-hero {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 22px;
  align-items: center;
  padding: 28px 0 10px;
}

.project-copy,
.project-cover,
.gallery-card,
.related-card {
  border-radius: var(--radius-xl);
  background: var(--panel);
  border: 1px solid rgba(255, 255, 255, 0.84);
  box-shadow: var(--shadow);
}

.project-copy,
.project-cover {
  padding: 24px;
}

.back-link {
  display: inline-flex;
  margin-bottom: 14px;
  color: #7e5cff;
  font-weight: 700;
}

.project-lead {
  max-width: 56ch;
  margin: 18px 0 0;
  color: var(--muted);
  line-height: 1.75;
}

.project-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

.meta-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.76);
  border: 1px solid rgba(255, 255, 255, 0.9);
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 700;
}

.project-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}

.project-cover {
  overflow: hidden;
}

.project-cover img,
.project-cover-video,
.gallery-card video {
  width: 100%;
  display: block;
  border-radius: 24px;
  background: #111;
}

.project-cover-video,
.gallery-card video {
  height: auto;
  max-height: 72vh;
}

.project-cover img {
  min-height: 520px;
  object-fit: cover;
}

.project-gallery,
.related-grid {
  display: grid;
  gap: 18px;
}

.project-gallery {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.project-gallery.is-stacked {
  grid-template-columns: 1fr;
  max-width: 920px;
  margin: 0 auto;
}

.gallery-card {
  overflow: hidden;
  transition: transform 180ms ease, box-shadow 180ms ease;
  margin: 0;
}

.project-gallery.is-stacked .gallery-card img {
  width: 100%;
  height: auto;
  min-height: 0;
  object-fit: contain;
  background: rgba(255, 255, 255, 0.72);
}

.gallery-card:hover,
.related-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 30px 55px rgba(109, 84, 180, 0.18);
}

.gallery-card img,
.related-card img {
  width: 100%;
  display: block;
  object-fit: cover;
}

.project-gallery.is-stacked .gallery-card img {
  object-fit: contain;
}

.gallery-card img {
  min-height: 280px;
}

.related-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.related-card {
  overflow: hidden;
}

.related-card img {
  min-height: 220px;
}

.related-copy {
  padding: 16px 18px 20px;
}

.related-copy h3 {
  margin: 12px 0 0;
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.08rem;
  line-height: 1.2;
}

.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 650ms ease, transform 650ms ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

@keyframes tagPop {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes bob {
  0%,
  100% {
    transform: translate3d(0, 0, 0);
  }
  50% {
    transform: translate3d(0, -14px, 0);
  }
}

@keyframes spinSlow {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

@keyframes marquee {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-50%);
  }
}

@media (max-width: 1120px) {
  .hero,
  .story-grid,
  .contact-card,
  .section-head,
  .project-hero {
    grid-template-columns: 1fr;
  }

  .hero-visual {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .photo-stage {
    grid-row: auto;
  }

  .service-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .work-card,
  .work-card.size-wide {
    grid-column: span 6;
  }

  .related-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 860px) {
  .topbar {
    top: 10px;
    flex-wrap: wrap;
    justify-content: center;
    border-radius: 28px;
  }

  .nav {
    flex-wrap: wrap;
    justify-content: center;
  }

  .hero {
    min-height: auto;
    padding-top: 24px;
  }

  .hero-stats,
  .service-grid {
    grid-template-columns: 1fr;
  }

  .works-grid {
    grid-template-columns: 1fr;
  }

  .project-gallery {
    grid-template-columns: 1fr;
  }

  .work-card,
  .work-card.size-wide {
    grid-column: auto;
  }
}

@media (max-width: 560px) {
  :root {
    --container: min(100vw - 24px, 1180px);
  }

  h1 {
    font-size: clamp(2.7rem, 15vw, 4.2rem);
  }

  h2 {
    font-size: clamp(1.8rem, 10vw, 2.8rem);
  }

  .topbar,
  .story-card,
  .info-card,
  .contact-card,
  .work-card,
  .service-card,
  .hero-visual,
  .stat-card {
    border-radius: 24px;
  }

  .photo-stage {
    min-height: 420px;
  }

  .hero-photo {
    min-height: 420px;
  }
}

/* Gift box intro */
html.gift-disabled .gift-overlay,
html.gift-disabled .gift-replay-btn {
  display: none !important;
}

html.gift-skip .gift-overlay {
  display: none;
}

html.gift-skip.gift-replaying .gift-overlay {
  display: grid;
}

html.gift-skip.gift-replaying .gift-replay-btn {
  display: none;
}

html:not(.gift-skip) body {
  overflow: hidden;
}

body.gift-locked {
  overflow: hidden;
}

.gift-overlay {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: grid;
  place-items: center;
  overflow: hidden;
  background:
    radial-gradient(circle at 20% 18%, rgba(255, 143, 184, 0.55), transparent 28%),
    radial-gradient(circle at 82% 16%, rgba(132, 214, 255, 0.55), transparent 26%),
    radial-gradient(circle at 50% 82%, rgba(255, 214, 126, 0.42), transparent 30%),
    linear-gradient(180deg, #fff4fb 0%, #fff8ef 48%, #f7f2ff 100%);
  transition: opacity 0.9s ease, visibility 0.9s ease;
}

.gift-overlay.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.gift-overlay.is-opened {
  background: transparent;
}

.gift-overlay.is-celebrating {
  animation: giftScreenShake 0.55s ease-in-out;
}

.gift-flash {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at center, rgba(255, 255, 255, 0.95), rgba(255, 200, 230, 0.45), transparent 70%);
  opacity: 0;
  z-index: 8;
}

.gift-flash.is-active {
  animation: giftFlashPop 0.65s ease-out forwards;
}

.gift-shockwave {
  position: absolute;
  left: 50%;
  top: 46%;
  width: 40px;
  height: 40px;
  margin: -20px 0 0 -20px;
  border-radius: 50%;
  border: 4px solid rgba(255, 255, 255, 0.9);
  box-shadow:
    0 0 0 0 rgba(255, 123, 191, 0.55),
    0 0 30px rgba(140, 121, 255, 0.45);
  opacity: 0;
  pointer-events: none;
  z-index: 7;
}

.gift-shockwave.is-active {
  animation: giftShockwaveExpand 0.9s cubic-bezier(0.15, 0.85, 0.2, 1) forwards;
}

.gift-fireworks,
.gift-confetti-rain {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 9;
}

.gift-firework {
  position: absolute;
  width: 0;
  height: 0;
  transform: translate(-50%, -50%);
}

.gift-firework-core {
  position: absolute;
  left: 0;
  top: 0;
  width: 18px;
  height: 18px;
  margin: -9px 0 0 -9px;
  border-radius: 50%;
  background: var(--color, #fff);
  box-shadow: 0 0 24px var(--color, #fff), 0 0 48px var(--color, #fff);
  animation: giftFireworkCore 0.45s ease-out forwards;
  animation-delay: var(--delay);
}

.gift-firework-spark {
  position: absolute;
  left: 0;
  top: 0;
  width: 5px;
  height: 5px;
  margin: -2px 0 0 -2px;
  border-radius: 50%;
  opacity: 0;
  animation: giftFireworkSpark 1.15s cubic-bezier(0.12, 0.85, 0.22, 1) forwards;
  animation-delay: var(--spark-delay);
}

.gift-firework-spark-ring {
  width: 7px;
  height: 3px;
  border-radius: 2px;
  margin: -1px 0 0 -3px;
}

.gift-rocket {
  position: absolute;
  bottom: -20px;
  width: 4px;
  height: 18px;
  border-radius: 999px;
  background: linear-gradient(180deg, #fff, #ffd978);
  box-shadow: 0 0 12px #ffba53, 0 0 20px #ff7cbf;
  opacity: 0;
  animation: giftRocketRise 0.55s cubic-bezier(0.2, 0.9, 0.2, 1) forwards;
  animation-delay: var(--delay);
}

.gift-rocket::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -8px;
  width: 8px;
  height: 8px;
  margin-left: -4px;
  border-radius: 50%;
  background: radial-gradient(circle, #fff 0%, #ffba53 45%, transparent 70%);
  animation: giftRocketTrail 0.12s ease-in-out infinite alternate;
}

.gift-rain-piece {
  position: absolute;
  top: -20px;
  border-radius: 2px;
  opacity: 0;
  animation: giftRainFall var(--dur) linear forwards;
  animation-delay: var(--delay);
}

.gift-sky,
.gift-sparkles {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.gift-sparkle {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.85);
  box-shadow: 0 0 18px rgba(255, 255, 255, 0.8);
  animation: giftSparkle 2.8s ease-in-out infinite;
}

.gift-stage {
  position: relative;
  z-index: 2;
  display: grid;
  justify-items: center;
  gap: 28px;
}

.gift-hint {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(1rem, 2.4vw, 1.2rem);
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #4d356d;
  animation: giftHintPulse 2s ease-in-out infinite;
  transition: opacity 0.25s ease;
}

.gift-box {
  position: relative;
  width: min(74vw, 340px);
  height: min(74vw, 340px);
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  transform-style: preserve-3d;
  animation: giftFloat 3.4s ease-in-out infinite;
}

.gift-box:focus-visible {
  outline: 3px solid rgba(140, 121, 255, 0.45);
  outline-offset: 12px;
  border-radius: 24px;
}

.gift-glow {
  position: absolute;
  inset: 8% 4%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 123, 191, 0.34), transparent 68%);
  filter: blur(10px);
  animation: giftGlow 2.6s ease-in-out infinite;
}

.gift-lid,
.gift-body {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

.gift-lid {
  top: 12%;
  width: 88%;
  height: 28%;
  z-index: 4;
  transform-origin: center bottom;
  transition: transform 0.75s cubic-bezier(0.2, 0.9, 0.24, 1.2);
}

.gift-lid-top {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 18px 18px 10px 10px;
  background: linear-gradient(180deg, #ff95c5 0%, #ff6fae 100%);
  box-shadow:
    inset 0 10px 18px rgba(255, 255, 255, 0.34),
    0 16px 30px rgba(255, 105, 170, 0.28);
}

.gift-body {
  top: 34%;
  width: 88%;
  height: 48%;
  z-index: 2;
  border-radius: 12px 12px 22px 22px;
  background: linear-gradient(180deg, #ff7eb8 0%, #ef5f9f 100%);
  box-shadow:
    inset 0 -16px 24px rgba(154, 33, 88, 0.16),
    0 28px 48px rgba(255, 105, 170, 0.28);
  transition: transform 0.7s ease, opacity 0.55s ease;
}

.gift-ribbon {
  position: absolute;
  background: linear-gradient(180deg, #fff7d1, #ffd978);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.45);
}

.gift-ribbon-v {
  left: 50%;
  top: -8%;
  width: 18%;
  height: 116%;
  transform: translateX(-50%);
  border-radius: 8px;
}

.gift-ribbon-h {
  left: -4%;
  top: 42%;
  width: 108%;
  height: 18%;
  border-radius: 8px;
}

.gift-bow {
  position: absolute;
  left: 50%;
  top: -34%;
  width: 54%;
  height: 42%;
  transform: translateX(-50%);
}

.gift-bow-loop {
  position: absolute;
  top: 0;
  width: 42%;
  height: 100%;
  border-radius: 50% 50% 42% 42%;
  background: linear-gradient(180deg, #ffe9a8, #ffc85f);
  box-shadow: inset 0 -8px 12px rgba(196, 128, 20, 0.18);
}

.gift-bow-loop-left {
  left: 0;
  transform: rotate(-18deg);
}

.gift-bow-loop-right {
  right: 0;
  transform: rotate(18deg);
}

.gift-bow-knot {
  position: absolute;
  left: 50%;
  top: 34%;
  width: 28%;
  height: 34%;
  transform: translateX(-50%);
  border-radius: 12px;
  background: linear-gradient(180deg, #ffe082, #ffb347);
}

.gift-base-shadow {
  position: absolute;
  left: 50%;
  bottom: 4%;
  width: 72%;
  height: 10%;
  transform: translateX(-50%);
  border-radius: 50%;
  background: rgba(120, 72, 150, 0.18);
  filter: blur(8px);
}

.gift-box.is-opening {
  animation: giftShake 0.55s ease-in-out;
}

.gift-box.is-opening .gift-lid {
  transform: translateX(-50%) translateY(-140%) rotate(-28deg) scale(1.12);
}

.gift-box.is-opening .gift-bow {
  animation: giftBowPop 0.6s ease-out forwards;
}

.gift-box.is-opening .gift-body,
.gift-box.is-opened .gift-body {
  transform: translateX(-50%) scale(0.84);
  opacity: 0;
}

.gift-box.is-opened {
  animation: none;
  opacity: 0;
  transform: scale(0.7);
  transition: opacity 0.45s ease, transform 0.55s ease;
}

.gift-overlay.is-message {
  background:
    radial-gradient(circle at 20% 18%, rgba(255, 143, 184, 0.55), transparent 28%),
    radial-gradient(circle at 82% 16%, rgba(132, 214, 255, 0.55), transparent 26%),
    radial-gradient(circle at 50% 82%, rgba(255, 214, 126, 0.42), transparent 30%),
    linear-gradient(180deg, #fff4fb 0%, #fff8ef 48%, #f7f2ff 100%);
}

.gift-message {
  position: relative;
  z-index: 12;
  width: min(92vw, 640px);
  padding: 0 20px;
  animation: giftMessageIn 0.55s cubic-bezier(0.2, 0.9, 0.24, 1) both;
}

.gift-message-card {
  padding: clamp(28px, 5vw, 40px);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(140, 121, 255, 0.16);
  box-shadow: 0 28px 70px rgba(143, 112, 255, 0.18);
  text-align: center;
}

.gift-message-text {
  margin: 0;
  font-size: clamp(1.05rem, 2.8vw, 1.28rem);
  line-height: 1.7;
  color: #3d2858;
}

.gift-countdown-label {
  margin: 24px 0 8px;
  font-family: "Space Grotesk", sans-serif;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #7a6794;
}

.gift-countdown {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(2.8rem, 10vw, 4rem);
  font-weight: 700;
  line-height: 1;
  background: linear-gradient(135deg, #ff7cbf, #8c79ff, #48d8ff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: giftCountPulse 1s ease-in-out infinite;
}

@keyframes giftMessageIn {
  from {
    opacity: 0;
    transform: translateY(24px) scale(0.96);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes giftCountPulse {
  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.08);
  }
}

.gift-burst {
  position: absolute;
  left: 50%;
  top: 46%;
  width: 0;
  height: 0;
  z-index: 5;
  pointer-events: none;
}

.gift-burst-piece {
  position: absolute;
  left: 0;
  top: 0;
  border-radius: 3px;
  opacity: 0;
  animation: giftBurstFly var(--dur, 1.1s) cubic-bezier(0.15, 0.85, 0.2, 1) forwards;
  animation-delay: var(--delay);
}

.gift-replay-btn[hidden] {
  display: none !important;
}

.gift-replay-btn {
  position: fixed;
  right: 0;
  top: 50%;
  z-index: 120;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 14px 16px 18px;
  border: 0;
  border-radius: 22px 0 0 22px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(255, 244, 252, 0.92));
  border: 1px solid rgba(140, 121, 255, 0.18);
  border-right: 0;
  box-shadow: -8px 12px 30px rgba(143, 112, 255, 0.16);
  color: #4d356d;
  cursor: pointer;
  transform: translateY(-50%);
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.gift-replay-btn:hover {
  transform: translateY(-50%) translateX(-4px);
  box-shadow: -12px 16px 34px rgba(143, 112, 255, 0.22);
}

.gift-replay-icon {
  font-size: 1.2rem;
  line-height: 1;
}

.gift-replay-text {
  max-width: 10ch;
  font-family: "Space Grotesk", sans-serif;
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.25;
  text-align: left;
}

@keyframes giftFloat {
  0%,
  100% {
    transform: translateY(0) rotate(0deg);
  }

  50% {
    transform: translateY(-16px) rotate(1.5deg);
  }
}

@keyframes giftGlow {
  0%,
  100% {
    opacity: 0.75;
    transform: scale(1);
  }

  50% {
    opacity: 1;
    transform: scale(1.06);
  }
}

@keyframes giftHintPulse {
  0%,
  100% {
    opacity: 0.72;
    transform: translateY(0);
  }

  50% {
    opacity: 1;
    transform: translateY(-4px);
  }
}

@keyframes giftSparkle {
  0%,
  100% {
    opacity: 0.2;
    transform: scale(0.7);
  }

  50% {
    opacity: 1;
    transform: scale(1.2);
  }
}

@keyframes giftShake {
  0%,
  100% {
    transform: translateX(0) rotate(0deg);
  }

  20% {
    transform: translateX(-8px) rotate(-2deg);
  }

  40% {
    transform: translateX(8px) rotate(2deg);
  }

  60% {
    transform: translateX(-6px) rotate(-1deg);
  }

  80% {
    transform: translateX(6px) rotate(1deg);
  }
}

@keyframes giftBurstFly {
  0% {
    opacity: 1;
    transform: translate(0, 0) rotate(0deg) scale(1);
  }

  100% {
    opacity: 0;
    transform: translate(var(--x), var(--y)) rotate(var(--r)) scale(0.35);
  }
}

@keyframes giftFlashPop {
  0% {
    opacity: 0;
  }

  18% {
    opacity: 0.95;
  }

  100% {
    opacity: 0;
  }
}

@keyframes giftShockwaveExpand {
  0% {
    opacity: 0.95;
    transform: scale(0.2);
  }

  100% {
    opacity: 0;
    transform: scale(18);
  }
}

@keyframes giftFireworkCore {
  0% {
    opacity: 1;
    transform: scale(0.2);
  }

  40% {
    opacity: 1;
    transform: scale(1.4);
  }

  100% {
    opacity: 0;
    transform: scale(2.2);
  }
}

@keyframes giftFireworkSpark {
  0% {
    opacity: 1;
    transform: translate(0, 0) rotate(0deg) scale(1);
  }

  100% {
    opacity: 0;
    transform: translate(var(--fx), var(--fy)) rotate(var(--fr)) scale(0.2);
  }
}

@keyframes giftRocketRise {
  0% {
    opacity: 1;
    transform: translateY(0);
  }

  100% {
    opacity: 0;
    transform: translateY(calc(-1 * var(--target-y)));
  }
}

@keyframes giftRocketTrail {
  from {
    opacity: 0.6;
    transform: scale(0.8);
  }

  to {
    opacity: 1;
    transform: scale(1.2);
  }
}

@keyframes giftRainFall {
  0% {
    opacity: 1;
    transform: translateY(0) translateX(0) rotate(0deg);
  }

  100% {
    opacity: 0.85;
    transform: translateY(110vh) translateX(var(--drift)) rotate(var(--spin));
  }
}

@keyframes giftScreenShake {
  0%,
  100% {
    transform: translate(0, 0);
  }

  15% {
    transform: translate(-6px, 4px);
  }

  30% {
    transform: translate(7px, -3px);
  }

  45% {
    transform: translate(-5px, -5px);
  }

  60% {
    transform: translate(5px, 4px);
  }

  75% {
    transform: translate(-3px, 2px);
  }
}

@keyframes giftBowPop {
  0% {
    transform: translateX(-50%) scale(1);
  }

  40% {
    transform: translateX(-50%) scale(1.35) rotate(8deg);
  }

  100% {
    transform: translateX(-50%) scale(0.4) translateY(-80px);
    opacity: 0;
  }
}

@media (max-width: 720px) {
  .gift-replay-btn {
    padding: 14px 10px 14px 14px;
  }

  .gift-replay-text {
    font-size: 0.74rem;
    max-width: 9ch;
  }
}
