/* Events Calendar — standalone static site (Vercel). No build step, no deps.
 *
 * This is an APP, not a document: the calendar owns exactly one viewport and
 * nothing scrolls except the detail panel. That constraint drives most of what
 * follows — the week rows share the leftover height so a month always fits, and
 * event bars are positioned over the day cells so one event can cross days. */
:root{
  --bg:#070a12; --bg2:#0b1020; --surface:#111729; --raised:#161d33;
  --border:#1e2740; --border2:#2a3552;
  --text:#eef2fb; --muted:#93a0bd; --faint:#5f6b8a;
  --accent:#22d3ee; --accent2:#67e8f9; --accent-soft:rgba(34,211,238,.12);
  --purple:#7c3aed; --amber:#f0a92e;
  --radius:16px; --radius-sm:10px;
  --display:"Outfit",system-ui,sans-serif; --body:"Inter",system-ui,sans-serif;
}
*{box-sizing:border-box;margin:0;padding:0}
body{background:var(--bg);color:var(--text);font-family:var(--body);line-height:1.55;-webkit-font-smoothing:antialiased}
body::before{content:"";position:fixed;inset:0;z-index:-1;background:
  radial-gradient(55vw 55vw at 12% 0%, rgba(34,211,238,.12), transparent 60%),
  radial-gradient(45vw 45vw at 95% 30%, rgba(124,58,237,.10), transparent 60%), var(--bg);}
img{max-width:100%;display:block}
[hidden]{display:none !important}
a{color:inherit;text-decoration:none}
button{font-family:inherit}
::selection{background:var(--accent-soft);color:var(--accent2)}

/* ============ one-viewport shell ============ */
html, body.app{height:100%;overflow:hidden}
body.app{display:grid;grid-template-rows:auto 1fr}

/* ============ topbar ============ */
/* z-index matters: backdrop-filter makes this a stacking context, and without a
   z-index of its own the calendar (a later sibling) painted OVER the filters
   dropdown on mobile — it appeared behind the grid. */
.tb{display:flex;align-items:center;gap:18px;padding:0 18px;height:60px;flex:none;position:relative;z-index:50;
  background:rgba(11,16,32,.82);backdrop-filter:blur(14px);border-bottom:1px solid var(--border)}
.tb-brand{display:flex;align-items:center;gap:9px;font-family:var(--display);font-weight:700;font-size:16px;flex:none}
.tb-brand img{width:26px;height:26px;border-radius:7px}
.tb-brand b{color:var(--accent)}
.tb-nav{display:flex;align-items:center;gap:6px;flex:none}
.tb-icon{width:32px;height:32px;border-radius:9px;display:grid;place-items:center;background:var(--raised);
  border:1px solid var(--border);color:var(--text);font-size:19px;line-height:1;cursor:pointer;transition:all .14s}
.tb-icon:hover{border-color:var(--accent);color:var(--accent2)}
.tb-today{padding:7px 14px;border-radius:9px;background:var(--raised);border:1px solid var(--border);
  color:var(--text);font-weight:600;font-size:13px;cursor:pointer;transition:all .14s}
.tb-today:hover{border-color:var(--accent);color:var(--accent2)}
.tb-title{font-family:var(--display);font-size:19px;font-weight:700;margin-left:10px;white-space:nowrap}
.tb-tools{display:flex;align-items:center;gap:9px;margin-left:auto;flex:none}
.tb-search{display:flex;align-items:center;gap:7px;padding:0 11px;height:34px;background:var(--bg2);
  border:1px solid var(--border);border-radius:9px}
.tb-search input{width:150px;background:none;border:0;outline:0;color:var(--text);font-family:var(--body);font-size:13px}
.tb-tools select{height:34px;padding:0 10px;background:var(--bg2);border:1px solid var(--border);border-radius:9px;
  color:var(--text);font-family:var(--body);font-size:13px;cursor:pointer;max-width:160px}
.tb-cta{padding:8px 15px;border-radius:9px;background:linear-gradient(135deg,var(--accent2),var(--accent));
  color:#04222a;font-weight:700;font-size:13px;white-space:nowrap}
.tb-burger{display:none;background:none;border:0;color:var(--text);font-size:20px;cursor:pointer}

/* ============ shell: calendar + detail ============ */
.shell{display:grid;grid-template-columns:1fr 380px;min-height:0;overflow:hidden}

/* ============ calendar ============ */
.cal{position:relative;display:flex;flex-direction:column;min-height:0;padding:14px 16px 16px}
.cal-head{display:grid;grid-template-columns:repeat(7,1fr);gap:6px;flex:none;margin-bottom:6px}
.cal-head span{text-align:center;font-size:11px;font-weight:700;letter-spacing:.09em;text-transform:uppercase;
  color:var(--faint);padding-bottom:4px}
/* Weeks split the leftover height evenly, so the month always fits the screen. */
.cal-weeks{flex:1;display:flex;flex-direction:column;gap:6px;min-height:0}
.cal-week{position:relative;flex:1;display:grid;grid-template-columns:repeat(7,1fr);gap:6px;min-height:0}

.day{position:relative;border-radius:11px;background:var(--surface);border:1px solid var(--border);
  padding:5px 7px;min-width:0;overflow:hidden;transition:border-color .14s,background .14s}
/* Days outside the month keep a faint body: they used to be fully transparent,
   so a multi-day bar crossing a month boundary appeared to float in empty space
   — which is what looked broken at the end of the month. */
.day.out{background:rgba(17,23,41,.4);border-color:rgba(30,39,64,.5)}
.day.out .day-n{color:var(--faint);opacity:.5}
.day.today{border-color:var(--accent);background:var(--accent-soft)}
.day-n{font-size:12px;font-weight:700;color:var(--muted);position:relative;z-index:1}
.day.today .day-n{color:var(--accent2)}

/* Bars sit ABOVE the day cells so one event can cover several columns — a normal
   grid child could not, without breaking the day boxes underneath. */
/* 30px, measured not guessed: the day number's text box runs to 27px from the
   top of the week row, so anything less overlaps it. */
.week-bars{position:absolute;inset:30px 0 4px;pointer-events:none}
/* 22px tall on a 26px lane pitch: the old 20/23 left a 3px gap and the bars
   read as one solid block. */
.bar{position:absolute;height:22px;pointer-events:auto;cursor:pointer;display:flex;align-items:center;gap:5px;
  padding:0 8px;border-radius:6px;border:1px solid var(--ec-bd,var(--border2));background:var(--ec-bg,var(--raised));
  color:var(--ec-fg,var(--text));font-size:11.5px;font-weight:600;white-space:nowrap;overflow:hidden;
  text-overflow:ellipsis;font-family:var(--body);text-align:left;transition:filter .14s,transform .14s}

/* Quiet weeks: taller bars so a long name can wrap and be read in full.
   The height is FIXED, not auto — with `height:auto` each bar sized itself to
   its own text, so a one-word event and a wrapped one sat side by side at
   wildly different heights and the week looked broken. Every bar in a roomy
   week is the same height; only the text inside differs. */
.week-bars.roomy .bar{height:40px;align-items:flex-start;padding:5px 8px}
.week-bars.roomy .bar>span:last-child{white-space:normal;overflow:hidden;line-height:1.28;
  display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical}
.week-bars.roomy .bar-time{flex:none;line-height:1.28}
.week-bars.roomy .bar-dot{margin-top:6px}
.bar:hover{filter:brightness(1.25);transform:translateY(-1px)}
.bar.sel{outline:2px solid var(--ec-fg,var(--accent));outline-offset:1px}
/* A run continuing past the edge of the week loses its rounding on that side, so
   it reads as one event across weeks rather than several separate ones. */
.bar.cont-l{border-top-left-radius:0;border-bottom-left-radius:0;border-left-color:transparent}
.bar.cont-r{border-top-right-radius:0;border-bottom-right-radius:0;border-right-color:transparent}
.bar-time{opacity:.75;font-variant-numeric:tabular-nums}
.bar-dot{width:6px;height:6px;border-radius:50%;background:currentColor;flex:none}
.day-more{position:absolute;left:7px;bottom:3px;font-size:10.5px;color:var(--muted);background:none;border:0;
  cursor:pointer;font-weight:600;z-index:2}
.day-more:hover{color:var(--accent2)}

/* Sat as bare text over the grid, so it collided with the day cells and was
   unreadable. It is now a proper card, centred over a dimmed month, with the
   grid faded behind it so the message is clearly the thing to read. */
.cal-empty{position:absolute;inset:0;display:grid;place-items:center;z-index:5;pointer-events:none;
  background:radial-gradient(58% 58% at 50% 50%, rgba(7,10,18,.95), rgba(7,10,18,.74));backdrop-filter:blur(2px);
  animation:empty-in .32s cubic-bezier(.16,1,.3,1) both}
.cal-empty-card{pointer-events:auto;text-align:center;padding:30px 34px;max-width:380px;
  background:var(--surface);border:1px solid var(--border2);border-radius:18px;
  box-shadow:0 24px 60px rgba(0,0,0,.5)}
.cal-empty-ic{font-size:44px;margin-bottom:10px;display:block;animation:empty-float 3.4s ease-in-out infinite}
.cal-empty h3{font-family:var(--display);font-size:19px;color:var(--text);margin-bottom:6px}
.cal-empty p{font-size:14px;color:var(--muted);line-height:1.55}
.cal-empty .btn{margin-top:16px}
@keyframes empty-in{from{opacity:0}to{opacity:1}}
@keyframes empty-float{0%,100%{transform:translateY(0)}50%{transform:translateY(-6px)}}
.cal-banner{position:absolute;left:16px;right:16px;bottom:16px;padding:11px 15px;background:rgba(240,74,74,.14);
  border:1px solid rgba(240,74,74,.4);border-radius:11px;font-size:13.5px}

/* ============ detail panel ============ */
.side{border-left:1px solid var(--border);background:var(--bg2);overflow-y:auto;overscroll-behavior:contain;min-height:0}
.side-empty{padding:40px 26px;text-align:center;color:var(--muted)}
.side-empty-ic{font-size:40px;margin-bottom:10px;opacity:.8}
.side-empty h2{font-family:var(--display);font-size:19px;color:var(--text);margin-bottom:7px}
.side-empty p{font-size:14px;line-height:1.6}
.side-legend{margin-top:26px;display:flex;flex-direction:column;gap:8px;text-align:left}
.side-legend-row{display:flex;align-items:center;gap:9px;font-size:12.5px}
.side-legend-sw{width:13px;height:13px;border-radius:4px;flex:none;border:1px solid rgba(255,255,255,.14)}

/* Gradient first (the placeholder), longhands after: the `background` shorthand
   resets background-size/position, which is what made images render at their
   natural size anchored top-left. */
.sd-banner{height:150px;position:relative;background:linear-gradient(135deg,var(--accent),var(--purple));
  background-size:cover;background-position:center;background-repeat:no-repeat}
.sd-close{position:absolute;top:10px;right:10px;width:30px;height:30px;border-radius:8px;background:rgba(7,10,18,.6);
  border:1px solid rgba(255,255,255,.2);color:#fff;display:grid;place-items:center;cursor:pointer;font-size:15px;backdrop-filter:blur(4px)}
.sd-close:hover{background:rgba(7,10,18,.85)}
.sd-body{padding:18px 22px 26px}
.sd-tags{display:flex;gap:6px;flex-wrap:wrap;margin-bottom:11px}
.sd-title{font-family:var(--display);font-size:22px;font-weight:800;line-height:1.2;margin-bottom:14px}
.sd-meta{display:flex;flex-direction:column;gap:9px;padding:13px 0;border-top:1px solid var(--border);border-bottom:1px solid var(--border)}
.sd-row{display:flex;align-items:center;gap:9px;font-size:13.5px;color:var(--muted)}
.sd-row b{color:var(--text)}
.sd-studio-logo{width:22px;height:22px;border-radius:6px;object-fit:cover;flex:none}
.sd-desc{margin-top:14px;font-size:14px;line-height:1.65;color:var(--muted);white-space:pre-wrap}
.sd-actions{margin-top:18px;display:flex;flex-direction:column;gap:8px}
.sd-actions .btn{width:100%;justify-content:center}

.chip{display:inline-flex;align-items:center;gap:5px;padding:3px 9px;border-radius:999px;font-size:11.5px;
  font-weight:700;border:1px solid var(--border2);background:var(--raised);color:var(--muted)}
.chip-amber{background:rgba(240,169,46,.14);color:var(--amber);border-color:rgba(240,169,46,.34)}

.btn{display:inline-flex;align-items:center;gap:8px;padding:10px 17px;border-radius:10px;font-weight:700;
  font-size:14px;border:1px solid transparent;cursor:pointer;font-family:var(--body);transition:all .15s}
.btn-primary{background:linear-gradient(135deg,var(--accent2),var(--accent));color:#04222a}
.btn-primary:hover{transform:translateY(-1px)}
.btn-ghost{background:var(--raised);border-color:var(--border2);color:var(--text)}
.btn-ghost:hover{border-color:var(--accent);color:var(--accent2)}

.skel{background:linear-gradient(90deg,var(--surface),var(--raised),var(--surface));background-size:200% 100%;
  animation:sk 1.3s linear infinite;border-radius:11px}
@keyframes sk{to{background-position:-200% 0}}

/* ============ narrow screens ============
   Below the split point the detail becomes an overlay sheet: two columns on a
   phone would leave the calendar unusably thin. */
@media (max-width:1080px){
  .shell{grid-template-columns:1fr}
  .side{position:fixed;top:60px;bottom:0;right:0;width:min(400px,92vw);z-index:40;
    transform:translateX(101%);transition:transform .22s ease;box-shadow:-18px 0 50px rgba(0,0,0,.5)}
  .side.open{transform:translateX(0)}
  .side-empty{display:none}
}
@media (max-width:860px){
  .tb{gap:10px;padding:0 12px}
  .tb-title{font-size:16px;margin-left:4px}
  .tb-tools{position:absolute;top:60px;left:0;right:0;flex-direction:column;align-items:stretch;gap:8px;
    padding:12px;background:var(--bg2);border-bottom:1px solid var(--border);display:none;z-index:60;
    box-shadow:0 18px 40px rgba(0,0,0,.55)}
  .tb-tools.open{display:flex}
  .tb-tools select,.tb-search{width:100%;max-width:none}
  .tb-search input{width:100%}
  .tb-burger{display:block}
  .tb-brand span{display:none}
}
@media (max-width:560px){
  .cal{padding:8px}
  .cal-week{gap:4px}
  .day{padding:3px 4px;border-radius:8px}
  .bar{font-size:10px;padding:0 5px;height:17px}
  .bar-time{display:none}
}

/* Finished events stay on the calendar as history, but reading as past. */
.bar.past{opacity:.42;filter:saturate(.55)}
.bar.past:hover{opacity:.8;filter:saturate(.9)}


/* ---- Hover preview ----
   Shows the poster and the summary on hover. The detail panel then carries the
   full description only, so the two are not saying the same thing twice. */
.ev-pop{position:fixed;z-index:200;width:290px;border-radius:14px;overflow:hidden;pointer-events:none;
  background:var(--surface);border:1px solid var(--border2);box-shadow:0 24px 60px rgba(0,0,0,.6);
  opacity:0;transform:translateY(6px);transition:opacity .13s ease,transform .13s ease}
.ev-pop.show{opacity:1;transform:translateY(0)}
.ev-pop-img{height:150px;background:linear-gradient(135deg,var(--accent),var(--purple));
  background-size:cover;background-position:center;background-repeat:no-repeat}
.ev-pop-b{padding:13px 15px 15px}
.ev-pop-t{font-family:var(--display);font-weight:700;font-size:15.5px;margin-bottom:5px;line-height:1.25}
.ev-pop-m{font-size:12px;color:var(--faint);margin-bottom:8px;display:flex;gap:7px;flex-wrap:wrap}
.ev-pop-s{font-size:13px;color:var(--muted);line-height:1.55;
  display:-webkit-box;-webkit-line-clamp:4;-webkit-box-orient:vertical;overflow:hidden}
@media (hover:none){.ev-pop{display:none}}


/* ============ motion ============
   Everything here is subtle and short: a calendar is a tool, and animation
   should confirm what happened, never make you wait for it. All of it is
   dropped entirely for anyone who asked the OS to reduce motion. */
@keyframes bar-in{from{opacity:0;transform:translateY(-4px) scaleX(.97)}to{opacity:1;transform:none}}
.bar{animation:bar-in .26s cubic-bezier(.16,1,.3,1) both;animation-delay:var(--d,0ms)}
.bar:active{transform:translateY(0) scale(.985)}

@keyframes month-in{from{opacity:0;transform:translateX(var(--slide,10px))}to{opacity:1;transform:none}}
.cal-weeks.swap{animation:month-in .3s cubic-bezier(.16,1,.3,1) both}

/* The detail slides in from the side it lives on, so it reads as arriving from
   the panel rather than appearing out of nowhere. */
@keyframes sd-in{from{opacity:0;transform:translateX(16px)}to{opacity:1;transform:none}}
.side-detail{animation:sd-in .26s cubic-bezier(.16,1,.3,1) both}
.side-empty{animation:sd-in .26s cubic-bezier(.16,1,.3,1) both}

.tb-icon,.tb-today{transition:all .14s,transform .12s}
.tb-icon:active,.tb-today:active{transform:scale(.92)}
.tb-cta{position:relative;overflow:hidden;border:0;cursor:pointer;
  transition:transform .14s,box-shadow .18s,filter .14s}
.tb-cta:hover{transform:translateY(-1px);box-shadow:0 10px 26px rgba(34,211,238,.35);filter:brightness(1.05)}
.tb-cta:active{transform:translateY(0) scale(.97)}
/* Sheen sweep on hover — a single pass, not a loop. */
.tb-cta::after{content:"";position:absolute;top:0;left:-120%;width:60%;height:100%;
  background:linear-gradient(100deg,transparent,rgba(255,255,255,.45),transparent);transition:left .55s ease}
.tb-cta:hover::after{left:140%}

.btn{transition:transform .14s,box-shadow .18s,filter .14s,border-color .14s,color .14s}
.btn:active{transform:scale(.97)}
.day{transition:border-color .14s,background .14s,transform .14s}
.day:not(.out):hover{border-color:var(--border2)}

@media (prefers-reduced-motion:reduce){
  *,*::before,*::after{animation-duration:.01ms!important;animation-iteration-count:1!important;
    transition-duration:.01ms!important;scroll-behavior:auto!important}
}
