:root {
  --bg: #f9eef2;
  --tile: #f0e1e8;
  --ink: #1f1e1c;
  --gap: 12px;
  color-scheme: light;
}

* { box-sizing: border-box; }

html {
  background: var(--bg);
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
}

.defs { position: absolute; width: 0; height: 0; overflow: hidden; }

button { font: inherit; color: inherit; }

:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }

/* Main image ---------------------------------------------------------- */

.hero {
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 5svh 5vw;
  overflow: hidden; /* keeps the corner charms from causing sideways scroll on phones */
  /* soft pink wash behind the main image */
  background:
    radial-gradient(58% 52% at 50% 50%, rgba(255, 166, 200, 0.5), rgba(255, 166, 200, 0) 75%),
    radial-gradient(120% 70% at 50% 0%, rgba(255, 196, 218, 0.45), rgba(255, 196, 218, 0) 70%);
}

/* Wrapper that carries the soft pink glow around the image. */
.hero__glow {
  position: relative;
  isolation: isolate;
  visibility: hidden; /* shown once the photo has loaded, so the glow never appears on its own */
  box-shadow:
    0 0 0 1px rgba(255, 196, 218, 0.45),
    0 0 70px 6px rgba(255, 160, 198, 0.32),
    0 30px 60px -30px rgba(90, 30, 60, 0.35);
}
.hero__glow.is-ready { visibility: visible; }

.hero__art {
  position: relative;
  filter: url(#anime) saturate(1.3) contrast(1.05);
}

.hero img {
  display: block;
  width: auto;
  height: auto;
  max-width: min(90vw, 1200px);
  max-height: 88svh;
}

.hero__ears {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* Soft pink colour tint, kept gentle so his features stay true. */
.hero__tint,
.hero__light {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.hero__tint {
  background: linear-gradient(165deg, rgba(255, 168, 204, 0.6), rgba(255, 150, 192, 0.42) 55%, rgba(255, 128, 178, 0.55));
  mix-blend-mode: soft-light;
}
/* Hello Kitty-style charms tucked around the corners of the photo */
.charm {
  position: absolute;
  display: block;
  height: auto;
  pointer-events: none;
  filter: drop-shadow(0 6px 10px rgba(160, 50, 100, 0.22));
}
.charm--kitty { width: 23%; top: -6%; left: -10%; rotate: -12deg; }
.charm--apple { width: 11%; top: 3%; right: -6%; rotate: 14deg; }
.charm--heart { width: 14%; top: 52%; left: -8%; rotate: -10deg; }
.charm--bow { width: 21%; bottom: 9%; right: -9%; rotate: 12deg; }

/* Name plate */
.hero__caption {
  position: absolute;
  left: 50%;
  bottom: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 0.45em;
  margin: 0;
  padding: 0.5em 1.1em 0.5em 0.9em;
  border: 2px solid #ffc0d4;
  border-radius: 999px;
  background: #fff;
  color: #d93a72;
  font-family: ui-rounded, "SF Pro Rounded", "Hiragino Maru Gothic ProN", "Arial Rounded MT Bold", system-ui, sans-serif;
  font-size: clamp(14px, 1.7vw, 22px);
  font-weight: 700;
  letter-spacing: 0.01em;
  white-space: nowrap;
  translate: -50% 50%;
  box-shadow: 0 8px 22px -6px rgba(217, 58, 114, 0.35);
}
.hero__caption svg { width: 1.5em; height: auto; flex: none; }

.hero__light {
  background:
    radial-gradient(70% 45% at 50% 0%, rgba(255, 205, 225, 0.34), rgba(255, 205, 225, 0) 70%),
    radial-gradient(60% 40% at 50% 100%, rgba(255, 170, 205, 0.16), rgba(255, 170, 205, 0) 70%);
  mix-blend-mode: screen;
}

/* Masonry gallery (columns are built by app.js) ------------------------ */

.gallery {
  display: flex;
  align-items: flex-start;
  gap: var(--gap);
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 var(--gap);
}

.gallery__col {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: var(--gap);
}

.tile {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: var(--tile);
  cursor: zoom-in;
}

.tile img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

#more { height: 1px; }

/* Mute / unmute ------------------------------------------------------- */

.sound {
  position: fixed;
  right: max(16px, env(safe-area-inset-right));
  bottom: max(16px, env(safe-area-inset-bottom));
  z-index: 10;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 50%;
  background: rgba(249, 238, 242, 0.88);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  cursor: pointer;
}

.sound svg { width: 20px; height: 20px; fill: currentColor; }
.sound .sound__off,
.sound[aria-pressed="true"] .sound__on { display: none; }
.sound[aria-pressed="true"] .sound__off { display: block; }

/* Larger view --------------------------------------------------------- */

.viewer {
  width: 100vw;
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: zoom-out;
}

.viewer[open] { display: grid; place-items: center; }
.viewer::backdrop { background: rgba(249, 238, 242, 0.97); }

.viewer img {
  display: block;
  max-width: 94vw;
  max-height: 92dvh;
  width: auto;
  height: auto;
  object-fit: contain;
}

.viewer__close {
  position: fixed;
  top: max(12px, env(safe-area-inset-top));
  right: max(12px, env(safe-area-inset-right));
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}

.viewer__close svg { width: 24px; height: 24px; }

/* Tap-to-enter: only shown when the browser won't let the music start by itself ---- */

html.is-gated { overflow: hidden; }

.gate {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 14px;
  width: 100%;
  padding: 0;
  border: 0;
  background: rgba(249, 238, 242, 0.55);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  color: #d93a72;
  font-family: ui-rounded, "SF Pro Rounded", "Hiragino Maru Gothic ProN", "Arial Rounded MT Bold", system-ui, sans-serif;
  cursor: pointer;
}
.gate:focus-visible { outline: none; }
.gate:focus-visible .gate__play { outline: 2px solid #d93a72; outline-offset: 4px; }

.gate__play {
  display: grid;
  place-items: center;
  width: 88px;
  height: 88px;
  border: 2px solid #ffc0d4;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 12px 30px -8px rgba(217, 58, 114, 0.4);
}
.gate__play svg { width: 34px; height: 34px; margin-left: 5px; fill: currentColor; }
.gate__hint { font-size: 17px; font-weight: 700; letter-spacing: 0.02em; }

@media (max-width: 640px) {
  :root { --gap: 8px; }
  .charm--kitty { left: -3%; top: -5%; }
  .charm--apple { right: -2%; }
  .charm--heart { left: -3%; }
  .charm--bow { right: -3%; }
  .hero { padding: 4svh 4vw; }
  .hero img { max-width: 92vw; max-height: 84svh; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
