/* Tantrum Advent Calendar 2026 — traditional card calendar */
:root {
  --ink: #f1e4c0;
  --ink-dim: #d2c19a;
  --gold: #e8c97a;
  --page: 1000px;
  --gutter: clamp(0.85rem, 2.4vw, 1.45rem);
  --row-gap: clamp(1.4rem, 3.6vw, 2.1rem);
  --font: "Cinzel", "Palatino Linotype", Palatino, "Times New Roman", Times, serif;
}

* { box-sizing: border-box; }

html {
  min-height: 100%;
  background-color: #1a1614;
  overflow-x: hidden;
}

body {
  margin: 0;
  min-height: 100%;
  background: #1a1614;
  color: var(--ink);
  font-family: var(--font);
  overflow-x: hidden;
}

/* Full-bleed calendar: the picture goes edge to edge, title and footer sit on the artwork. */
.page {
  max-width: none;
  width: 100%;
  margin: 0;
  padding: 0;
  position: relative;
  overflow-x: hidden;
  overflow-y: visible;
}

.masthead {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 40;
  text-align: center;
  padding: 0.45rem 0.7rem 1.8rem;
  /* Soft fade for the type only — not a plate behind the splat. */
  background: linear-gradient(180deg, rgba(14, 11, 9, 0.62) 0%, rgba(14, 11, 9, 0.22) 58%, rgba(14, 11, 9, 0) 100%);
  pointer-events: none;
}

h1 {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem 0.6rem;
  margin: 0;
  font-weight: 600;
  font-size: clamp(0.84rem, 3.9vw, 1.62rem);
  letter-spacing: 0.055em;
  line-height: 1.15;
  text-wrap: balance;
  text-shadow:
    0 1px 2px rgba(0, 0, 0, 0.85),
    0 2px 10px rgba(0, 0, 0, 0.7);
}

.title-text { text-align: left; }

/* The logo is used exactly as supplied: no plate, no outline, no recolour. */
.splat {
  height: 3.6em;
  width: auto;
  flex-shrink: 0;
  display: block;
  pointer-events: none;
}

.subtitle {
  margin: 0.35rem 0 0;
  font-size: clamp(0.72rem, 2.2vw, 0.95rem);
  font-weight: 400;
  letter-spacing: 0.02em;
  color: var(--ink-dim);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.85), 0 2px 8px rgba(0, 0, 0, 0.6);
}

.stage {
  position: relative;
  width: 100%;
  line-height: 0;
  overflow: visible;
}

.scene {
  width: 100%;
  height: auto;
  display: block;
}

/* 4 x 6 grid of 16:9 video-shaped doors, centred on the tall picture. */
.doors-wrap {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(0.9rem, 4.4%, 1.7rem);
  pointer-events: none;
  overflow: visible;
}

.doors {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-template-rows: repeat(6, auto);
  column-gap: var(--gutter);
  row-gap: var(--row-gap);
  pointer-events: auto;
  overflow: visible;
}

.cell {
  position: relative;
  aspect-ratio: 16 / 9;
  width: 100%;
  min-width: 0;
  min-height: 0;
  z-index: 1;
}
.cell.is-open { z-index: 20; }
/* Earlier doors in a row sit above later ones, so a flap leaning right lies over its neighbour. */
.cell:nth-child(4n+1) { z-index: 4; }
.cell:nth-child(4n+2) { z-index: 3; }
.cell:nth-child(4n+3) { z-index: 2; }
.cell:nth-child(4n+4) { z-index: 1; }
.cell.is-open:nth-child(4n+1) { z-index: 24; }
.cell.is-open:nth-child(4n+2) { z-index: 23; }
.cell.is-open:nth-child(4n+3) { z-index: 22; }
.cell.is-open:nth-child(4n+4) { z-index: 21; }

/* ---------- The opening: just the video ---------- */
.reveal {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: #070504;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.6), inset 0 0 12px rgba(0, 0, 0, 0.5);
  opacity: 0;
  pointer-events: none;
  z-index: 1;
}
.cell.is-open .reveal { opacity: 1; pointer-events: auto; }

.video-btn {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  margin: 0;
  border: 0;
  background: #070504;
  cursor: pointer;
  line-height: 0;
}
.video-btn:focus-visible { outline: 2px solid #fff4c8; outline-offset: -3px; }

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

.play {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: clamp(2rem, 5.2vw, 2.9rem);
  height: clamp(2rem, 5.2vw, 2.9rem);
  border-radius: 50%;
  background: rgba(14, 10, 6, 0.74);
  border: 1.5px solid rgba(243, 230, 194, 0.92);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
  pointer-events: none;
  transition: transform 0.15s ease, background 0.15s ease;
}
.play::before {
  content: "";
  position: absolute;
  left: 54%;
  top: 50%;
  transform: translate(-40%, -50%);
  border-style: solid;
  border-width: 0.5rem 0 0.5rem 0.82rem;
  border-color: transparent transparent transparent #f3e6c2;
}
.video-btn:hover .play,
.video-btn:focus-visible .play { transform: translate(-50%, -50%) scale(1.08); background: rgba(150, 40, 20, 0.85); }

.player {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  background: #000;
}

.coming-fill {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.3rem;
  color: var(--gold);
  font-size: clamp(0.62rem, 1.5vw, 0.85rem);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-align: center;
}

/* Small link in the gutter just under the opened video */
.yt-link {
  position: absolute;
  right: 0;
  top: calc(100% + 1px);
  z-index: 5;
  display: none;
  padding: 0.04em 0.4em 0.06em;
  font-family: var(--font);
  font-size: clamp(0.42rem, 0.78vw, 0.52rem);
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1.35;
  white-space: nowrap;
  color: #f1e4c0;
  text-decoration: none;
  background: rgba(14, 10, 6, 0.82);
  border: 1px solid rgba(232, 201, 122, 0.45);
  border-radius: 1px;
}
.cell.is-open .yt-link { display: block; }
.yt-link:hover,
.yt-link:focus-visible { background: #e8c97a; color: #1a1004; outline: none; }

/* ---------- Fine tear-out perforation around each closed door ---------- */
.perf {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: visible;
  z-index: 4;
  opacity: 0.72;
}
.cell.is-open .perf { opacity: 0; }
.perf-edge {
  position: absolute;
  pointer-events: none;
  --pitch: 6px;
  background-image:
    radial-gradient(circle at 50% 50%, rgba(243, 248, 255, 0.9) 1.15px, transparent 1.35px),
    radial-gradient(circle at 50% 50%, rgba(8, 6, 12, 0.7) 1.5px, transparent 1.7px);
  background-size: var(--pitch) var(--pitch);
}
.perf-t, .perf-b { left: 0; right: 0; height: var(--pitch); background-repeat: repeat-x; background-position: 0 50%, 0 50%; }
.perf-t { top: -1px; }
.perf-b { bottom: -1px; }
.perf-l, .perf-r { top: 3px; bottom: 3px; width: var(--pitch); background-repeat: repeat-y; background-position: 50% 0, 50% 0; }
.perf-l { left: -1px; }
.perf-r { right: -1px; }

.cell.is-today:not(.is-open) .perf {
  opacity: 1;
  filter:
    drop-shadow(0 0 2px #ffe9a8)
    drop-shadow(0 0 7px #ffd24a)
    drop-shadow(0 0 14px rgba(255, 200, 70, 0.95));
  animation: glow 1.8s ease-in-out infinite;
}
@keyframes glow {
  0%, 100% { filter: drop-shadow(0 0 2px #ffe9a8) drop-shadow(0 0 6px #ffd24a) drop-shadow(0 0 11px rgba(255, 200, 70, 0.75)); }
  50% { filter: drop-shadow(0 0 3px #fff4c8) drop-shadow(0 0 10px #ffe078) drop-shadow(0 0 18px rgba(255, 210, 90, 1)); }
}

/* ---------- The door (flap) ---------- */
.flap {
  appearance: none;
  -webkit-appearance: none;
  position: absolute;
  inset: 0;
  padding: 0;
  margin: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  font: inherit;
  color: inherit;
  touch-action: manipulation;
  perspective: 1200px;
  z-index: 6;
}
.flap:focus { outline: none; }
.flap:focus-visible .leaf-front { outline: 2px solid #fff4c8; outline-offset: 2px; }
.cell.is-open .flap { pointer-events: none; }
.cell.is-open .flap .leaf { pointer-events: auto; cursor: pointer; }

.leaf {
  position: absolute;
  inset: 0;
  transform-origin: right center;   /* hinge on the right edge of the opening, flap swings out to the right */
  transform-style: preserve-3d;
  transition: transform 0.75s cubic-bezier(0.2, 0.75, 0.15, 1);
}

.leaf-front,
.leaf-back {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

/* Closed: no fill, the photograph stays sharp. Big bold number centred on the door. */
.leaf-front { display: block; background: transparent; }

.num {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-weight: 900;
  font-size: clamp(1.85rem, 4.8vw, 3rem);
  letter-spacing: 0.01em;
  line-height: 1;
  color: #ead08a;
  text-shadow:
    0 0 5px rgba(0, 0, 0, 0.8),
    0 1px 3px rgba(0, 0, 0, 0.7),
    0 0 10px rgba(0, 0, 0, 0.45);
  pointer-events: none;
}

.lock {
  position: absolute;
  top: 0.4em;
  left: 0.4em;
  width: 7px;
  height: 8px;
  opacity: 0.5;
  pointer-events: none;
  filter: drop-shadow(0 0 1px #140c06);
}
.lock svg { display: block; width: 100%; height: 100%; fill: #fff4c8; stroke: #140c06; stroke-width: 0.6; }

/* Open: back of the door is plain light card with a torn, perforated free edge. */
.leaf-back {
  transform: rotateY(180deg);
  background-color: #e6e2da;
  box-shadow: inset 0 1px 0 rgba(0,0,0,0.22), inset 0 -2px 0 rgba(0,0,0,0.28);
  background-image:
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='140' height='140'><filter id='n' x='0' y='0' width='100%25' height='100%25'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.36  0 0 0 0 0.34  0 0 0 0 0.31  0 0 0 0.20 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>"),
    linear-gradient(180deg, rgba(255, 255, 255, 0.35), rgba(0, 0, 0, 0.05)),
    linear-gradient(90deg, #c7c2b9 0%, #dedad2 12%, #efece6 45%, #f4f1ec 70%, #e2ded6 100%);
  /* torn edge on the free (visual right) side */
  clip-path: polygon(0 0, 100% 0, 99.2% 7%, 100% 14%, 99% 22%, 100% 30%, 99.3% 38%, 100% 46%, 99% 54%, 100% 62%, 99.3% 70%, 100% 78%, 99% 86%, 100% 93%, 99.2% 100%, 0 100%);
}
/* perforation holes just inside the free edge */
.leaf-back::after {
  content: "";
  position: absolute;
  top: 4px;
  bottom: 4px;
  right: 5px;
  width: 6px;
  background-image: radial-gradient(circle at 50% 50%, rgba(70, 64, 58, 0.62) 1.25px, rgba(255, 255, 255, 0.55) 1.45px, transparent 1.8px);
  background-size: 6px 6px;
  background-repeat: repeat-y;
}
/* fold shade at the hinge (visual left of the back face) */
.leaf-back::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(50, 40, 30, 0.55) 0, rgba(50, 40, 30, 0.18) 14%, rgba(50, 40, 30, 0) 34%);
}
/* Swing angles (past 90deg so the plain back is what you see) */
.cell.is-open .leaf { transform: rotateY(94deg); }

/* Soft shadow the swung door throws on its neighbour */
.flap-shadow {
  position: absolute;
  left: 96%;
  top: 8%;
  bottom: -8%;
  width: 36%;
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.62), rgba(0, 0, 0, 0.42) 40%, rgba(0, 0, 0, 0));
  filter: blur(7px);
  opacity: 0;
  pointer-events: none;
  z-index: 2;
  transition: opacity 0.5s ease 0.15s;
}
.cell.is-open .flap-shadow { opacity: 1; }

.cell.is-locked .flap { cursor: not-allowed; }

.cell.is-shaking { animation: shake 0.42s ease; }
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-5px); }
  40% { transform: translateX(5px); }
  60% { transform: translateX(-3px); }
  80% { transform: translateX(3px); }
}

.cell[data-tip] .flap::before {
  content: attr(data-tip);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 4px);
  transform: translateX(-50%);
  padding: 0.18em 0.45em;
  background: rgba(12, 8, 0, 0.92);
  color: var(--ink);
  font-size: 0.62rem;
  font-weight: 400;
  letter-spacing: 0.02em;
  white-space: nowrap;
  border: 1px solid rgba(224, 195, 106, 0.45);
  border-radius: 2px;
  opacity: 0;
  pointer-events: none;
  z-index: 6;
  transition: opacity 0.15s ease;
  line-height: 1.2;
}
.cell[data-tip] .flap:hover::before,
.cell[data-tip] .flap:focus-visible::before { opacity: 1; }

.foot {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  text-align: center;
  padding: 1.6rem 0.6rem 0.55rem;
  line-height: 1.4;
  background: linear-gradient(0deg, rgba(14, 11, 9, 0.7) 0%, rgba(14, 11, 9, 0.22) 62%, rgba(14, 11, 9, 0) 100%);
  pointer-events: none;
}
.foot p { margin: 0 0 0.45rem; }
.foot a { pointer-events: auto; }
.playlist {
  color: var(--gold);
  text-decoration: none;
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  border-bottom: 1px solid rgba(224, 195, 106, 0.55);
  padding-bottom: 0.1em;
}
.playlist:hover, .playlist:focus-visible { color: #fff4c8; border-bottom-color: #fff4c8; outline: none; }
.credit { color: #a8997a; font-size: 0.8rem; letter-spacing: 0.06em; }

/* ---------- Phone: 2 columns x 12 rows ---------- */
@media (max-width: 600px) {
  .page { padding: 0; overflow-x: hidden; }
  :root { --gutter: 1.05rem; --row-gap: 1.95rem; }
  .splat { height: 3.2em; }
  .lock { width: 6px; height: 7px; }
  h1 { gap: 0.2rem 0.35rem; letter-spacing: 0.035em; }
  .num { font-size: 2.05rem; }
  .yt-link { font-size: 0.48rem; top: calc(100% + 1px); }
  .masthead { padding: 0.35rem 0.45rem 1.4rem; }
  .foot { padding: 1.3rem 0.45rem 0.45rem; }

  /* The photo covers the taller stage (sides cropped, full height of the scene kept). */
  .scene { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 66% 42%; }
  .doors-wrap { position: relative; display: block; padding: 6.3rem 0.7rem 5.6rem; }
  .doors { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: repeat(12, auto); }
  .cell:nth-child(2n+1) { z-index: 2; }
  .cell:nth-child(2n) { z-index: 1; }
  .cell.is-open:nth-child(2n+1) { z-index: 22; }
  .cell.is-open:nth-child(2n) { z-index: 21; }
}

@media (prefers-reduced-motion: reduce) {
  .leaf, .flap-shadow, .play, .cell[data-tip] .flap::before { transition: none; }
  .cell.is-today:not(.is-open) .perf, .cell.is-shaking { animation: none; }
}
