/* The conference schedule that builds itself on scroll. Colours in :root (the Playground palette): indigo is the main
   hall and the line of the hour, coral is the studio, everything else is a warm neutral. GSAP moves .frame, the CSS
   styles .card inside it; GSAP moves .ses (its --g grow) and .ses__text, the CSS styles .ses__face. The minute of the
   day is --now on .grid (moved by the script), from 0 (9:00) to 240 (13:00). */
:root {
  --page: #f1eee8;          /* the page */
  --page-lift: #f9f7f3;     /* the soft lift of the page behind the card */
  --card: #ffffff;          /* the card */
  --ink: #17161c;           /* the words */
  --muted: #8b8790;         /* the small words */
  --line: #e9e6e1;          /* the hairlines of the grid */
  --indigo: #5546ff;        /* the main hall and the line of the hour */
  --coral: #ff6f4f;         /* the studio */
  --button: #17161c;        /* the button */
  --button-ink: #ffffff;    /* the words on the button */
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { background: var(--page); }
html, body { overflow-x: clip; }
body {
  background: var(--page);
  color: var(--ink);
  font-family: 'Mona Sans Variable', 'Mona Sans', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.muted { color: var(--muted); }

.day { position: relative; height: 420vh; }
.stage {
  position: sticky;
  top: 0;
  height: 100vh;
  display: grid;
  place-items: center;
  padding: clamp(8px, 2.4vh, 40px) 12px;
  overflow: hidden;
  isolation: isolate;
  background: radial-gradient(120% 90% at 50% 40%, var(--page-lift), var(--page) 70%);
}
@supports (height: 100lvh) {
  .stage { height: 100lvh; }
}

/* two soft lights behind the card, indigo high on the left and coral low on the right; they drift with the day */
.light {
  position: absolute;
  z-index: -1;
  left: 50%;
  top: 50%;
  width: min(70vw, 70vh, 520px);
  height: min(70vw, 70vh, 520px);
  margin: calc(min(70vw, 70vh, 520px) / -2) 0 0 calc(min(70vw, 70vh, 520px) / -2);
  border-radius: 50%;
  pointer-events: none;
  filter: blur(40px);
}
.light--a { background: radial-gradient(closest-side, color-mix(in srgb, var(--indigo) 30%, transparent), color-mix(in srgb, var(--indigo) 8%, transparent) 60%, transparent); }
.light--b { background: radial-gradient(closest-side, color-mix(in srgb, var(--coral) 30%, transparent), color-mix(in srgb, var(--coral) 8%, transparent) 60%, transparent); }
.grain {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  opacity: 0.09;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23g)'/%3E%3C/svg%3E");
}

/* ---------------------------------------------------------------- the card */
.frame { width: min(100%, 440px); }
.card {
  position: relative;
  border-radius: clamp(18px, 4.4vh, 26px);
  padding: clamp(11px, 3vh, 22px) clamp(11px, 3.4vw, 20px) clamp(11px, 2.8vh, 20px);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(255, 255, 255, 0.82));
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  backdrop-filter: blur(20px) saturate(140%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 1),
    inset 0 0 0 1px rgba(23, 22, 28, 0.05),
    0 1px 2px rgba(23, 22, 28, 0.05),
    0 8px 18px -8px rgba(23, 22, 28, 0.1),
    0 34px 70px -28px rgba(40, 30, 90, 0.24);
}
/* the light under the pointer */
.card__glow {
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  opacity: 0;
  transition: opacity 0.5s ease;
  background: radial-gradient(260px circle at var(--mx, 50%) var(--my, -30%), color-mix(in srgb, var(--indigo) 7%, transparent), transparent 70%);
}
@media (hover: hover) {
  .card:hover .card__glow { opacity: 1; }
}

.head { position: relative; display: flex; align-items: center; gap: 10px; }
.head__mark {
  flex: none;
  display: grid;
  place-items: center;
  width: clamp(26px, 7vh, 34px);
  height: clamp(26px, 7vh, 34px);
  border-radius: 10px;
  background: linear-gradient(160deg, color-mix(in srgb, var(--indigo) 92%, white), var(--indigo));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 4px 10px -4px color-mix(in srgb, var(--indigo) 70%, transparent);
}
.head__mark svg { width: 15px; height: 15px; fill: none; stroke: #fff; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.head__text { flex: 1; min-width: 0; }
.head__title { font-size: clamp(13px, 3.4vh, 15px); font-weight: 620; font-variation-settings: 'wdth' 104; letter-spacing: -0.005em; white-space: nowrap; }
.head__text .muted { font-size: clamp(10.5px, 2.8vh, 12px); margin-top: 1px; white-space: nowrap; }
.chip {
  flex: none;
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 560;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  background: #f6f4f1;
  box-shadow: inset 0 0 0 1px rgba(23, 22, 28, 0.06);
}
.chip__num { display: inline-block; min-width: 0.6em; text-align: right; }

/* the two rooms */
.tracks {
  display: grid;
  grid-template-columns: var(--hourcol) 1fr 1fr;
  margin-top: clamp(9px, 2.8vh, 20px);
  font-size: clamp(10px, 2.6vh, 11.5px);
  font-weight: 560;
  color: var(--muted);
  letter-spacing: 0.01em;
}
.tracks__name { padding-left: 6px; }
.card { --hourcol: clamp(34px, 9vw, 42px); }

/* ---------------------------------------------------------------- the grid of the day */
.grid {
  --now: 0;
  position: relative;
  display: grid;
  grid-template-columns: var(--hourcol) 1fr;
  height: clamp(150px, 48vh, 300px);
  margin-top: clamp(8px, 1.8vh, 12px);
}
.hours { position: relative; }
.hour {
  position: absolute;
  left: 0;
  top: calc(var(--at) / 240 * 100%);
  transform: translateY(-50%);
  font-size: clamp(9.5px, 2.4vh, 10.5px);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  line-height: 1;
  transition: opacity 0.25s ease;
}
.hour i { font-style: normal; display: block; }
.hour.is-hidden { opacity: 0; }

.board { position: relative; }
.rule {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(var(--at) / 240 * 100%);
  height: 1px;
  background: var(--line);
  transform-origin: 0 50%;
}
.rule--half { background: repeating-linear-gradient(90deg, var(--line) 0 3px, transparent 3px 7px); }
.divider { position: absolute; left: 50%; top: 0; bottom: 0; width: 1px; background: linear-gradient(180deg, transparent, var(--line) 12%, var(--line) 88%, transparent); }

.list { list-style: none; position: absolute; inset: 0; }

/* a session: --s start and --d length in minutes, --c its column, --w how many columns, --g its grow (0 to 1, GSAP) */
.ses {
  --g: 0;
  position: absolute;
  left: calc(var(--c) * 50% + 3px);
  width: calc(var(--w) * 50% - 6px);
  top: calc(var(--s) / 240 * 100% + 2px);
  height: max(0px, calc(var(--d) / 240 * 100% * var(--g) - 4px));
  --tint: var(--indigo);
}
.ses--b { --tint: var(--coral); }
.ses--lunch { --tint: #b8b2aa; }

/* the hairline drawn at the start of the session, before the block drops */
.ses__bar {
  position: absolute;
  left: 0;
  right: 0;
  top: -1px;
  height: 2px;
  border-radius: 2px;
  background: var(--tint);
  transform: scaleX(0);
  transform-origin: 0 50%;
}

.ses__face {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border-radius: clamp(7px, 1.8vh, 10px);
  container-type: size;
  background: linear-gradient(180deg, color-mix(in srgb, var(--tint) 11%, white), color-mix(in srgb, var(--tint) 7%, white));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--tint) 16%, transparent), 0 1px 2px rgba(23, 22, 28, 0.04);
  transition: box-shadow 0.4s ease, background 0.4s ease, transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.ses--lunch .ses__face {
  background:
    repeating-linear-gradient(135deg, rgba(23, 22, 28, 0.035) 0 5px, transparent 5px 10px),
    #faf9f7;
  box-shadow: inset 0 0 0 1px rgba(23, 22, 28, 0.06);
}
/* the live session: deeper tint, a ring that catches the light, lifted a hair */
.ses.is-live .ses__face {
  background: linear-gradient(180deg, color-mix(in srgb, var(--tint) 18%, white), color-mix(in srgb, var(--tint) 11%, white));
  box-shadow:
    inset 0 0 0 1px color-mix(in srgb, var(--tint) 42%, transparent),
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 6px 16px -8px color-mix(in srgb, var(--tint) 60%, transparent);
}
@media (hover: hover) {
  .ses:hover .ses__face {
    transform: translateY(-1px);
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--tint) 34%, transparent), 0 8px 18px -10px color-mix(in srgb, var(--tint) 55%, transparent);
  }
}

/* the edge on the left: faint for every session, filled from the top while it is live (--p, the script) */
.ses__edge {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2.5px;
  background: color-mix(in srgb, var(--tint) 30%, transparent);
}
.ses__fill {
  --p: 0;
  position: absolute;
  inset: 0;
  background: var(--tint);
  transform: scaleY(var(--p));
  transform-origin: 50% 0;
}

.ses__text {
  position: absolute;
  left: clamp(7px, 2vw, 10px);
  right: 6px;
  top: clamp(3px, 1vh, 6px);
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}
.ses__text b {
  font-size: clamp(10.5px, 2.8vh, 12.5px);
  font-weight: 600;
  font-variation-settings: 'wdth' 96;
  letter-spacing: -0.005em;
  line-height: 1.2;
  color: color-mix(in srgb, var(--tint) 30%, var(--ink));
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ses--lunch .ses__text { flex-direction: row; align-items: center; gap: 6px; top: 0; bottom: 0; }
.ses--lunch .ses__text b { color: #5e5a63; font-weight: 540; }
.ses__text small {
  font-size: clamp(9px, 2.3vh, 10.5px);
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
  color: color-mix(in srgb, var(--tint) 40%, var(--muted));
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ses__people {
  position: absolute;
  left: clamp(7px, 2vw, 10px);
  bottom: clamp(4px, 1vh, 6px);
  display: flex;
}
/* short blocks: the faces move up beside the title, very short ones hide them */
@container (max-height: 64px) and (max-width: 170px) {
  .ses__people { display: none; }
}
@container (max-height: 64px) and (min-width: 170.01px) {
  .ses__people { top: clamp(4px, 1vh, 6px); bottom: auto; left: auto; right: 6px; }
  .ses__text { right: 44px; }
}
@container (max-height: 42px) {
  .ses__people { display: none; }
  .ses__text { right: 6px; }
}
.av {
  display: grid;
  place-items: center;
  width: clamp(15px, 4vh, 19px);
  height: clamp(15px, 4vh, 19px);
  border-radius: 50%;
  font-style: normal;
  font-size: clamp(6.5px, 1.7vh, 8px);
  font-weight: 650;
  letter-spacing: 0.02em;
  color: #fff;
  box-shadow: 0 0 0 1.5px #fff;
}
.av + .av { margin-left: -4px; }
.av--1 { background: linear-gradient(150deg, #8c80ff, #4b3df0); }
.av--2 { background: linear-gradient(150deg, #ffa58f, #f05a3c); }
.av--3 { background: linear-gradient(150deg, #9b97a3, #4e4a56); }
.av--4 { background: linear-gradient(150deg, #e5b48a, #b97a4a); }

/* the line of the hour across the board, and its time on a pill in the hour column */
.now {
  position: absolute;
  left: -3px;
  right: 0;
  top: calc(var(--now) / 240 * 100%);
  height: 0;
  z-index: 2;
  pointer-events: none;
}
.now__line {
  position: absolute;
  left: 0;
  right: 0;
  top: -0.5px;
  height: 1.5px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--indigo), color-mix(in srgb, var(--indigo) 60%, transparent) 70%, transparent);
  box-shadow: 0 0 8px color-mix(in srgb, var(--indigo) 35%, transparent);
}
.pill {
  position: absolute;
  left: -4px;
  top: calc(var(--now) / 240 * 100%);
  transform: translateY(-50%);
  z-index: 3;
  display: inline-flex;
  align-items: center;
  height: clamp(16px, 4.4vh, 20px);
  padding: 0 5px;
  border-radius: 999px;
  background: var(--indigo);
  color: #fff;
  font-size: clamp(9px, 2.3vh, 10.5px);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), 0 3px 8px -2px color-mix(in srgb, var(--indigo) 60%, transparent);
}
.dg { display: inline-block; height: 1em; overflow: hidden; width: 0.62em; text-align: center; }
.dg__strip { display: block; will-change: transform; }
.dg__strip b { display: block; height: 1em; line-height: 1; font-weight: inherit; }
.pill__colon { padding: 0 0.04em; }
.pill .dg:first-child.is-blank { width: 0; }

/* ---------------------------------------------------------------- the foot */
.foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: clamp(10px, 2.6vh, 20px);
  padding-top: clamp(9px, 2.4vh, 16px);
  border-top: 1px solid var(--line);
}
.foot__sum { display: flex; flex-direction: column; min-width: 0; }
.foot__sum b {
  font-size: clamp(15px, 4.4vh, 20px);
  font-weight: 640;
  font-variation-settings: 'wdth' 96;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}
.foot__sum span { font-size: clamp(10px, 2.6vh, 11.5px); white-space: nowrap; }

.btn {
  position: relative;
  flex: none;
  height: clamp(38px, 10vh, 52px);
  padding: 0 clamp(14px, 4vw, 20px);
  border: 0;
  border-radius: 999px;
  overflow: hidden;
  background: var(--button);
  color: var(--button-ink);
  font: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16), 0 1px 2px rgba(23, 22, 28, 0.2), 0 8px 18px -8px rgba(23, 22, 28, 0.45);
}
.btn:focus-visible { outline: 2px solid var(--indigo); outline-offset: 3px; }
.btn__fill {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, color-mix(in srgb, var(--indigo) 88%, white), var(--indigo));
  transform: scaleX(0);
  transform-origin: 0 50%;
}
.btn__face { position: relative; display: flex; align-items: center; gap: 8px; height: 100%; }
.btn__words {
  font-size: clamp(12.5px, 3.3vh, 14px);
  font-weight: 600;
  font-variation-settings: 'wdth' 100;
  white-space: nowrap;
  transition: font-variation-settings 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@media (hover: hover) {
  .btn:hover .btn__words { font-variation-settings: 'wdth' 112; }
}
.btn__icon { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; overflow: visible; }
.btn__check { stroke-dasharray: 1; stroke-dashoffset: 1; stroke-width: 1.7; }

@media (max-width: 360px) {
  .foot__sum span { display: none; }
}
