/* U22 Tile-Wall Calendar styles */
.u22cal {
  --grout: #0f0b08; --warm: #ffb46b; --gold: #d9b878; --cream: #f4efe6; --gl: 0px; --gw: 100vw;
  position: fixed; top: 0; bottom: 0; left: var(--gl); width: var(--gw); z-index: 100001; display: none; flex-direction: column;
  padding: clamp(64px, 11vh, 96px) clamp(10px, 1.6vw, 22px) clamp(10px, 1.4vw, 18px); gap: clamp(8px, 1.4vh, 14px); overflow: hidden;
  background: radial-gradient(120% 90% at 50% 0%, #3a2a1c 0%, #1d1510 62%, #140f0b 100%); color: var(--cream);
  font-family: 'JSF Maison', 'Cormorant Garamond', Georgia, serif;
  box-shadow: inset 46px 0 60px -34px rgba(0, 0, 0, .95), inset -46px 0 60px -34px rgba(0, 0, 0, .95);
}
.u22cal.show { display: flex; }
.u22cal > * { opacity: 0; transition: opacity .5s ease; }
.u22cal.open > * { opacity: 1; transition: opacity .7s ease .55s; }.cal-tnum { font-feature-settings: "lnum" 1, "tnum" 1, "zero" 1; font-variant-numeric: lining-nums tabular-nums; }
.cal-micro { font-size: 11px; letter-spacing: .18em; text-transform: uppercase; color: rgba(244, 239, 230, .5); line-height: 1; }
.u22cal button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }

.cal-top { position: absolute; left: clamp(12px, 1.8vw, 24px); right: clamp(12px, 1.8vw, 24px); top: clamp(12px, 2vh, 20px); display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px; }
.cal-close { justify-self: end; font-size: 11px !important; letter-spacing: .18em; text-transform: uppercase; color: rgba(244, 239, 230, .5) !important; transition: color .3s; }
.cal-close:hover { color: var(--cream) !important; }
.cal-month { display: flex; align-items: center; gap: clamp(12px, 2vw, 28px); }
.cal-title { margin: 0; font-weight: 300; font-size: clamp(30px, 4.4vw, 62px); line-height: 1; letter-spacing: -.03em; white-space: nowrap; }
.cal-title em { font-style: italic; color: var(--gold); font-weight: 400; }
.cal-arrow { width: 44px; height: 44px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(244, 239, 230, .2); font-size: 18px !important; transition: box-shadow .3s, opacity .3s, transform .4s cubic-bezier(.16, 1, .3, 1); }
.cal-arrow:hover:not(:disabled) { box-shadow: inset 0 0 0 1px var(--gold); transform: scale(1.06); }
.cal-arrow:disabled { opacity: .25; cursor: default; }

.cal-stage { position: relative; flex: 1; min-height: 0; perspective: 1400px; overflow: hidden; }
.cal-sheet { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; transform-origin: 50% 50%; backface-visibility: hidden; }
.cal-sheet.in { animation: calSheetIn .66s cubic-bezier(.76, 0, .18, 1) both; z-index: 2; }
.cal-sheet.out { animation: calSheetOut .66s cubic-bezier(.76, 0, .18, 1) both; z-index: 1; pointer-events: none; }
/* month pages whoosh in/out from behind the curtain edges */
@keyframes calSheetIn { 0% { transform: translateX(calc(108% * var(--dx, 1))) rotateY(calc(-16deg * var(--dx, 1))) scale(.94); filter: blur(7px) brightness(1.6); } 70% { filter: blur(0) brightness(1.1); } 100% { transform: none; filter: none; } }
@keyframes calSheetOut { 0% { transform: none; filter: none; } 100% { transform: translateX(calc(-108% * var(--dx, 1))) rotateY(calc(16deg * var(--dx, 1))) scale(.94); filter: blur(7px) brightness(.5); } }
.cal-dow { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.cal-dow span { font-size: 10.5px; letter-spacing: .24em; text-transform: uppercase; color: rgba(244, 239, 230, .4); padding-left: 4px; }

/* ---------- the tile wall ---------- */
.cal-grid {
  position: relative; flex: none; display: grid; gap: 3px; padding: 3px; border-radius: 4px; background: var(--grout);
  grid-template-columns: repeat(7, 1fr); grid-template-rows: repeat(var(--weeks, 5), 1fr);
  box-shadow: 0 30px 60px -30px rgba(0, 0, 0, .9), inset 0 0 0 1px rgba(255, 255, 255, .04);
}
.cal-cell {
  position: relative; overflow: hidden; min-height: 0; border-radius: 1px; text-align: left; isolation: isolate;
  grid-row: calc(var(--r) + 1); grid-column: calc(var(--c) + 1);
  display: flex !important; flex-direction: column; justify-content: space-between; padding: 7px 9px 6px !important;
  background: #14110e;
}
.cal-cell.void { background: #17120e; }
.cal-cell::before { /* the picture, one piece per date */
  content: ""; position: absolute; inset: 0; z-index: -2;
  background: url('/assets/generated/u22_curtain_party_vertical_9_16.jpg') var(--bx, 0) var(--by, 0) / var(--bw, cover) var(--bh, auto) no-repeat;
  filter: brightness(.34) saturate(.7); transition: filter .6s ease;
}
.cal-cell.void::before { filter: brightness(.2) saturate(.6); }
.cal-cell::after { /* 15.15 cm tile grout inside the date */
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    linear-gradient(115deg, rgba(255, 255, 255, .09), transparent 38%),
    linear-gradient(to right, rgba(8, 6, 5, .62) 1.5px, transparent 1.5px) 0 0 / var(--tx, 40px) 100%,
    linear-gradient(to bottom, rgba(8, 6, 5, .62) 1.5px, transparent 1.5px) 0 0 / 100% var(--ty, 40px);
}

.cal-n { font-size: clamp(15px, 1.7vw, 24px); line-height: 1; letter-spacing: -.01em; color: rgba(244, 239, 230, .62); text-shadow: 0 1px 6px rgba(0, 0, 0, .8); }
.cal-tag { font-size: 9.5px; letter-spacing: .18em; text-transform: uppercase; color: rgba(255, 233, 200, .95); text-shadow: 0 1px 8px rgba(0, 0, 0, .95); line-height: 1.15; }
.cal-cell.past .cal-n { color: rgba(244, 239, 230, .16); text-decoration: line-through; text-decoration-thickness: 1px; }
.cal-cell.today .cal-n::after { content: ""; display: inline-block; width: 5px; height: 5px; margin-left: 6px; border-radius: 50%; background: var(--warm); box-shadow: 0 0 8px var(--warm); vertical-align: middle; }
.cal-cell.off { cursor: default; }

/* lit tiles = screens that are on */
.cal-cell.on { cursor: pointer; }
.cal-cell.on::before { filter: brightness(.82) saturate(1.05) contrast(1.05); animation: calFlicker 5.5s ease-in-out infinite; animation-delay: calc(var(--c) * 370ms); }
.cal-cell.on .cal-n { color: var(--cream); }
.cal-cell.on .cal-tag, .cal-cell.on .cal-n { position: relative; z-index: 2; }
.cal-cell.on:hover::before { filter: brightness(1.05) saturate(1.15); }
.cal-cell.on:hover { box-shadow: inset 0 0 0 1.5px rgba(255, 224, 170, .7); }
.cal-cell.secret::before { filter: brightness(.5) saturate(.5) hue-rotate(-18deg) sepia(.5); }
.cal-cell.secret .cal-tag::before { content: "\2756 "; opacity: .8; }
.cal-cell.sel::before { filter: brightness(1.12) saturate(1.2); animation: none; }
.cal-cell.sel { box-shadow: inset 0 0 0 2px var(--gold), 0 0 28px -4px rgba(255, 180, 107, .65); z-index: 3; }
.cal-cell.sel .cal-n { color: #fff; }
.cal-cell.on::selection { background: none; }
/* scanlines drifting across lit screens */
.cal-cell.on i, .cal-cell.on .cal-n { }
.cal-cell.on { background-image: repeating-linear-gradient(0deg, rgba(255, 255, 255, .035) 0 1px, transparent 1px 3px); }
@keyframes calFlicker { 0%, 100% { opacity: 1; } 47% { opacity: .93; } 50% { opacity: .84; } 53% { opacity: .96; } }

/* boot-up wave when a month appears */
.cal-grid.boot .cal-cell:not(.void) { animation: calBoot .7s cubic-bezier(.16, 1, .3, 1) both; animation-delay: calc((var(--r) + var(--c)) * 55ms + .1s); }
@keyframes calBoot { 0% { opacity: 0; filter: brightness(2.4); transform: scale(.94); } 40% { opacity: 1; filter: brightness(1.5); } 100% { opacity: 1; filter: none; transform: none; } }
/* ripple when a night is picked */
.cal-cell.pulse::before { animation: calPulse .9s ease-out var(--pd, 0ms) 1 both; }
@keyframes calPulse { 0% { filter: brightness(.82); } 35% { filter: brightness(1.4) saturate(1.3); } 100% { filter: brightness(.82); } }

/* ---------- dock: a paper ticket strip, set in ink ---------- */
.cal-dock {
  --paper: #efe5cf; --ink: #1d1710; --ink2: rgba(29, 23, 16, .55); --red: #8f2d27;
  position: relative; display: grid; grid-template-columns: minmax(0, 1.4fr) auto auto auto; align-items: center; gap: clamp(14px, 2.2vw, 30px);
  padding: 11px 16px 11px 26px; border-radius: 3px; color: var(--ink);
  background: radial-gradient(120% 140% at 12% 0%, rgba(255, 255, 255, .5), transparent 55%), linear-gradient(172deg, #f3ead5, #e6dbc2);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .6) inset, 0 16px 28px -14px rgba(0, 0, 0, .85);
}
.cal-dock::before { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; mix-blend-mode: multiply; opacity: .5;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' seed='3'/><feColorMatrix values='0 0 0 0 .35  0 0 0 0 .28  0 0 0 0 .18  0 0 0 .5 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>"); }
.cal-dock::after { /* punched holes on the left edge */ content: ""; position: absolute; left: -7px; top: 0; bottom: 0; width: 14px; pointer-events: none;
  background: radial-gradient(circle at 50% 50%, #1d1510 6px, transparent 6.5px) 0 0 / 14px 22px repeat-y; }
.cal-dock.pop { animation: calDockPop .7s cubic-bezier(.2, 1.4, .4, 1); }
@keyframes calDockPop { 0% { transform: translateY(6px) rotate(-.4deg); } 100% { transform: none; } }
.cal-dock .cal-micro { color: var(--ink2); font-size: 9.5px; }
.cal-sel { display: flex; flex-direction: column; gap: 5px; min-width: 0; position: relative; z-index: 1; }
.cal-sel-t { font-size: clamp(20px, 2vw, 28px); line-height: 1; letter-spacing: -.02em; color: var(--ink); }
.cal-sel-w { font-size: 11.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--ink2); }
.cal-seats { display: flex; align-items: center; gap: 4px; position: relative; z-index: 1; padding: 0 14px; border-left: 1px dashed rgba(29, 23, 16, .3); border-right: 1px dashed rgba(29, 23, 16, .3); }
.cal-seats button { width: 28px; height: 28px; border-radius: 0; box-shadow: none; font-size: 18px !important; color: var(--ink) !important; transition: color .2s, transform .3s cubic-bezier(.2, 1.4, .4, 1); }
.cal-seats button:hover { color: var(--red) !important; transform: scale(1.25); }
.cal-seats span { font-size: 21px; min-width: 1.6ch; text-align: center; }
.cal-total { position: relative; z-index: 1; font-size: clamp(20px, 2.1vw, 28px); letter-spacing: -.02em; min-width: 5ch; text-align: right; color: var(--ink); }
.cal-cta {
  position: relative; z-index: 1; display: inline-flex; align-items: center; justify-content: center; height: 40px; padding: 0 20px; border-radius: 2px;
  background: var(--ink); color: #f3ead5 !important; text-decoration: none; font-size: 11px; letter-spacing: .2em; text-transform: uppercase; white-space: nowrap;
  box-shadow: 0 2px 0 rgba(143, 45, 39, .55); transform: rotate(-.6deg);
  opacity: .35; pointer-events: none; transition: opacity .4s, background .3s, transform .4s cubic-bezier(.2, 1.4, .4, 1), box-shadow .3s;
}
.cal-cta.ready { opacity: 1; pointer-events: auto; }
.cal-cta.ready:hover { background: var(--red); transform: rotate(0deg) translateY(-1px); box-shadow: 0 4px 0 rgba(29, 23, 16, .5); }
@media (max-width: 760px) {
  .cal-top { grid-template-columns: auto 1fr auto; } .cal-top > .cal-micro { display: none; }
  .cal-tag { font-size: 8px; letter-spacing: .1em; }
  .cal-dock { grid-template-columns: 1fr auto; } .cal-seats { border: 0; padding: 0; } .cal-total { text-align: left; } .cal-cta { grid-column: 1 / -1; }
}
@media (prefers-reduced-motion: reduce) {
  .u22cal, .cal-cell, .cal-cell::before, .cal-dock { animation: none !important; transition-duration: .01s !important; }
}
