/* The conference schedule tabs with the talks that slide in: the schedule card of Fernway Ideas, an invented
   conference of ideas, alone on a white page. The indicator under the tabs is moved by script.js on a spring (it
   stretches while it travels); the talks slide out and in the way you went; a hovered talk opens with its summary. */
:root {
  --page: #ffffff;                       /* the page */
  --card: #fcfbf8;                       /* the body of the card */
  --card-top: #ffffff;                   /* the top of the card, where the light falls */
  --ink: #17161a;                        /* titles */
  --muted: #76737b;                      /* speakers, times, small words */
  --faint: #b6b2ac;                      /* the quietest words */
  --line: rgba(23, 22, 26, 0.07);        /* hairlines */
  --track: #f1efea;                      /* the well the tabs sit in */
  --accent: #1f7a53;                     /* the one colour: fern green */
  --accent-soft: rgba(31, 122, 83, 0.1); /* the tint of the accent */
  --row: clamp(42px, 10.6vh, 58px);      /* the height of a closed talk */
  --font: 'Mona Sans Variable', system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { touch-action: manipulation; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--page);
  color: var(--ink);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }

.stage {
  position: relative;
  min-height: 100vh;
  display: grid;
  justify-items: center;
  align-items: start;
  padding: clamp(8px, 3vh, 32px) 12px;
}

/* ---------- the card ---------- */
.prog {
  position: relative;
  width: min(392px, 92vw);
  padding: clamp(11px, 2.6vh, 20px) clamp(11px, 3.4vw, 18px) clamp(9px, 2vh, 14px);
  border-radius: 22px;
  background:
    radial-gradient(110% 55% at 12% 0%, rgba(31, 122, 83, 0.055), transparent 62%),
    linear-gradient(180deg, var(--card-top), var(--card) 40%);
  border: 1px solid rgba(23, 22, 26, 0.07);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.95) inset,
    0 1px 2px rgba(23, 22, 26, 0.05),
    0 8px 22px -8px rgba(23, 22, 26, 0.13),
    0 32px 64px -28px rgba(23, 22, 26, 0.24);
  overflow: hidden;
  isolation: isolate;
}
/* a very fine grain, so the paper is not flat */
.prog::before {
  content: '';
  position: absolute; inset: 0; z-index: -1; pointer-events: none;
  opacity: 0.35;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.09 0 0 0 0 0.08 0 0 0 0 0.1 0 0 0 0.05 0'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)'/%3E%3C/svg%3E");
}

.prog__head { display: flex; align-items: center; gap: 10px; margin-bottom: clamp(8px, 2vh, 14px); }
.prog__mark {
  width: 34px; height: 34px; border-radius: 10px; flex: none;
  display: grid; place-items: center;
  background: linear-gradient(160deg, #2b9468, #17603f);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.3) inset, 0 -1px 0 rgba(0, 0, 0, 0.15) inset, 0 5px 12px -4px rgba(23, 96, 63, 0.6);
}
.prog__mark svg { width: 20px; height: 20px; fill: none; stroke: #fff; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.prog__mark-a { fill: rgba(255, 255, 255, 0.16); }
.prog__meta { display: flex; flex-direction: column; line-height: 1.18; flex: 1; min-width: 0; }
.prog__brand { font-weight: 650; font-size: 15px; letter-spacing: -0.01em; font-variation-settings: 'wdth' 104; }
.prog__sub { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.prog__saved {
  display: inline-flex; align-items: center; gap: 5px; flex: none;
  height: 26px; padding: 0 10px 0 8px; border-radius: 99px;
  font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums;
  background: #fff;
  box-shadow: 0 0 0 1px var(--line), 0 1px 2px rgba(23, 22, 26, 0.05);
}
.prog__saved svg { width: 13px; height: 13px; fill: var(--accent); stroke: var(--accent); stroke-width: 1.3; stroke-linejoin: round; }
.prog__roll { display: inline-block; position: relative; min-width: 0.62em; text-align: center; height: 15px; overflow: hidden; line-height: 15px; color: var(--ink); font-weight: 600; }
.prog__roll > span { display: block; }

/* ---------- the tabs ---------- */
.tabs {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  height: clamp(34px, 8.6vh, 42px);
  padding: 3px;
  border-radius: 13px;
  background: var(--track);
  box-shadow: inset 0 1px 2px rgba(23, 22, 26, 0.07), inset 0 0 0 1px rgba(23, 22, 26, 0.035), 0 1px 0 rgba(255, 255, 255, 0.9);
}
.tabs__ind {
  position: absolute; top: 3px; bottom: 3px; left: 0;
  width: 10px;
  border-radius: 10px;
  background: linear-gradient(180deg, #ffffff, #fbfaf7);
  box-shadow:
    0 0 0 0.5px rgba(23, 22, 26, 0.08),
    0 1px 1px rgba(23, 22, 26, 0.06),
    0 3px 8px -2px rgba(23, 22, 26, 0.14),
    inset 0 1px 0 #fff;
  will-change: transform, width;
  overflow: hidden;
}
/* a soft sheen that slides across the pill while it travels */
.tabs__shine {
  position: absolute; top: 0; bottom: 0; left: -40%; width: 40%;
  background: linear-gradient(100deg, transparent, rgba(31, 122, 83, 0.08), transparent);
  opacity: 0;
}
.tab {
  position: relative; z-index: 1;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border-radius: 10px;
  font-size: clamp(12px, 3.4vw, 13.5px);
  font-weight: 560;
  color: var(--muted);
  font-variation-settings: 'wdth' 96;
  transition: color 0.25s ease, font-variation-settings 0.45s cubic-bezier(0.3, 1.5, 0.5, 1);
  -webkit-tap-highlight-color: transparent;
}
.tab[aria-selected='true'] { color: var(--ink); font-variation-settings: 'wdth' 108; }
.tab:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.tab__count {
  min-width: 17px; height: 17px; padding: 0 5px; border-radius: 99px;
  display: inline-grid; place-items: center;
  font-size: 10.5px; font-weight: 620; font-variant-numeric: tabular-nums;
  color: var(--faint);
  background: rgba(23, 22, 26, 0.045);
  transition: color 0.25s ease, background-color 0.25s ease;
}
.tab[aria-selected='true'] .tab__count { color: var(--accent); background: var(--accent-soft); }
@media (hover: hover) {
  .tab:not([aria-selected='true']):hover { color: #4c4a52; }
}

/* ---------- the talks ---------- */
.talks {
  position: relative;
  margin-top: clamp(6px, 1.6vh, 12px);
  overflow: hidden;
}
.talks__list { list-style: none; margin: 0; padding: 0; }
.talks__list > li { position: relative; }
.talks__list > li + li::before {
  content: ''; position: absolute; top: 0; left: 62px; right: 6px; height: 1px; background: var(--line);
}

.talk {
  position: relative;
  display: grid;
  grid-template-columns: 52px 1fr auto;
  column-gap: 10px;
  align-items: start;
  width: 100%;
  min-height: var(--row);
  padding: clamp(7px, 1.7vh, 11px) 8px clamp(7px, 1.7vh, 11px) 6px;
  border-radius: 12px;
  text-align: left;
  -webkit-tap-highlight-color: transparent;
}
.talk::after {
  content: ''; position: absolute; inset: 0; border-radius: 12px; z-index: -1;
  background: #fff;
  box-shadow: 0 0 0 1px rgba(23, 22, 26, 0.05), 0 6px 16px -8px rgba(23, 22, 26, 0.18);
  opacity: 0; transform: scale(0.985);
  transition: opacity 0.3s ease, transform 0.45s cubic-bezier(0.3, 1.4, 0.5, 1);
}
.talk.is-open::after { opacity: 1; transform: scale(1); }
.talk:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }

.talk__time {
  display: flex; flex-direction: column; gap: 3px;
  padding-top: 1px;
  font-size: 12.5px; font-weight: 600; letter-spacing: -0.005em;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}
.talk__len { font-size: 10.5px; font-weight: 500; color: var(--faint); }
.talk__live {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 10.5px; font-weight: 640; color: var(--accent);
  letter-spacing: 0.01em;
}
.talk__live svg { width: 10px; height: 10px; flex: none; }
.talk__live rect { fill: var(--accent); transform-box: fill-box; transform-origin: 50% 100%; }

.talk__body { min-width: 0; }
.talk__title {
  display: block;
  font-size: clamp(13px, 3.6vw, 14px); font-weight: 600; line-height: 1.25; letter-spacing: -0.012em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  font-variation-settings: 'wdth' 100;
  transition: font-variation-settings 0.5s cubic-bezier(0.3, 1.4, 0.5, 1);
}
.talk.is-open .talk__title { white-space: normal; font-variation-settings: 'wdth' 104; }
.talk__who { display: flex; align-items: center; gap: 6px; margin-top: 3px; font-size: 11.5px; color: var(--muted); min-width: 0; }
.talk__face {
  width: 16px; height: 16px; border-radius: 50%; flex: none;
  display: grid; place-items: center;
  font-size: 7.5px; font-weight: 700; letter-spacing: 0.02em; color: #fff;
  box-shadow: 0 0 0 1.5px #fff, 0 1px 2px rgba(23, 22, 26, 0.2);
}
.talk__name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.talk__room {
  margin-top: 1px;
  height: 20px; padding: 0 8px; border-radius: 99px;
  display: inline-flex; align-items: center;
  font-size: 10.5px; font-weight: 560; white-space: nowrap;
  color: var(--muted);
  background: rgba(23, 22, 26, 0.04);
  box-shadow: inset 0 0 0 1px rgba(23, 22, 26, 0.04);
}

/* the summary: closed at height 0, opened by script.js */
.talk__more { grid-column: 2 / 4; height: 0; overflow: hidden; }
.talk__more-in { display: flex; align-items: flex-end; gap: 10px; padding-top: 7px; }
.talk__sum { margin: 0; flex: 1; font-size: 11.5px; line-height: 1.42; color: #56535b; }
.talk__save {
  flex: none;
  width: 28px; height: 28px; border-radius: 9px;
  display: grid; place-items: center;
  color: var(--muted);
  background: #fff;
  box-shadow: 0 0 0 1px rgba(23, 22, 26, 0.08), 0 1px 2px rgba(23, 22, 26, 0.06);
  transition: color 0.2s ease, box-shadow 0.2s ease;
}
.talk__save svg { width: 14px; height: 14px; fill: transparent; stroke: currentColor; stroke-width: 1.4; stroke-linejoin: round; transition: fill 0.2s ease; }
.talk__save[aria-pressed='true'] { color: var(--accent); box-shadow: 0 0 0 1px rgba(31, 122, 83, 0.25), 0 2px 6px -2px rgba(31, 122, 83, 0.35); }
.talk__save[aria-pressed='true'] svg { fill: var(--accent); }
.talk__save:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (hover: hover) {
  .talk__save:hover { color: var(--ink); }
}

.prog__foot {
  display: flex; justify-content: space-between; gap: 10px;
  margin-top: clamp(6px, 1.4vh, 10px); padding: clamp(7px, 1.4vh, 10px) 6px 0;
  border-top: 1px solid var(--line);
  font-size: 11px; color: var(--faint);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.prog__span { color: var(--muted); }
.prog__rooms { overflow: hidden; text-overflow: ellipsis; }

/* ---------- the pilot's pointer ---------- */
.pointer {
  position: absolute; left: 0; top: 0; width: 22px; height: 22px;
  margin: -3px 0 0 -4px;
  pointer-events: none; opacity: 0; z-index: 5;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.25));
}
.pointer path { fill: #17161a; stroke: #fff; stroke-width: 1.4; stroke-linejoin: round; }

.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.talk__room-in { display: none; }
@media (max-width: 440px) {
  .talk { grid-template-columns: 50px 1fr; }
  .talk__room { display: none; }
  .talk__role { display: none; }
  .talk__room-in { display: inline; }
  .talk__more { grid-column: 2 / 3; }
}
@media (max-width: 360px) {
  .talk { grid-template-columns: 46px 1fr; column-gap: 8px; }
  .talks__list > li + li::before { left: 54px; }
  .prog__rooms { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .tab, .talk::after, .talk__title { transition-duration: 0.01s; }
}
