/*
  re:Work site.

  A white page. Colour comes from the logo's ramp, one hue per chapter of the
  tour, and from the app's own screens. Headlines are set in the app's serif
  (New York on a Mac, Newsreader elsewhere) in the logo's ink teal; everything
  else is the app's sans.

  The tour is the page: each chapter pins a stage holding a scene, a part of
  the app redrawn at reading size, which builds as its notes scroll past
  (site.js). The header's strip is the tour's map and fills in as you read.

  Colour, type and shape tokens live in tokens.css; docs/design-system.md
  explains them.

  Order: base, buttons, header, hero, tour, scenes, privacy,
  closing, footer, document pages.
*/

/* ---------- Base ---------- */

*,
*::before,
*::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + 16px);
}
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  background: var(--page);
  color: var(--site-text);
  font: 400 var(--type-body)/1.55 var(--font-sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img, svg { display: block; }
a { color: inherit; }

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
  border-radius: 4px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  top: -60px;
  left: 12px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: 10px;
  background: var(--site-ink);
  color: var(--page);
  font-weight: 600;
  text-decoration: none;
}
.skip-link:focus { top: 12px; }

.serif-display {
  font-family: var(--font-serif);
  font-weight: 400;
  color: var(--site-ink);
  letter-spacing: var(--track-title);
  text-wrap: balance;
}

/* ---------- Buttons ---------- */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 44px;
  padding: 0 20px;
  border-radius: var(--r-pill);
  font: 600 15px/1 var(--font-sans);
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 0.15s, color 0.15s, box-shadow 0.15s;
}
.button .apple { width: 17px; height: 17px; margin-top: -3px; flex: none; }
.button--primary {
  background: var(--site-ink);
  color: var(--page);
}
.button--primary:hover { background: color-mix(in srgb, var(--site-ink) 86%, var(--coral)); }
.button--quiet {
  color: var(--site-ink);
  box-shadow: inset 0 0 0 1.5px var(--site-line);
}
.button--quiet:hover { box-shadow: inset 0 0 0 1.5px var(--site-ink); }
.button--large { min-height: 54px; padding: 0 28px; font-size: 17px; }
.button--small { min-height: 38px; padding: 0 16px; font-size: 14px; }
.button--small .apple { width: 14px; height: 14px; }

.download-meta {
  color: var(--site-muted);
  font-size: 14px;
  line-height: 1.5;
}

/* ---------- Header ---------- */

.top {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: clamp(16px, 3vw, 44px);
  height: var(--header-h);
  padding: 0 var(--gutter);
  background: color-mix(in srgb, var(--page) 90%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  backdrop-filter: saturate(1.4) blur(14px);
}
.top::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 1px;
  background: var(--site-line);
}
.top__mark { flex: none; display: block; border-radius: 6px; }
.top__mark .mark { height: 26px; width: auto; }
.mark .mark-dot { fill: var(--site-ink); }

.top__nav { margin-left: auto; }
.top__nav ul { display: flex; gap: 28px; }
.top__nav a {
  font-size: 15px;
  font-weight: 500;
  color: var(--site-muted);
  text-decoration: none;
}
.top__nav a:hover,
body[data-page="privacy"] .top__nav [data-nav="privacy"],
body[data-page="download"] .top__nav [data-nav="download"] { color: var(--site-ink); }

/* The strip: the home page's navigation and the tour's map. Each chapter is
   a bar in its ramp colour that fills as the chapter is read. */
.strip { flex: 1; min-width: 0; }
.strip__list { display: flex; gap: 6px; }
.strip__list li { flex: 1; min-width: 0; }
.strip__list a {
  display: block;
  padding: 8px 0 10px;
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.2;
  color: var(--site-muted);
  white-space: nowrap;
}
.strip__list a:hover,
.strip__list a[aria-current] { color: var(--site-ink); }
.strip__bar {
  display: block;
  height: 8px;
  margin-top: 7px;
  border-radius: 4px;
  overflow: hidden;
  background: color-mix(in srgb, var(--c) 20%, var(--page));
}
.strip__bar::after {
  content: "";
  display: block;
  height: 100%;
  border-radius: 4px;
  background: var(--c);
  transform-origin: 0 50%;
  transform: scaleX(var(--p, 0));
}
.strip__list a:hover .strip__bar { background: color-mix(in srgb, var(--c) 36%, var(--page)); }

/* The page's one unprompted motion: the bars arrive out of line and settle
   into a row, as the app does with a day. */
@media (prefers-reduced-motion: no-preference) {
  .strip__bar {
    animation: settle 0.9s cubic-bezier(0.2, 0.9, 0.25, 1) both;
    animation-delay: calc(var(--i) * 70ms + 150ms);
  }
  @keyframes settle {
    from { transform: translate(var(--dx), var(--dy)) scaleX(var(--sx)); opacity: 0; }
    35% { opacity: 1; }
  }
}

@media (max-width: 900px) {
  .strip__list { gap: 4px; }
  .strip__list { position: relative; }
  .strip__list a { padding: 12px 0 26px; }
  /* Room for one name under the bars: the chapter being read, or the bar
     that has keyboard focus. The rest stay available to screen readers. */
  .strip__label {
    position: absolute;
    left: 0;
    bottom: 4px;
    font-size: 12px;
    color: var(--site-ink);
  }
  .strip__list a:not([aria-current], :focus-visible) .strip__label,
  .strip__list:has(a:focus-visible) a:not(:focus-visible) .strip__label {
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }
  .strip__bar { margin-top: 0; height: 10px; border-radius: 5px; }
  .top__nav ul { gap: 18px; }
}
@media (max-width: 480px) {
  .top .button--small span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }
  .top .button--small { padding: 0 12px; gap: 0; }
  .top__mark .mark { height: 22px; }
}

/* ---------- Hero ---------- */

.hero {
  padding: clamp(40px, 9vh, 104px) var(--gutter) clamp(44px, 8vh, 88px);
}
.hero__title {
  font-size: var(--type-hero);
  line-height: 0.94;
  letter-spacing: var(--track-hero);
  text-wrap: initial;
}
.hero__title span { display: block; }
.hero__title span + span { padding-left: 0.62em; }
.hero__row {
  display: grid;
  grid-template-columns: minmax(0, 24em) auto;
  justify-content: space-between;
  align-items: end;
  gap: 28px 48px;
  margin-top: clamp(28px, 5vh, 56px);
}
.hero__lede {
  font-size: var(--type-lede);
  line-height: 1.45;
  color: var(--site-text);
}
.hero__actions { display: grid; gap: 12px; justify-items: start; }
/* The hero rises in once on load, in reading order. Pure CSS, so it never
   shows, hides and shows again while site.js loads. */
@media (prefers-reduced-motion: no-preference) {
  .hero__title, .hero__lede, .hero__actions {
    animation: rise 0.8s var(--ease-reveal) both;
  }
  .hero__lede { animation-delay: 0.11s; }
  .hero__actions { animation-delay: 0.2s; }
  @keyframes rise { from { opacity: 0; translate: 0 24px; } }
}
@media (max-width: 760px) {
  .hero__row { grid-template-columns: 1fr; }
  .hero__title { text-wrap: balance; }
  .hero__title span { display: inline; }
  .hero__title span + span { padding-left: 0; }
}

/* ---------- Tour ---------- */
/*
  A chapter holds one screen of the app and a few notes about it. With
  script, the screen and the current note pin together for the length of
  the chapter and the page's scrolling only moves between steps: one note
  shows at a time, the screen makes that note's change, and the rest of the
  screen steps back while it does (site.js). Without script, or in a window
  too short to pin, the finished screen sits above all of its notes.
*/

.chapter {
  --accent: var(--ramp-blue);
  --step-h: 70vh;
  position: relative;
  padding: 0 var(--gutter);
}
.chapter + .chapter { margin-top: clamp(56px, 12vh, 140px); }

.beat h2 {
  font-size: var(--type-title);
  line-height: 1.04;
}
.beat h2 + p {
  margin-top: 18px;
  font-size: var(--type-lede);
  line-height: 1.45;
}
.beat h3 {
  font-size: clamp(24px, 2.1vw, 30px);
  line-height: 1.2;
  font-weight: 600;
  color: var(--site-ink);
  letter-spacing: -0.015em;
}
.beat h3 + p { margin-top: 14px; font-size: var(--type-lede); line-height: 1.45; }
.beat p { max-width: 20em; }

/* Unpinned: the finished screen, then every note. */
.chapter__stage { height: min(78vh, 720px); min-height: 280px; }
.chapter__beats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 28px 40px;
  margin-top: 32px;
}
.chapter__beats .beat:first-child { grid-column: 1 / -1; }
.snap { display: none; }

@media (min-height: 561px) {
  .js .chapter {
    height: calc(100vh - var(--header-h) + (var(--n, 4) + 0.2) * var(--step-h));
    height: calc(100svh - var(--header-h) + (var(--n, 4) + 0.2) * var(--step-h));
  }
  .js .chapter__pin {
    position: sticky;
    top: var(--header-h);
    display: grid;
    height: calc(100vh - var(--header-h));
    height: calc(100svh - var(--header-h));
  }
  /* One note at a time, all in the same place. */
  .js .chapter__beats {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
    margin: 0;
    align-content: center;
  }
  /* The leaving note fades quickly; the next one waits for it, then
     settles up from a little below and behind. */
  .js .beat {
    grid-area: 1 / 1;
    align-self: center;
    opacity: 0;
    translate: 0 18px;
    scale: 0.985;
    pointer-events: none;
    transition: opacity 0.2s, translate 0.2s, scale 0.2s;
  }
  .js .beat.is-active {
    opacity: 1;
    translate: 0 0;
    scale: 1;
    pointer-events: auto;
    transition:
      opacity 0.5s 0.14s var(--ease-settle),
      translate 0.7s 0.14s var(--ease-settle),
      scale 0.7s 0.14s var(--ease-settle);
  }
  /* How far through the chapter's notes the reader is. It follows the
     scroll continuously (--fill, from site.js) rather than jumping a
     step at a time. */
  .js .chapter__beats::after {
    content: "";
    grid-area: 2 / 1;
    width: 132px;
    height: 4px;
    margin-top: 36px;
    border-radius: 2px;
    background: linear-gradient(to right, var(--accent) calc(var(--fill, 0) * 100%), var(--site-line) 0);
  }
  /* Where each step begins. site.js measures the gap between these to
     know how much scrolling a step takes. The page doesn't snap to them:
     wheel scrolling is eased instead (site.js), and snapping would fight
     the easing. */
  .js .snap {
    display: block;
    position: absolute;
    top: calc(var(--i) * var(--step-h));
    width: 1px;
    height: 1px;
  }
  /* html's scroll-padding leaves 16px of air under the header; a pinned
     chapter sits flush against it when its link is followed. */
  .js .chapter { scroll-margin-top: -16px; }
}
@media (prefers-reduced-motion: reduce) {
  .js .beat, .js .beat.is-active { transition: none; translate: 0 0; scale: 1; }
}

/* Wide: the note sits beside the screen. */
@media (min-width: 960px) and (min-height: 561px) {
  .js .chapter__pin {
    grid-template-columns: minmax(250px, 21vw) minmax(0, 1fr);
    column-gap: clamp(48px, 6.5vw, 120px);
    padding: clamp(24px, 5vh, 56px) 0;
  }
  .js .chapter__beats { grid-column: 1; grid-row: 1; }
  .js .chapter__stage {
    grid-column: 2;
    grid-row: 1;
    height: 100%;
    max-height: 920px;
    min-height: 0;
    align-self: center;
    /* A window is as tall as its screen needs (--em-h, in the scene's own
       em), up to the room there is, and sits mid-height. */
    container-type: inline-size;
    display: grid;
    align-items: center;
  }
  .js .chapter__stage .stage { height: min(100%, calc(min(1.62cqi, 16.5px) * var(--em-h, 50))); }
}

/* Narrow: the screen on top, the note beneath it. */
@media (max-width: 959px) and (min-height: 561px) {
  .chapter { --step-h: 64svh; }
  .js .chapter__pin { grid-template-rows: auto minmax(0, 1fr); }
  .js .chapter__stage { height: 56svh; min-height: 300px; padding: 12px 0 0; }
  .js .chapter__beats { align-content: start; padding-top: 28px; }
  .js .beat { align-self: start; }
  .js .chapter__beats::after { margin-top: 18px; }
  .stage { border-radius: 18px; }
}

/* ---------- Scenes ---------- */
/*
  Each stage holds a scene: a part of the app redrawn at reading size, in the
  logo's ramp. A scene is not played; it is scrubbed. site.js turns the scroll
  position into a place among the chapter's notes and gives every part marked
  data-at a --k from 0 (not yet there) to 1 (in place). The classes below say
  what a part does with its --k. Without script every --k is 1, so the scene
  stands finished.

  Scenes are sized in em from the stage's own box, so one drawing fits a tall
  desktop stage and a short phone one. Wide layouts fit 56 x 44em, narrow
  ones 30 x 32em.
*/

.stage {
  container: stage / size;
  position: relative;
  overflow: hidden;
  height: 100%;
  border-radius: var(--r-stage);
  border: 1px solid var(--site-line);
  background: var(--window);
  box-shadow: var(--shadow-window);
}
/* Everything in a stage is sized from this box's em. */
.win {
  position: absolute;
  inset: 0;
  font-size: clamp(10px, min(1.62cqw, calc(100cqh / var(--em-h, 50))), 16.5px);
  line-height: 1.35;
  color: var(--site-text);
}
.scene {
  position: absolute;
  inset: 0 0 0 10em;
  display: grid;
  align-content: start;
  justify-items: stretch;
  padding: 3.2em 2.4em 2em 2.4em;
}

/* The app's window: traffic lights and its five views down the left, the
   one this chapter shows picked out in the chapter's colour. */
.win__chrome {
  position: absolute;
  inset: 0 auto 0 0;
  width: 10em;
  display: flex;
  flex-direction: column;
  padding: 1.15em 0.8em 1.2em;
  border-right: 1px solid var(--site-line);
  background: var(--site-wash);
}
.win__lights { display: flex; gap: 0.5em; padding-left: 0.4em; }
.win__lights i { width: 0.76em; height: 0.76em; border-radius: 50%; background: #ff5f57; }
.win__lights i:nth-child(2) { background: #febc2e; }
.win__lights i:nth-child(3) { background: #28c840; }
.win__nav {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.3em;
  margin-top: 2.6em;
  font-size: 0.92em;
  font-weight: 500;
  color: var(--site-muted);
}
.win__nav li { padding: 0.45em 0.75em; border-radius: 0.55em; }
.win__settings { margin-top: auto; }
#today .win__nav [data-view="today"],
#streams .win__nav [data-view="streams"],
#work .win__nav [data-view="work"],
#plan .win__nav [data-view="plan"],
#you .win__nav [data-view="you"] { color: var(--accent-text, var(--accent)); font-weight: 600; background: color-mix(in srgb, var(--accent) 12%, var(--window)); }

/* The menu bar chapter shows the desktop instead: a menu bar, and the
   panel hanging from re:Work's icon in it. */
.stage--desktop {
  --tray: 38;
  --panel-w: 35em;
  background: linear-gradient(var(--site-wash), var(--window) 70%);
}
.stage--desktop .scene { inset: 2.3em 0 0 0; padding: 0; justify-items: center; }
.desk__bar {
  position: absolute;
  inset: 0 0 auto 0;
  display: flex;
  align-items: center;
  gap: 1.1em;
  height: 2.3em;
  padding: 0 1.1em;
  border-bottom: 1px solid var(--site-line);
  background: color-mix(in srgb, var(--page) 78%, transparent);
  color: var(--site-text);
}
.desk__bar > span, .desk__bar > b { font-size: 0.82em; font-weight: 500; }
.desk__bar > b { font-weight: 700; }
.desk__bar .apple { width: 1em; height: 1em; margin-top: -0.15em; }
.desk__clock { margin-left: auto; font-variant-numeric: tabular-nums; }
.desk__tray {
  position: absolute;
  left: calc(50% + var(--tray) * var(--panel-w) / 100 - 1.15em);
  top: 0.3em;
  display: grid;
  place-items: center;
  width: 2.3em;
  height: 1.7em;
  border-radius: 0.4em;
  background: color-mix(in srgb, var(--accent) 18%, var(--page));
}
.desk__tray img { width: 1.25em; height: auto; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .desk__tray img { filter: invert(1); }
}

@container stage (max-width: 560px) {
  /* Small stages show less, larger: about 26 x 29em, so the smallest label
     stays near 10px on a phone. */
  .win { font-size: clamp(9px, min(3.9cqw, 3.39cqh), 14px); }
  .scene { inset: 2.8em 0 0 0; padding: 1em 1.2em 0.8em; }
  .win__chrome {
    inset: 0 0 auto 0;
    width: auto;
    height: 2.8em;
    flex-direction: row;
    align-items: center;
    padding: 0 1.1em;
    border-right: 0;
    border-bottom: 1px solid var(--site-line);
  }
  .win__lights { padding: 0; }
  .win__nav { flex: none; flex-direction: row; margin: 0 0 0 auto; font-size: 0.8em; }
  .win__nav li { display: none; padding: 0.25em 0.7em; }
  #today .win__nav [data-view="today"],
  #streams .win__nav [data-view="streams"],
  #work .win__nav [data-view="work"],
  #plan .win__nav [data-view="plan"],
  #you .win__nav [data-view="you"] { display: block; }
  .stage--desktop .win { --tray: 22; --panel-w: 22em; }
  .stage--desktop .scene { inset: 2.3em 0 0 0; padding: 0; }
  .wide-only { display: none !important; }
}
@container stage (min-width: 561px) {
  .narrow-only { display: none !important; }
}

.fx-fade {
  opacity: var(--k, 1);
  translate: 0 calc((1 - var(--k, 1)) * 0.9em);
}
.fx-pop {
  opacity: var(--k, 1);
  scale: calc(0.86 + 0.14 * var(--k, 1));
}
.fx-x { transform-origin: 0 50%; transform: scaleX(var(--k, 1)); }
.fx-y { transform-origin: 50% 100%; transform: scaleY(var(--k, 1)); }
/* Opens room in a column: the block grows from nothing to its height,
   given as --h. */
.fx-open {
  max-height: calc(var(--k, 1) * var(--h, 10em));
  overflow: hidden;
  opacity: var(--k, 1);
}
html:not(.js) [data-out] { display: none; }

.sc-card {
  border-radius: 1em;
  border: 1px solid var(--site-line);
  background: var(--card);
  box-shadow: var(--shadow-card);
}
.sc-head { display: flex; align-items: baseline; gap: 1em; margin-bottom: 1.3em; }
.sc-head h4 { margin: 0; font: 400 1.9em/1.1 var(--font-serif); letter-spacing: -0.015em; color: var(--site-ink); }
.sc-head__note { font-size: 0.9em; color: var(--site-muted); }
.sc-chip {
  margin-left: auto;
  align-self: start;
  padding: 0.4em 1em;
  border-radius: var(--r-pill);
  background: var(--site-wash);
  font-size: 0.82em;
  font-weight: 500;
  white-space: nowrap;
  color: var(--site-text);
}
.sc-label { font-size: 0.84em; font-weight: 500; color: var(--site-muted); }
.sc-num { font-variant-numeric: tabular-nums; }
.sc-strong { font-weight: 600; color: var(--site-ink); }
.sc-bar {
  display: block;
  height: 0.7em;
  border-radius: 0.35em;
  background: var(--c, var(--accent));
}
/* The part the current note is about. */
[data-lit] { transition: box-shadow 0.35s, background-color 0.35s; }
/* While a note is being read, the parts it is not about step back. */
[data-part] { transition: filter 0.4s; }
.is-dim { filter: opacity(0.42); }
.is-lit { box-shadow: 0 0 0 2px var(--accent-text, var(--accent)), 0 0.6em 1.6em color-mix(in srgb, var(--accent) 18%, transparent); }
@media (prefers-reduced-motion: reduce) {
  [data-lit], [data-part] { transition: none; }
}

/* --- Menu bar: the Today panel, dropping from its icon --- */
.sc-panel { width: 25em; font-size: 1.4em; margin-top: 0.45em; }
@container stage (max-width: 560px) {
  .sc-panel { font-size: 1em; width: 22em; margin-top: 0.6em; }
  .sc-panel__say { display: none; }
  .sc-panel__sky { padding: 1em 1.1em 1.1em; }
}
.sc-panel__card {
  overflow: hidden;
  transform-origin: calc(50% + var(--tray) * 1%) 0;
  box-shadow: 0 0 0 0.5px rgba(10, 64, 76, 0.16), var(--shadow-window);
}
.sc-panel__sky {
  padding: 1.2em 1.3em 1.3em;
  background: linear-gradient(rgba(6, 52, 121, 0.18), rgba(6, 52, 121, 0.18)), url("../img/sky-morning.jpg") center / cover;
  color: #fff;
}
.sc-panel__date { font-family: var(--font-serif); font-size: 2em; line-height: 1.1; letter-spacing: -0.01em; }
.sc-panel__meta { margin-top: 0.2em; font-size: 0.82em; opacity: 0.92; }
.sc-panel__say {
  margin-top: 1em;
  padding: 0.8em 1em;
  border-radius: 0.9em;
  background: #fff;
  color: #263236;
  font-size: 0.92em;
}
.sc-panel__say b { font-weight: 600; color: var(--ramp-magenta); }
.sc-panel__body { padding: 0.5em 0.8em 0.9em; }
.sc-panel__body > div { padding-top: 0.6em; }
.sc-panel__body > .sc-row { padding-top: 0.35em; margin-top: 0.35em; }
.sc-panel__body .sc-label { display: block; margin: 0 0.5em 0.4em; }
.sc-panel__body .sc-split { margin: 0 0.5em; }
.sc-split { display: flex; gap: 0.25em; }
.sc-split .sc-bar { flex: var(--w) 0 0; }
.sc-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 0 0.6em;
  align-items: baseline;
  padding: 0.35em 0.5em;
  border-radius: 0.6em;
}
/* Rows sit inside blocks that clip, so they light with a wash, not a ring. */
.sc-row.is-lit { box-shadow: none; background: color-mix(in srgb, var(--c) 12%, transparent); }
.sc-row::before {
  content: "";
  width: 0.55em;
  height: 0.55em;
  border-radius: 50%;
  background: var(--c);
}
.sc-row small { display: block; font-size: 0.82em; color: var(--site-muted); }
.sc-panel__rule { height: 1px; background: var(--site-line); }

/* --- Today: a day's stretches, in order --- */
.sc-day > div:first-child { display: grid; gap: 0.5em; }
.sc-day {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 15em;
  gap: 1.6em;
  align-items: start;
}
.sc-day > .sc-totals { margin-top: 4.1em; }
@container stage (max-width: 560px) {
  .sc-day { grid-template-columns: minmax(0, 1fr); gap: 0.6em; }
  .sc-day > .sc-totals { margin-top: 0; }
}
/* The painted sky a day opens with in the app. */
.sc-sky {
  display: flex;
  align-items: center;
  gap: 0.3em;
  height: 3.4em;
  padding: 0 0.8em;
  border-radius: 0.7em;
  background: linear-gradient(rgba(6, 52, 121, 0.14), rgba(6, 52, 121, 0.14)), url("../img/sky-morning.jpg") center / cover;
  color: #fff;
  font: 400 1.5em/1 var(--font-serif);
}
.sc-sky small { font: 600 0.5em var(--font-sans); padding-top: 0.6em; }
.sc-dates { display: flex; gap: 0.3em; margin-bottom: 0.8em; }
.sc-dates span {
  display: grid;
  justify-items: center;
  width: 2.7em;
  padding: 0.3em 0;
  border-radius: 0.6em;
  font-size: 0.86em;
  color: var(--site-muted);
}
.sc-dates small { font-size: 0.8em; }
.sc-dates .is-on { background: var(--accent); color: #fff; }
.sc-stretch {
  display: grid;
  grid-template-columns: 5.2em minmax(0, 1fr) 9em;
  gap: 0 1em;
  align-items: center;
  padding: 1.15em 1.2em;
}
.sc-stretch time { font-size: 0.86em; color: var(--site-muted); }
.sc-stretch h4 { margin: 0; font: 400 1.35em/1.15 var(--font-serif); color: var(--site-ink); }
.sc-stretch p { font-size: 0.86em; color: var(--site-muted); }
.sc-kinds { display: grid; gap: 0.3em; padding: 0.4em; border-radius: 0.7em; }
.sc-kind { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0.2em 0.5em; font-size: 0.82em; font-weight: 500; }
.sc-kind .sc-bar { grid-column: 1 / -1; width: calc(var(--w) * 1%); }
.sc-gap > div { display: flex; align-items: center; gap: 0.7em; padding-left: 2.2em; font-size: 0.82em; color: var(--site-muted); }
.sc-gap span { display: block; padding: 0.75em 0; }
.sc-gap i { width: 1px; align-self: stretch; background: repeating-linear-gradient(var(--site-muted) 0 0.25em, transparent 0.25em 0.5em); }
.sc-totals { padding: 1.2em 1.3em; display: grid; gap: 0.8em; }
.sc-totals__big { font-size: 1.7em; line-height: 1.1; font-weight: 600; color: var(--site-ink); }
.sc-totals .sc-kind { font-size: 0.88em; }
@container stage (max-width: 560px) {
  .sc-stretch { grid-template-columns: 3.9em minmax(0, 1fr) 7.6em; gap: 0 0.6em; padding: 0.55em 0.7em; }
  .sc-stretch p { display: none; }
  .sc-stretch h4 { font-size: 1.15em; }
  .sc-stretch time { font-size: 0.8em; }
  .sc-kinds { padding: 0.2em; }
  .sc-dates { margin-bottom: 0.2em; }
  .sc-dates span { width: 2.4em; }
  .sc-sky { display: none; }
  .sc-totals { grid-template-columns: auto 1fr 1fr; align-items: center; gap: 0.35em 1.2em; padding: 0.5em 0.9em; }
  .sc-totals > div:first-child { grid-row: span 2; }
  .sc-totals__big { font-size: 1.25em; }
  .sc-totals .sc-label { display: none; }
  .sc-gap span { padding: 0.1em 0; }
  .sc-gap > div { padding-left: 1.4em; }
  .sc-day > div:first-child { gap: 0.35em; }
}

/* --- Streams: pieces that find each other --- */
.sc-streams {
  position: relative;
  height: 24em;
  --label-w: 10.5em;
  --total-w: 5.5em;
}
@container stage (max-width: 560px) { .sc-streams { height: 20em; --label-w: 9em; --total-w: 4.6em; } }
.sc-streams__labels span,
.sc-streams__totals span {
  position: absolute;
  left: 0;
  top: calc(var(--r) * 25% + 12.5% - 0.7em);
  left: 1.2em;
  width: var(--label-w);
  font-weight: 500;
  color: var(--site-muted);
  white-space: nowrap;
}
.sc-streams__labels .sc-strong { font-weight: 600; color: var(--site-ink); }
.sc-streams__totals span {
  left: auto;
  right: 1.2em;
  width: var(--total-w);
  text-align: right;
  font-weight: 600;
  color: var(--site-ink);
}
.sc-streams__lane {
  position: absolute;
  inset: 0 calc(var(--total-w) + 2em) 0 calc(var(--label-w) + 1.2em);
}
.sc-streams__group {
  position: absolute;
  inset: calc(var(--r) * 25% + 3.5%) 0 calc((3 - var(--r)) * 25% + 3.5%) 0;
  border-radius: 1em;
  border: 1px solid var(--site-line);
  background: var(--card);
  opacity: var(--k, 1);
}
.piece {
  position: absolute;
  left: calc(var(--x) * 1%);
  top: calc(var(--r) * 25% + 12.5% - 0.5em);
  width: calc(var(--w) * 1% - 0.4em);
  height: 1em;
  border-radius: 0.5em;
  background: var(--c);
}

/* --- Insights: the period, measured --- */
.sc-insights { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1.4em; }
.sc-figures { grid-column: 1 / -1; display: flex; gap: 3em; padding: 0 0.3em 0.3em; }
.sc-figures b { display: block; white-space: nowrap; font-size: 2.1em; line-height: 1.15; font-weight: 500; color: var(--site-ink); }
.sc-insights .sc-card { padding: 1.2em 1.3em; display: grid; gap: 0.75em; align-content: start; }
.sc-insights h4 { margin: 0; display: flex; justify-content: space-between; align-items: baseline; font-size: 1.05em; font-weight: 600; color: var(--site-ink); }
.sc-insights h4 small { font-size: 0.8em; font-weight: 400; color: var(--site-muted); }
.sc-mix { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; gap: 0 0.8em; align-items: center; font-size: 0.9em; }
.sc-mix::before { content: ""; width: 0.6em; height: 0.6em; border-radius: 0.2em; background: var(--c); }
.sc-mix em { font-style: normal; font-size: 0.88em; color: var(--site-muted); min-width: 4.4em; text-align: right; }
.sc-chart { display: flex; align-items: flex-end; gap: 0.5em; height: 8em; padding-top: 1.2em; border-bottom: 1px solid var(--site-line); }
.sc-chart span { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; font-size: 0.8em; color: var(--site-muted); }
.sc-chart i { display: block; flex: none; width: 100%; height: calc(var(--v) / 31 * (100% - 1.6em)); min-height: 1px; border-radius: 0.3em 0.3em 0 0; background: var(--ramp-blue); }
.sc-focus { grid-column: 1 / -1; grid-template-columns: 1fr 1fr; gap: 0.6em 2em !important; }
.sc-focus h4 { grid-column: 1 / -1; }
.sc-runs { display: flex; align-items: center; gap: 0.3em; margin-top: 0.4em; }
.sc-runs .sc-bar { width: calc(var(--w) * 1%); }
@container stage (max-width: 560px) {
  .sc-insights { grid-template-columns: minmax(0, 1fr); gap: 0.6em; }
  .sc-figures { gap: 1.2em; }
  .sc-figures .sc-chip, .sc-figures > div:nth-child(3) { display: none; }
  .sc-figures b { font-size: 1.4em; }
  .sc-insights .sc-card { padding: 0.6em 0.8em; gap: 0.3em; }
  .sc-insights h4 small, .sc-mix em, .sc-mix:nth-of-type(n + 4), .sc-focus .sc-label { display: none; }
  .sc-mix { grid-template-columns: auto minmax(0, 1fr) auto; }
  .sc-runs { margin-top: 0.25em; }
  .sc-chart { height: 3.4em; padding-top: 0.2em; }
  .sc-chart span { font-size: 0; }
  .sc-chart i { height: calc(var(--v) / 31 * 100%); }
  .sc-focus { gap: 0.2em 1.4em !important; }
}

/* --- You: what the weeks add up to --- */
.sc-you { max-width: 50em; display: grid; gap: 1.5em; }
.sc-you .sc-head { margin-bottom: 0; }
.sc-weeks { display: flex; align-items: center; gap: 0.5em; }
.sc-weeks i { width: 2.2em; height: 0.7em; border-radius: 0.35em; background: var(--c); opacity: calc(0.14 + 0.86 * var(--k, 1)); }
.sc-weeks .sc-label { margin-left: 0.6em; }
.sc-you p.sc-say { font: 400 1.5em/1.25 var(--font-serif); color: var(--site-ink); letter-spacing: -0.01em; }
.sc-you p.sc-say b { font-weight: 400; background: linear-gradient(transparent 62%, color-mix(in srgb, var(--c) 34%, transparent) 0); }
.sc-axis { position: relative; height: 5.2em; margin-top: 1.3em; }
.sc-axis__hours { position: absolute; inset: auto 0 0 0; display: flex; justify-content: space-between; padding-top: 0.4em; border-top: 1px solid var(--site-line); font-size: 0.8em; color: var(--site-muted); }
.sc-axis__band {
  position: absolute;
  top: 1.5em;
  left: calc(var(--from) * 1%);
  width: calc((var(--to) - var(--from)) * 1%);
  height: 1.1em;
  border-radius: 0.55em;
  background: var(--c);
}
.sc-axis__band--over {
  --c2: color-mix(in srgb, var(--c) 35%, var(--window));
  border-radius: 0 0.55em 0.55em 0;
  background: linear-gradient(-45deg, var(--c) 25%, var(--c2) 25%, var(--c2) 50%, var(--c) 50%, var(--c) 75%, var(--c2) 75%) 0 0 / 0.8em 0.8em;
}
.sc-axis__focus { top: 0.9em; height: 2.3em; border-radius: 0.6em; background: color-mix(in srgb, var(--c) 22%, transparent); box-shadow: inset 0 0 0 2px var(--c); }
.sc-axis__tag { position: absolute; top: -0.6em; left: calc(var(--from) * 1%); font-size: 0.82em; font-weight: 600; color: var(--site-ink); white-space: nowrap; }
.sc-evidence { align-self: start; padding: 0.9em 1.1em; font-size: 0.9em; line-height: 1.5; max-width: 22em; }
.sc-chips { display: flex; flex-wrap: wrap; gap: 0.5em; margin-top: 0.7em; }
.sc-chips span { display: flex; align-items: center; gap: 0.5em; padding: 0.35em 0.8em; border-radius: var(--r-pill); border: 1px solid var(--site-line); background: var(--card); font-size: 0.86em; font-weight: 500; }
.sc-chips span::before { content: ""; width: 0.6em; height: 0.6em; border-radius: 50%; background: var(--c); }
.sc-you__pair { display: grid; grid-template-columns: 1fr 1fr; gap: 1.6em; }
@container stage (max-width: 560px) {
  .sc-you { gap: 0.7em; }
  .sc-you .sc-weeks .sc-label, .sc-chips { display: none; }
  .sc-weeks i { flex: 1; }
  .sc-you p.sc-say { font-size: 1.2em; }
  .sc-you__pair { grid-template-columns: 1fr; gap: 0.6em; }
  .sc-axis { height: 4.4em; margin-top: 0.5em; }
  .sc-evidence { display: none; }
  .sc-weeks i { width: 1.6em; }
}

/* --- Plan: a week, and one suggestion --- */
.sc-plan { display: grid; grid-template-columns: minmax(0, 1fr) 17em; gap: 0 1.4em; align-items: start; }
.sc-plan .sc-head { grid-column: 1 / -1; }
.sc-week { padding: 0.9em 1em 1em 0.6em; }
.sc-week__head,
.sc-week__grid { display: grid; grid-template-columns: 3.6em repeat(5, minmax(0, 1fr)); }
.sc-week__head span { text-align: center; font-size: 0.84em; font-weight: 500; color: var(--site-muted); padding-bottom: 0.6em; }
.sc-week__grid { position: relative; height: 26em; }
.sc-week__hours { display: grid; grid-template-rows: repeat(8, 1fr); padding-right: 0.7em; text-align: right; white-space: nowrap; font-size: 0.8em; color: var(--site-muted); }
.sc-week__day {
  position: relative;
  border-left: 1px solid var(--site-line);
  background: repeating-linear-gradient(var(--site-line) 0 1px, transparent 1px 12.5%);
}
.sc-week__day.is-lit { box-shadow: none; background-color: color-mix(in srgb, var(--accent) 9%, transparent); }
.ev {
  position: absolute;
  left: 0.2em;
  right: 0.2em;
  top: calc(var(--t) * 12.5% + 1px);
  height: calc(var(--h) * 12.5% - 2px);
  padding: 0.25em 0.45em;
  border-radius: 0.45em;
  border-left: 0.25em solid var(--c);
  background: color-mix(in srgb, var(--c) 16%, var(--card));
  font-size: 0.8em;
  font-weight: 500;
  color: var(--site-ink);
  line-height: 1.2;
  overflow: hidden;
}
.ev--focus {
  border: 0;
  background: color-mix(in srgb, var(--c) calc(var(--k2, 1) * 26%), var(--card));
  box-shadow: inset 0 0 0 1.5px var(--c);
}
.ev--move { z-index: 2; top: calc((var(--t) + var(--k, 1) * var(--dt)) * 12.5% + 1px); box-shadow: 0 0.3em 0.9em rgba(10, 64, 76, 0.14); }
.sc-suggest { padding: 1.3em 1.4em; display: grid; gap: 0.8em; }
.sc-suggest h4 { margin: 0; font-size: 1.15em; line-height: 1.25; font-weight: 600; color: var(--site-ink); }
.sc-suggest p { font-size: 0.9em; line-height: 1.45; color: var(--site-muted); }
.sc-btns { display: flex; gap: 0.5em; }
.sc-btns span { padding: 0.35em 0.9em; border-radius: 0.5em; border: 1px solid var(--site-line); font-size: 0.86em; font-weight: 600; }
.sc-btns .is-primary { border-color: transparent; background: var(--site-ink); color: var(--page); }
@container stage (max-width: 560px) {
  .sc-plan { grid-template-columns: minmax(0, 1fr); gap: 0.5em; }
  .sc-plan .sc-head { margin-bottom: 0.2em; }
  .sc-head h4 { font-size: 1.5em; }
  .sc-head { margin-bottom: 0.6em; }
  .sc-week { padding: 0.6em 0.7em 0.7em 0.3em; }
  .sc-week__grid { height: 14em; }
  .sc-week__head, .sc-week__grid { grid-template-columns: 3em repeat(5, minmax(0, 1fr)); }
  .sc-week__hours { font-size: 0.74em; padding-right: 0.5em; }
  .sc-week__hours span:nth-child(even) { visibility: hidden; }
  /* Only the two events the suggestion is about keep their names. */
  .ev { font-size: 0; padding: 0; }
  .ev--focus, .ev--move { font-size: 0.76em; padding: 0.1em 0.3em; }
  .sc-suggest { padding: 0.6em 0.9em; gap: 0.25em; grid-template-columns: minmax(0, 1fr) auto; align-items: center; }
  .sc-suggest .sc-label, .sc-suggest p { display: none; }
  .sc-suggest h4 { font-size: 1em; }
}

/* ---------- Reveal ---------- */
/*
  Sections after the tour fade up once as they come into view: site.js adds
  .is-in when an element's top passes 85% of the window, staggering
  siblings by 80ms. Without script or with reduced motion they are simply
  there.
*/
@media (prefers-reduced-motion: no-preference) {
  .js [data-reveal] {
    opacity: 0;
    translate: 0 24px;
    transition:
      opacity 0.8s var(--ease-reveal) var(--reveal-delay, 0s),
      translate 0.8s var(--ease-reveal) var(--reveal-delay, 0s);
  }
  .js [data-reveal].is-in { opacity: 1; translate: 0 0; }
}

/* ---------- Privacy ---------- */

.privacy {
  margin-top: clamp(72px, 16vh, 180px);
  padding: 0 var(--gutter);
}
.privacy__head { max-width: 40em; }
.privacy__head h2 { font-size: clamp(40px, 5.6vw, 88px); line-height: 1; letter-spacing: var(--track-display); }
.privacy__head p { margin-top: 18px; font-size: var(--type-lede); }
.ledger {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(20px, 3vw, 48px);
  margin-top: clamp(36px, 6vh, 64px);
}
.ledger__col {
  padding-top: 18px;
  border-top: 4px solid var(--c);
}
.ledger__col h3 {
  font-size: 15px;
  font-weight: 600;
  color: var(--site-muted);
}
.ledger__col p {
  margin-top: 10px;
  max-width: 14em;
  font-family: var(--font-serif);
  font-size: var(--type-statement);
  line-height: 1.16;
  letter-spacing: -0.015em;
  color: var(--site-ink);
}
.privacy__more { margin-top: 36px; }
.text-link {
  color: var(--site-ink);
  font-weight: 600;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 4px;
  text-decoration-color: var(--coral);
}
.text-link:hover { text-decoration-thickness: 2.5px; }
@media (max-width: 760px) {
  .ledger { grid-template-columns: 1fr; }
  .ledger__col p { max-width: none; }
}

/* ---------- Closing ---------- */

.closing {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 48px clamp(32px, 6vw, 96px);
  margin-top: clamp(80px, 18vh, 200px);
  padding: 0 var(--gutter) clamp(72px, 14vh, 160px);
}
.closing h2 { font-size: clamp(44px, 7.2vw, 116px); line-height: 0.96; letter-spacing: var(--track-display); }
.closing__lede { margin: 22px 0 30px; font-size: var(--type-lede); }
.checks {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  margin-top: 22px;
  color: var(--site-muted);
  font-size: 15px;
}
.checks li { display: flex; align-items: center; gap: 8px; }
.checks li::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--coral);
}
.closing__panel { margin: 0; }
/* The finished panel, drawn like the tour's. */
.sc-panel--closing { width: 25em; max-width: 100%; margin: 0; font-size: clamp(13px, 1.25vw, 17px); line-height: 1.35; color: var(--site-text); }
.sc-panel--closing .sc-panel__card { border-radius: var(--r-dialog); }
.sc-panel__sky--night {
  background: linear-gradient(rgba(4, 18, 46, 0.2), rgba(4, 18, 46, 0.2)), url("../img/sky-night.jpg") center / cover;
}
@media (max-width: 900px) {
  .closing { grid-template-columns: 1fr; }
  .closing__panel { justify-self: center; }
}

/* ---------- Footer ---------- */

.site-footer {
  border-top: 1px solid var(--site-line);
  padding: 32px var(--gutter) 40px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 18px 40px;
  font-size: 14px;
  color: var(--site-muted);
}
.site-footer__mark .mark { height: 22px; width: auto; }
.site-footer p { flex: 1; min-width: 16em; }
.site-footer ul { display: flex; flex-wrap: wrap; gap: 8px 24px; }
.site-footer a { text-decoration: none; }
.site-footer ul a:hover { color: var(--site-ink); text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Document pages: download, privacy, 404 ---------- */

.doc {
  max-width: 1040px;
  padding: clamp(48px, 10vh, 112px) var(--gutter) clamp(72px, 12vh, 140px);
}
.doc > header h1 {
  font-size: var(--type-display);
  line-height: 0.98;
  letter-spacing: var(--track-display);
}
.doc > header p {
  margin-top: 22px;
  max-width: 32em;
  font-size: var(--type-lede);
  line-height: 1.45;
}
.doc section { margin-top: clamp(56px, 9vh, 88px); }
.doc section > h2 {
  margin-bottom: 20px;
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: var(--type-heading-serif);
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--site-ink);
}
.doc section > h2 small {
  display: block;
  margin-bottom: 6px;
  font: 500 15px/1.3 var(--font-sans);
  letter-spacing: 0;
  color: var(--site-muted);
}
.doc p, .doc li, .doc dd { max-width: var(--measure); }
.doc section p + p { margin-top: 0.9em; }
.doc a:not(.button) {
  color: var(--site-ink);
  font-weight: 500;
  text-decoration-color: var(--coral);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 3px;
}
.doc ul.plain { list-style: disc; padding-left: 1.1em; }
.doc ul.plain li { margin-bottom: 0.45em; }
.doc ul.plain li::marker { color: var(--coral); }
.doc .small-sans { margin-top: 14px; font-size: 15px; color: var(--site-muted); }
.doc .muted { color: var(--site-muted); font-weight: 400; }

.download-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 12px 32px;
  margin-top: clamp(36px, 6vh, 56px);
  padding: clamp(20px, 3vw, 36px);
  border-radius: var(--r-stage);
  background: var(--site-wash);
}
.download-card img { width: 132px; height: 132px; }
.download-card h2 {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: 34px;
  line-height: 1.1;
  color: var(--site-ink);
}
.download-card .download-meta { margin: 6px 0 18px; }
.download-card__actions { display: flex; flex-wrap: wrap; gap: 12px; }
.download-alt { margin-top: 16px; font-size: 14px; color: var(--site-muted); }
@media (max-width: 560px) {
  .download-card { grid-template-columns: 1fr; }
  .download-card img { width: 96px; height: 96px; margin: -6px; }
}

.steps { counter-reset: step; display: grid; gap: 22px; }
.steps > li {
  counter-increment: step;
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 0 14px;
}
.steps > li::before {
  content: counter(step);
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--site-wash);
  color: var(--site-ink);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.steps h3 { font-size: 19px; line-height: 1.3; font-weight: 600; color: var(--site-ink); padding-top: 7px; }
.steps p { margin-top: 4px; color: var(--site-muted); }
.steps kbd {
  display: inline-block;
  min-width: 1.6em;
  padding: 1px 6px;
  border-radius: 6px;
  border: 1px solid var(--site-line);
  background: var(--page);
  font: 500 0.85em var(--font-sans);
  text-align: center;
  color: var(--site-ink);
}

.faq dt {
  margin-top: 22px;
  padding-top: 22px;
  border-top: 1px solid var(--site-line);
  font-weight: 600;
  font-size: 19px;
  color: var(--site-ink);
}
.faq dt:first-child { margin-top: 0; }
.faq dd { margin-top: 6px; color: var(--site-muted); }

.table-wrap { margin-top: 20px; overflow-x: auto; }
.table { width: 100%; min-width: 560px; border-collapse: collapse; font-size: 15px; line-height: 1.45; }
.table th, .table td {
  padding: 12px 16px 12px 0;
  text-align: left;
  vertical-align: top;
  border-top: 1px solid var(--site-line);
}
.table thead th { border-top: 0; font-size: 13px; font-weight: 600; color: var(--site-muted); }
.table tbody th { font-weight: 600; color: var(--site-ink); width: 28%; }
