/* Wine Cellar Modal — margashova.com */

:root {
  --wc-ease:     cubic-bezier(0.2, 0.8, 0.2, 1);
  --wc-ease-out: cubic-bezier(0, 0, 0.2, 1);
  --wc-radius:   10px;
  --wc-radius-sm: 6px;
}

/* ── Backdrop ───────────────────────────────────────────────── */
.wc-root {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: wc-fade-in 280ms var(--wc-ease-out) both;
}
.wc-root[hidden] { display: none; }

@keyframes wc-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.wc-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 8, 6, 0.52);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

/* ── Panel ──────────────────────────────────────────────────── */
.wc-panel {
  position: relative;
  width: min(860px, calc(100vw - 32px));
  height: min(560px, calc(100vh - 48px));
  background: var(--room-bg, #f0ede8);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  display: grid;
  grid-template-rows: auto 1fr auto;
  animation: wc-rise 420ms var(--wc-ease-out) both;
}
@keyframes wc-rise {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Header ─────────────────────────────────────────────────── */
.wc-chrome {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 24px;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}
.wc-eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--rose);
}
.wc-count {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--ink3);
  margin-left: auto;
  margin-right: 14px;
  font-variant-numeric: tabular-nums;
}
.wc-close {
  width: 28px;
  height: 28px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink2);
  cursor: pointer;
  display: inline-grid;
  place-items: center;
  border-radius: var(--wc-radius-sm);
  transition: color 0.15s, border-color 0.15s;
}
.wc-close:hover { color: var(--blue); border-color: var(--blue); }

/* ── Body: stage + meta ─────────────────────────────────────── */
.wc-body {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  min-height: 0;
  border-bottom: 1px solid var(--line);
}

/* Left: bottle stage */
.wc-stage {
  position: relative;
  background: rgba(0,0,0,0.03);
  overflow: hidden;
  cursor: grab;
  touch-action: pan-y;
  user-select: none;
}
.wc-stage.dragging { cursor: grabbing; }
.wc-stage::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 42%;
  background: linear-gradient(to bottom, transparent 0%, rgba(0,0,0,0.04) 100%);
  pointer-events: none;
}

.wc-scene {
  position: absolute;
  inset: 0;
}

.wc-slot {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 140px;
  height: 380px;
  margin-left: -70px;
  margin-top: -190px;
  will-change: transform, opacity;
  cursor: pointer;
  transition: transform 360ms cubic-bezier(0.4,0,0.2,1), opacity 360ms cubic-bezier(0.4,0,0.2,1), filter 360ms cubic-bezier(0.4,0,0.2,1);
}
.wc-slot.is-active { cursor: default; }

.wc-bottle-wrap {
  width: 100%;
  height: 100%;
  position: relative;
}
.wc-bottle {
  width: 100%;
  height: 100%;
  display: block;
}

/* Contact shadow — subtle ellipse under each bottle */
.wc-shadow {
  position: absolute;
  left: 50%;
  bottom: -4px;
  width: 100px;
  height: 10px;
  margin-left: -50px;
  background: radial-gradient(ellipse at center,
    rgba(0,0,0,0.38) 0%,
    rgba(0,0,0,0.18) 45%,
    rgba(0,0,0,0) 75%);
  filter: blur(2px);
  border-radius: 50%;
  pointer-events: none;
}

/* Right: metadata */
.wc-meta {
  border-left: 1px solid var(--line);
  padding: 40px 36px;
  display: flex;
  align-items: center;
  overflow: hidden;
}
.wc-meta-inner {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 20px;
  animation: wc-meta-in 420ms var(--wc-ease-out) both;
}
@keyframes wc-meta-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.wc-field { display: flex; flex-direction: column; gap: 3px; }
.wc-key {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink3);
}
.wc-val {
  font-family: var(--font);
  font-size: 13px;
  line-height: 1.4;
  color: var(--ink);
}
.wc-val-lead {
  font-family: var(--font-heading);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.2;
  color: var(--ink);
}
.wc-meta-footer {
  margin-top: 4px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.wc-year { color: var(--rose-dark); font-weight: 500; }
.wc-note { margin-left: 6px; color: var(--rose-dark); }

/* ── Footer: arrows + dots ──────────────────────────────────── */
.wc-foot {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 14px 24px;
}
.wc-arrow {
  width: 26px;
  height: 26px;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink2);
  border-radius: var(--wc-radius-sm);
  cursor: pointer;
  display: inline-grid;
  place-items: center;
  transition: color 0.15s, border-color 0.15s, opacity 0.15s;
  flex-shrink: 0;
}
.wc-arrow:hover:not(:disabled) { color: var(--blue); border-color: var(--blue); }
.wc-arrow:disabled { opacity: 0.3; cursor: not-allowed; }

.wc-dots { display: flex; gap: 6px; }
.wc-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--ink3);
  border: none;
  padding: 0;
  opacity: 0.35;
  cursor: pointer;
  transition: opacity 150ms, transform 150ms, background 150ms;
}
.wc-dot:hover { opacity: 0.8; }
.wc-dot.is-on {
  opacity: 1;
  background: var(--ink);
  transform: scale(1.4);
}

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 620px) {
  .wc-body {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr auto;
  }
  .wc-meta {
    border-left: none;
    border-top: 1px solid var(--line);
    padding: 20px 18px;
  }
  .wc-meta-inner { gap: 14px; }
  .wc-panel {
    width: calc(100vw - 24px);
    height: calc(100vh - 24px);
  }
}
