/* ASOHero public site. System: docs/brand/design-system.md. Tokens: tokens.css
   (loaded first by layout.mjs). Same-origin only: no inline styles anywhere. */

@font-face {
  font-family: "Schibsted Grotesk Variable";
  font-style: normal;
  font-display: swap;
  font-weight: 400 900;
  src: url(/assets/fonts/schibsted-grotesk-latin-wght-normal.woff2) format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Schibsted Grotesk Variable";
  font-style: normal;
  font-display: swap;
  font-weight: 400 900;
  src: url(/assets/fonts/schibsted-grotesk-latin-ext-wght-normal.woff2) format("woff2-variations");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

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

:root {
  color-scheme: light;
  font-family: var(--font-sans);
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

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

html,
body {
  background: var(--paper);
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-size: var(--body-size);
  line-height: var(--body-line);
  font-weight: var(--weight-body);
  caret-color: var(--accent);
}

main {
  flex: 1 0 auto;
}

[hidden] {
  display: none !important;
}

h1,
h2,
h3,
p,
ol,
ul {
  margin: 0;
}

h1,
h2,
h3 {
  font-weight: var(--weight-head);
  text-wrap: balance;
}

p {
  text-wrap: pretty;
}

::selection {
  background: var(--accent-tint);
  color: var(--ink);
}

a {
  color: var(--accent);
  text-decoration-line: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  text-decoration-color: rgb(42 68 212 / 0.4);
  transition: text-decoration-color var(--base) var(--ease), color var(--fast) var(--ease);
}

a:hover {
  text-decoration-color: currentColor;
}

button,
input {
  font: inherit;
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.skip-link {
  position: absolute;
  left: var(--s4);
  top: -100px;
  z-index: 10;
  padding: var(--s2) var(--s4);
  background: var(--paper);
  border: 1px solid var(--control);
  border-radius: var(--radius-control);
  font-size: var(--ui-size);
  line-height: var(--ui-line);
  font-weight: var(--weight-ui);
}

.skip-link:focus {
  top: var(--s3);
}

/* Layout: wrap and rails ------------------------------------------------- */

/* From 600px, content sits 24px inside the rails so no text or control
   border ever touches one. */
.wrap {
  width: 100%;
  max-width: calc(var(--content) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: calc(var(--gutter) + var(--inset));
}

/* Rails: hairlines at the content edges (and the centre on split sections),
   drawn behind content on a pseudo-element. Text never sits on a rail. */
.frame,
.site-header,
.site-footer {
  position: relative;
  isolation: isolate;
}

.frame::before,
.site-header::before,
.site-footer::before {
  content: none;
  position: absolute;
  z-index: -1;
  top: 0;
  bottom: 0;
  left: 50%;
  width: min(var(--content), calc(100% - 2 * var(--gutter)));
  transform: translateX(-50%);
  pointer-events: none;
  border-inline: 1px solid var(--rail, var(--rule));
}

@media (min-width: 600px) {
  .frame::before,
  .site-header::before,
  .site-footer::before {
    content: "";
  }
}

.frame--ink {
  --rail: var(--rule-on-ink);
  background: var(--ink);
  color: var(--on-ink);
}

/* Header and footer ---------------------------------------------------- */

.site-header {
  border-bottom: 1px solid var(--rule);
}

.site-header__inner {
  height: var(--header-h);
  display: flex;
  align-items: center;
}

.brand {
  color: var(--ink);
  text-decoration: none;
  font-size: 20px;
  line-height: 1;
  font-weight: var(--weight-head);
  letter-spacing: -0.02em;
}

.brand:hover {
  color: var(--ink);
}

.site-footer {
  border-top: 1px solid var(--rule);
  font-size: var(--small-size);
  line-height: var(--small-line);
  color: var(--ink-2);
}

.site-footer__inner {
  padding-block: var(--s6);
  display: grid;
  gap: var(--s2);
}

@media (min-width: 900px) {
  .site-footer__inner {
    padding-block: var(--s7);
  }
}

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

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  cursor: pointer;
  font-size: var(--ui-size);
  line-height: var(--ui-line);
  font-weight: var(--weight-ui);
}

.button--primary {
  min-height: 48px;
  padding: 0 var(--s5) 0 20px;
  border-radius: var(--radius-control);
  background: var(--accent);
  color: var(--on-ink);
  transition: background-color var(--fast) var(--ease);
}

/* Stripe-style hover arrow: a chevron drawn with borders. */
.button--primary::after {
  content: "";
  width: 7px;
  height: 7px;
  margin-left: 10px;
  border-top: 2px solid currentColor;
  border-right: 2px solid currentColor;
  transform: rotate(45deg);
  transition: transform var(--base) var(--ease);
}

.button--primary:hover:not(:disabled) {
  background: var(--accent-hover);
}

.button--primary:hover:not(:disabled)::after {
  transform: translateX(3px) rotate(45deg);
}

.button--primary:active:not(:disabled) {
  background: var(--ink);
}

.button--primary:disabled {
  cursor: progress;
}

.button--primary:disabled::after {
  display: none;
}

.button--text {
  min-height: 44px;
  padding: 0;
  background: none;
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  text-decoration-color: rgb(42 68 212 / 0.4);
}

.button--text:hover {
  text-decoration-color: currentColor;
}

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

.hero__grid {
  padding-top: var(--hero-top);
  padding-bottom: var(--section-y);
  display: grid;
  grid-template-columns: minmax(0, 1fr);
}

.hero__title {
  max-width: 18ch;
  font-size: var(--display-size);
  line-height: var(--display-line);
  letter-spacing: var(--track-display);
}

.hero__lead {
  max-width: 34em;
  margin-top: var(--s5);
  font-size: var(--lead-size);
  line-height: var(--lead-line);
  letter-spacing: var(--track-lead);
  color: var(--ink-2);
}

.form-panel {
  width: 100%;
  max-width: 520px;
  margin-top: var(--s6);
}

.hero__art {
  margin-top: var(--s8);
}

@media (min-width: 900px) {
  .hero__grid {
    grid-template-columns: repeat(12, minmax(0, 1fr));
    grid-template-rows: auto auto 1fr;
    column-gap: var(--grid-gap);
    align-items: start;
  }

  .hero__title {
    grid-column: 1 / 9;
    max-width: none;
  }

  /* Desktop rhythm is tightened so the button clears a 1280x800 fold. */
  .hero__lead {
    grid-column: 1 / 7;
    margin-top: var(--s4);
  }

  .form-panel {
    grid-column: 1 / 7;
    grid-row: 3;
    max-width: none;
    margin-top: var(--s5);
  }

  .form-panel .teardown-form {
    gap: var(--s4);
  }

  .hero__art {
    grid-column: 8 / 13;
    grid-row: 2 / 4;
    margin-top: var(--s5);
  }
}

/* Form ------------------------------------------------------------------ */

.teardown-form {
  display: grid;
  gap: var(--s5);
}

.form-error {
  padding: var(--s3) var(--s4);
  border: 1px solid var(--bad);
  background: var(--bad-tint);
  font-size: var(--small-size);
  line-height: var(--small-line);
  font-weight: var(--weight-ui);
  color: var(--ink);
}

.field {
  display: grid;
  gap: var(--s2);
}

.field-label {
  font-size: var(--ui-size);
  line-height: var(--ui-line);
  font-weight: var(--weight-ui);
}

.text-input {
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid var(--control);
  border-radius: var(--radius-control);
  background: var(--paper);
  font-size: var(--ui-size);
  line-height: var(--ui-line);
  transition: border-color var(--fast) var(--ease);
}

.text-input::placeholder {
  color: var(--ink-3);
  opacity: 1;
}

.text-input:hover {
  border-color: var(--ink-2);
}

.text-input:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-ring);
}

.text-input[aria-invalid="true"] {
  border-color: var(--bad);
}

.text-input[aria-invalid="true"]:focus-visible {
  box-shadow: 0 0 0 3px rgb(192 38 45 / 0.25);
}

.field-hint {
  font-size: var(--small-size);
  line-height: var(--small-line);
  color: var(--ink-2);
}

.field-error {
  font-size: var(--small-size);
  line-height: var(--small-line);
  font-weight: var(--weight-ui);
  color: var(--bad);
}

/* The hint gives way to the error in the same place. */
.field:has(.field-error:not([hidden])) .field-hint {
  display: none;
}

/* Checkbox */

.consent {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  column-gap: var(--s3);
  row-gap: var(--s1);
  align-items: start;
}

.consent__box {
  appearance: none;
  width: 20px;
  height: 20px;
  margin: 1px 0 0;
  display: grid;
  place-content: center;
  border: 1px solid var(--control);
  border-radius: var(--radius-check);
  background: var(--paper);
  cursor: pointer;
  transition: background-color var(--base) var(--ease), border-color var(--fast) var(--ease);
}

.consent__box::before {
  content: "";
  width: 10px;
  height: 6px;
  margin-top: -2px;
  border-left: 2px solid var(--on-ink);
  border-bottom: 2px solid var(--on-ink);
  transform: rotate(-45deg) scale(0);
  transition: transform var(--base) var(--ease);
}

.consent__box:hover {
  border-color: var(--ink-2);
}

.consent__box:checked {
  background: var(--accent);
  border-color: var(--accent);
}

.consent__box:checked::before {
  transform: rotate(-45deg) scale(1);
}

.consent__label {
  font-size: var(--small-size);
  line-height: var(--small-line);
  text-wrap: pretty;
  cursor: pointer;
}

.consent__note {
  grid-column: 2;
  font-size: var(--small-size);
  line-height: var(--small-line);
  color: var(--ink-2);
}

.hp {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.submit {
  width: 100%;
}

@media (min-width: 600px) {
  .submit {
    width: auto;
    justify-self: start;
  }
}

.fine-print {
  font-size: var(--small-size);
  line-height: var(--small-line);
  color: var(--ink-2);
}

/* Success */

.success {
  display: grid;
  gap: var(--s3);
  justify-items: start;
  padding-top: var(--s5);
  border-top: 1px solid var(--rule);
}

.success:focus {
  outline: none;
}

.success h2 {
  font-size: var(--h2-size);
  line-height: var(--h2-line);
  letter-spacing: var(--track-h2);
}

.success p {
  max-width: 34em;
  color: var(--ink-2);
  overflow-wrap: anywhere;
}

.success #success-sent-to {
  color: var(--ink);
  font-weight: var(--weight-ui);
}

/* Example teardown ----------------------------------------------------- */

.example {
  border: 1px solid var(--rule);
  background: var(--paper);
  padding: var(--s4);
}

@media (min-width: 600px) {
  .example {
    padding: var(--s5);
  }
}

.example__label,
.example__hint {
  font-size: var(--micro-size);
  line-height: var(--micro-line);
  font-weight: var(--weight-ui);
  letter-spacing: var(--track-micro);
  color: var(--ink-2);
}

.example__app {
  margin-top: var(--s4);
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: var(--s3);
  align-items: center;
}

.example__name {
  font-size: var(--h3-size);
  line-height: var(--h3-line);
  font-weight: var(--weight-head);
  letter-spacing: var(--track-h3);
}

.example__meta {
  font-size: var(--small-size);
  line-height: var(--small-line);
  color: var(--ink-2);
}

.example__hint {
  margin-top: var(--s5);
  padding-bottom: var(--s2);
}

.example__fields {
  list-style: none;
  padding: 0;
  margin: 0 calc(-1 * var(--s3));
}

.xfield {
  border-top: 1px solid var(--rule);
}

.xfield__button {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 12px;
  column-gap: var(--s3);
  align-items: center;
  padding: var(--s3);
  border: 0;
  background: none;
  text-align: left;
  cursor: pointer;
  transition: background-color var(--fast) var(--ease);
}

.xfield__button:hover,
.xfield__button[aria-expanded="true"] {
  background: var(--paper-2);
}

.xfield__button:focus-visible {
  outline-offset: -2px;
}

/* Disclosure chevron, drawn with borders. */
.xfield__button::after {
  content: "";
  grid-column: 3;
  grid-row: 1;
  justify-self: center;
  width: 6px;
  height: 6px;
  margin-top: -3px;
  border-right: 1.5px solid var(--ink-2);
  border-bottom: 1.5px solid var(--ink-2);
  transform: rotate(45deg);
  transition: transform var(--base) var(--ease);
}

.xfield__button[aria-expanded="true"]::after {
  margin-top: 3px;
  transform: rotate(225deg);
}

.xfield__label {
  grid-column: 1;
  grid-row: 1;
  font-size: var(--ui-size);
  line-height: var(--ui-line);
  font-weight: var(--weight-ui);
}

.xfield__count,
.xfield__value {
  grid-column: 2;
  grid-row: 1;
  font-size: var(--micro-size);
  line-height: var(--micro-line);
  font-weight: var(--weight-ui);
  letter-spacing: var(--track-micro);
  font-variant-numeric: tabular-nums;
  color: var(--ink-2);
  white-space: nowrap;
}

/* Rows with a ruler show the current text on its own line under the label. */
.xfield__button:has(.ruler) .xfield__value {
  grid-column: 1 / 3;
  grid-row: 2;
  font-size: var(--small-size);
  line-height: var(--small-line);
  font-weight: var(--weight-body);
  letter-spacing: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ruler {
  grid-column: 1 / 3;
  grid-row: 3;
  position: relative;
  display: block;
  margin-top: var(--s2);
}

/* One 3px tick per allowed character, 3px apart: 30 ticks. */
.ruler--chars {
  width: 177px;
  height: 8px;
  background: repeating-linear-gradient(to right, var(--rule) 0 3px, transparent 3px 6px);
}

/* One 8px slot per screenshot, 4px apart: 10 slots. */
.ruler--slots {
  grid-row: 2;
  width: 116px;
  height: 14px;
  background: repeating-linear-gradient(to right, var(--rule) 0 8px, transparent 8px 12px);
}

.ruler__fill {
  position: absolute;
  inset: 0 auto 0 0;
  display: flex;
  clip-path: inset(0 0 0 0);
  transition: clip-path var(--slow) var(--ease);
}

.ruler--chars .ruler__fill {
  background: repeating-linear-gradient(to right, var(--accent) 0 3px, transparent 3px 6px);
}

.ruler--chars .ruler__fill i {
  flex: none;
  width: 6px;
}

.ruler--slots .ruler__fill {
  background: repeating-linear-gradient(to right, var(--accent) 0 8px, transparent 8px 12px);
}

.ruler--slots .ruler__fill i {
  flex: none;
  width: 12px;
}


.xfield__note {
  padding: 0 var(--s3) var(--s4);
  background: var(--paper-2);
  font-size: var(--small-size);
  line-height: var(--small-line);
  color: var(--ink-2);
}

.swap {
  margin-top: var(--s3);
  padding: var(--s3) var(--s4);
  background: var(--accent-tint);
  /* An explicit end value, so the wipe interpolates instead of snapping. */
  clip-path: inset(0 0 0 0);
}

.swap__k {
  font-size: var(--micro-size);
  line-height: var(--micro-line);
  font-weight: var(--weight-ui);
  letter-spacing: var(--track-micro);
  color: var(--ink-2);
}

.swap__v {
  margin-top: 2px;
  font-weight: var(--weight-ui);
  color: var(--ink);
}

/* Sections ------------------------------------------------------------- */

.contents {
  border-top: 1px solid var(--rule);
}

.contents .wrap,
.inkband .wrap,
.figures .wrap,
.searchpic .wrap {
  padding-block: var(--section-y);
}

.contents h2,
.inkband h2,
.figures h2,
.searchpic h2,
.closing h2 {
  max-width: 640px;
  font-size: var(--h2-size);
  line-height: var(--h2-line);
  letter-spacing: var(--track-h2);
}

.cells {
  list-style: none;
  padding: 0;
  margin: var(--s6) 0 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  border-top: 1px solid var(--rule);
}

.cell {
  padding-block: var(--s5);
  border-bottom: 1px solid var(--rule);
}

.cell h3 {
  font-size: var(--h3-size);
  line-height: var(--h3-line);
  letter-spacing: var(--track-h3);
}

.cell p {
  max-width: 34em;
  color: var(--ink-2);
}

.cell h3 + p {
  margin-top: var(--s2);
}

/* Two columns split exactly on the centre rail, which is the divider. */
@media (min-width: 900px) {
  .cells {
    margin-top: var(--s7);
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .cell {
    padding-block: var(--s6);
  }

  .cell:nth-child(odd) {
    padding-right: var(--s7);
  }

  .cell:nth-child(even) {
    padding-left: var(--s7);
  }

  /* The centre rail runs only through the cell rows and is their divider. */
  .cells {
    position: relative;
  }

  .cells::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 1px;
    background: var(--rail, var(--rule));
  }

  .cell:nth-last-child(-n + 2):nth-child(odd),
  .cell:nth-last-child(-n + 2):nth-child(odd) + .cell {
    border-bottom: 0;
  }
}

.cell:last-child {
  border-bottom: 0;
}

/* Ink band */

.inkband h2 {
  color: var(--on-ink);
}

.cells--ink {
  border-color: var(--rule-on-ink);
}

.cells--ink .cell {
  border-color: var(--rule-on-ink);
}

.cells--ink .cell p {
  color: var(--on-ink-2);
}

.frame--ink a {
  color: var(--accent-on-ink);
}

.frame--ink :focus-visible {
  outline-color: var(--accent-on-ink);
}

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

.prose {
  padding-block: var(--section-y);
}

.prose > * {
  max-width: 720px;
}

.prose h1 {
  font-size: var(--h2-size);
  line-height: var(--h2-line);
  letter-spacing: var(--track-h2);
}

.prose .updated {
  margin-top: var(--s3);
  font-size: var(--small-size);
  line-height: var(--small-line);
  color: var(--ink-2);
}

.privacy-section {
  margin-top: var(--s7);
  padding-top: var(--s5);
  border-top: 1px solid var(--rule);
}

.privacy-section h2 {
  font-size: var(--h3-size);
  line-height: var(--h3-line);
  letter-spacing: var(--track-h3);
}

.privacy-section p,
.privacy-section ul {
  margin-top: var(--s3);
  color: var(--ink-2);
}

.privacy-section ul {
  padding-left: var(--s4);
  list-style: square;
}

.privacy-section li::marker {
  color: var(--ink-3);
}

.privacy-section li + li {
  margin-top: var(--s2);
}

.prose p,
.prose li {
  overflow-wrap: anywhere;
}

/* Message pages: confirmations, errors, unsubscribe, 404 -------------- */

.message {
  padding-block: var(--section-y);
  display: grid;
  gap: var(--s4);
  justify-items: start;
}

.message > * {
  max-width: 640px;
}

.message h1 {
  font-size: var(--h2-size);
  line-height: var(--h2-line);
  letter-spacing: var(--track-h2);
}

.message p {
  color: var(--ink-2);
  overflow-wrap: anywhere;
}

.message form {
  margin-top: var(--s2);
}

/* ======================================================================
   Phase 3: motion. Research and rules: docs/brand/motion-research.md.
   Every hidden start state lives inside prefers-reduced-motion:
   no-preference and behind a JS "armed" class where JS decides the
   trigger, so reduced motion and no-JS both get the complete final state.
   Only opacity, transform and clip-path animate.
   ====================================================================== */

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
}

@keyframes fill {
  from {
    clip-path: inset(0 100% 0 0);
  }
}

@keyframes busy {
  0% {
    transform: scaleX(0);
    transform-origin: left;
  }
  50% {
    transform: scaleX(1);
    transform-origin: left;
  }
  50.01% {
    transform-origin: right;
  }
  100% {
    transform: scaleX(0);
    transform-origin: right;
  }
}

/* Moment 1: the example measures itself ------------------------------ */

.xfield:nth-child(1) { --i: 0; }
.xfield:nth-child(2) { --i: 1; }
.xfield:nth-child(3) { --i: 2; }
.xfield:nth-child(4) { --i: 3; }
.xfield:nth-child(5) { --i: 4; }

@media (prefers-reduced-motion: no-preference) {
  /* From 900px the example is in the first viewport: it plays on load in
     CSS. Below that, JS arms it and plays it in view. The rows are in place
     from first paint; only the rulers, the counts (JS) and the open note's
     "Do this" block move, so the frame is never empty. */
  @media (min-width: 900px) {
    .example:not(.is-armed) {
      --start: 300ms;
    }
  }

  .example.is-armed {
    --start: 0ms;
  }

  .example .ruler__fill {
    animation: fill 400ms var(--ease-out) both;
    animation-delay: calc(var(--start, 0ms) + var(--i) * var(--stagger));
  }

  .example:not(.is-touched) .xfield__note:not([hidden]) .swap {
    animation: fill var(--long) var(--ease-out) both;
    animation-delay: var(--start, 0ms);
  }

  /* Below 900px without JS arming, nothing waits. */
  @media (max-width: 899px) {
    .example:not(.is-armed) .ruler__fill,
    .example:not(.is-armed) .swap {
      animation: none;
    }
  }

  .example.is-armed:not(.is-live) :is(.ruler__fill, .swap) {
    animation-play-state: paused;
  }

  /* After the first interaction: notes rise as they open, and the opened
     row's ruler measures again. */
  .example.is-touched .xfield__note:not([hidden]) {
    animation: rise var(--house) var(--ease) both;
  }

  .example.is-touched .xfield.is-measuring .ruler__fill {
    animation: fill var(--house) var(--ease-out) both;
  }
}

/* Moment 4: micro-interactions ---------------------------------------- */

/* Only transform, opacity and clip-path animate in phase 3, so the focus
   ring appears at once; the border colour keeps its phase 2 transition. */

/* The button arrow gains a shaft on hover; the head moves 4px. */
.button--primary {
  position: relative;
}

.button--primary::before {
  content: "";
  order: 2;
  width: 14px;
  height: 2px;
  margin-left: 10px;
  margin-right: -14px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  opacity: 0;
  transition: transform var(--house) var(--ease-out), opacity var(--house) var(--ease-out);
}

.button--primary::after {
  order: 3;
  transition: transform var(--house) var(--ease-out);
}

.button--primary:hover:not(:disabled)::before {
  opacity: 1;
  transform: translateX(4px) scaleX(1);
}

.button--primary:hover:not(:disabled)::after {
  transform: translateX(4px) rotate(45deg);
}

.button--primary:disabled::before {
  display: none;
}

/* While a request is open: a 2px line runs under the button. */
.button--primary[aria-busy="true"]::after {
  display: block;
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -6px;
  width: auto;
  height: 2px;
  margin: 0;
  border: 0;
  background: var(--accent);
  transform: scaleX(0);
  animation: busy 1.2s var(--ease) infinite;
}

@media (prefers-reduced-motion: reduce) {
  .button--primary[aria-busy="true"]::after {
    animation: none;
    transform: none;
    opacity: 0.4;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .success:not([hidden]) {
    animation: rise var(--house) var(--ease) both;
  }
}

/* Moment 2: "What's in the teardown" as a story ------------------------ */
/* Base (phones, and any width with reduced motion): four items, each with
   a small specimen of its part above the heading. */

.story {
  margin-top: var(--s6);
}

.story__steps {
  list-style: none;
  padding: 0;
  margin: 0;
  border-top: 1px solid var(--rule);
  display: grid;
  grid-template-columns: minmax(0, 1fr);
}

.story__step {
  padding-block: var(--s5);
  border-bottom: 1px solid var(--rule);
}

.story__step:last-child {
  border-bottom: 0;
}

.story__step h3 {
  font-size: var(--h3-size);
  line-height: var(--h3-line);
  letter-spacing: var(--track-h3);
}

.story__step p {
  max-width: 34em;
  margin-top: var(--s2);
  color: var(--ink-2);
}

.specimen {
  margin-bottom: var(--s4);
  padding: var(--s4);
  border: 1px solid var(--rule);
  background: var(--paper);
  max-width: 420px;
}

.story__stage {
  display: none;
}

@media (min-width: 900px) {
  .story {
    margin-top: var(--s7);
  }

  .story__steps {
    position: relative;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .story__steps::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 1px;
    background: var(--rule);
  }

  .story__step {
    padding-block: var(--s6);
  }

  .story__step:nth-child(odd) {
    padding-right: var(--s7);
  }

  .story__step:nth-child(even) {
    padding-left: var(--s7);
  }

  .story__step:nth-last-child(-n + 2):nth-child(odd),
  .story__step:nth-last-child(-n + 2):nth-child(odd) + .story__step {
    border-bottom: 0;
  }
}

/* From 900px with motion allowed: the steps scroll on the left while one
   Stowlark teardown stays pinned on the right and builds part by part. */
@media (min-width: 900px) and (prefers-reduced-motion: no-preference) {
  .story {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    column-gap: var(--grid-gap);
  }

  .story__steps {
    grid-column: 1 / 6;
    grid-template-columns: minmax(0, 1fr);
    border-top: 0;
    padding-bottom: 24vh;
  }

  .story__steps::before {
    content: none;
  }

  .story__step,
  .story__step:nth-child(odd),
  .story__step:nth-child(even) {
    min-height: 62vh;
    padding: 0;
    border: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
  }

  .story__step .specimen {
    display: none;
  }

  .story.is-armed .story__step:not(.is-active) h3,
  .story.is-armed .story__step:not(.is-active) p {
    color: var(--ink-3);
  }

  /* A 48px rule above each step; the cobalt layer scales in when active. */
  .story__step h3 {
    position: relative;
  }

  .story__step h3::before,
  .story__step h3::after {
    content: "";
    display: block;
    width: 48px;
    height: 2px;
    background: var(--rule);
  }

  .story__step h3::before {
    margin-bottom: var(--s4);
  }

  .story__step h3::after {
    position: absolute;
    top: 0;
    left: 0;
    background: var(--accent);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform var(--house) var(--ease-out);
  }

  .story__step.is-active h3::after {
    transform: scaleX(1);
  }

  .story__stage {
    display: block;
    grid-column: 7 / 13;
    position: sticky;
    top: max(var(--s6), calc(50vh - 320px));
    align-self: start;
    margin-top: 12vh;
  }
}

/* The pinned teardown */

.tdx {
  border: 1px solid var(--rule);
  background: var(--paper);
  padding: var(--s4) var(--s5) var(--s5);
}

.tdx__head {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  gap: var(--s3);
  align-items: center;
  padding-bottom: var(--s3);
  border-bottom: 1px solid var(--rule);
}

.tdx__name {
  font-size: var(--ui-size);
  line-height: var(--ui-line);
  font-weight: var(--weight-head);
}

.tdx__label {
  font-size: var(--micro-size);
  line-height: var(--micro-line);
  font-weight: var(--weight-ui);
  letter-spacing: var(--track-micro);
  color: var(--ink-2);
}

.tdx__part {
  padding-block: var(--s3);
  border-bottom: 1px solid var(--rule);
}

.tdx__part:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

/* Part specimens (shared by the stage and the phone specimens) */

.px-k {
  font-size: var(--micro-size);
  line-height: var(--micro-line);
  font-weight: var(--weight-ui);
  letter-spacing: var(--track-micro);
  color: var(--ink-2);
}

.px-scores {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--s4);
}

.px-score {
  display: grid;
  gap: var(--s1);
  min-width: 0;
}

.px-score__name {
  font-size: var(--micro-size);
  line-height: var(--micro-line);
  font-weight: var(--weight-ui);
  color: var(--ink-2);
}

.px-score__fig {
  font-size: var(--h3-size);
  line-height: var(--h3-line);
  font-weight: var(--weight-head);
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

/* Score meters are 20 ticks of 5 points: the ruler language again. */
.px-meter {
  position: relative;
  display: block;
  width: 100%;
  max-width: 118px;
  height: 6px;
  background: repeating-linear-gradient(to right, var(--rule) 0 4px, transparent 4px 6px);
}

.px-meter__fill {
  position: absolute;
  inset: 0 auto 0 0;
  display: flex;
  clip-path: inset(0 0 0 0);
}

.px-meter__fill i {
  flex: none;
  width: 6px;
}

.px-meter__fill--good { background: repeating-linear-gradient(to right, var(--good) 0 4px, transparent 4px 6px); }
.px-meter__fill--warn { background: repeating-linear-gradient(to right, var(--warn) 0 4px, transparent 4px 6px); }
.px-meter__fill--bad { background: repeating-linear-gradient(to right, var(--bad) 0 4px, transparent 4px 6px); }

.px-band {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: var(--micro-size);
  line-height: var(--micro-line);
  font-weight: var(--weight-ui);
}

.px-sq {
  width: 8px;
  height: 8px;
  flex: none;
  border-radius: var(--radius-check);
}

.px-sq--good { background: var(--good); }
.px-sq--warn { background: var(--warn); }
.px-sq--bad { background: var(--bad); }

/* The fix: the current title with its ruler, then the recommendation on
   accent-tint: "Do this", the replacement typing its new words while its
   ruler extends, and the note. */
.px-fix {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) auto;
  column-gap: var(--s3);
  row-gap: var(--s2);
  align-items: center;
}

.px-do {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) auto;
  column-gap: var(--s3);
  row-gap: var(--s1);
  align-items: center;
  padding: var(--s2) var(--s3);
  margin-inline: calc(-1 * var(--s3));
  background: var(--accent-tint);
}

.px-title--now {
  color: var(--ink-2);
  font-weight: var(--weight-body);
}

.px-title {
  font-size: var(--small-size);
  line-height: var(--small-line);
  font-weight: var(--weight-ui);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.px-fix .ruler,
.px-do .ruler {
  grid-column: auto;
  grid-row: auto;
  margin-top: 0;
}

.px-add {
  display: inline-block;
  white-space: pre;
  vertical-align: bottom;
  clip-path: inset(0 0 0 0);
}

.px-note {
  grid-column: 2 / -1;
  font-size: var(--micro-size);
  line-height: var(--micro-line);
  color: var(--ink-2);
}

.ruler__ext {
  position: absolute;
  inset: 0 auto 0 0;
  display: flex;
}

.ruler__ext b {
  flex: none;
  width: 6px;
}

.ruler__ext-ticks {
  display: flex;
  background: repeating-linear-gradient(to right, var(--accent) 0 3px, transparent 3px 6px);
  clip-path: inset(0 0 0 0);
}

.ruler__ext-ticks i {
  flex: none;
  width: 6px;
}

.px-q {
  display: inline-block;
  padding: 2px var(--s2);
  border: 1px solid var(--control);
  border-radius: var(--radius-control);
  font-size: var(--small-size);
  line-height: var(--small-line);
}

.px-rows {
  list-style: none;
  padding: 0;
  margin: var(--s2) 0 0;
}

.px-row {
  display: grid;
  grid-template-columns: 28px 16px minmax(0, 1fr) auto;
  gap: var(--s2);
  align-items: center;
  padding-block: 1px;
  font-size: var(--micro-size);
  line-height: var(--micro-line);
}

.px-row__pos {
  font-variant-numeric: tabular-nums;
  color: var(--ink-2);
}

.px-row__meta {
  color: var(--ink-2);
}

.px-row__name {
  font-weight: var(--weight-ui);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.px-row--you {
  margin-top: 2px;
  padding-inline: var(--s1);
  margin-inline: calc(-1 * var(--s1));
  background: var(--accent-tint);
}

.px-row--you .px-row__pos {
  color: var(--accent);
  font-weight: var(--weight-head);
}

.px-line {
  position: relative;
  margin-block: var(--s1);
  height: 20px;
  display: flex;
  align-items: center;
}

.px-line::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 1px;
  background: var(--ink-3);
  transform-origin: left;
}

.px-line span {
  position: relative;
  margin-left: auto;
  padding-left: var(--s2);
  background: var(--paper);
  font-size: var(--micro-size);
  line-height: var(--micro-line);
  font-weight: var(--weight-ui);
  color: var(--ink-2);
}

.px-facts {
  margin: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--s2) var(--s4);
}

.px-fact {
  min-width: 0;
  font-size: var(--micro-size);
  line-height: var(--micro-line);
}

.px-fact dt {
  font-weight: var(--weight-ui);
}

.px-fact dd {
  margin: 0;
  color: var(--ink-2);
}

/* In the small specimens the ruler drops under the title. */
.specimen .px-fix {
  grid-template-columns: 56px minmax(0, 1fr);
}

.specimen .px-do {
  grid-template-columns: 44px minmax(0, 1fr);
}

.specimen :is(.px-fix, .px-do) .ruler {
  grid-column: 2;
  grid-row: auto;
}

.specimen .px-note {
  grid-column: 2;
}

@media (max-width: 599px) {

  /* Scores become rows: name and figure, then meter and band. */
  .px-scores {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--s2);
  }

  .px-score {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    column-gap: var(--s3);
    row-gap: 2px;
  }

  .px-score__fig {
    grid-column: 2;
    grid-row: 1;
    justify-self: end;
  }

  .px-band {
    grid-column: 2;
    grid-row: 2;
    justify-self: end;
  }
}

/* Build states. A part is unbuilt only when JS armed it and motion is
   allowed; transitions (not keyframes) so scrolling back reverses. */

.px-scores .px-score:nth-child(1) { --j: 0; }
.px-scores .px-score:nth-child(2) { --j: 1; }
.px-scores .px-score:nth-child(3) { --j: 2; }
.px-rows > :nth-child(1) { --j: 0; }
.px-rows > :nth-child(2) { --j: 1; }
.px-rows > :nth-child(3) { --j: 2; }
.px-rows > :nth-child(4) { --j: 3; }
.px-rows > :nth-child(5) { --j: 4; }
.px-rows > :nth-child(6) { --j: 5; }
.px-rows > :nth-child(7) { --j: 6; }
.px-rows > :nth-child(8) { --j: 7; }
.px-rows > :nth-child(9) { --j: 8; }
.px-fact:nth-child(1) { --j: 0; }
.px-fact:nth-child(2) { --j: 1; }
.px-fact:nth-child(3) { --j: 2; }
.px-fact:nth-child(4) { --j: 3; }

/* Unbuilt parts show only their skeleton (ruler and meter tracks, icon
   tiles, hairlines); building brings the text in and runs the measures.
   Text is fully hidden, never faint, so nothing sits below AA contrast. Transitions, not keyframes,
   so scrolling back reverses. Staggers apply only on the way in. */
@media (prefers-reduced-motion: no-preference) {
  .is-ready :is(.tdx__part, .specimen) :is(.px-score__name, .px-score__fig, .px-band, .px-k, .px-title, .px-note, .px-q, .px-row__pos, .px-row__icon, .px-row__name, .px-row__meta, .px-row--you, .px-more, .px-line span, .px-fact, .shots) {
    transition: opacity var(--house) var(--ease), transform var(--house) var(--ease);
  }

  .is-ready :is(.tdx__part, .specimen) :is(.px-row) {
    transition: transform var(--house) var(--ease);
  }

  .is-ready :is(.tdx__part, .specimen) :is(.px-meter__fill, .ruler__fill) {
    transition: clip-path var(--long) var(--ease-out);
  }

  /* 14 steps: one per character of the added words, so the ruler gains a
     tick for each letter typed. */
  .is-ready :is(.tdx__part, .specimen) :is(.px-add, .ruler__ext-ticks) {
    transition: clip-path var(--long) steps(14, end);
  }

  .is-ready :is(.tdx__part, .specimen) .px-line::before {
    transition: transform var(--long) var(--ease-out);
  }

  .is-armed :is(.tdx__part, .specimen):not(.is-built) :is(.px-score__name, .px-score__fig, .px-band, .px-k, .px-title, .px-note, .px-q, .px-row__pos, .px-row__icon, .px-row__name, .px-row__meta, .px-row--you, .px-more, .px-line span, .px-fact, .shots) {
    opacity: 0;
  }

  .is-armed :is(.tdx__part, .specimen):not(.is-built) :is(.px-row, .px-fact, .px-score__fig) {
    transform: translateY(6px);
  }

  .is-armed :is(.tdx__part, .specimen):not(.is-built) :is(.px-meter__fill, .ruler__fill, .px-add, .ruler__ext-ticks) {
    clip-path: inset(0 100% 0 0);
  }

  .is-armed :is(.tdx__part, .specimen):not(.is-built) .px-line::before {
    transform: scaleX(0);
  }

  .is-armed :is(.tdx__part, .specimen).is-built :is(.px-score__name, .px-score__fig, .px-band, .px-meter__fill) {
    transition-delay: calc(var(--j, 0) * 120ms);
  }

  .is-armed :is(.tdx__part, .specimen).is-built .px-row :is(.px-row__pos, .px-row__icon, .px-row__name, .px-row__meta) {
    transition-delay: calc(var(--j, 0) * 50ms);
  }

  /* Fix: the current title and its 8 ticks appear, then the new words type
     on while the ruler extends to 22, then the note. */
  .is-armed :is(.tdx__part, .specimen).is-built .px-fix .ruler__fill {
    transition-delay: 100ms;
  }

  .is-armed :is(.tdx__part, .specimen).is-built .px-do :is(.px-k, .px-title) {
    transition-delay: 300ms;
  }

  .is-armed :is(.tdx__part, .specimen).is-built .px-do .ruler__fill {
    transition-delay: 300ms;
  }

  .is-armed :is(.tdx__part, .specimen).is-built :is(.px-add, .ruler__ext-ticks) {
    transition-delay: 700ms;
  }

  .is-armed :is(.tdx__part, .specimen).is-built .px-do .px-note {
    transition-delay: 1300ms;
  }

  .is-armed :is(.tdx__part, .specimen).is-built :is(.px-row, .px-fact) {
    transition-delay: calc(var(--j, 0) * 50ms);
  }

  /* Search: the rivals arrive, then the first-page line draws, then
     Stowlark's row appears below it. */
  .is-armed :is(.tdx__part, .specimen).is-built .px-line::before {
    transition-delay: 350ms;
  }

  .is-armed :is(.tdx__part, .specimen).is-built .px-line span {
    transition-delay: 700ms;
  }

  .is-armed :is(.tdx__part, .specimen).is-built .px-row--you,
  .is-armed :is(.tdx__part, .specimen).is-built .px-row--you :is(.px-row__pos, .px-row__icon, .px-row__name, .px-row__meta) {
    transition-delay: 900ms;
  }
}

/* ======================================================================
   Phase 4: imagery. Proposal: docs/brand/imagery-proposal.md.
   ====================================================================== */

/* Made-up app icons. The glyph sheet is drawn once per page; it takes no
   space. Each icon is a hue field in Apple's mask with a tonal ramp, an inner
   hairline so pale hues hold their edge, and a two-tone glyph. */
.art-defs {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.aicon {
  --hi: var(--art-teal-hi);
  --lo: var(--art-teal-lo);
  --deep: var(--art-teal-deep);
  --g1: #ffffff;
  --g2: var(--deep);
  position: relative;
  display: block;
  flex: none;
  width: 64px;
  height: 64px;
  border-radius: var(--radius-icon);
  background: linear-gradient(170deg, var(--hi), var(--lo) 85%);
  box-shadow:
    inset 0 0 0 1px rgb(11 27 46 / 0.08),
    inset 0 1px 0 rgb(255 255 255 / 0.22);
}

.aicon svg {
  display: block;
  width: 100%;
  height: 100%;
  fill: var(--g1);
  stroke: var(--g1);
  stroke-width: 0;
  stroke-linecap: round;
  stroke-linejoin: round;
  color: var(--g2);
  /* Artwork depth inside the icon only; static, never animated. */
  filter: drop-shadow(0 1.5px 1px rgb(11 27 46 / 0.16));
}

.aicon--dark {
  --g1: var(--deep);
  --g2: rgb(255 255 255 / 0.78);
}

.aicon--coral { --hi: var(--art-coral-hi); --lo: var(--art-coral-lo); --deep: var(--art-coral-deep); }
.aicon--amber { --hi: var(--art-amber-hi); --lo: var(--art-amber-lo); --deep: var(--art-amber-deep); }
.aicon--gold { --hi: var(--art-gold-hi); --lo: var(--art-gold-lo); --deep: var(--art-gold-deep); }
.aicon--moss { --hi: var(--art-moss-hi); --lo: var(--art-moss-lo); --deep: var(--art-moss-deep); }
.aicon--jade { --hi: var(--art-jade-hi); --lo: var(--art-jade-lo); --deep: var(--art-jade-deep); }
.aicon--teal { --hi: var(--art-teal-hi); --lo: var(--art-teal-lo); --deep: var(--art-teal-deep); }
.aicon--sky { --hi: var(--art-sky-hi); --lo: var(--art-sky-lo); --deep: var(--art-sky-deep); }
.aicon--iris { --hi: var(--art-iris-hi); --lo: var(--art-iris-lo); --deep: var(--art-iris-deep); }
.aicon--plum { --hi: var(--art-plum-hi); --lo: var(--art-plum-lo); --deep: var(--art-plum-deep); }
.aicon--rose { --hi: var(--art-rose-hi); --lo: var(--art-rose-lo); --deep: var(--art-rose-deep); }

.aicon--s48 { width: 48px; height: 48px; }
.aicon--s32 { width: 32px; height: 32px; }
.aicon--s24 { width: 24px; height: 24px; }
.aicon--s16 { width: 16px; height: 16px; box-shadow: inset 0 0 0 1px rgb(11 27 46 / 0.08); }
.aicon--s16 svg { filter: none; }

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

/* Colour fields. Flat planes that bleed to an edge and carry the 24px
   measuring grid. They count toward the navy 30 and the cobalt 20. */

.hero,
.contents,
.closing {
  overflow-x: clip;
}

/* Hero field: cobalt tint behind the example, bleeding right (and both
   ways on phones), with a 30-tick ruler on its foot, 8 ticks filled. */
.hero__art {
  position: relative;
  isolation: isolate;
}

.hero__art::before,
.closing::after {
  content: "";
  position: absolute;
  z-index: -1;
  background:
    linear-gradient(to right, var(--field-tint-line) 1px, transparent 1px) 0 0 / 24px 24px,
    linear-gradient(to bottom, var(--field-tint-line) 1px, transparent 1px) 0 0 / 24px 24px,
    var(--accent-tint);
}

.hero__art::before {
  top: calc(-1 * var(--s6));
  bottom: calc(-1 * var(--section-y));
  left: calc(-1 * (var(--gutter) + var(--inset)));
  right: calc(-1 * (var(--gutter) + var(--inset)));
}

.hero__art::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: calc(-1 * var(--section-y) + var(--s5));
  width: 210px;
  height: 12px;
  background:
    repeating-linear-gradient(to right, var(--accent) 0 2px, transparent 2px 7px) 0 0 / 56px 100% no-repeat,
    repeating-linear-gradient(to right, var(--field-tint-tick) 0 2px, transparent 2px 7px) 0 0 / 210px 100% no-repeat;
}

/* From 900px the field is the hero's right side, from the header rule to
   the hero's foot, starting at column 9 so the headline never reaches it.
   The example panel straddles its edge. */
@media (min-width: 900px) {
  .hero__art::before {
    content: none;
  }

  .hero::after {
    --w: min(var(--content), 100% - 2 * var(--gutter));
    content: "";
    position: absolute;
    z-index: -1;
    top: 0;
    bottom: 0;
    right: 0;
    left: calc((100% - var(--w)) / 2 + var(--inset) + 8 * ((var(--w) - 2 * var(--inset) - 11 * var(--grid-gap)) / 12 + var(--grid-gap)));
    background:
      linear-gradient(to right, var(--field-tint-line) 1px, transparent 1px) 0 0 / 24px 24px,
      linear-gradient(to bottom, var(--field-tint-line) 1px, transparent 1px) 0 0 / 24px 24px,
      var(--accent-tint);
  }
}

/* Figures: Apple's limits, each drawing its own limit. ------------------ */

.figures {
  border-top: 1px solid var(--rule);
}

.figs {
  list-style: none;
  padding: 0;
  margin: var(--s6) 0 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  border-top: 1px solid var(--rule);
}

.fig {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  grid-template-rows: auto auto;
  column-gap: var(--s4);
  align-items: end;
  padding-block: var(--s5);
  border-bottom: 1px solid var(--rule);
}

.fig:last-child {
  border-bottom: 0;
}

.fig__value {
  grid-row: 1 / 3;
  align-self: center;
  font-size: var(--display-size);
  line-height: 1;
  font-weight: var(--weight-head);
  letter-spacing: var(--track-display);
  font-variant-numeric: tabular-nums;
}

.fig__label {
  grid-column: 2;
  grid-row: 1;
  font-weight: var(--weight-ui);
}

.fig__ruler {
  grid-column: 2;
  grid-row: 2;
  display: block;
  margin-top: var(--s2);
  clip-path: inset(0 0 0 0);
}

.fig__ruler--chars {
  width: 210px;
  height: 16px;
  background: repeating-linear-gradient(to right, var(--accent) 0 2px, transparent 2px 7px) 0 0 / 210px 100% no-repeat;
}

.fig__ruler--fine {
  width: 200px;
  height: 16px;
  background:
    repeating-linear-gradient(to right, var(--accent) 0 1px, transparent 1px 20px) 0 0 / 200px 100% no-repeat,
    repeating-linear-gradient(to right, rgb(42 68 212 / 0.5) 0 1px, transparent 1px 2px) 0 100% / 200px 10px no-repeat;
}

.fig__ruler--slots {
  width: 210px;
  height: 24px;
  background: repeating-linear-gradient(to right, rgb(42 68 212 / 0.24) 0 14px, transparent 14px 21px) 0 0 / 210px 100% no-repeat;
}

.figs__source {
  margin-top: var(--s5);
  font-size: var(--small-size);
  line-height: var(--small-line);
  color: var(--ink-2);
}

@media (min-width: 900px) {
  .figs {
    margin-top: var(--s7);
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .fig {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto auto;
    padding: var(--s6) var(--s5);
    border-bottom: 0;
  }

  .fig:first-child {
    padding-left: 0;
  }

  .fig:last-child {
    padding-right: 0;
  }

  .fig + .fig {
    border-left: 1px solid var(--rule);
  }

  .fig__value {
    grid-row: 1;
  }

  .fig__ruler {
    grid-row: 2;
    grid-column: 1;
    margin-top: var(--s5);
  }

  .fig__label {
    grid-row: 3;
    grid-column: 1;
    margin-top: var(--s3);
  }
}

.fig:nth-child(1) { --j: 0; }
.fig:nth-child(2) { --j: 1; }
.fig:nth-child(3) { --j: 2; }
.fig:nth-child(4) { --j: 3; }

@media (prefers-reduced-motion: no-preference) {
  .figures.is-ready .fig__ruler {
    transition: clip-path var(--long) var(--ease-out);
    transition-delay: calc(var(--j, 0) * var(--stagger));
  }

  .figures.is-armed:not(.is-built) .fig__ruler {
    clip-path: inset(0 100% 0 0);
  }
}

/* Story field: one cobalt plane behind the stage column, the full height of
   the section, bleeding right. Column 7 of the 12-column story grid. */
@media (min-width: 900px) and (prefers-reduced-motion: no-preference) {
  .contents::after {
    --w: min(var(--content), 100% - 2 * var(--gutter));
    content: "";
    position: absolute;
    z-index: -1;
    top: 0;
    bottom: 0;
    right: 0;
    left: calc((100% - var(--w)) / 2 + var(--inset) + 6 * ((var(--w) - 2 * var(--inset) - 11 * var(--grid-gap)) / 12 + var(--grid-gap)) - var(--s6));
    background:
      linear-gradient(to right, var(--field-cobalt-line) 1px, transparent 1px) 0 0 / 24px 24px,
      linear-gradient(to bottom, var(--field-cobalt-line) 1px, transparent 1px) 0 0 / 24px 24px,
      var(--field-cobalt);
  }

  /* The heading, the steps and the pinned panel share one grid, so the
     panel starts beside the heading and stays pinned through the last step
     with no empty run above the first step or after the last (lead review).
     The steps are spaced evenly; site.js activates them by scroll progress
     through the section, not by a fixed line. */
  .contents .wrap {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    grid-template-rows: auto 1fr;
    column-gap: var(--grid-gap);
  }

  .contents .wrap > h2 {
    grid-column: 1 / 6;
    grid-row: 1;
  }

  .story {
    display: contents;
  }

  .story__steps {
    grid-column: 1 / 6;
    grid-row: 2;
    margin-top: var(--s7);
    padding-top: 0;
    padding-bottom: 0;
  }

  .story__step,
  .story__step:nth-child(odd),
  .story__step:nth-child(even) {
    min-height: 34vh;
    justify-content: flex-start;
  }

  .story__step:last-child {
    min-height: 0;
  }

  .story__stage {
    grid-column: 7 / 13;
    grid-row: 1 / 3;
  }

  .story__stage {
    top: max(var(--s6), calc(50vh - 350px));
    margin-top: 0;
  }

  .tdx {
    border: 0;
  }
}

.tdx {
  position: relative;
  isolation: isolate;
}

/* The active part is lit with the cobalt tint; the rest stay complete. */
.tdx__part {
  position: relative;
}

.tdx__part::before {
  content: "";
  position: absolute;
  z-index: -1;
  top: 0;
  bottom: 0;
  left: calc(-1 * var(--s5));
  right: calc(-1 * var(--s5));
  background: var(--accent-tint);
  opacity: 0;
}

.tdx__part.is-active::before {
  opacity: 1;
}

.tdx__part.is-active .px-line span {
  background: var(--accent-tint);
}

@media (prefers-reduced-motion: no-preference) {
  .tdx__part::before {
    transition: opacity var(--house) var(--ease);
  }
}

/* Replaying a part: its start state applies at once, with no transition. */
.tdx__part.is-replay,
.tdx__part.is-replay * {
  transition: none !important;
}

/* Phone and reduced-motion specimens: each on its own cobalt field. */
.specimen {
  padding: var(--s5) var(--s4);
  border: 0;
  max-width: none;
  margin-inline: calc(-1 * (var(--gutter) + var(--inset)));
  background:
    linear-gradient(to right, var(--field-cobalt-line) 1px, transparent 1px) 0 0 / 24px 24px,
    linear-gradient(to bottom, var(--field-cobalt-line) 1px, transparent 1px) 0 0 / 24px 24px,
    var(--field-cobalt);
}

.specimen__panel {
  max-width: 420px;
  padding: var(--s4);
  background: var(--paper);
}

@media (min-width: 600px) {
  .specimen {
    margin-inline: 0;
    padding: var(--s5);
  }
}

.px-more {
  display: flex;
  align-items: center;
  gap: var(--s1);
  padding-block: 2px;
  font-size: var(--micro-size);
  line-height: var(--micro-line);
}

.px-more__pos {
  margin-right: var(--s1);
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
}

.px-factsbox {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--s3);
}

@media (min-width: 600px) {
  .px-factsbox {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: var(--s4);
    align-items: center;
  }
}

/* Stowlark's screenshots, drawn flat. */
.shots {
  display: flex;
  gap: 6px;
}

.shot {
  display: block;
  width: 40px;
  height: 80px;
}

.shot__bg { fill: var(--paper-2); stroke: var(--rule); stroke-width: 1; }
.shot__head { fill: var(--art-teal-lo); }
.shot__title { fill: #ffffff; }
.shot__track { fill: rgb(255 255 255 / 0.35); }
.shot__fill { fill: #ffffff; }
.shot__box { fill: none; stroke: var(--art-teal-lo); stroke-width: 1; }
.shot__box--done { fill: var(--art-teal-lo); }
.shot__line { fill: var(--shot-line); }

/* The search, as a picture --------------------------------------------- */

.searchpic {
  --ic: 48px;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  background:
    linear-gradient(to right, var(--field-grey-line) 1px, transparent 1px) 0 0 / 24px 24px,
    linear-gradient(to bottom, var(--field-grey-line) 1px, transparent 1px) 0 0 / 24px 24px,
    var(--paper-2);
}

.searchpic__head p {
  max-width: 34em;
  margin-top: var(--s3);
  color: var(--ink-2);
}

.searchpic__art {
  margin-top: var(--s6);
}

.searchpic__bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--s3) var(--s5);
}

.searchpic__q {
  display: inline-flex;
  align-items: center;
  gap: var(--s3);
  height: 48px;
  width: min(100%, 360px);
  padding-inline: var(--s4);
  background: var(--paper);
  border: 1px solid var(--control);
  border-radius: var(--radius-control);
  font-weight: var(--weight-ui);
}

.searchpic__glass {
  position: relative;
  width: 14px;
  height: 14px;
  flex: none;
  border: 2px solid var(--ink-2);
  border-radius: 50%;
  transform: translate(-1px, -1px);
}

.searchpic__glass::after {
  content: "";
  position: absolute;
  right: -5px;
  bottom: -4px;
  width: 6px;
  height: 2px;
  background: var(--ink-2);
  transform: rotate(45deg);
}

.searchpic__typed {
  display: inline-block;
  clip-path: inset(0 0 0 0);
}

.searchpic__label {
  font-size: var(--micro-size);
  line-height: var(--micro-line);
  font-weight: var(--weight-ui);
  letter-spacing: var(--track-micro);
  color: var(--ink-2);
}

.wall {
  list-style: none;
  padding: 0;
  margin: var(--s6) 0 0;
  display: grid;
  grid-template-columns: repeat(5, var(--ic));
  justify-content: space-between;
  row-gap: var(--s4);
}

.wall__cell {
  display: grid;
  justify-items: center;
  align-content: start;
  gap: 6px;
  min-height: calc(var(--ic) + 26px);
}

.wall .aicon {
  width: var(--ic);
  height: var(--ic);
}

.wall__cell:not(.wall__cell--lit, .wall__cell--you) .aicon {
  opacity: 0.3;
}

.wall__pos {
  font-size: var(--micro-size);
  line-height: var(--micro-line);
  font-weight: var(--weight-ui);
  letter-spacing: var(--track-micro);
  font-variant-numeric: tabular-nums;
  color: var(--ink-2);
  white-space: nowrap;
}

.wall__pos--you {
  color: var(--accent);
  font-weight: var(--weight-head);
}

/* On phones the label wraps under its own icon instead of running under
   #15, and the ring sits closer. */
@media (max-width: 599px) {
  .wall__pos--you {
    max-width: calc(var(--ic) + var(--s3));
    white-space: normal;
    text-align: center;
  }

  .wall__cell--you .aicon::after {
    inset: -3px;
  }
}

.wall__cell--you .aicon::after {
  content: "";
  position: absolute;
  inset: -4px;
  border: 2px solid var(--accent);
  border-radius: 26%;
}

.wall__line {
  grid-column: 1 / -1;
  position: relative;
  height: 20px;
  margin-block: calc(-1 * var(--s1));
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.wall__line::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 1px;
  background: var(--ink-3);
  transform-origin: left;
}

.wall__line span {
  position: relative;
  padding-left: var(--s2);
  background: var(--paper-2);
  font-size: var(--micro-size);
  line-height: var(--micro-line);
  font-weight: var(--weight-ui);
  color: var(--ink-2);
}

@media (min-width: 600px) {
  .wall {
    grid-template-columns: repeat(10, var(--ic));
  }
}

@media (min-width: 900px) {
  .searchpic {
    --ic: 56px;
  }

  .searchpic__head {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    column-gap: var(--grid-gap);
    align-items: end;
  }

  .searchpic__head h2 {
    grid-column: 1 / 7;
  }

  .searchpic__head p {
    grid-column: 8 / 13;
    margin-top: 0;
  }

  .searchpic__art {
    margin-top: var(--s7);
  }

  .wall {
    margin-top: var(--s6);
    row-gap: var(--s5);
  }
}

.wall__cell--lit:nth-child(1) { --j: 0; }
.wall__cell--lit:nth-child(2) { --j: 1; }
.wall__cell--lit:nth-child(3) { --j: 2; }
.wall__cell--lit:nth-child(4) { --j: 3; }
.wall__cell--lit:nth-child(5) { --j: 4; }
.wall__cell--lit:nth-child(6) { --j: 5; }
.wall__cell--lit:nth-child(7) { --j: 6; }
.wall__cell--lit:nth-child(8) { --j: 7; }
.wall__cell--lit:nth-child(9) { --j: 8; }
.wall__cell--lit:nth-child(10) { --j: 9; }

/* In view, once: the query types, page one lights up in order, the line
   draws, then Stowlark's ring. Nothing moves position. */
@media (prefers-reduced-motion: no-preference) {
  .searchpic.is-ready .searchpic__typed {
    transition: clip-path var(--long) steps(12, end);
  }

  .searchpic.is-ready .wall__cell--lit :is(.aicon, .wall__pos) {
    transition: opacity var(--house) var(--ease);
    transition-delay: calc(500ms + var(--j, 0) * 60ms);
  }

  .searchpic.is-ready .wall__line::before {
    transition: transform var(--long) var(--ease-out);
    transition-delay: 1100ms;
  }

  .searchpic.is-ready :is(.wall__line span, .wall__cell--you .wall__pos) {
    transition: opacity var(--house) var(--ease);
    transition-delay: 1500ms;
  }

  .searchpic.is-ready .wall__cell--you .aicon::after {
    transition: opacity var(--house) var(--ease), transform var(--house) var(--ease-out);
    transition-delay: 1500ms;
  }

  .searchpic.is-armed:not(.is-built) .searchpic__typed {
    clip-path: inset(0 100% 0 0);
  }

  .searchpic.is-armed:not(.is-built) .wall__cell--lit .aicon {
    opacity: 0.3;
  }

  .searchpic.is-armed:not(.is-built) :is(.wall__cell--lit .wall__pos, .wall__line span, .wall__cell--you .wall__pos, .wall__cell--you .aicon::after) {
    opacity: 0;
  }

  .searchpic.is-armed:not(.is-built) .wall__cell--you .aicon::after {
    transform: scale(0.85);
  }

  .searchpic.is-armed:not(.is-built) .wall__line::before {
    transform: scaleX(0);
  }
}

/* How the teardown works: the flow, in the ink band -------------------- */

.how {
  margin-bottom: var(--s9);
}

.flow {
  margin-top: var(--s6);
}

.flow__nodes {
  position: relative;
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: var(--s5);
}

/* The line runs through the drawings, behind them. On phones it runs down
   the left margin and each node is its label over a full-width drawing, so
   the example content shows whole. */
.flow__nodes::before {
  content: "";
  position: absolute;
  top: var(--s3);
  bottom: var(--s3);
  left: 7px;
  width: 2px;
  background: var(--accent-on-ink);
  clip-path: inset(0 0 0 0);
}

.flow__nodes {
  padding-left: var(--s6);
}

.flow__node {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--s2);
}

.flow__node .flow__label {
  grid-row: 1;
}

.flow__art {
  position: relative;
  display: grid;
  justify-items: start;
  max-width: 360px;
  font-size: var(--micro-size);
  line-height: var(--micro-line);
  color: var(--ink);
}

.flow__art > * {
  width: 100%;
}

.flow__art > .fl-chip {
  width: auto;
  max-width: 100%;
}

.flow__label {
  font-weight: var(--weight-ui);
  color: var(--on-ink);
}

.fl-panel {
  display: grid;
  align-content: start;
  gap: 4px;
  padding: var(--s2) 10px;
  background: var(--paper);
  overflow: hidden;
}

.fl-panel > *,
.fl-panel span {
  min-width: 0;
}

.fl-strong {
  display: block;
  font-weight: var(--weight-head);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fl-dim {
  display: block;
  color: var(--ink-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fl-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  height: 32px;
  padding-inline: 10px;
  background: var(--paper);
  border-radius: var(--radius-control);
}

.fl-chip__glyph {
  flex: none;
  width: 12px;
  height: 7px;
  border: 2px solid var(--accent);
  border-radius: 4px;
}

.fl-chip__text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ink-2);
}

.fl-app {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: var(--s2);
  align-items: center;
}

.fl-listing .shots {
  gap: 4px;
  margin-top: 2px;
}

.fl-listing .shot {
  width: 24px;
  height: 48px;
}

.fl-q {
  display: block;
  padding: 0 6px;
  border: 1px solid var(--control);
  border-radius: var(--radius-control);
}

.fl-row {
  display: grid;
  grid-template-columns: 20px 16px minmax(0, 1fr);
  gap: 6px;
  align-items: center;
}

.fl-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fl-score {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  gap: var(--s2);
  align-items: center;
}

.fl-fig {
  font-weight: var(--weight-head);
  font-variant-numeric: tabular-nums;
}

.fl-meter {
  display: block;
  height: 4px;
  background: var(--rule);
}

.fl-meter i {
  display: block;
  height: 100%;
}

.fl-meter--good i { background: var(--good); }
.fl-meter--warn i { background: var(--warn); }
.fl-meter--bad i { background: var(--bad); }
.fl-meter--v3 { width: 30%; }
.fl-meter--v4 { width: 40%; }
.fl-meter--v5 { width: 50%; }

.fl-do {
  display: block;
  margin-top: 2px;
  padding: 2px 6px;
  background: var(--accent-tint);
}

.fl-line {
  display: block;
  color: var(--ink-2);
}

.fl-link {
  display: block;
  font-weight: var(--weight-head);
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

@media (min-width: 900px) {
  .flow {
    margin-top: var(--s7);
  }

  .flow__nodes {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: var(--grid-gap);
    padding-left: 0;
  }

  .flow__art {
    justify-items: stretch;
    align-items: center;
    max-width: none;
  }

  /* Labels sit above the drawings, so the line runs clear through them. */
  .flow__nodes::before {
    top: calc(2 * var(--body-line) + var(--s3) + 65px);
    bottom: auto;
    left: calc((100% - 4 * var(--grid-gap)) / 10);
    right: calc((100% - 4 * var(--grid-gap)) / 10);
    width: auto;
    height: 2px;
  }

  .flow__node {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--s3);
    align-items: start;
  }

  .flow__label {
    grid-row: 1;
    min-height: calc(2 * var(--body-line));
  }

  .flow__art {
    height: 132px;
  }

  .fl-panel {
    height: 100%;
  }

}

.flow__node:nth-child(1) { --j: 0; }
.flow__node:nth-child(2) { --j: 1; }
.flow__node:nth-child(3) { --j: 2; }
.flow__node:nth-child(4) { --j: 3; }
.flow__node:nth-child(5) { --j: 4; }

@media (min-width: 900px) and (prefers-reduced-motion: no-preference) {
  .how.is-ready .flow__nodes::before {
    transition: clip-path 1200ms var(--ease);
    transition-delay: 150ms;
  }

  .how.is-ready .flow__art {
    transition: opacity var(--house) var(--ease), transform var(--house) var(--ease);
    transition-delay: calc(var(--j, 0) * 240ms);
  }

  .how.is-armed:not(.is-built) .flow__nodes::before {
    clip-path: inset(0 100% 0 0);
  }

  .how.is-armed:not(.is-built) .flow__art {
    opacity: 0;
    transform: translateY(8px);
  }
}

/* Closing call to action ------------------------------------------------- */

.closing {
  border-top: 1px solid var(--rule);
}

.closing::after {
  inset: 0;
}

.closing__grid {
  padding-block: var(--section-y);
}

.closing__text p {
  max-width: 34em;
  margin-top: var(--s3);
  color: var(--ink-2);
}

.closing__button {
  margin-top: var(--s5);
  text-decoration: none;
}

.closing__button:hover {
  color: var(--on-ink);
}

/* The visitor's listing, not yet measured: a white panel on the field
   with an empty icon slot and empty rulers. */
.closing__listing {
  margin-top: var(--s7);
  max-width: 360px;
  padding: var(--s5);
  background: var(--paper);
  display: grid;
  gap: var(--s4);
}

.cl-app {
  display: flex;
  align-items: center;
  gap: var(--s4);
}

.cl-row {
  display: grid;
  gap: var(--s2);
}

.cl-row .ruler {
  grid-column: auto;
  grid-row: auto;
  margin-top: 0;
}

.cl-k {
  font-size: var(--micro-size);
  line-height: var(--micro-line);
  font-weight: var(--weight-ui);
  letter-spacing: var(--track-micro);
  color: var(--ink-2);
}

.closing__empty {
  display: block;
  width: 56px;
  height: 56px;
  border: 2px dashed var(--accent);
  border-radius: var(--radius-icon);
}

.closing__you {
  font-size: var(--ui-size);
  line-height: var(--ui-line);
  font-weight: var(--weight-head);
  color: var(--ink);
}

@media (min-width: 900px) {
  .closing__grid {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    column-gap: var(--grid-gap);
    align-items: center;
  }

  .closing__text {
    grid-column: 1 / 7;
  }

  .closing__listing {
    grid-column: 8 / 13;
    justify-self: end;
    width: 100%;
    margin-top: 0;
  }

  .closing__empty {
    width: 64px;
    height: 64px;
  }
}

/* Strengths: what the teardown gives, each over a small drawing of the
   product doing it (the Stowlark example). Ink band, after the flow. */
.cells--ink .cell h3 {
  color: var(--on-ink);
}

.sg-art {
  max-width: 320px;
  margin-bottom: var(--s4);
  font-size: var(--micro-size);
  line-height: var(--micro-line);
  color: var(--ink);
}

.sg-panel {
  padding: var(--s3) var(--s3);
}

.sg-panel .ruler {
  grid-column: auto;
  grid-row: auto;
  margin-top: 2px;
}

.sg-row {
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr) auto;
  gap: var(--s2);
  align-items: center;
}

/* A drawn check mark: two borders of a rotated box. */
.sg-check {
  width: 6px;
  height: 10px;
  margin-left: 3px;
  border: solid var(--accent);
  border-width: 0 2px 2px 0;
  transform: translateY(-2px) rotate(45deg);
}

.sg-pos {
  font-weight: var(--weight-head);
  font-variant-numeric: tabular-nums;
}

.sg-you {
  margin-top: 2px;
  margin-inline: -4px;
  padding-inline: 4px;
  background: var(--accent-tint);
}

.sg-you .sg-pos {
  color: var(--accent);
}

.sg-change {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: var(--s2);
  align-items: center;
  padding-block: 2px;
  border-bottom: 1px solid var(--rule);
}

.sg-change:last-child {
  border-bottom: 0;
}

.sg-n {
  font-weight: var(--weight-ui);
  font-variant-numeric: tabular-nums;
  color: var(--ink-3);
}

.sg-panel .fl-row {
  grid-template-columns: 28px 16px minmax(0, 1fr);
}

/* One height for the four drawings, so the 2 by 2 grid keeps its rhythm. */
@media (min-width: 900px) {
  .sg-panel {
    min-height: 120px;
  }
}
