/* Shared by the homepage and the Education page: the scroll-drawn thread, its
   steps, the two-pane figure, the fact sheet, and the closing band.
   Brand values mirror Color.Theme in the Mac app. */
.flow-page {
  --flow-width: 1200px;
  --flow-tan-deep: #DAC08D;
  --flow-rose: #E68B89;
  --flow-blush: #F0BCBC;
  --flow-rule: color-mix(in srgb, var(--text-primary) 14%, transparent);
  --flow-ease: cubic-bezier(.2, .7, .2, 1);
}
:root[data-theme="dark"] .flow-page {
  --flow-tan-deep: #3B3023;
  --flow-rose: #F08F92;
  --flow-blush: #593137;
}

.flow-skip-link {
  position: fixed;
  top: -80px;
  left: 24px;
  z-index: 30;
  padding: 12px 20px;
  background: var(--surface);
  color: var(--accent);
  border-radius: 8px;
}
.flow-skip-link:focus { top: 80px; }
.flow-page [hidden] { display: none !important; }
.flow-page :is(a, button):focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 5px;
}
.flow-page :is(.primary-link, .primary-button):active { transform: scale(.97); }
.flow-page .primary-link { width: auto; min-height: 50px; padding-inline: 27px; }
.flow-page h2 {
  margin: 0;
  font-family: "Avenir-Medium", "Avenir Next", Avenir, sans-serif;
  font-size: clamp(34px, 4vw, 56px);
  font-weight: 500;
  line-height: 1.08;
  letter-spacing: -.04em;
  text-wrap: balance;
}
.flow-page h3 {
  margin: 0;
  font-family: "Avenir-Medium", "Avenir Next", Avenir, sans-serif;
  font-weight: 500;
}
.flow-page mark,
.flow-highlight {
  color: inherit;
  background-color: transparent;
  background-image: linear-gradient(var(--flow-blush), var(--flow-blush));
  background-repeat: no-repeat;
}
/* A highlighter stroke across part of a headline. */
.flow-highlight {
  padding-inline: .09em;
  margin-inline: -.09em;
  background-position: 0 64%;
  background-size: 100% 44%;
  animation: flow-sweep 900ms 300ms var(--flow-ease) both;
}
@keyframes flow-sweep { from { background-size: 0% 44%; } }
.flow-page kbd {
  display: inline-grid;
  place-items: center;
  min-width: 1.75em;
  height: 1.75em;
  padding-inline: .3em;
  border: 1px solid var(--border);
  border-bottom-width: 2px;
  border-radius: 6px;
  font-family: inherit;
  font-size: .85em;
}

/* Thread section */
.flow-section {
  position: relative;
  padding: 118px 28px 140px;
  background: var(--story-background);
}
.flow-thread {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: none;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}
.thread-ready .flow-thread { display: block; }
.flow-thread path { fill: none; stroke-width: 3; stroke-linecap: round; }
.flow-thread-track { stroke: var(--flow-tan-deep); }
.flow-thread-line { stroke: var(--accent); }
.flow-thread-head { fill: var(--accent); opacity: 0; transition: opacity 200ms ease; }

.flow-heading,
.flow-step {
  display: grid;
  grid-template-columns: minmax(0, 5fr) 96px minmax(0, 7fr);
}
.flow-heading {
  position: relative;
  z-index: 1;
  align-items: end;
  max-width: var(--flow-width);
  margin: 0 auto 110px;
}
.flow-heading h2 { font-size: clamp(34px, 3.7vw, 52px); }
.flow-heading p {
  grid-column: 3;
  max-width: 330px;
  margin: 0 0 8px;
  color: var(--text-secondary);
  font-size: 19px;
  line-height: 1.5;
}
.flow-steps {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 150px;
  max-width: var(--flow-width);
  margin: 0 auto;
  padding: 0;
  list-style: none;
}
.flow-step { align-items: center; }
.flow-step:nth-child(even) { grid-template-columns: minmax(0, 7fr) 96px minmax(0, 5fr); }
.flow-step:nth-child(even) .flow-step-visual { order: 1; }
.flow-step:nth-child(even) .flow-node { order: 2; }
.flow-step:nth-child(even) .flow-step-copy { order: 3; }

.flow-step-label {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 0 0 18px;
  font-family: "Avenir-Heavy", "Avenir Next", Avenir, sans-serif;
  font-size: 16px;
  font-weight: 800;
}
.flow-step-label span { color: var(--accent); font-variant-numeric: tabular-nums; }
.flow-step-copy h3 { font-size: clamp(28px, 2.8vw, 40px); line-height: 1.12; letter-spacing: -.035em; text-wrap: balance; }
.flow-step-copy > p:not(.flow-step-label) {
  max-width: 430px;
  margin: 22px 0 0;
  color: var(--text-secondary);
  font-size: 17px;
  line-height: 1.65;
}
.flow-facts { max-width: 430px; margin: 28px 0 0; padding: 0; list-style: none; font-size: 14px; line-height: 1.5; }
.flow-facts li { padding: 11px 0; border-top: 1px solid var(--flow-rule); }
.flow-facts li:last-child { border-bottom: 1px solid var(--flow-rule); }

/* Each marker is a pie that gains a slice per step. */
.flow-node { justify-self: center; width: 46px; height: 46px; }
.flow-node svg { display: block; width: 100%; height: 100%; }
.flow-node-plate { fill: var(--background); stroke: var(--flow-tan-deep); stroke-width: 1.5; }
.flow-node-slice { fill: none; stroke: var(--accent); stroke-width: 14; transition: stroke-dasharray 700ms var(--flow-ease); }
.thread-ready .flow-node:not(.is-reached) .flow-node-slice { stroke-dasharray: 0 43.982; }

.flow-step-visual {
  margin: 0;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--border) 45%, transparent);
  border-radius: 14px;
  background: var(--background);
  box-shadow: 0 24px 50px var(--screenshot-shadow);
}
.flow-step-visual img { display: block; width: 100%; height: auto; }

/* Two panes joined by a badge on the divider. */
.flow-split {
  position: relative;
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  margin: 0;
  background: var(--surface);
}
.flow-split > div { padding: clamp(22px, 3vw, 38px); }
.flow-split > div + div { position: relative; background: var(--background); border-left: 1px solid var(--flow-rule); }
.flow-split p { margin: 0; }
.flow-split-label {
  color: var(--accent);
  font-family: "Avenir-Heavy", "Avenir Next", Avenir, sans-serif;
  font-size: 13px;
  font-weight: 800;
}
.flow-split-badge {
  position: absolute;
  top: 50%;
  left: 0;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--on-accent);
  transform: translate(-50%, -50%);
}
.flow-split-badge svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.motion-ok .flow-split-badge { transform: translate(-50%, -50%) scale(0); transition: transform 450ms 1150ms var(--flow-ease); }
.motion-ok .flow-split.is-visible .flow-split-badge { transform: translate(-50%, -50%) scale(1); }

/* Fact sheet */
.flow-kit {
  --flow-inset: max(28px, calc((100% - var(--flow-width)) / 2));
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: 60px;
  padding: 110px var(--flow-inset);
  background: var(--surface);
}
.flow-kit-heading { align-self: start; position: sticky; top: 40px; }
.flow-kit-heading p { margin: 20px 0 0; color: var(--text-secondary); font-size: 18px; line-height: 1.6; }
.flow-kit-list { margin: 0; }
.flow-kit-list div {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr);
  gap: 20px;
  align-items: baseline;
  padding: 19px 0;
  border-top: 1px solid var(--flow-rule);
}
.flow-kit-list div:last-child { border-bottom: 1px solid var(--flow-rule); }
.flow-kit-list dt {
  color: var(--accent);
  font-family: "Avenir-Heavy", "Avenir Next", Avenir, sans-serif;
  font-size: 16px;
  font-weight: 800;
}
.flow-kit-list dd { margin: 0; font-size: 18px; line-height: 1.5; }
.flow-kit-list kbd { margin-left: 3px; }

/* Closing band */
.flow-closing { padding: 85px 24px 95px; background: var(--story-background); text-align: center; }
.flow-closing img { display: block; margin: 0 auto 20px; }
.flow-closing > p { max-width: 560px; margin: 22px auto 0; color: var(--text-secondary); font-size: 18px; line-height: 1.6; }
.flow-closing .primary-link { margin: 32px auto 0; }
.flow-back-top { display: block; width: fit-content; margin: 24px auto 0; color: var(--text-secondary); text-decoration: none; font-size: 13px; }
.flow-back-top:hover { color: var(--accent); }

/* Reveal on scroll, switched on by flow.js only when motion is welcome. */
.motion-ok [data-reveal] { opacity: 0; transform: translateY(26px); transition: opacity 600ms ease, transform 800ms var(--flow-ease); }
.motion-ok [data-reveal].is-visible { opacity: 1; transform: none; }

@media (max-width: 1100px) {
  .flow-heading,
  .flow-step { grid-template-columns: minmax(0, 5fr) 72px minmax(0, 6fr); }
  .flow-step:nth-child(even) { grid-template-columns: minmax(0, 6fr) 72px minmax(0, 5fr); }
  .flow-steps { gap: 120px; }
}
@media (max-width: 900px) {
  .flow-section { padding: 76px 24px 90px; }
  .flow-heading { display: block; margin-bottom: 56px; }
  .flow-heading p { margin: 18px 0 0; font-size: 17px; }
  .flow-steps { gap: 76px; }
  .flow-step,
  .flow-step:nth-child(even) { grid-template-columns: 34px minmax(0, 1fr); column-gap: 18px; row-gap: 28px; align-items: start; }
  .flow-step .flow-node,
  .flow-step:nth-child(even) .flow-node { order: 0; grid-row: 1 / span 2; width: 34px; height: 34px; margin-top: -8px; }
  .flow-step .flow-step-copy,
  .flow-step:nth-child(even) .flow-step-copy { order: 1; grid-column: 2; }
  .flow-step .flow-step-visual,
  .flow-step:nth-child(even) .flow-step-visual { order: 2; grid-column: 2; }
  .flow-step-copy > p:not(.flow-step-label), .flow-facts { max-width: 560px; }
  .flow-kit { --flow-inset: 24px; grid-template-columns: 1fr; gap: 40px; padding-block: 76px; }
  .flow-kit-heading { position: static; }
}
@media (max-width: 600px) {
  .flow-page h2 { font-size: 34px; }
  .flow-step-copy h3 { font-size: 28px; }
  .flow-step-visual { border-radius: 9px; }
  .flow-split { grid-template-columns: 1fr; }
  .flow-split > div + div { border-left: 0; border-top: 1px solid var(--flow-rule); }
  .flow-split-badge { top: 0; left: 40px; }
  .flow-kit-list div { grid-template-columns: 1fr; gap: 6px; padding: 16px 0; }
  .flow-kit-list dd { font-size: 17px; }
  .flow-closing { padding-block: 64px; }
  .flow-page .site-footer { flex-direction: column; align-items: flex-start; padding: 25px 24px; }
  .flow-page .site-footer nav { flex-wrap: wrap; gap: 16px 20px; }
}
@media (prefers-reduced-motion: reduce) {
  html:has(.flow-page) { scroll-behavior: auto; }
  .flow-page *, .flow-page *::before, .flow-page *::after { animation: none !important; transition: none !important; }
  .flow-page [data-reveal] { opacity: 1; transform: none; }
  .flow-page .flow-split-badge { transform: translate(-50%, -50%); }
}
