:root {
  color-scheme: light;
  --ink: #4f222f;
  --muted: #815967;
  --soft: rgba(79, 34, 47, 0.74);
  --line: rgba(217, 92, 128, 0.28);
  --panel: rgba(255, 255, 255, 0.78);
  --panel-strong: rgba(255, 255, 255, 0.94);
  --rose: #ef6f9a;
  --red: #d94c78;
  --coral: #ff9cab;
  --gold: #e5ad39;
  --teal: #63b8b1;
  --sky: #aee7ff;
  --sky-strong: #62bde6;
  --sky-soft: rgba(174, 231, 255, 0.44);
  --cream: #fff9ee;
  --shadow: rgba(142, 54, 82, 0.2);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(255, 238, 246, 0.2), #fff5f8 36rem),
    #fff5f8;
  color: var(--ink);
}

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

button,
input,
textarea {
  font: inherit;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.ambient {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 12% 18%, rgba(239, 111, 154, 0.22), transparent 20rem),
    radial-gradient(circle at 82% 18%, rgba(174, 231, 255, 0.34), transparent 22rem),
    radial-gradient(circle at 70% 72%, rgba(174, 231, 255, 0.22), transparent 18rem),
    linear-gradient(135deg, transparent 0 22px, rgba(239, 111, 154, 0.05) 22px 24px, transparent 24px 46px);
  z-index: -1;
}

.hero {
  position: relative;
  min-height: 92vh;
  display: grid;
  grid-template-rows: auto 1fr;
  background:
    linear-gradient(90deg, rgba(255, 249, 238, 0.96), rgba(255, 249, 238, 0.74) 46%, rgba(255, 231, 239, 0.2)),
    linear-gradient(0deg, #fff5f8 0%, transparent 34%),
    url("assets/sanrio-friends-hero.png?v=13") center / cover;
}

body.gift-locked {
  overflow: hidden;
}

.gift-gate {
  position: fixed;
  inset: 0;
  z-index: 30;
  min-height: 100vh;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 18px;
  padding: 28px;
  background:
    linear-gradient(180deg, rgba(255, 249, 238, 0.86), rgba(255, 245, 248, 0.96)),
    url("assets/sanrio-friends-hero.png?v=13") center / cover;
  text-align: center;
  transition:
    opacity 720ms ease,
    visibility 720ms ease,
    transform 720ms ease;
}

.gift-gate.is-open {
  opacity: 0;
  visibility: hidden;
  transform: translateY(-24px) scale(1.03);
  pointer-events: none;
}

.gift-gate h1 {
  max-width: 680px;
  margin: 0;
  font-size: clamp(3rem, 9vw, 6.4rem);
}

.gift-box {
  position: relative;
  width: 164px;
  height: 138px;
  margin-bottom: 12px;
  border: 3px solid rgba(79, 34, 47, 0.16);
  border-radius: 8px;
  background: linear-gradient(135deg, #ffd7e2, #ef6f9a);
  box-shadow: 0 26px 70px rgba(142, 54, 82, 0.24);
  animation: gift-breathe 1800ms ease-in-out infinite;
}

.gift-lid {
  position: absolute;
  left: -12px;
  right: -12px;
  top: -30px;
  height: 38px;
  border: 3px solid rgba(79, 34, 47, 0.16);
  border-radius: 8px;
  background: linear-gradient(135deg, #fff, #ffcad4);
  transform-origin: right bottom;
}

.gift-gate.is-opening .gift-lid {
  animation: lid-open 680ms ease forwards;
}

.gift-ribbon {
  position: absolute;
  background: #fff9ee;
}

.gift-ribbon-vertical {
  top: -30px;
  bottom: 0;
  left: 50%;
  width: 24px;
  transform: translateX(-50%);
}

.gift-ribbon-horizontal {
  left: 0;
  right: 0;
  top: 46px;
  height: 24px;
}

.music-button {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 12;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  border: 2px solid rgba(98, 189, 230, 0.42);
  border-radius: 999px;
  padding: 10px 15px;
  background: rgba(255, 255, 255, 0.88);
  color: var(--ink);
  box-shadow: 0 12px 32px rgba(98, 189, 230, 0.2);
  cursor: pointer;
  font-weight: 900;
  backdrop-filter: blur(10px);
}

.music-button span:first-child {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--sky-soft);
  color: var(--sky-strong);
}

.music-button[aria-pressed="true"] {
  background: linear-gradient(135deg, #dff6ff, #fff);
}

.topbar {
  position: relative;
  z-index: 4;
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 22px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand,
.nav-links {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand {
  font-weight: 900;
}

.brand-mark {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 2px solid rgba(98, 189, 230, 0.38);
  border-radius: 8px;
  background: var(--panel-strong);
  color: var(--sky-strong);
  box-shadow: 0 8px 20px rgba(98, 189, 230, 0.2);
}

.nav-links a,
.icon-button {
  color: var(--soft);
}

.nav-links a {
  font-size: 0.94rem;
  font-weight: 800;
}

.icon-button {
  width: 38px;
  height: 38px;
  border: 2px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  cursor: pointer;
}

.hidden-editor {
  display: none;
}

body.editor-enabled .hidden-editor {
  display: grid;
  place-items: center;
}

.hero-content {
  position: relative;
  z-index: 4;
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  align-self: center;
  padding: 40px 0 110px;
}

.eyebrow,
.section-kicker {
  margin: 0 0 12px;
  color: var(--rose);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  max-width: 760px;
  margin-bottom: 18px;
  font-size: clamp(3rem, 10vw, 6.8rem);
  line-height: 0.95;
}

.hero-content p:not(.eyebrow) {
  max-width: 610px;
  color: var(--muted);
  font-size: clamp(1.05rem, 2.4vw, 1.35rem);
  line-height: 1.55;
}

.hero-actions,
.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.primary-button,
.secondary-button,
.mood-buttons button {
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  padding: 12px 18px;
  cursor: pointer;
  font-weight: 900;
}

.primary-button {
  background: linear-gradient(135deg, #ffcad4, var(--rose));
  color: #4f222f;
  box-shadow: 0 12px 26px rgba(239, 111, 154, 0.28);
}

.secondary-button {
  border: 2px solid rgba(98, 189, 230, 0.42);
  background: linear-gradient(135deg, rgba(174, 231, 255, 0.5), rgba(255, 255, 255, 0.76));
  color: var(--ink);
}

.icon-button,
.primary-button,
.secondary-button,
.mood-buttons button,
.letter-card {
  position: relative;
  overflow: hidden;
  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    border-color 180ms ease,
    background 180ms ease,
    filter 180ms ease;
}

.icon-button:hover,
.primary-button:hover,
.secondary-button:hover,
.mood-buttons button:hover,
.letter-card:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 18px 38px rgba(217, 76, 120, 0.22);
  filter: saturate(1.08);
}

.icon-button:active,
.primary-button:active,
.secondary-button:active,
.mood-buttons button:active,
.letter-card:active {
  transform: translateY(1px) scale(0.98);
}

.primary-button::before,
.secondary-button::before,
.mood-buttons button::before,
.letter-card::before,
.icon-button::before {
  content: "";
  position: absolute;
  inset: -40% -80%;
  background: linear-gradient(115deg, transparent 35%, rgba(255, 255, 255, 0.7), transparent 65%);
  transform: translateX(-70%) rotate(8deg);
  transition: transform 520ms ease;
  pointer-events: none;
}

.primary-button:hover::before,
.secondary-button:hover::before,
.mood-buttons button:hover::before,
.letter-card:hover::before,
.icon-button:hover::before {
  transform: translateX(70%) rotate(8deg);
}

main section {
  position: relative;
  z-index: 4;
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 70px 0;
}

.time-band {
  display: grid;
  grid-template-columns: 1fr minmax(280px, 460px);
  gap: 28px;
  align-items: center;
}

.time-band h2,
.section-heading h2 {
  margin-bottom: 0;
  font-size: clamp(2rem, 5vw, 3.2rem);
  line-height: 1.05;
}

.counter-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border: 2px solid rgba(98, 189, 230, 0.38);
  border-radius: 8px;
  overflow: hidden;
  background:
    linear-gradient(145deg, rgba(174, 231, 255, 0.28), transparent),
    var(--panel);
  box-shadow: 0 18px 60px rgba(98, 189, 230, 0.17);
}

.counter-grid div {
  min-width: 0;
  padding: 24px 14px;
  text-align: center;
}

.counter-grid div + div {
  border-left: 2px solid var(--line);
}

.counter-grid strong {
  display: block;
  font-size: clamp(1.8rem, 5vw, 3rem);
  color: var(--rose);
  line-height: 1;
}

.counter-grid span {
  display: block;
  margin-top: 8px;
  color: var(--muted);
}

.section-heading {
  max-width: 720px;
  margin-bottom: 28px;
}

.letter-grid,
.memory-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.letter-card,
.memory-card {
  min-height: 190px;
  border: 2px solid var(--line);
  border-radius: 8px;
  padding: 20px;
  background:
    linear-gradient(145deg, rgba(255, 202, 212, 0.56), transparent),
    var(--panel);
  box-shadow: 0 18px 48px rgba(142, 54, 82, 0.16);
  animation: card-pop 560ms ease both;
}

.letter-card,
.memory-card,
.counter-grid,
.message-panel {
  position: relative;
}

.letter-card::after,
.memory-card::after,
.counter-grid::after,
.message-panel::after {
  content: "";
  position: absolute;
  top: 12px;
  right: 14px;
  width: 28px;
  height: 18px;
  background:
    radial-gradient(circle at 25% 50%, var(--rose) 0 42%, transparent 44%),
    radial-gradient(circle at 75% 50%, var(--rose) 0 42%, transparent 44%),
    radial-gradient(circle at 50% 50%, var(--red) 0 18%, transparent 20%);
  opacity: 0.72;
  pointer-events: none;
  animation: bow-wiggle 2600ms ease-in-out infinite;
}

.letter-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  text-align: left;
  color: var(--ink);
  cursor: pointer;
}

.letter-card span {
  width: 58px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 2px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--rose);
  transform-origin: center bottom;
  transition: transform 220ms ease;
}

.letter-card span::before {
  content: "";
  width: 26px;
  height: 18px;
  border: 2px solid currentColor;
  border-top: 0;
  border-radius: 0 0 6px 6px;
  background:
    linear-gradient(135deg, transparent 48%, currentColor 49% 52%, transparent 53%),
    linear-gradient(225deg, transparent 48%, currentColor 49% 52%, transparent 53%);
  opacity: 0.75;
}

.letter-card:hover span,
.letter-card.is-opening span {
  transform: rotateX(28deg) translateY(-4px);
}

.letter-card h3,
.memory-card h3 {
  margin: 18px 0 8px;
  font-size: 1.18rem;
}

.letter-card p,
.memory-card p,
.message-panel p,
.promise-section p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.65;
}

.mood-layout {
  display: grid;
  grid-template-columns: minmax(220px, 360px) 1fr;
  gap: 16px;
}

.timeline {
  position: relative;
  display: grid;
  gap: 14px;
  padding-left: 26px;
}

.timeline::before {
  content: "";
  position: absolute;
  top: 8px;
  bottom: 8px;
  left: 8px;
  width: 2px;
  background: linear-gradient(var(--rose), var(--sky-strong));
}

.timeline-item {
  position: relative;
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 18px;
  padding: 18px 0 18px 22px;
  animation: card-pop 560ms ease both;
}

.timeline-item::before {
  content: "";
  position: absolute;
  left: -24px;
  top: 25px;
  width: 14px;
  height: 14px;
  border: 3px solid #fff;
  border-radius: 999px;
  background: var(--rose);
  box-shadow: 0 0 0 3px rgba(239, 111, 154, 0.18);
}

.timeline-item time {
  color: var(--rose);
  font-weight: 900;
}

.timeline-item h3 {
  margin: 0 0 6px;
  font-size: 1.22rem;
}

.timeline-item p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.mood-buttons {
  display: grid;
  gap: 10px;
}

.mood-buttons button {
  text-align: left;
  background: rgba(255, 255, 255, 0.78);
  color: var(--ink);
  border: 2px solid var(--line);
}

.mood-buttons button[aria-pressed="true"] {
  background: linear-gradient(135deg, #dff6ff, #ffcad4);
  color: #4f222f;
  animation: selected-pulse 1400ms ease-in-out infinite;
}

.message-panel {
  min-height: 230px;
  display: grid;
  align-items: center;
  border: 2px solid rgba(98, 189, 230, 0.38);
  border-radius: 8px;
  padding: 28px;
  background:
    linear-gradient(145deg, rgba(174, 231, 255, 0.34), transparent),
    var(--panel-strong);
}

.message-panel p {
  font-size: clamp(1.2rem, 3vw, 2rem);
  color: var(--ink);
}

.memory-card {
  min-height: 170px;
}

.memory-card time {
  color: var(--rose);
  font-weight: 900;
}

.gallery-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.9fr 0.9fr;
  grid-auto-rows: 220px;
  gap: 14px;
}

.photo-slot {
  position: relative;
  overflow: hidden;
  border: 2px solid rgba(98, 189, 230, 0.34);
  border-radius: 8px;
  padding: 18px;
  background:
    linear-gradient(145deg, rgba(174, 231, 255, 0.34), rgba(255, 202, 212, 0.36)),
    rgba(255, 255, 255, 0.72);
  color: var(--ink);
  cursor: pointer;
  text-align: left;
  box-shadow: 0 18px 48px rgba(98, 189, 230, 0.14);
}

.photo-slot.is-private {
  cursor: default;
}

.photo-slot:disabled {
  opacity: 1;
}

.photo-slot.is-private::after {
  content: "";
  position: absolute;
  inset: 18px;
  border: 1px solid rgba(255, 255, 255, 0.68);
  border-radius: 7px;
  pointer-events: none;
}

.photo-slot:first-child {
  grid-row: span 2;
}

.photo-slot img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo-slot span {
  position: relative;
  z-index: 1;
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--rose);
  font-size: 1.35rem;
}

.photo-slot strong,
.photo-slot small {
  position: relative;
  z-index: 1;
  display: block;
}

.photo-slot strong {
  margin-top: 68px;
  font-size: 1.1rem;
}

.photo-slot small {
  margin-top: 6px;
  color: var(--muted);
  font-weight: 800;
}

.promise-section {
  padding-bottom: 100px;
}

.promise-section p {
  max-width: 850px;
  font-size: clamp(1.6rem, 4.6vw, 3.4rem);
  line-height: 1.15;
  color: var(--ink);
}

.modal {
  width: min(620px, calc(100% - 28px));
  border: 2px solid var(--line);
  border-radius: 8px;
  padding: 28px;
  background: var(--cream);
  color: var(--ink);
  box-shadow: 0 30px 90px rgba(142, 54, 82, 0.24);
}

.modal::backdrop {
  background: rgba(79, 34, 47, 0.28);
  backdrop-filter: blur(6px);
}

.modal h2 {
  margin-bottom: 14px;
  font-size: clamp(1.7rem, 5vw, 2.5rem);
}

.modal p {
  color: var(--muted);
  line-height: 1.7;
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 38px;
  height: 38px;
  border: 2px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  font-size: 1.5rem;
  line-height: 1;
}

.edit-modal form {
  display: grid;
  gap: 14px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-weight: 800;
}

input,
textarea {
  width: 100%;
  border: 2px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fff;
  color: var(--ink);
}

textarea {
  resize: vertical;
}

.heart-pop {
  position: fixed;
  z-index: 20;
  left: var(--x);
  top: var(--y);
  transform: translate(-50%, -50%);
  color: var(--rose);
  font-size: 1.15rem;
  font-weight: 900;
  pointer-events: none;
  animation: heart-float 820ms ease-out forwards;
}

@keyframes card-pop {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes bow-wiggle {
  0%,
  100% {
    transform: rotate(-4deg) scale(1);
  }
  50% {
    transform: rotate(5deg) scale(1.08);
  }
}

@keyframes selected-pulse {
  0%,
  100% {
    box-shadow: 0 10px 24px rgba(239, 111, 154, 0.18);
  }
  50% {
    box-shadow: 0 16px 36px rgba(239, 111, 154, 0.34);
  }
}

@keyframes heart-float {
  0% {
    opacity: 0;
    transform: translate(-50%, -20%) scale(0.6) rotate(0deg);
  }
  20% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate(calc(-50% + var(--drift)), -88px) scale(1.25) rotate(18deg);
  }
}

@keyframes gift-breathe {
  0%,
  100% {
    transform: translateY(0) rotate(-1deg);
  }
  50% {
    transform: translateY(-8px) rotate(1deg);
  }
}

@keyframes lid-open {
  to {
    transform: translate(28px, -46px) rotate(24deg);
    opacity: 0.35;
  }
}

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

@media (max-width: 820px) {
  .topbar,
  .nav-links {
    align-items: flex-start;
  }

  .nav-links a {
    display: none;
  }

  .hero {
    min-height: 88vh;
    background:
      linear-gradient(90deg, rgba(255, 249, 238, 0.98), rgba(255, 249, 238, 0.88) 62%, rgba(255, 231, 239, 0.45)),
      linear-gradient(0deg, #fff5f8 0%, transparent 34%),
      url("assets/sanrio-friends-hero.png?v=13") 62% center / cover;
  }

  .time-band,
  .mood-layout,
  .timeline-item {
    grid-template-columns: 1fr;
  }

  .letter-grid,
  .memory-list,
  .gallery-grid {
    grid-template-columns: 1fr;
  }

  .gallery-grid {
    grid-auto-rows: 190px;
  }

  .photo-slot:first-child {
    grid-row: span 1;
  }

  .counter-grid {
    grid-template-columns: 1fr;
  }

  .counter-grid div + div {
    border-left: 0;
    border-top: 2px solid var(--line);
  }
}
