/* shiftlabs.org: The well-kept board. Tokens and type steps live in base.css, dashboard fragments in app.css.
   One 12-column board (6 on a tablet, 2 on a phone), 8px gaps, 16px margins, square tiles filled edge to edge. */

.skip { position: absolute; left: var(--margin); top: var(--margin); z-index: 10; padding: 12px 16px; background: var(--field); color: var(--field-ink); font-weight: 600; text-decoration: none; }
.skip:not(:focus) { width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
[hidden] { display: none !important; }

/* ---------- board and tiles ---------- */
.board, .masthead { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--gap); max-width: 1920px; margin-inline: auto; padding-inline: var(--margin); }
.board { margin-top: var(--gap); }
.tile { position: relative; min-width: 0; padding: var(--pad); background: var(--surface); color: var(--ink); overflow: clip; }
.t-surface { background: var(--surface); }
.t-surface-2 { background: var(--surface-2); }
.t-mid { background: var(--muted); color: var(--bg); }
.t-field { background: var(--field); color: var(--field-ink); }
.t-night { background: var(--night); color: var(--night-ink); }
.t-accent { background: var(--accent); color: #232323; }
.t-night :focus-visible, .t-field :focus-visible { outline-color: var(--accent); }
.t-accent :focus-visible { outline-color: #232323; }
.t-accent .button { background: #232323; color: #ffffff; }
a.tile { text-decoration: none; transition: background-color var(--t-hover) ease, color var(--t-hover) ease; }
@media (hover: hover) and (pointer: fine) {
  a.tile.t-surface:hover, .links a.tile:hover { background: var(--surface-2); }
  a.tile.t-accent:hover { background: #8cf0b9; }
  .button:hover { background: #000000; }
  .t-accent .button:hover, .t-night .button:hover { background: #000000; color: #ffffff; }
}
:root[data-theme="dark"] .button:hover { background: #ffffff; }
.arrow { width: 1.4em; height: 1.4em; flex: none; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: square; transition: transform var(--t-ui) var(--ease-out); }
a:hover > .arrow { transform: translateX(4px); }

/* ---------- masthead: the name band and the link row ---------- */
.masthead { padding-top: var(--margin); }
.name { grid-column: 1 / -1; display: flex; align-items: flex-end; justify-content: space-between; gap: 32px; padding: 0 var(--pad); container-type: inline-size; }
.name__word { flex: none; margin: 0 0 0 -0.035em; font-size: calc(100cqi * 0.176); font-weight: 800; line-height: 0.8; letter-spacing: -0.055em; padding: 0.09em 0 0.035em; white-space: nowrap; }
.name__what { max-width: 13em; padding-bottom: calc(var(--pad) + 4px); font-size: var(--step-lead); font-weight: 600; line-height: 1.18; letter-spacing: -0.02em; }
.links { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: var(--gap); }
.links .tile { min-height: 64px; padding: 20px var(--pad); font-weight: 600; }
.links .tile[aria-current="page"] { background: var(--field); color: var(--field-ink); }

/* ---------- hero: left rail, centre, colour rail ---------- */
.hero { height: clamp(32rem, calc(100svh - 112px - (min(100vw, 1920px) - 32px) * 0.1628), 52rem); grid-template-rows: minmax(0, 1fr); }
.hero__left { grid-column: 1 / 3; grid-row: 1; display: grid; grid-template-rows: auto minmax(0, 1fr); gap: var(--gap); min-height: 0; }
.hero__code { grid-column: 3 / 11; grid-row: 1; }
.hero__rail { grid-column: 11 / 13; grid-row: 1; display: grid; grid-template-rows: repeat(4, minmax(0, 1fr)) auto; gap: var(--gap); margin: 0; }
.hero__rail .tile { display: flex; flex-direction: column; justify-content: space-between; gap: 6px; padding: 16px 20px; }
.hero__rail b { font-size: var(--step-body); font-weight: 600; line-height: 1.2; letter-spacing: -0.01em; }
.hero__rail span { font-size: var(--step-small); line-height: 1.35; }
.hero__action .action { display: flex; flex-direction: row; align-items: center; justify-content: space-between; gap: 12px; min-height: 72px; padding: 0 20px; font-size: var(--step-body); font-weight: 600; }
.hero__facts { display: grid; align-content: start; gap: 9px; padding: 20px; font-size: var(--step-small); line-height: 1.35; }
.hero__facts li { position: relative; padding-left: 16px; }
.hero__facts li::before { content: ""; position: absolute; left: 0; top: 0.5em; width: 7px; height: 7px; background: currentColor; }
.hero__run { padding: 18px 18px 6px; }
.run-card { display: grid; align-content: start; gap: 3px; background: transparent; }
.run-card__id code { font-size: 14px; }
.run-card .tl { margin-top: 12px; }
@media (min-width: 1100px) { .hero__run .tl .t { display: none; } }

/* code tiles */
.code-tile { display: flex; flex-direction: column; padding: 0; }
.code-tile__bar { display: flex; justify-content: space-between; gap: 16px; padding: 16px var(--pad) 0; font-size: var(--step-small); color: var(--night-muted); }
.code-tile pre { flex: 1; margin: 0; padding: 12px var(--pad) var(--pad); overflow: auto; font-size: 14px; line-height: 1.6; tab-size: 2; color: var(--night-ink); }
.code-tile code { font-size: inherit; }
.code-tile .k { color: light-dark(#000000, #ffffff); font-weight: 500; }
.code-tile .s { color: light-dark(#3f3f3f, #c8c8c8); }
.code-tile .c { color: light-dark(#6a6a6a, #9a9a9a); }
.code-tile__bar > span:last-child { margin-left: auto; }
.lang { display: flex; gap: 4px; margin: -6px 0 0 -10px; }
.lang[hidden] { display: none; }
.lang button { font: inherit; color: var(--night-muted); background: none; border: 0; padding: 6px 10px; cursor: pointer; transition: background-color 160ms, color 160ms; }
.lang button:hover { color: var(--night-ink); }
.lang button[aria-pressed="true"] { color: var(--night-ink); background: color-mix(in srgb, var(--night-ink) 14%, transparent); }

/* photographs and footage: one treatment, greyscale, captions on a solid block */
.photo, .film { padding: 0; background: var(--surface-2); }
.photo img, .film video { width: 100%; height: 100%; object-fit: cover; filter: grayscale(1) contrast(1.05); background: var(--surface-2); }
.photo figcaption, .film figcaption { position: absolute; left: 0; bottom: 0; max-width: calc(100% - 32px); padding: 8px 12px; background: var(--field); color: var(--field-ink); font-size: var(--step-small); line-height: 1.35; }

/* ---------- showcase: steer a run ---------- */
.showcase__head { grid-column: 1 / 5; display: flex; flex-direction: column; gap: 14px; }
.showcase__head h2 { font-weight: 800; }
.showcase__head .small { margin-top: auto; }
.showcase__photo { grid-column: 5 / 13; aspect-ratio: 2 / 1; }
.showcase__photo img { position: absolute; inset: 0; object-position: 50% 28%; }
.showcase__demo { grid-column: 1 / 9; display: flex; flex-direction: column; padding: 0; min-height: 620px; }
.showcase__controls { grid-column: 9 / 13; display: flex; flex-direction: column; gap: 4px; padding: 12px var(--pad) var(--pad); }
.demo { flex: 1; display: flex; flex-direction: column; min-height: 0; background: transparent; }
[data-ui] .demo__bar { display: flex; align-items: baseline; gap: 16px; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.demo__clock { margin-left: auto; }
.demo__grid { flex: 1; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 12px; padding: 12px; min-height: 0; }
.demo__runs, .demo__detail { min-width: 0; overflow: hidden; }
.demo__runs { display: flex; flex-direction: column; }
.demo__runs tbody tr { cursor: pointer; }
.demo__runs .rowbtn { all: unset; cursor: pointer; font-family: var(--font-code); font-size: 13px; }
.demo__runs .rowbtn:focus-visible { outline: 2px solid var(--line); outline-offset: 2px; }
[data-ui] .demo__revs { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--border); }
.demo__revs .ui-title { padding: 0 12px 6px; }
.demo__kv { padding: 0 16px 12px; }
.demo__tl { padding: 4px 16px 4px; }
.demo__out caption { text-align: left; padding: 10px 12px 4px; }
[data-ui] .demo__out { table-layout: fixed; }
[data-ui] .demo__out td { white-space: normal; overflow-wrap: anywhere; }
[data-ui] .demo__out th:nth-child(1) { width: 44%; }
[data-ui] .demo__out th:nth-child(3) { width: 5.5rem; }
.demo__actions { display: flex; align-items: center; gap: 10px; padding: 12px 16px 14px; }
.rules { display: grid; gap: 12px; padding-top: 12px; }
.rules b { font-weight: 600; }
.controls { display: flex; flex-direction: column; height: 100%; }
.control { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 56px; font-size: var(--step-small); }
.control__name { font-weight: 600; }
.control__btn { min-height: 40px; min-width: 7.5rem; padding: 0 16px; background: var(--field); color: var(--field-ink); font-weight: 600; transition: transform var(--t-press) var(--ease-out), background-color var(--t-hover) ease; }
.control__btn:active, .seg button:active { transform: scale(0.96); }
.seg { display: inline-flex; padding: 3px; background: var(--bg); }
.seg button { min-width: 48px; min-height: 36px; font-weight: 600; transition: background-color var(--t-hover) ease, color var(--t-hover) ease; }
.seg button[aria-pressed="true"] { background: var(--field); color: var(--field-ink); }
.showcase__controls select { min-height: 40px; min-width: 11rem; padding: 0 34px 0 12px; border: 0; border-radius: 0; background: var(--bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 4.5 6 8l3.5-3.5' fill='none' stroke='%23777' stroke-width='1.6'/%3E%3C/svg%3E") no-repeat right 12px center / 12px; color: var(--ink); font-size: var(--step-small); appearance: none; }
.switch { appearance: none; position: relative; width: 48px; height: 28px; margin: 0; background: var(--bg); cursor: pointer; transition: background-color var(--t-ui) ease; }
.switch::after { content: ""; position: absolute; top: 4px; left: 4px; width: 20px; height: 20px; background: var(--muted); transition: transform var(--t-ui) var(--ease-out), background-color var(--t-ui) ease; }
.switch:checked { background: var(--field); }
.switch:checked::after { transform: translateX(20px); background: var(--accent); }
.controls__more { display: none; }
.controls__log { margin-top: auto; padding-top: 16px; font-size: var(--step-small); line-height: 1.4; }

/* ---------- features: close-ups on a board ---------- */
.features { grid-template-rows: repeat(8, 104px); }
.features__head { grid-column: 1 / 5; grid-row: 1 / 3; }
.features__head h2 { max-width: 9ch; }
.features__photo { grid-column: 5 / 7; grid-row: 1 / 3; }
.features__photo img { object-position: 70% 22%; scale: 2; transform-origin: 70% 22%; }
.cu-rev { grid-column: 7 / 10; grid-row: 1 / 3; }
.cu-redact { grid-column: 10 / 13; grid-row: 1 / 3; }
.cu-gateway { grid-column: 1 / 7; grid-row: 3 / 7; }
.features .film { grid-column: 7 / 10; grid-row: 3 / 7; }
.cu-count { grid-column: 10 / 13; grid-row: 3 / 5; }
.cu-sign { grid-column: 10 / 13; grid-row: 5 / 7; }
.cu-sleep { grid-column: 1 / 7; grid-row: 7 / 9; }
.cu-refused { grid-column: 7 / 13; grid-row: 7 / 9; }
.closeup { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto auto; padding: 0; }
.closeup__ui { display: flex; align-items: flex-start; min-height: 0; padding: 18px 20px; overflow: clip; }
.closeup__ui > * { flex: none; width: max-content; zoom: 2.2; }
.closeup__name { padding: 14px 20px 0; font-size: var(--step-body); font-weight: 600; line-height: 1.25; letter-spacing: -0.01em; }
.closeup__line { max-width: 46ch; padding: 2px 20px 18px; font-size: var(--step-body); line-height: 1.35; }
.closeup.t-surface .closeup__line, .closeup.t-surface-2 .closeup__line { color: var(--muted); }
.closeup.t-night .closeup__line, .closeup.t-field .closeup__line { opacity: 0.86; }
.cu-redact .closeup__ui { justify-content: flex-end; }
.cu-gateway .closeup__ui { align-items: center; }
.cu-gateway .closeup__ui > * { zoom: 2.6; }
.cu-sleep .closeup__ui > * { zoom: 2.8; }
.cu-refused .closeup__ui > * { zoom: 1.7; }
.cu-count .closeup__ui > * { zoom: 1.9; }
.features .film video { object-position: 64% 50%; }

/* ---------- the marquee: the one claim, edge to edge ---------- */
.marquee { grid-column: 1 / -1; padding: 22px 0 26px; }
.marquee__track { display: flex; width: max-content; max-width: none; margin: 0; font-size: var(--step-display); font-weight: 800; letter-spacing: -0.05em; line-height: 1; white-space: nowrap; }
.marquee__track span { padding: 0 0.32em 0 var(--pad); }
@media (prefers-reduced-motion: no-preference) {
  .marquee__track { animation: marquee 48s linear infinite; }
  .marquee:hover .marquee__track, .marquee.is-paused .marquee__track { animation-play-state: paused; }
}
@media (prefers-reduced-motion: reduce) {
  .marquee__track { width: auto; font-size: var(--step-head); white-space: normal; padding-inline: var(--pad); }
  .marquee__track span { padding: 0; }
  .marquee__track span + span { display: none; }
}
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------- how a run starts: many into one ---------- */
.how__band { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 36px var(--gap); padding: clamp(28px, 3vw, 44px) var(--pad); }
.how__intro { grid-column: 1 / 7; display: grid; gap: 18px; }
.how__intro p { max-width: 52ch; }
.how__figure { grid-column: 1 / -1; }
.flow { width: 100%; height: auto; overflow: visible; }
.flow .p1 { fill: #5c5c5c; }
.flow .p2 { fill: #8c8c8c; }
.flow .q { fill: light-dark(#a8a8a8, #d6d6d6); }
.flow .a { fill: var(--accent); }
.flow--tall { display: none; }
.how__steps { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--gap) calc(var(--gap) + 24px); }
.how__steps li { display: grid; gap: 6px; align-content: start; max-width: 40ch; }
.how__steps h3 { font-size: var(--step-lead); font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; }
.how__steps code { color: var(--night-ink); }

/* ---------- access: tabs and bands ---------- */
.access__head { grid-column: 1 / 9; display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 24px; padding-block: 32px; }
.access__photo { grid-column: 9 / -1; min-height: 13rem; }
.access__photo img { position: absolute; inset: 0; object-position: 30% 24%; }
.access__head h2 { max-width: 20ch; }
.access__tabs { grid-column: 1 / 3; display: grid; align-content: start; gap: 6px; }
.access__tabs .tile { display: grid; gap: 2px; min-height: 64px; padding: 12px 18px; text-align: left; transition: background-color var(--t-hover) ease, color var(--t-hover) ease; }
.access__tabs b { font-size: var(--step-body); font-weight: 600; line-height: 1.25; }
.access__tabs span { font-size: var(--step-small); }
.access__tabs [aria-selected="true"] { background: var(--field); color: var(--field-ink); }
@media (hover: hover) and (pointer: fine) {
  .access__tabs [aria-selected="false"]:hover { background: var(--surface-2); }
}
.access__panels { grid-column: 3 / -1; display: grid; gap: var(--gap); align-content: start; }
.access__tabs:not([hidden]) ~ .access__panels .access__label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.access__label { padding: 14px 20px; background: var(--field); color: var(--field-ink); font-size: var(--step-body); font-weight: 600; }
.bands { display: grid; gap: 4px; }
.bands li { display: grid; grid-template-columns: 8.5rem minmax(0, 1fr) 9.5rem; align-items: center; gap: 4px 24px; min-height: 76px; padding: 12px 20px; background: var(--surface); }
.bands li:nth-child(even) { background: var(--surface-2); }
.bands b { font-size: var(--step-lead); font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; font-variant-numeric: tabular-nums; white-space: nowrap; }
.bands span { line-height: 1.3; }
.bands strong { display: block; font-weight: 600; }
.bands em { display: block; font-style: normal; font-weight: 400; color: var(--muted); }
.bands i { font-style: normal; font-size: var(--step-small); text-align: right; color: var(--muted); }

/* ---------- pricing: the price, very large ---------- */
.pricing__head { grid-column: 1 / 5; display: grid; align-content: start; gap: 14px; }
.pricing__head h2 { font-weight: 800; }
.pricing__figure { grid-column: 5 / -1; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 21rem); gap: 28px 24px; align-items: start; padding: clamp(28px, 3vw, 44px) var(--pad); }
.price { grid-column: 1; grid-row: 1; margin: 0; font-size: var(--step-display); font-weight: 800; letter-spacing: -0.05em; line-height: 0.85; font-variant-numeric: tabular-nums; }
.price__cur { font-size: var(--step-head); vertical-align: 1.1em; margin-right: 0.04em; }
.price__per { margin-left: 0.5em; font-size: var(--step-body); font-weight: 600; letter-spacing: 0; }
.usage { grid-column: 2; grid-row: 1 / 3; display: grid; gap: 10px; padding: 16px; }
.usage__rows { display: grid; gap: 12px; margin: 0; }
.usage__rows > div { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; }
.usage__rows dt { color: var(--muted); }
.usage__rows dd { margin: 0; text-align: right; }
.usage__rows .meter { grid-column: 1 / -1; }
[data-ui] .p63 { width: 63%; } [data-ui] .p41 { width: 41.2%; } [data-ui] .p40 { width: 40%; }
.price__lines { grid-column: 1; display: grid; gap: 4px; font-size: var(--step-lead); font-weight: 600; letter-spacing: -0.015em; line-height: 1.25; }
.pricing__figure .button { grid-column: 1; justify-self: start; }

/* ---------- footer: the last rows of the board ---------- */
.footer { padding-bottom: var(--margin); }
.footer__statement { grid-column: 1 / 5; min-height: 220px; display: flex; flex-direction: column; justify-content: space-between; gap: 24px; }
.footer__statement .lead { font-weight: 600; max-width: 22ch; }
.footer__legal { display: grid; gap: 4px; }
.footer__nav { grid-column: 5 / 8; display: flex; flex-direction: column; justify-content: space-between; gap: 20px; }
.footer__nav ul { display: grid; gap: 6px; padding: 0; list-style: none; }
.footer__nav a { font-weight: 600; }
.footer__region { grid-column: 8 / 10; display: grid; align-content: start; gap: 8px; }
.footer__mail { grid-column: 10 / 13; display: flex; flex-direction: column; justify-content: space-between; gap: 20px; }
.footer__address { font-size: var(--step-lead); font-weight: 600; letter-spacing: -0.02em; overflow-wrap: anywhere; }
.footer__mark { grid-column: 1 / 9; display: flex; align-items: flex-end; min-height: 320px; container-type: inline-size; }
.footer__mark span { font-size: min(var(--step-display), 100cqi / 4.02); font-weight: 800; letter-spacing: -0.055em; line-height: 0.8; white-space: nowrap; }
.footer__cta { grid-column: 9 / 13; display: flex; flex-direction: column; justify-content: space-between; min-height: 320px; }
.footer__cta .lead { font-weight: 800; }
.footer__cta .arrow { width: 72px; height: 72px; align-self: flex-end; stroke-width: 2; }
.credits { grid-column: 1 / -1; display: grid; gap: 8px; font-size: var(--step-small); }
.credits ul { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px 24px; padding: 0; list-style: none; }
.credits a { text-underline-offset: 0.18em; }
.theme-toggle { align-self: flex-start; min-height: 44px; padding: 0 14px; background: var(--surface-2); font-weight: 600; font-size: var(--step-small); }

/* ---------- motion: entrances, feedback, the one moving picture ---------- */
@media (prefers-reduced-motion: no-preference) {
  .js .hero .tile, .js .links .tile, .js .name { animation: tile-in 700ms var(--ease-expo) both; }
  .js .links .tile:nth-child(2) { animation-delay: 40ms; }
  .js .links .tile:nth-child(3) { animation-delay: 80ms; }
  .js .links .tile:nth-child(4) { animation-delay: 120ms; }
  .js .links .tile:nth-child(5) { animation-delay: 160ms; }
  .js .hero__code { animation-delay: 120ms; }
  .js .hero__left .tile { animation-delay: 200ms; }
  .js .hero__rail li:nth-child(1).tile { animation-delay: 240ms; }
  .js .hero__rail li:nth-child(2).tile { animation-delay: 300ms; }
  .js .hero__rail li:nth-child(3).tile { animation-delay: 360ms; }
  .js .hero__rail li:nth-child(4).tile { animation-delay: 420ms; }
  .js .hero__action .tile { animation-delay: 480ms; }
  .js .closeup[data-reveal] .closeup__ui > * { transition: transform 1100ms var(--ease-expo) 120ms; transform: translateX(6%); }
  .js .closeup[data-reveal].is-in .closeup__ui > * { transform: none; }
  .js .photo[data-reveal] img { transform: scale(1.08); transition: transform 1400ms var(--ease-soft); }
  .js .photo[data-reveal].is-in img { transform: none; }
  .js .how__figure[data-reveal] .a { opacity: 0; transition: opacity 600ms var(--ease-out) 500ms; }
  .js .how__figure[data-reveal].is-in .a { opacity: 1; }
  .demo [data-new] { animation: row-in 520ms var(--ease-out) both; }
  .bands li { animation: band-in 420ms var(--ease-out) both; }
  .bands li:nth-child(2) { animation-delay: 50ms; }
  .bands li:nth-child(3) { animation-delay: 100ms; }
  .bands li:nth-child(4) { animation-delay: 150ms; }
  .bands li:nth-child(5) { animation-delay: 200ms; }
}
@keyframes tile-in { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes row-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
@keyframes band-in { from { opacity: 0; transform: translateX(-12px); } to { opacity: 1; transform: none; } }
.button:active, a.tile:active { transform: scale(0.985); }

/* ---------- tablet ---------- */
@media (max-width: 1099px) {
  .board, .masthead { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .name { flex-direction: column; align-items: flex-start; gap: 0; padding: 0 var(--pad) var(--pad); }
  .name__word { font-size: calc((100cqi - 2 * var(--pad)) / 4.02); }
  .name__what { max-width: 26em; padding-bottom: 0; }
  .hero { height: auto; }
  .hero__left { display: contents; }
  .hero__rail { grid-column: 1 / -1; grid-row: auto; order: 1; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-template-rows: auto auto; }
  .hero__rail .tile { min-height: 108px; }
  .hero__action { grid-column: 1 / -1; }
  .hero__code { grid-column: 1 / -1; grid-row: auto; order: 2; }
  .hero__facts { grid-column: 1 / 4; order: 3; font-size: var(--step-body); }
  .hero__run { grid-column: 4 / -1; order: 4; }
  .showcase__head, .showcase__photo, .showcase__demo, .showcase__controls { grid-column: 1 / -1; }
  .showcase__photo { aspect-ratio: 16 / 9; }
  .features { grid-template-rows: none; grid-auto-rows: minmax(13.5rem, auto); }
  .features > * { grid-column: span 3; grid-row: auto; }
  .features__head { grid-column: 1 / 5; }
  .features__photo { grid-column: 5 / -1; }
  .cu-gateway { grid-column: 1 / -1; min-height: 22rem; }
  .features .film { grid-column: 1 / -1; grid-row: auto; order: 1; aspect-ratio: 16 / 9; }
  .cu-sleep, .cu-refused { grid-column: 1 / -1; }
  .how__intro { grid-column: 1 / -1; }
  .access__head, .access__photo { grid-column: 1 / -1; }
  .access__photo { min-height: 0; aspect-ratio: 21 / 9; }
  .access__tabs { grid-column: 1 / -1; grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .access__panels { grid-column: 1 / -1; }
  .bands li { grid-template-columns: 6.5rem minmax(0, 1fr) 7rem; gap: 4px 16px; }
  .pricing__head, .pricing__figure { grid-column: 1 / -1; }
  .footer__statement { grid-column: 1 / 5; }
  .footer__nav { grid-column: 5 / -1; }
  .footer__region { grid-column: 1 / 3; }
  .footer__mail { grid-column: 3 / -1; }
  .credits ul { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer__mark { grid-column: 1 / -1; min-height: 220px; }
  .footer__cta { grid-column: 1 / -1; min-height: 160px; }
}

/* ---------- phone ---------- */
@media (max-width: 599px) {
  :root { --pad: 18px; }
  .board, .masthead { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .links { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .links .tile:last-child { grid-column: 1 / -1; }
  .links .tile { min-height: 48px; padding: 13px 16px; }
  .hero__rail { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero__rail .tile { min-height: 92px; padding: 14px 16px; }
  .hero__action .action { min-height: 60px; }
  .hero__code { min-height: 0; }
  .hero__code pre { max-height: 22rem; }
  .hero__run, .hero__facts { grid-column: 1 / -1; }
  .demo__grid { grid-template-columns: minmax(0, 1fr); }
  .demo__bar .f:not(.demo__clock) { display: none; }
  .showcase__demo { min-height: 0; }
  .showcase__photo { aspect-ratio: 4 / 3; order: 5; }
  .controls__more { display: block; align-self: flex-start; min-height: 44px; margin: 4px 0; font-weight: 600; text-decoration: underline; text-underline-offset: 0.2em; }
  .controls:not(.is-open) .control--more { display: none; }
  .control { min-height: 52px; }
  .showcase__controls select { min-width: 9.5rem; }
  .features { grid-auto-rows: auto; }
  .features > * { grid-column: 1 / -1; }
  .features__photo, .access__photo { aspect-ratio: 4 / 3; }
  .features__photo img { scale: 1.5; }
  .closeup { min-height: 15rem; }
  .features .film { aspect-ratio: 4 / 3; grid-row: auto; }
  .cu-gateway { min-height: 18rem; }
  .cu-gateway .closeup__ui > * { zoom: 1.4; }
  .cu-sleep .closeup__ui > * { zoom: 1.5; }
  .flow--wide { display: none; }
  .flow--tall { display: block; max-width: 22rem; margin-inline: auto; }
  .how__steps { grid-template-columns: minmax(0, 1fr); }
  .access__head { flex-direction: column; align-items: stretch; padding-block: 24px; }
  .access__head .button { width: 100%; }
  .access__tabs { position: sticky; top: 0; z-index: 2; padding-block: 6px; background: var(--bg); grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; }
  .access__tabs .tile { min-height: 48px; padding: 8px 6px; text-align: center; place-items: center; }
  .access__tabs b { font-size: 14px; }
  .access__tabs span { display: none; }
  .bands li { grid-template-columns: minmax(0, 1fr) auto; padding: 16px; gap: 4px 12px; }
  .bands b { grid-row: 1; grid-column: 1; }
  .bands i { grid-row: 1; grid-column: 2; }
  .bands span { grid-row: 2; grid-column: 1 / -1; }
  .credits ul { grid-template-columns: minmax(0, 1fr); }
  .pricing__figure { grid-template-columns: minmax(0, 1fr) minmax(0, 34%); gap: 22px 12px; }
  .price { font-size: 34vw; }
  .usage { grid-column: 2; grid-row: 1; padding: 10px; }
  .usage .ui-title, .usage__rows dt { font-size: 12px; }
  .usage__rows > div { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .usage__rows dd { text-align: left; }
  .price__lines, .pricing__figure .button { grid-column: 1 / -1; }
  .pricing__figure .button { width: 100%; }
  .footer__mark { order: -2; min-height: 160px; }
  .footer__cta { order: -1; }
  .footer__statement { grid-column: 1 / -1; min-height: 0; }
  .footer__nav, .footer__region { grid-column: span 1; min-height: 0; }
  .footer__mail { grid-column: 1 / -1; min-height: 0; }
  .footer__nav ul { gap: 10px; }
  .footer__address { font-size: var(--step-body); }
}

/* ---------- subpages: docs, security, 404. A head tile on the left third, the record on the right ---------- */
.masthead--sub { padding-bottom: 0; }
.mark { grid-column: 1 / 4; display: flex; align-items: flex-end; padding: 0 var(--pad); container-type: inline-size; text-decoration: none; }
.mark span { font-size: calc(100cqi / 4.02); font-weight: 800; letter-spacing: -0.055em; line-height: 0.8; padding: 0.09em 0 0.035em; white-space: nowrap; }
.masthead--sub .links { grid-column: 4 / 11; }
.masthead__action { grid-column: 11 / -1; display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 64px; padding: 0 20px; font-weight: 600; }
@media (hover: hover) and (pointer: fine) { a.mark:hover { background: var(--surface-2); } }

.docs-bar { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.docs-bar .tile { min-height: 56px; padding: 16px var(--pad); font-weight: 600; }
.docs-bar .tile[aria-current="page"] { background: var(--field); color: var(--field-ink); }
@media (hover: hover) and (pointer: fine) { .docs-bar a.tile:not([aria-current]):hover { background: var(--surface-2); } }
.page-head--doc .page-head__title { grid-column: 1 / -1; min-height: 0; gap: 24px; }
@media (max-width: 1099px) {
  .docs-bar { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .docs-bar .tile:last-child { grid-column: span 2; }
}
@media (max-width: 599px) {
  .docs-bar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .docs-bar .tile:last-child { grid-column: 1 / -1; }
}

.page-head__title { grid-column: 1 / 9; display: flex; flex-direction: column; justify-content: space-between; gap: 40px; min-height: 26rem; }
.page-title { font-size: clamp(3.5rem, 8vw, 7.5rem); line-height: 0.9; letter-spacing: -0.05em; max-width: 12ch; }
.page-head__title .lead { max-width: 34ch; font-weight: 600; }
.page-head__title .lead code { font-weight: 500; }
.page-head__photo { grid-column: 9 / -1; grid-row: span 2; min-height: 20rem; }
.page-head__photo img { position: absolute; inset: 0; }
.page-index { grid-column: 1 / 9; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--gap); }
.page-index .tile { min-height: 64px; padding: 18px 20px; font-weight: 600; }
@media (hover: hover) and (pointer: fine) { .page-index a.tile:hover { background: var(--surface-2); } }

.doc { scroll-margin-top: var(--gap); }
.doc + .doc { margin-top: 56px; }
.doc code { overflow-wrap: anywhere; }
.doc__head { grid-column: 1 / 5; display: flex; flex-direction: column; gap: 16px; }
.doc__head h2 { max-width: 13ch; }
@media (min-width: 1100px) {
  .doc__head { display: block; }
  .doc__head h2 { position: sticky; top: 0; z-index: 1; max-width: none; margin-top: calc(-1 * var(--pad)); padding: var(--pad) 0 16px; background: var(--surface); }
  .doc__head h2 + p { max-width: 30ch; }
}
.doc__wide { grid-column: 5 / -1; }
.doc__half { grid-column: span 6; }
.doc__full { grid-column: 1 / -1; }
.doc__code, .doc__frag { grid-column: 1 / 7; }
.doc__side { grid-column: 7 / -1; }
.doc__film { grid-column: 5 / 9; }
.doc .film { min-height: 18rem; }
.doc .film video { position: absolute; inset: 0; }
.doc__frag--side { grid-column: 9 / -1; }
.doc__wide-left { grid-column: 1 / 9; }
.doc__narrow, .doc__frag--narrow { grid-column: 9 / -1; }
.doc__mid { grid-column: 5 / 10; }
.doc__frag--end { grid-column: 10 / -1; }
.doc__frag--mid { grid-column: 5 / 9; }
.doc__frag--wide, .doc__frag--full { grid-column: 1 / -1; }
.doc__frag--right { grid-column: 5 / -1; }
.frag--usage .usage__rows { padding: 0 12px; }
.frag--usage .ui-title { padding: 12px 12px 0; }
.egress-rules { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.egress-photo { aspect-ratio: 3 / 1; }
.egress-photo img { position: absolute; inset: 0; object-position: 60% 22%; }
.page-head__photo--wac img { object-position: 30% 30%; }
.doc__sub { font-size: var(--step-lead); letter-spacing: -0.02em; line-height: 1.1; margin-bottom: 16px; }
.doc .tile p + p { margin-top: 0.9em; }
.doc__frag { padding: 0; background: var(--night); }
.frag { display: grid; align-content: start; gap: 12px; height: 100%; padding: 4px 4px 16px; }
.frag .ui-head { padding: 12px 12px 0; }
.frag__kv, .frag__tl, .frag__note, .frag__key { padding: 0 12px; }
.frag__key code { display: block; padding: 10px 12px; background: var(--raised); color: var(--text); font-size: 13px; overflow-wrap: anywhere; }
.doc__frag td code { overflow-wrap: normal; }

.ref-rows { display: grid; gap: 4px; align-content: stretch; }
.ref-rows li { display: grid; grid-template-columns: minmax(0, 15rem) minmax(0, 1fr); align-items: baseline; gap: 4px 24px; padding: 16px 20px; background: var(--surface); }
.ref-rows li:nth-child(even) { background: var(--surface-2); }
.ref-rows li > code, .ref-rows li > b { font-weight: 600; overflow-wrap: anywhere; }
.ref-rows p { max-width: 60ch; }
.doc__side .ref-rows li, .doc__side li { grid-template-columns: minmax(0, 11rem) minmax(0, 1fr); }

.rules-list { display: grid; gap: 14px; align-content: start; }
.rules-list li { position: relative; max-width: 72ch; padding-left: 20px; }
.rules-list li::before { content: ""; position: absolute; left: 0; top: 0.55em; width: 8px; height: 8px; background: currentColor; }

.table-tile { min-width: 0; }
.ref { width: 100%; border-collapse: collapse; }
.ref__caption { padding: 14px 20px; background: var(--field); color: var(--field-ink); font-weight: 600; text-align: left; }
.ref th { padding: 12px 20px 8px; background: var(--surface-2); color: var(--muted); font-size: var(--step-small); font-weight: 600; text-align: left; }
.ref td { padding: 14px 20px; background: var(--surface); vertical-align: baseline; }
.ref tbody tr:nth-child(even) td { background: var(--surface-2); }
.ref td:first-child { font-weight: 600; }
.ref__note { display: block; color: var(--muted); font-weight: 400; }
.ref--routes td:not(:first-child) { white-space: nowrap; }
.ref--routes th:last-child, .ref--routes td:last-child { text-align: right; }
.ref:not(.ref--routes) td:first-child code { overflow-wrap: normal; }

.footer--sub .footer__statement { grid-column: 1 / 5; }
.footer--sub .footer__nav { grid-column: 5 / 8; }
.footer--sub .footer__region { grid-column: 8 / 10; }
.footer--sub .footer__mail { grid-column: 10 / -1; }
.footer--sub .credits ul { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.lost { grid-column: 1 / 9; display: flex; flex-direction: column; justify-content: space-between; gap: 40px; min-height: 30rem; }
.lost .page-title { font-size: clamp(2.5rem, 5vw, 4.5rem); max-width: 20ch; }
.lost__photo { grid-column: 9 / -1; min-height: 20rem; }
.lost__photo img { position: absolute; inset: 0; object-position: 40% 30%; }
.lost__links { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--gap); }
.lost__links .tile { min-height: 96px; display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; font-size: var(--step-lead); font-weight: 800; letter-spacing: -0.02em; text-decoration: none; }

@media (max-width: 1099px) {
  .mark { grid-column: 1 / 4; grid-row: 1; }
  .masthead__action { grid-column: 4 / -1; grid-row: 1; }
  .masthead--sub .links { grid-column: 1 / -1; grid-row: 2; }
  .ref--routes td:not(:first-child) { white-space: normal; }
  .doc__frag [data-ui] td { white-space: normal; }
  .doc__frag [data-ui] td.num { white-space: nowrap; }
  .page-head__title, .page-index, .page-head__photo { grid-column: 1 / -1; }
  .page-head__title { min-height: 0; }
  .page-head__photo { grid-row: auto; min-height: 0; aspect-ratio: 16 / 9; }
  .doc__head, .doc__wide, .doc__full, .doc__code, .doc__frag, .doc__side, .doc__wide-left, .doc__narrow, .doc__frag--narrow, .doc__mid, .doc__frag--end, .doc__frag--mid, .doc__frag--right { grid-column: 1 / -1; }
  .egress-photo { aspect-ratio: 2 / 1; }
  .egress-rules { grid-template-columns: minmax(0, 1fr); }
  .ref-rows li { grid-template-columns: minmax(0, 11rem) minmax(0, 1fr); }
  .doc__half, .doc__film, .doc__frag--side { grid-column: span 3; }
  .doc__head h2 { max-width: none; }
  .footer--sub .footer__statement { grid-column: 1 / 5; }
  .footer--sub .footer__nav { grid-column: 5 / -1; }
  .footer--sub .footer__region { grid-column: 1 / 3; }
  .footer--sub .footer__mail { grid-column: 3 / -1; }
  .lost, .lost__photo, .lost__links { grid-column: 1 / -1; }
  .lost { min-height: 0; }
  .lost__photo { aspect-ratio: 16 / 9; min-height: 0; }
}
@media (max-width: 599px) {
  .mark { grid-column: 1 / 2; }
  .masthead__action { grid-column: 2 / 3; }
  .masthead__action { min-height: 56px; padding: 0 16px; }
  .ref__caption { display: block; }
  .page-index { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .page-index .tile { min-height: 52px; padding: 14px 16px; }
  .page-head__photo { aspect-ratio: 4 / 3; }
  .doc__half, .doc__film, .doc__frag--side { grid-column: 1 / -1; }
  .doc__film { aspect-ratio: 4 / 3; min-height: 0; }
  .doc .film { min-height: 0; aspect-ratio: 4 / 3; }
  .egress-photo { aspect-ratio: 4 / 3; }
  .ref-rows li, .doc__side .ref-rows li, .doc__side li { grid-template-columns: minmax(0, 1fr); padding: 14px 16px; }
  .ref thead { display: none; }
  .ref, .ref tbody, .ref tr, .ref td { display: block; width: 100%; }
  .ref tr { display: grid; gap: 4px; padding: 14px 16px; background: var(--surface); }
  .ref tbody tr:nth-child(even) { background: var(--surface-2); }
  .ref td, .ref tbody tr:nth-child(even) td { padding: 0; background: transparent; }
  .ref td:not(:first-child)::before { content: attr(data-label) ": "; color: var(--muted); font-weight: 400; }
  .ref--routes td:last-child { text-align: left; }
  [data-ui] .col-wide { display: none; }
  .frag__audit thead { display: none; }
  .frag__audit, .frag__audit tbody { display: block; }
  .frag__audit tr { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 2px 12px; padding: 9px 12px; border-bottom: 1px solid var(--rule); }
  .frag__audit tr:last-child { border-bottom: 0; }
  .frag__audit td { padding: 0; border: 0; }
  .frag__audit td:last-child { grid-column: 1 / -1; }
  .footer--sub .footer__statement, .footer--sub .footer__mail { grid-column: 1 / -1; }
  .footer--sub .footer__nav, .footer--sub .footer__region { grid-column: span 1; }
  .footer--sub .credits ul { grid-template-columns: minmax(0, 1fr); }
  .lost__links { grid-template-columns: minmax(0, 1fr); }
}
