/* The home page's timeline (app.js timeline()): the lessons done, Now, and the lessons to come, read top to bottom
   down one spine. Uses the tokens from style.css; no colours of its own. Done is a filled node on a solid line, Now a
   ring (with a slow, soft pulse unless reduced motion), the lessons to come hollow nodes on a dotted line. Nothing red,
   nothing that counts against anyone. */
.tl{--spine:13px;--gut:38px;list-style:none;margin:clamp(14px,4vw,26px) 0 0;padding:0;display:grid;min-width:0}
.tl-item{position:relative;padding:0 0 18px var(--gut);min-width:0;--node-y:29px}
/* The spine: each item draws its own stretch, from its top to its bottom, so the line runs on unbroken. */
.tl-item::before{content:"";position:absolute;left:var(--spine);top:0;bottom:0;width:2px;margin-left:-1px;background:var(--accent)}
.tl-item:first-child::before{top:var(--node-y)}
.tl-item:last-child::before{bottom:auto;height:var(--node-y)}
.tl-now::before{background:linear-gradient(to bottom,var(--accent) var(--node-y),transparent var(--node-y)),
  repeating-linear-gradient(to bottom,var(--line-strong) 0 4px,transparent 4px 9px)}
.tl-now.is-finished::before{background:var(--accent)}
.tl-next::before,.tl-end::before{background:repeating-linear-gradient(to bottom,var(--line-strong) 0 4px,transparent 4px 9px)}
.tl-node{position:absolute;left:var(--spine);top:var(--node-y);width:12px;height:12px;transform:translate(-50%,-50%);border-radius:50%;box-sizing:border-box;
  background:var(--bg);border:2px solid var(--field-border)}
.tl-done .tl-node{background:var(--accent);border-color:var(--accent)}
.tl-now{--node-y:12px;padding-bottom:26px}
.tl-now .tl-node{width:20px;height:20px;border:2px solid var(--accent);background:radial-gradient(circle,var(--accent) 0 3.5px,var(--bg) 4.5px)}
.tl-now.is-finished .tl-node{background:var(--accent)}
.tl-now .tl-node::after{content:"";position:absolute;inset:-6px;border-radius:50%;border:2px solid var(--accent);opacity:0}
.tl-end{--node-y:12px;padding-bottom:4px}
.tl-end .tl-node{width:14px;height:14px;border-style:dashed}

/* The words beside a node: "You are here · Sat, Oct 18", "At this pace you'd finish around …". */
.tl-when{margin:0;padding-top:2px;font-size:var(--step--2);color:var(--muted);line-height:1.45}
.tl-when b{color:var(--ink);font-weight:600}
.tl-when time{color:var(--ink);font-weight:500;white-space:nowrap}
.tl-now > .now-block{margin:8px 0 0}
.tl-sep{color:var(--muted)}
.tl-h .dn{white-space:nowrap}.tl-h .tt{display:inline-block}   /* a title moves to the next line whole, rather than splitting after a word */

/* A lesson done: one tappable line (picture, name, the day it was done) that opens onto its recap. */
.tl-h{margin:0;font-family:var(--body);font-size:var(--step-0);font-weight:500;line-height:var(--lh-snug);letter-spacing:0}
.tl-done .done-toggle{display:grid;grid-template-columns:auto 1fr auto;grid-template-rows:auto auto;column-gap:12px;row-gap:0;align-items:center;
  width:100%;min-height:58px;padding:7px 2px;border:0;background:none;text-align:left;cursor:pointer;color:var(--ink);font:inherit;border-radius:var(--r-sm)}
.tl-done .done-toggle .art{grid-row:1/3;width:56px;height:42px;border-radius:8px}
.tl-done .done-toggle .dt{grid-column:2;align-self:end;font-weight:500;line-height:1.35}
.tl-done .done-toggle .dd{grid-column:2;grid-row:2;align-self:start;font-size:var(--step--2);font-weight:400;color:var(--muted);font-variant-numeric:tabular-nums}
.tl-done .done-toggle::after{grid-column:3;grid-row:1/3;content:"";width:7px;height:7px;margin:0 6px;border-right:1.5px solid var(--muted);border-bottom:1.5px solid var(--muted);
  transform:rotate(45deg) translateY(-2px);transition:transform var(--dur-ui) var(--ease-calm)}
.tl-done .done-toggle[aria-expanded="true"]::after{transform:rotate(225deg) translateY(-1px)}
.tl-done .done-toggle:hover .dt{color:var(--accent)}
.tl-done .done-toggle:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
.tl-done .done-body{display:grid;gap:10px;padding:6px 0 6px}
.tl-done .recap{padding:14px 16px}
.done-links{display:flex;flex-wrap:wrap;gap:0 18px;align-items:center}
.done-links .link{font-size:var(--step--2);min-height:36px;display:inline-flex;align-items:center;padding:0}
/* Collapsed (more than two done): a little smaller, one quiet line each. */
.tl-done:not(.is-open){padding-bottom:6px}
.tl-done:not(.is-open) .done-toggle .art{opacity:.85}
.tl-done:not(.is-open) .done-toggle .dt{font-size:var(--step--1)}

/* The lessons to come: quieter, their pictures a little faded, nothing to press. */
.tl-next{--node-y:26px;padding-bottom:8px}
.tl-row{display:grid;grid-template-columns:auto 1fr;gap:12px;align-items:center;min-height:52px;padding:4px 2px}
.tl-row .art{width:48px;height:36px;border-radius:7px;opacity:.6;filter:saturate(.7)}
.tl-text{display:grid;gap:0;min-width:0}
.tl-next .tl-h{font-size:var(--step--1);color:var(--muted);font-weight:500}
.tl-next .tl-h .tl-sep{color:inherit}
.tl-meta{margin:0;font-size:var(--step--3);color:var(--muted);font-variant-numeric:tabular-nums}
.tl-next.is-soon .tl-h{color:var(--ink)}
.tl-next.is-soon .tl-row .art{opacity:.8}
.tl-next.is-soon .tl-node{border-color:var(--accent)}
.tl-next + .tl-end{padding-top:6px}

/* The Now card sits beside the spine, so on a phone its picture is smaller and its words get the width. */
@media (max-width:480px){
  .tl-now .now-head{align-items:start;gap:12px}
  .tl-now .now-head .art{width:64px;height:48px;margin-top:4px}
}
/* Between lessons the Now block has no picture of its own (it's on the line above). */
.now-head.plain{grid-template-columns:1fr}

/* The ring breathes, slowly; still with reduced motion. */
@media (prefers-reduced-motion: no-preference){
  .tl-now:not(.is-finished) .tl-node::after{animation:tl-breathe 3.2s var(--ease-calm) infinite}
  @keyframes tl-breathe{0%{opacity:.45;transform:scale(.7)}70%,100%{opacity:0;transform:scale(1.25)}}
}
@media (max-width:360px){
  .tl{--spine:9px;--gut:28px}
  .tl-done .done-toggle .art{width:48px;height:36px}
  .tl-row .art{width:40px;height:30px}
}
@media (forced-colors: active){
  .tl-item::before{background:GrayText}.tl-done .tl-node,.tl-now .tl-node{background:Highlight;border-color:Highlight}
}
@media print{.tl-item::before,.tl-node{display:none}.tl-item{padding-left:0}}
