/* ============================================================
   TOKENS
   ============================================================ */
:root {
  --clr-canvas:     #fafaf9;
  --clr-text:       #1a1a1a;
  --clr-muted:      #aeaeb2;
  --clr-rose:       #c9a0a8;
  --clr-rose-light: #e8b4bc;
  --ease-liquid:    cubic-bezier(0.16, 1, 0.3, 1);
  --cols:           4;
  --gap:            12px;
}

/* ============================================================
   RESET
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  background: var(--clr-canvas);
  color: var(--clr-text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', sans-serif;
  min-height: 100dvh;
  overflow-x: hidden;
}

/* ============================================================
   GRAIN
   ============================================================ */
.grain-overlay {
  position: fixed; inset: -50%;
  width: 200%; height: 200%;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: 0.025;
  pointer-events: none;
  z-index: 900;
  animation: grain 0.12s steps(1) infinite;
}
@keyframes grain {
  0%  { transform: translate(0,0); }
  25% { transform: translate(-2%,-3%); }
  50% { transform: translate(3%,1%); }
  75% { transform: translate(-1%,4%); }
}

/* ============================================================
   SNOW CANVAS
   ============================================================ */
#snow-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;          /* above ambient blobs, below content */
}

/* ============================================================
   AMBIENT
   ============================================================ */
.ambient { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.ambient__blob {
  position: absolute; border-radius: 50%;
  filter: blur(100px); animation: blobFloat 22s ease-in-out infinite;
}
.ambient__blob--1 { width:500px; height:500px; background:radial-gradient(circle,rgba(232,180,188,.22) 0%,transparent 70%); top:-130px; left:-130px; animation-duration:20s; }
.ambient__blob--2 { width:380px; height:380px; background:radial-gradient(circle,rgba(201,160,168,.15) 0%,transparent 70%); bottom:-100px; right:-80px; animation-duration:26s; animation-delay:-9s; }
.ambient__blob--3 { width:280px; height:280px; background:radial-gradient(circle,rgba(255,220,200,.12) 0%,transparent 70%); top:38%; left:58%; animation-duration:32s; animation-delay:-15s; }
@keyframes blobFloat {
  0%,100%{ transform:translate(0,0) scale(1); }
  33%    { transform:translate(28px,-18px) scale(1.04); }
  66%    { transform:translate(-18px,24px) scale(0.97); }
}

/* ============================================================
   PAGE LAYOUT
   ============================================================ */
.page {
  position: relative; z-index: 1;
  display: flex; flex-direction: column; align-items: center;
  padding: clamp(48px,7vw,96px) clamp(16px,4vw,48px) clamp(40px,6vw,72px);
  gap: clamp(40px,5vw,72px);
}

/* ============================================================
   HEADER
   ============================================================ */
.page__header {
  text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  animation: fadeUp 1.2s var(--ease-liquid) both;
}
.page__eyebrow {
  font-size: .63rem; font-weight: 400;
  letter-spacing: .26em; text-transform: uppercase; color: var(--clr-muted);
}
.page__title {
  font-family: 'Playfair Display', 'PingFang SC', 'Heiti SC', Georgia, serif;
  font-size: clamp(1.8rem, 5vw, 3.2rem);
  font-weight: 400; line-height: 1.2; letter-spacing: .04em;
  color: var(--clr-text);
}
.page__title-heart {
  font-style: normal;
  font-size: clamp(1.4rem, 4vw, 2.6rem);
  vertical-align: middle;
  font-family: initial;
  display: inline-block;
  animation: heartbeat 1.2s cubic-bezier(0.215, 0.61, 0.355, 1) infinite;
  transform-origin: center;
}

@keyframes heartbeat {
  0%   { transform: scale(1);    }
  14%  { transform: scale(1.28); }
  28%  { transform: scale(1);    }
  42%  { transform: scale(1.18); }
  56%  { transform: scale(1);    }
  100% { transform: scale(1);    }
}
.page__subtitle {
  font-size: .8rem; font-weight: 300;
  color: var(--clr-muted); letter-spacing: .06em;
}
.page__divider { margin-top: 6px; opacity: .7; }

/* ── Upload hint button (in header) ── */
.upload-hint {
  display: inline-flex; align-items: center; gap: 7px;
  margin-top: 6px;
  padding: 8px 18px;
  border-radius: 999px;
  border: 0.5px solid rgba(201,160,168,.5);
  background: rgba(255,255,255,.7);
  backdrop-filter: blur(8px);
  font-size: .72rem; font-weight: 400;
  letter-spacing: .08em;
  color: var(--clr-rose);
  cursor: pointer;
  transition: background .3s, box-shadow .3s, transform .3s var(--ease-liquid);
  user-select: none;
}
.upload-hint:hover {
  background: rgba(255,255,255,.95);
  box-shadow: 0 4px 20px rgba(201,160,168,.25);
  transform: translateY(-1px);
}
.upload-hint__icon {
  font-size: .9rem; font-style: normal;
  display: inline-block;
  transition: transform .3s var(--ease-liquid);
}
.upload-hint:hover .upload-hint__icon { transform: scale(1.25) rotate(8deg); }

/* ============================================================
   DROP OVERLAY  — full-screen, appears on drag
   ============================================================ */
.drop-overlay {
  position: fixed; inset: 0; z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  background: rgba(250,248,248,.88);
  backdrop-filter: blur(20px) saturate(1.3);
  -webkit-backdrop-filter: blur(20px) saturate(1.3);
  opacity: 0; pointer-events: none;
  transition: opacity .25s var(--ease-liquid);
}
.drop-overlay.drop-overlay--active {
  opacity: 1; pointer-events: auto;
}
.drop-overlay__box {
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  padding: 56px 72px;
  border-radius: 32px;
  border: 2px dashed rgba(201,160,168,.7);
  background: rgba(255,255,255,.6);
  box-shadow: 0 8px 48px rgba(201,160,168,.2);
  animation: dropPulse 1.4s ease-in-out infinite;
}
@keyframes dropPulse {
  0%,100% { box-shadow: 0 8px 48px rgba(201,160,168,.2); }
  50%      { box-shadow: 0 8px 64px rgba(201,160,168,.45); }
}
.drop-overlay__icon { font-size: 3.5rem; animation: iconBounce .6s var(--ease-liquid) infinite alternate; }
@keyframes iconBounce {
  from { transform: translateY(0); }
  to   { transform: translateY(-8px); }
}
.drop-overlay__title {
  font-family: 'Playfair Display', serif; font-size: 1.5rem; font-weight: 400;
  color: var(--clr-text);
}
.drop-overlay__hint {
  font-size: .72rem; letter-spacing: .12em; color: var(--clr-muted); font-weight: 300;
}

/* ============================================================
   TOAST NOTIFICATION
   ============================================================ */
.toast {
  position: fixed; bottom: 32px; left: 50%; transform: translateX(-50%) translateY(12px);
  z-index: 1100;
  background: rgba(30,28,28,.88);
  color: #fff;
  font-size: .78rem; letter-spacing: .06em; font-weight: 300;
  padding: 11px 24px; border-radius: 999px;
  backdrop-filter: blur(12px);
  opacity: 0; pointer-events: none;
  transition: opacity .3s var(--ease-liquid), transform .3s var(--ease-liquid);
  white-space: nowrap;
}
.toast.toast--show {
  opacity: 1; pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

/* ── Delete button on uploaded cards ── */
.card__delete {
  position: absolute; top: 6%; right: 6%;
  width: 26px; height: 26px; border-radius: 50%;
  background: rgba(255,255,255,.85);
  border: none; cursor: pointer;
  font-size: .75rem; line-height: 1;
  color: #b05060;
  display: flex; align-items: center; justify-content: center;
  opacity: 0;
  transition: opacity .25s, transform .25s, background .25s;
  z-index: 3;
  backdrop-filter: blur(4px);
}
.card:hover .card__delete { opacity: 1; }
.card__delete:hover { background: #fff; transform: scale(1.15); }

/* ============================================================
   CIRCULAR GRID
   ============================================================ */
.masonry {
  width: 100%;
  max-width: 1080px;
  display: flex;
  flex-wrap: wrap;
  gap: clamp(14px, 2.5vw, 28px);
  justify-content: center;
  animation: fadeUp 1.3s var(--ease-liquid) .1s both;
}

/* Each card — perfect circle */
.card {
  /* Each circle is 1/5 of container width minus gaps */
  flex: 0 0 calc(20% - 23px);
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  overflow: hidden;
  cursor: pointer;
  position: relative;
  outline: 0.5px solid rgba(201,160,168,.4);
  box-shadow:
    0 0 0 1px rgba(255,255,255,.8) inset,
    0 4px 20px rgba(0,0,0,.07);
  transition:
    transform .55s var(--ease-liquid),
    box-shadow .55s var(--ease-liquid),
    outline-color .55s var(--ease-liquid),
    opacity .55s var(--ease-liquid);
  /* Entrance */
  opacity: 0;
  transform: scale(.7);
}

.card.card--visible {
  opacity: 1;
  transform: scale(1);
  transition:
    opacity .75s var(--ease-liquid),
    transform .75s var(--ease-liquid),
    box-shadow .55s var(--ease-liquid),
    outline-color .55s var(--ease-liquid);
}

.card:hover {
  transform: scale(1.12);
  box-shadow:
    0 0 0 1px rgba(255,255,255,.9) inset,
    0 8px 36px rgba(201,160,168,.45),
    0 0 60px rgba(201,160,168,.2);
  outline-color: rgba(201,160,168,.8);
  z-index: 2;
}

.card__img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .55s var(--ease-liquid), filter .55s var(--ease-liquid);
}

.card:hover .card__img {
  transform: scale(1.06);
  filter: brightness(1.05);
}

/* No overlay needed — glow does the job */
.card::after { display: none; }

/* ============================================================
   LIGHTBOX
   ============================================================ */
.lightbox {
  position: fixed; inset: 0; z-index: 999;
  background: rgba(250,250,249,.92);
  backdrop-filter: blur(28px) saturate(1.4);
  -webkit-backdrop-filter: blur(28px) saturate(1.4);
  display: flex; align-items: center; justify-content: center;
  cursor: zoom-out;
  animation: lbIn .4s var(--ease-liquid);
}
.lightbox[hidden] { display: none; }
@keyframes lbIn {
  from { opacity:0; } to { opacity:1; }
}

.lightbox__stage {
  max-width: min(92vw, 1000px);
  max-height: 88dvh;
  display: flex; align-items: center; justify-content: center;
  cursor: default;
}
.lightbox__img {
  max-width: 100%; max-height: 88dvh;
  border-radius: 18px;
  box-shadow: 0 24px 80px rgba(0,0,0,.18), 0 0 0 0.5px rgba(201,160,168,.4);
  object-fit: contain;
  animation: imgIn .45s var(--ease-liquid);
}
@keyframes imgIn {
  from { opacity:0; transform:scale(.94); }
  to   { opacity:1; transform:scale(1); }
}

.lightbox__close {
  position: absolute; top: 24px; right: 28px;
  background: none; border: none; cursor: pointer;
  font-size: 1.3rem; color: var(--clr-rose);
  width: 40px; height: 40px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  transition: background .25s, transform .25s;
}
.lightbox__close:hover {
  background: rgba(201,160,168,.12);
  transform: scale(1.1);
}

.lightbox__nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  background: rgba(255,255,255,.75);
  border: 0.5px solid rgba(201,160,168,.35);
  border-radius: 50%; width: 48px; height: 48px;
  font-size: 1.6rem; line-height: 1;
  color: var(--clr-rose); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .25s, transform .25s;
  backdrop-filter: blur(8px);
}
.lightbox__nav:hover { background: rgba(255,255,255,.95); transform: translateY(-50%) scale(1.08); }
.lightbox__nav--prev { left: clamp(12px,3vw,48px); }
.lightbox__nav--next { right: clamp(12px,3vw,48px); }

.lightbox__counter {
  position: absolute; bottom: 28px; left: 50%; transform: translateX(-50%);
  font-size: .68rem; letter-spacing: .18em; color: var(--clr-muted);
  font-weight: 300; text-transform: uppercase;
}

/* ============================================================
   FOOTER
   ============================================================ */
.page__footer { text-align: center; animation: fadeUp 1.5s var(--ease-liquid) .3s both; }
.page__footnote { font-size: .66rem; font-weight: 300; color: var(--clr-muted); letter-spacing: .14em; }

/* ============================================================
   ANIMATIONS
   ============================================================ */
@keyframes fadeUp {
  from { opacity:0; transform:translateY(18px); }
  to   { opacity:1; transform:translateY(0); }
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
/* 5 per row (default) → 4 → 3 → 2 per row */
@media (max-width: 900px) {
  .card { flex: 0 0 calc(25% - 22px); }
}
@media (max-width: 640px) {
  .card { flex: 0 0 calc(33.333% - 20px); }
  .masonry { gap: 12px; }
}
@media (max-width: 400px) {
  .card { flex: 0 0 calc(50% - 10px); }
  .masonry { gap: 10px; }
}

