/* Seasons: the three cards on the syllabus page, and the episode panel that
   opens under the player.

   The panel follows the Netflix episode list Aira sent as reference - numbered
   rows, a still, the title with its stamp right-aligned, a two-line line
   underneath, the current row lit. What is not borrowed is the colour: the
   archive's palette is black, red, off-white and grey, and theme-mcqueen.css
   is explicit that a fifth hue is not to be introduced, so every value here is
   one of those four at an opacity. */

/* ------------------------------------------------ the three season cards -- */

.seasons{ text-align:left; margin:0 0 2.4rem; }
.seasons-grid{
  display:grid; gap:1.1rem;
  grid-template-columns:repeat(auto-fit,minmax(286px,1fr));
}

/* A column, not a stack of absolutely positioned boxes. The first version
   pinned the body at 68% and the footer to the bottom inside a fixed aspect
   ratio, so the span line and the progress bar sat on top of each other the
   moment the title wrapped. Normal flow cannot overlap. */
.scard{
  position:relative; border-radius:14px; overflow:hidden; cursor:pointer;
  background:var(--panel); border:1px solid var(--line);
  display:flex; flex-direction:column;
  transition:transform .22s cubic-bezier(.2,.7,.3,1), border-color .22s;
}
.scard:hover,.scard:focus-visible{ transform:translateY(-4px); border-color:var(--accent); outline:none; }

.sfig{ position:relative; width:100%; aspect-ratio:16/9; overflow:hidden; background:var(--bg-soft); }
.scard .sart{ width:100%; height:100%; object-fit:cover; display:block; }
.sscrim{
  position:absolute; inset:0; pointer-events:none;
  background:linear-gradient(to bottom,rgba(0,0,0,.22) 0%,rgba(0,0,0,0) 38%,
    rgba(0,0,0,.28) 100%);
}
.sbadge{
  position:absolute; top:.7rem; left:.8rem; z-index:2;
  font-size:.63rem; font-weight:800; letter-spacing:.16em; text-transform:uppercase;
  background:var(--accent); color:var(--on-accent); padding:.26rem .55rem; border-radius:4px;
}
.splay{
  position:absolute; top:50%; left:50%; transform:translate(-50%,-50%);
  z-index:2; width:46px; height:46px; border-radius:50%;
  background:rgba(0,0,0,.55); color:#fff; display:grid; place-items:center;
  opacity:0; transition:opacity .22s;
}
.scard:hover .splay,.scard:focus-visible .splay{ opacity:1; }

.sbody{ padding:.95rem 1rem .5rem; flex:1 1 auto; }
.sname{ font-weight:800; font-size:1.12rem; letter-spacing:-.015em; color:var(--ink); }
.smeta{ color:var(--ink-dim); font-size:.84rem; margin-top:.25rem; }

.sfoot{ padding:0 1rem 1rem; }
.sbar{ height:3px; background:var(--line); border-radius:2px; overflow:hidden; margin-bottom:.45rem; }
.sbar span{ display:block; height:100%; background:var(--accent); }
.sstat{ color:var(--muted); font-size:.74rem; letter-spacing:.02em; }

/* ---------------------------------------------------- the season panel --- */

.mbody.seasonbody{ display:block; padding-bottom:2.2rem; }

.seasonhead{ max-width:70ch; }
.seasonwhy{
  color:var(--ink-soft); font-size:1rem; line-height:1.62; margin:.9rem 0 0;
}
.seasonends{ color:var(--ink-dim); }
.seasonacts{ margin:1.1rem 0 0; display:flex; gap:.6rem; flex-wrap:wrap; }

.epshead{
  display:flex; align-items:center; justify-content:space-between; gap:1rem;
  margin:2.3rem 0 .5rem;
}
.epshead h3{ margin:0; font-size:1.3rem; font-weight:800; letter-spacing:-.01em; color:var(--ink); }

/* The season switcher. A real select, so it works with a keyboard and on a
   phone without re-implementing a menu; the chevron is drawn on the wrapper. */
.epsel{ position:relative; }
.epsel select{
  appearance:none; -webkit-appearance:none;
  font:inherit; font-size:.95rem; font-weight:700; color:var(--ink);
  background:var(--bg-soft); border:1px solid var(--line); border-radius:7px;
  padding:.5rem 2.3rem .5rem .9rem; cursor:pointer;
}
.epsel select:hover{ border-color:var(--accent); }
.epsel::after{
  content:""; position:absolute; right:.95rem; top:50%; width:7px; height:7px;
  border-right:2px solid var(--ink-dim); border-bottom:2px solid var(--ink-dim);
  transform:translateY(-70%) rotate(45deg); pointer-events:none;
}
.epsnote{ color:var(--ink-dim); font-size:.86rem; margin:0 0 1rem; }

/* --------------------------------------------------------- episode rows -- */

.eprows{ display:block; }

.eprow{
  display:grid; grid-template-columns:2.4rem 132px 1fr auto;
  gap:1.1rem; align-items:start; width:100%; text-align:left;
  padding:1.05rem .9rem; border:0; border-top:1px solid var(--line);
  background:none; color:var(--ink); font-family:var(--font); cursor:pointer;
  border-radius:9px; transition:background .18s;
}
.eprow:first-child{ border-top:0; }
.eprow:hover{ background:var(--pill-hover); }
.eprow.on{ background:var(--pill-active); }

.epn{
  font-size:1.35rem; font-weight:700; color:var(--muted);
  font-variant-numeric:tabular-nums; line-height:1.5; text-align:center;
}
.eprow.on .epn,.eprow:hover .epn{ color:var(--ink); }
.eprow[data-prog="done"] .epn{ color:var(--accent); }

.epthumb{
  position:relative; display:block; aspect-ratio:16/9; border-radius:5px;
  overflow:hidden; background:var(--bg-soft);
}
.epthumb img{ width:100%; height:100%; object-fit:cover; display:block; }
.epthumbplay{
  position:absolute; inset:0; display:grid; place-items:center;
  background:rgba(0,0,0,.4); color:#fff; opacity:0; transition:opacity .18s;
}
.eprow:hover .epthumbplay,.eprow.on .epthumbplay{ opacity:1; }

.epmain{ min-width:0; padding-top:.1rem; }
.epttl{ display:block; font-weight:700; font-size:1.02rem; letter-spacing:-.01em; margin-bottom:.3rem; }
.epdek{
  display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden;
  color:var(--ink-dim); font-size:.9rem; line-height:1.5;
}

.eptime{
  color:var(--ink-dim); font-size:.88rem; white-space:nowrap; padding-top:.1rem;
  display:flex; flex-direction:column; align-items:flex-end; gap:.3rem;
}
.epdone{
  font-size:.62rem; font-weight:800; letter-spacing:.1em; text-transform:uppercase;
  color:var(--accent); border:1px solid var(--accent); border-radius:999px; padding:.1rem .45rem;
}

@media (max-width:760px){
  .eprow{ grid-template-columns:1.9rem 96px 1fr; gap:.8rem; padding:.9rem .4rem; }
  .eptime{ grid-column:2/-1; flex-direction:row; align-items:center; justify-content:flex-start; }
  .epn{ font-size:1.1rem; }
  .epshead{ margin-top:1.8rem; }
}

/* ------------------------------------------- the syllabus page's own head - */

/* Centred. This half of the page is a title and an invitation, and nothing
   else; aligning it left ran the heading, its line and the button down one
   edge with the rest of the screen empty. */
#grid-head.syl-head{ text-align:center; padding-top:2.2rem; }
/* One gap, applied by the column, so the space under the heading, the space
   under the line and the space above the oval are the same measurement
   rather than three margins that have to be kept in agreement. */
.syl-hero{
  max-width:46rem; margin:0 auto; padding:0 0 2.4rem;
  display:flex; flex-direction:column; align-items:center; gap:1.15rem;
}
.syl-hero > *{ margin:0 !important; }
.syl-hero h2{ margin:0; }
.syl-lede{ color:var(--ink-dim); font-size:1.1rem; margin:0; }

.syl-start{
  font-family:var(--font); font-size:1.05rem; font-weight:700;
  padding:.82rem 2rem; border-radius:999px; cursor:pointer;
  background:var(--accent); color:var(--on-accent); border:1px solid var(--accent);
  transition:background .2s, transform .2s;
}
.syl-start:hover{ background:var(--accent-deep); transform:translateY(-1px); }

.syl-hero.has .archprog{ margin:0 auto; width:100%; }
.syl-hero.has .syl-actions{ justify-content:center; margin:0; }

.syl-sech{
  text-align:left;
  font-size:.74rem; font-weight:800; letter-spacing:.16em; text-transform:uppercase;
  color:var(--accent); padding-bottom:.5rem; border-bottom:1px solid var(--line);
  margin-bottom:.9rem;
}
.syl-secsub{ text-align:left; color:var(--ink-dim); font-size:.92rem; margin:0 0 1.2rem; max-width:62ch; }

/* The seasons and the way back to the picker, at the foot of the card grid. */
.syl-tail{ grid-column:1/-1; margin:2.6rem 0 0; text-align:left; }
.syl-addmore{ display:flex; justify-content:flex-end; margin:0 0 1.8rem; }

/* ------------------------------------------------------ the start sheet -- */

.startwrap{ max-width:62ch; }

/* One vertical rhythm for the whole sheet. The space under the title used to
   come from the paragraph that followed it, so when that paragraph was cut
   the title sat almost on top of the first box while the boxes kept their own
   gap. A column with a single gap cannot drift like that: the space under the
   title and the space between the boxes are now the same measurement, read
   from one place. The eyebrow travels with the title rather than being
   spaced off it. */
.startsheet .startwrap{
  max-width:54rem; margin:0 auto; text-align:center;
  display:flex; flex-direction:column; gap:1.15rem;
}
.startsheet .startwrap > *{ margin:0; }
.starttitle .eyebrow{ margin:0 0 .35rem; }
.starttitle .mtitle{ margin:0; }
.startsheet .startlede{ margin-left:auto; margin-right:auto; }
.startsheet .startopts{ max-width:44rem; margin:0 auto; width:100%; gap:1.15rem; }
.startsheet .startopt{ align-items:start; }
.startsheet .startopt .startgo{ align-self:center; }
.startsheet .startopt{ text-align:left; }
.startsheet .seasonacts{ justify-content:center; }
/* Never floated. A float takes the back button out of flow and the heading
   wraps around it, so "Create your own" started indented by the button's
   width and "syllabus" began at the margin. It sits on its own line. */
/* Centred with everything else it shares the column with. The picker's own
   back sits in its left-aligned head and is not a child of this column, so
   it is unaffected. */
.startsheet .startwrap > .startback{ float:none; align-self:center; }
.pickersheet .startback{ display:block; }
/* the three seasons, centred under the question rather than stretched */
.startsheet .seasons-grid{ max-width:50rem; margin:0 auto; justify-content:center; }
.startsheet .startwrap{ padding-top:.4rem; }
.startlede{ color:var(--ink-dim); font-size:1.02rem; line-height:1.6; margin:.7rem 0 1.8rem; }

.startback{
  display:block; float:none;
  font:inherit; font-size:.86rem; font-weight:700; color:var(--ink-dim);
  background:none; border:0; padding:0 0 .7rem; cursor:pointer;
}
.startback:hover{ color:var(--accent); }

/* Side by side, because they are two ways of doing the same thing and not
   two steps of one. Stacked they read as an order, which the numbers in front
   of them made worse. */
.startopts{ display:grid; gap:.9rem; grid-template-columns:1fr; }
@media (min-width:720px){ .startopts{ grid-template-columns:1fr 1fr; } }
/* The words and the arrow travel together, centred in the pill as one block.
   The text column used to be 1fr, so it swallowed every spare pixel and
   pushed the arrow out to the rim - a thin left margin, a wide gap, and the
   pair sitting off to one side of a shape that is symmetrical. Sizing both
   columns to their content and centring the pair closes the gap and balances
   the ends. The text itself is still left aligned; only the block moved. */
.startopt{
  display:grid; grid-template-columns:minmax(0,auto) auto; justify-content:center;
  gap:1rem; align-items:center;
  width:100%; text-align:left; cursor:pointer; font-family:var(--font); color:var(--ink);
  background:var(--bg-soft); border:1px solid var(--line); border-radius:999px;
  padding:1.3rem 1.5rem; transition:border-color .2s, transform .2s, background .2s;
}
.startopt:hover{ border-color:var(--accent); transform:translateY(-2px); }
.startttl{ display:block; font-weight:800; font-size:1.1rem; letter-spacing:-.015em; }
.startsub{ display:block; color:var(--ink-dim); font-size:.9rem; line-height:1.5; margin-top:.25rem; }
.startgo{ color:var(--muted); font-size:1.5rem; line-height:1; }
.startopt:hover .startgo{ color:var(--accent); }

/* The + they are being told to press, drawn the same size it really is so it
   is recognised rather than described. */
.startdemo{
  display:flex; align-items:flex-start; gap:1rem;
  background:var(--bg-soft); border:1px solid var(--line); border-radius:12px;
  padding:1.1rem 1.2rem; margin:0 0 1.2rem;
}
.startdemo-btn{
  flex:0 0 auto; width:30px; height:30px; border-radius:50%;
  display:grid; place-items:center; font-size:1.1rem; font-weight:700;
  background:var(--accent); color:var(--on-accent);
}
.startdemo-say{ font-size:.94rem; line-height:1.55; color:var(--ink-dim); }
.startdemo-say b{ display:block; color:var(--ink); margin-bottom:.2rem; }
.startnote{ color:var(--ink-dim); font-size:.92rem; line-height:1.55; margin:0 0 1.4rem; }

.startsheet .seasons{ margin:0; }
.startsheet .seasons-grid{ grid-template-columns:1fr; }
.startsheet .scard{ aspect-ratio:auto; }
.startsheet .sfig{ aspect-ratio:21/9; }

@media (min-width:860px){
  .startsheet .startwrap{ max-width:72ch; }
  .startsheet .seasons-grid{ grid-template-columns:repeat(3,1fr); }
  .startsheet .sfig{ aspect-ratio:16/9; }
}

/* The read-alongside toggle splits the sheet into notes beside the player.
   A season has no notes, so in that mode it is hidden rather than left to
   do nothing when pressed. */
#modal:has(.sheet.seasonsheet) .modal-layout-toggle,
#modal:has(.sheet.pickersheet) .modal-layout-toggle{ display:none; }

/* --------------------------------------------------------- the picker ---- */

.pickersheet .startwrap{ text-align:left; max-width:none; }
.pickwrap{ padding-bottom:1rem; text-align:left; }
.pickhead{ margin:0 0 1.5rem; }
.pickhead .startlede{ margin:.6rem 0 0; }
.pickhead .startlede b{ color:var(--ink); }
.pickgrid{
  display:grid; gap:.9rem;
  grid-template-columns:repeat(auto-fill,minmax(198px,1fr));
}
.pickgrid .card{ width:auto; }

/* The old behaviour in here, as asked: no zoom, the + back in the top right,
   and a red edge when the card is under the cursor. The zoom belongs on a
   rail where cards have room to grow into; in a dense grid inside a sheet it
   only shoves its neighbours about. */
.pickersheet .pickgrid .card:hover{ transform:none; box-shadow:none; border-color:var(--accent); }
.pickersheet .pickgrid .card:hover img{ transform:none; }
.pickersheet .pickgrid .card .cadd{
  top:.5rem; right:.5rem; bottom:auto; left:auto; opacity:1;
}
.pickersheet .pickgrid .card .cprog{ top:auto; bottom:.5rem; right:.6rem; }

.pickfoot{
  display:flex; gap:.6rem; flex-wrap:wrap; justify-content:center;
  margin:2rem 0 0; padding-top:1.5rem; border-top:1px solid var(--line);
}

/* The back button stays in the corner the reader's eye is already in, and the
   frame moves down to meet it rather than being covered by it. The room is
   made by the sheet, so the player keeps its own full width and corners. */
.sheet.hasback{ padding-top:3.5rem; }
.sheet.hasback .player{ border-radius:6px; overflow:hidden; }

.pickback{
  position:absolute; top:1rem; left:1.1rem; z-index:9;
  font:inherit; font-size:.86rem; font-weight:700;
  background:rgba(0,0,0,.6); color:#fff; border:1px solid rgba(253,247,247,.35);
  border-radius:999px; padding:.42rem .9rem; cursor:pointer; backdrop-filter:blur(6px);
}
.pickback:hover{ background:var(--accent); border-color:var(--accent); }

@media (max-width:620px){
  .pickgrid{ grid-template-columns:repeat(auto-fill,minmax(150px,1fr)); }
  .pickhead{ flex-direction:column; }
}

/* ------------------------------------------------------------- movement -- */

/* One easing and two durations for the whole feature, so nothing moves at a
   speed the rest of it does not. The sheet's own entrance is in modal.css and
   is left alone; what was missing is everything inside it, which was being
   swapped in instantly - a step change rather than a transition, which is
   what made it feel abrupt. */
:root{
  /* A long deceleration rather than a quick one. Most of the distance is
     covered early and the last stretch is slow, which is what reads as
     deliberate instead of snappy. */
  --sx: cubic-bezier(.16,.84,.26,1);
  --t-fast: .24s;
  --t-med: .62s;
  /* The beat between one thing arriving and the next. Wide enough to be
     read as an order rather than seen as a stutter. */
  --t-step: .09s;
}

/* Further to travel, so the extra time is visible as movement rather than
   as a pause before something appears. */
@keyframes stepIn{
  from{ opacity:0; transform:translateY(16px); }
  to{ opacity:1; transform:none; }
}
@keyframes fadeIn{ from{ opacity:0; } to{ opacity:1; } }

/* Each screen of the sheet arrives rather than appears. */
.startwrap,
.pickwrap,
.seasonbody > .seasonhead{ animation:stepIn var(--t-med) var(--sx) both; }

/* The options and the cards follow a beat behind their heading, in order. */
.startopts .startopt{ animation:stepIn var(--t-med) var(--sx) both; }
.startopts .startopt:nth-child(1){ animation-delay:calc(var(--t-step) * 1); }
.startopts .startopt:nth-child(2){ animation-delay:calc(var(--t-step) * 2); }
.startsheet .seasons-grid .scard{ animation:stepIn var(--t-med) var(--sx) both; }
.startsheet .seasons-grid .scard:nth-child(1){ animation-delay:calc(var(--t-step) * 1); }
.startsheet .seasons-grid .scard:nth-child(2){ animation-delay:calc(var(--t-step) * 2); }
.startsheet .seasons-grid .scard:nth-child(3){ animation-delay:calc(var(--t-step) * 3); }

/* The episode list, and the player when an episode is swapped under it. */
.eprows{ animation:fadeIn var(--t-med) var(--sx) both; }
.eprows .eprow{ animation:stepIn var(--t-med) var(--sx) both; }
.eprows .eprow:nth-child(1){ animation-delay:calc(var(--t-step) * 1); }
.eprows .eprow:nth-child(2){ animation-delay:calc(var(--t-step) * 1.6); }
.eprows .eprow:nth-child(3){ animation-delay:calc(var(--t-step) * 2.2); }
.eprows .eprow:nth-child(4){ animation-delay:calc(var(--t-step) * 2.8); }
.eprows .eprow:nth-child(n+5){ animation-delay:calc(var(--t-step) * 3.4); }
.sheet .player{ animation:fadeIn calc(var(--t-med) + .15s) var(--sx) both; }
.pickgrid{ animation:fadeIn var(--t-med) var(--sx) both; }

/* Press states. A button that only changes on hover feels dead under a
   finger; these give the click somewhere to land. */
.syl-start,.syl-act,.startopt,.scard,.eprow,.pickback,.startback{
  transition:transform var(--t-fast) var(--sx),
             background-color var(--t-fast) var(--sx),
             border-color var(--t-fast) var(--sx),
             color var(--t-fast) var(--sx),
             opacity var(--t-fast) var(--sx);
}
.syl-start:active,.syl-act:active,.pickback:active{ transform:scale(.97); }
.startopt:active{ transform:translateY(-1px) scale(.995); }
.scard:active{ transform:translateY(-2px) scale(.995); }
.eprow:active{ transform:scale(.995); }

/* Nothing above is load-bearing, so it all comes off for anyone who asks. */
@media (prefers-reduced-motion: reduce){
  .startwrap,.pickwrap,.seasonbody > .seasonhead,.startopts .startopt,
  .startsheet .seasons-grid .scard,.eprows,.eprows .eprow,.sheet .player,.pickgrid{
    animation:none;
  }
  .syl-start,.syl-act,.startopt,.scard,.eprow,.pickback,.startback{ transition:none; }
  .syl-start:active,.syl-act:active,.pickback:active,.startopt:active,
  .scard:active,.eprow:active{ transform:none; }
}

/* The sign-in prompt is one question, and it was borrowing the size of a
   sheet built to hold three seasons and two ways in. The box stayed full
   height with the words stranded in a corner of it, which read as a mistake
   rather than as a question.

   It gets its own measurements: a box sized to what it is actually holding,
   centred on the screen, and the words and the button centred inside it. */
#modal .sheet.startsheet:has(.askin){
  max-width:min(30rem, calc(100vw - 2.4rem));
  margin:auto;
  align-self:center;
}
#modal .sheet.startsheet:has(.askin) .mbody{
  display:flex; align-items:center; justify-content:center;
  min-height:0; padding-top:2.6rem; padding-bottom:2.2rem;
}
.startsheet .startwrap.askin{
  max-width:26rem; gap:.9rem; text-align:center;
}
.startsheet .startwrap.askin .startlede{ max-width:24rem; }
.startsheet .startwrap.askin .seasonacts{ margin-top:.3rem; }
