/* MARS round 3: the product's dot language on the page.
   Dots are MARS's own: DotTrack (8px dots, 6px gap, red = read, blue = you are here), screentone
   (.tone: 1px dot on a 12px grid), the logo's planet and dotted orbit. Nothing here is a generic halftone. */
@property --dd { syntax: "<length>"; inherits: false; initial-value: 0px; }
:root {
  --spring: 211ms linear(0, 0.0042 2.1%, 0.0159 4.2%, 0.034 6.3%, 0.0574 8.3%, 0.0851 10.4%, 0.1163 12.5%, 0.1503 14.6%, 0.1864 16.7%, 0.224 18.8%, 0.2626 20.8%, 0.3016 22.9%, 0.3408 25%, 0.3798 27.1%, 0.4183 29.2%, 0.456 31.3%, 0.4928 33.3%, 0.5285 35.4%, 0.5629 37.5%, 0.596 39.6%, 0.6277 41.7%, 0.6579 43.8%, 0.6865 45.8%, 0.7137 47.9%, 0.7393 50%, 0.7634 52.1%, 0.7859 54.2%, 0.807 56.3%, 0.8267 58.3%, 0.845 60.4%, 0.8619 62.5%, 0.8775 64.6%, 0.892 66.7%, 0.9052 68.8%, 0.9173 70.8%, 0.9284 72.9%, 0.9384 75%, 0.9476 77.1%, 0.9558 79.2%, 0.9633 81.3%, 0.97 83.3%, 0.9759 85.4%, 0.9813 87.5%, 0.986 89.6%, 0.9901 91.7%, 0.9938 93.8%, 0.9969 95.8%, 0.9997 97.9%, 1); /* Feel "snappy": mass 1, 3.4 Hz, damping ratio 0.82, sampled from the exact solution */
  --dot-red: #e8542f; --dot-blue: #4da3ff; --dot-off: rgb(255 255 255 / .12); --dot-pale: #f3c9bd;
}

/* ---------- screentone grounds: the product's .tone, kept quiet and faded off the text ---------- */
.tonal { position: relative; }
.tonal > .wrap, .tonal > .footer__lede { position: relative; z-index: 1; }
.tonal::before { content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background-image: radial-gradient(rgb(28 20 18 / .13) 1px, transparent 1.4px); background-size: 12px 12px;
  -webkit-mask-image: linear-gradient(to bottom, transparent 40%, #000); mask-image: linear-gradient(to bottom, transparent 40%, #000); }
.tonal.ground-inverse::before { background-image: radial-gradient(rgb(255 255 255 / .09) 1px, transparent 1.4px); }

/* ---------- DotTrack, as the product draws it ---------- */
.dt { display: flex; gap: 6px; padding: 4px 2px; min-width: 0; }
.dt i { width: 8px; height: 8px; flex: none; border-radius: 50%; background: var(--dot-off);
  transition: transform var(--spring), opacity var(--spring); }
.dt i.on { background: var(--dot-red); box-shadow: 0 0 6px rgb(232 84 47 / .45); }
.dt i.here { background: var(--dot-blue); box-shadow: 0 0 0 3px rgb(77 163 255 / .25); transform: scale(1.25); }
.dt i.pre { transform: scale(.2); opacity: 0; }

/* ---------- hero: night chart, the dot planet, the app window ---------- */
.hero--mars { overflow: hidden; }
.hero__sky { position: absolute; inset: 96px 0 0 0; z-index: 0; width: 100%; height: calc(100% - 96px); object-fit: cover; pointer-events: none; display: block; }
.hero--mars > .wrap > .hero-text { position: relative; display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  grid-template-rows: auto minmax(0, 1fr); column-gap: var(--gutter, 24px); align-content: start; }
.hero--mars .hero__c { grid-column: 1; grid-row: 1; align-self: center; display: grid; justify-items: start; text-align: left; gap: var(--s-4); padding-top: var(--s-5); }
.hero--mars h1 { max-width: 14em; font-size: clamp(38px, 4.3vw, 60px); line-height: 1.12; }
.hero--mars .hero__lead { max-width: 34em; color: var(--muted); }
.hero--mars .btn-row { justify-content: flex-start; margin-top: var(--s-3); }
.hero--mars .hero-notice { display: flex; flex-wrap: wrap; gap: 4px 12px; color: var(--muted); }
.planet { grid-column: 2; grid-row: 1; position: relative; min-height: 350px; }
.planet canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.demo { grid-column: 1 / -1; grid-row: 2; position: relative; margin-top: var(--s-5); min-height: 0; overflow: hidden;
  -webkit-mask-image: linear-gradient(to bottom, #000 92%, transparent); mask-image: linear-gradient(to bottom, #000 92%, transparent); }
.demo .mx { width: 100%; }
.mx.is-assembling { -webkit-mask-image: radial-gradient(circle, #000 var(--dd), transparent calc(var(--dd) + .75px)); -webkit-mask-size: 10px 10px;
  mask-image: radial-gradient(circle, #000 var(--dd), transparent calc(var(--dd) + .75px)); mask-size: 10px 10px; }
.pausebtn { position: relative; grid-column: 2; grid-row: 1; align-self: end; justify-self: end; z-index: 6; display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 var(--s-4);
  border: 1px solid var(--line-strong); border-radius: 99px; background: rgb(18 13 11 / .6); color: var(--ink); font: 500 var(--t-small, 14px)/1 var(--font-text); cursor: pointer;
  transition: border-color var(--spring), background-color var(--spring); }
.pausebtn::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--dot-red); }
.pausebtn[aria-pressed="true"]::before { background: transparent; box-shadow: inset 0 0 0 1.5px var(--dot-red); }
.pausebtn:hover { border-color: var(--ink); }
.pausebtn:focus-visible { outline: 2px solid var(--dot-blue); outline-offset: 2px; }

/* the demo window: two views in one body */
.mx--demo .mx__body { display: block; position: relative; height: 284px; overflow: hidden; }
.view { position: absolute; inset: 0; transition: opacity var(--spring), transform var(--spring), visibility var(--spring); }
.view--home { display: grid; grid-template-columns: 200px minmax(0, 1fr); }
.view--home.is-off { opacity: 0; transform: scale(.985); pointer-events: none; visibility: hidden; }
.view--read { background: #050403; display: grid; grid-template-rows: 40px minmax(0, 1fr) 44px; opacity: 0; transform: scale(1.012); pointer-events: none; visibility: hidden; }
.view--read.is-on { opacity: 1; transform: none; visibility: visible; }
.view--read .rd__top { height: 40px; }
.mx--demo .rd__stage { height: auto; padding: 10px; }
.spread { display: flex; height: 100%; gap: 8px; transition: transform var(--spring), opacity var(--spring); }
.spread.leave { opacity: 0; transform: translateX(-26px); }
.spread.enter { opacity: 0; transform: translateX(26px); transition: none; }
.spread .pg { height: 100%; }
.rd__bar .dt { flex: 1; }
.shelf { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 12px; }
.mx--demo .mx__main { overflow: hidden; }
.mx--demo .mx__resume { grid-template-columns: 96px minmax(0, 1fr); }
.mx__act.is-hot { color: var(--mx-ink); }
.cur { position: absolute; left: 0; top: 0; z-index: 8; width: 22px; height: 22px; margin: -2px 0 0 -2px; pointer-events: none; will-change: transform; }
.cur svg { display: block; width: 22px; height: 22px; filter: drop-shadow(0 2px 3px rgb(0 0 0 / .5)); transition: transform var(--spring); transform-origin: 3px 2px; }
.cur.is-down svg { transform: scale(.82); }
.ping { position: absolute; z-index: 7; width: 8px; height: 8px; margin: -4px 0 0 -4px; border-radius: 50%; pointer-events: none; background: var(--dot-blue); box-shadow: 0 0 0 4px rgb(77 163 255 / .3);
  opacity: 0; transform: scale(.4); transition: transform var(--spring), opacity var(--spring); }
.ping.go { opacity: 1; transform: scale(2); }

/* ---------- dot numerals (the LED-matrix counters of the tagline) ---------- */
.dnum { display: block; height: clamp(64px, 9vw, 98px); width: auto; max-width: 100%; }
.nums .dnum { margin-bottom: var(--s-3); }
.dnum circle.off { fill: rgb(28 20 18 / .13); }
.dnum circle.on { fill: var(--dot-red); }
@media (max-width: 639px) { .nums--tag > div { display: grid; justify-items: start; gap: var(--s-2); } .nums--tag .dnum { height: 56px; } }

/* ---------- the library arrow: three dots hand a folder over ---------- */
.mx--lib .arrow { display: grid; align-content: center; justify-items: center; gap: 12px; }
.flow { display: grid; gap: 12px; }
.flow i { width: 6px; height: 6px; border-radius: 50%; background: var(--mx-red); opacity: .25; animation: flow 1.8s 3; }
.flow i:nth-child(2) { animation-delay: .3s; } .flow i:nth-child(3) { animation-delay: .6s; }
@keyframes flow { 0%, 60%, 100% { opacity: .25; transform: scale(1); } 25% { opacity: 1; transform: scale(1.35); } }
.mx--lib .series .cv { transition: transform var(--spring); }
.mx--lib .series .cv:hover { transform: translateY(-4px); }

/* ---------- covers: lift and the red dot spotlight (the product's own hover) ---------- */
.wall .cv, .mx--lib .series .cv { transition: transform var(--spring); }
.wall .cv:hover { transform: translateY(-4px); }
.wall .cv::before, .mx--lib .series .cv::before { content: ""; position: absolute; inset: 0; z-index: 2; opacity: 0; pointer-events: none; transition: opacity var(--spring);
  background: radial-gradient(circle, rgb(232 84 47 / .95) 1.3px, transparent 1.8px) 0 0 / 7px 7px;
  -webkit-mask-image: radial-gradient(circle 54px at var(--mx, 50%) var(--my, 50%), #000, transparent);
  mask-image: radial-gradient(circle 54px at var(--mx, 50%) var(--my, 50%), #000, transparent); }
.wall .cv:hover::before, .mx--lib .series .cv:hover::before { opacity: 1; }

/* ---------- the connect panel: a dot grid under the hub ---------- */
.dgp { background-image: radial-gradient(rgb(28 20 18 / .12) 1px, transparent 1.4px); background-size: 12px 12px; }

/* ---------- a Martian horizon at the foot: dust ridges, craters, a blue sunset ---------- */
.closing__cta > .horizon { position: relative; flex: none; height: clamp(120px, 14vw, 200px); line-height: 0; overflow: hidden; }
.horizon svg { position: absolute; inset: 0; width: 100%; height: 100%; }

/* ---------- pause, reduced motion ---------- */
html.paused .flow i, html.paused .ping { animation-play-state: paused; }
@media (prefers-reduced-motion: reduce) { .flow i { animation: none; opacity: .6; } .cur, .ping { display: none; } }
@media (max-width: 1023px) { .pausebtn { grid-column: 1; grid-row: 2; justify-self: end; margin: 0 0 var(--s-2); } .hero--mars > .wrap > .hero-text { grid-template-columns: 1fr; grid-template-rows: auto auto minmax(0, 1fr); } .hero--mars .hero__c { padding-top: var(--s-3); } .planet { grid-column: 1; grid-row: 2; min-height: 300px; } .demo { grid-row: 3; } }
@media (max-width: 639px) {
  .planet { min-height: 240px; } .demo { margin-top: var(--s-3); } .mx--demo .mx__body { height: 270px; }
  .view--home { grid-template-columns: 1fr; } .view--home .mx__side { display: none; } 
  .mx--demo .mx__resume { grid-template-columns: 76px minmax(0, 1fr); }
}

/* the tagline is a statement, not a section heading: keep its display size on a p */
.section-head p.said { font: var(--display-weight) clamp(46px, 7.4vw, 112px)/1.04 var(--font-display); letter-spacing: var(--display-tracking-xl); color: var(--ink); max-width: none; margin: 0; }
.section-head p.said .red { color: var(--accent); }
@media (max-width: 639px) { .section-head p.said { font-size: 13vw; } }

/* phone: two screens as two groups (layout-v4 .g2m). The text group sits in the first screen, the visual fills the second,
   so the content runs to the section's foot and the gap to the next section is the padding alone. */
@media (max-width: 639px) {
  #library .grid, #connect .grid, #start .grid { flex: 1 1 auto; display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: repeat(2, minmax(0, 1fr)); row-gap: var(--s-6); }
  #library .grid > *, #connect .grid > *, #start .grid > * { min-height: 0; }
  #library .grid > :last-child { display: flex; flex-direction: column; } #library .mx--lib { flex: 1 1 auto; }
  #library .mx--lib, #library .mx--lib > div { display: flex; flex-direction: column; } #library .mx--lib > div { flex: 1 1 auto; } #library .mx--lib .mx__body { flex: 1 1 auto; align-content: space-evenly; }
  #library .grid > :last-child, #connect .grid > :last-child, #start .grid > :last-child { align-self: stretch; }
}
@media (max-width: 639px) {
  #start .grid > :last-child { display: flex; flex-direction: column; justify-content: flex-end; }
  #connect .grid > :last-child { display: flex; flex-direction: column; } #connect .dgp { flex: 1 1 auto; display: flex; flex-direction: column; }
  #connect .dgp .dg { flex: 1 1 auto; min-height: 0; }
  .hero--mars { padding-bottom: 72px; }
}
picture.hero__sky img { display: block; width: 100%; height: 100%; object-fit: cover; }

/* The kit's iris ring grew by width and height (centred with a translate), which moves its box on every frame and
   registers as layout shift (0.30 in perf.mjs). Same hairline circle, drawn by a gradient on a fixed box: only paint changes. */
.mo-io > .mo-io__stage > .mo-io__ring { left: 0; top: 0; width: 100%; height: 100%; transform: none; border: 0; border-radius: 0; will-change: auto;
  background: radial-gradient(circle at var(--mo-cx) var(--mo-cy), transparent calc(var(--mo-r) - 1px), var(--accent) calc(var(--mo-r) - 1px), var(--accent) var(--mo-r), transparent calc(var(--mo-r) + 0.5px)); }

/* tablet: the cover wall fills its screen (four rows) and the tagline's numerals sit at the foot, so content runs to the
   section's end and the gap to the next section is the padding alone */
@media (min-width: 640px) and (max-width: 1023px) {
  #tagline > .wrap > .nums--tag { margin-top: auto; padding-top: var(--s-6); }
}

/* short screens (1024x768 and the like): the window shrinks to its resume card so the first screen holds it whole */
@media (min-width: 1024px) and (max-height: 820px) {
  .planet { min-height: 250px; }
  .hero--mars > .wrap > .hero-text { grid-template-columns: minmax(0, 8fr) minmax(0, 4fr); }
  .hero--mars h1 { max-width: none; }
  .mx--demo .mx__body { height: 176px; }
  .view--home { grid-template-columns: minmax(0, 1fr); }
  .view--home .mx__side, .view--home .mx__find { display: none; }
  .mx--demo .mx__main { padding-top: var(--s-4); }
}
@media (min-width: 640px) and (max-width: 1023px) { .planet { min-height: 210px; } .hero--mars .hero__c { padding-top: var(--s-2); } }
@media (max-width: 1023px) { #tagline > .wrap > .nums--tag { margin-top: auto; padding-top: var(--s-6); } }

/* the iris stage sat 9px from the section's top edge at tablet width ("flush" where the ground changes): a wider even gutter */
#scale.mo-io { --mo-gap: clamp(24px, 3vw, 44px); }
.demo .cv i { background: #0d0a09; }
/* one view at a time: home leaves first, the reader arrives after it (no moment with both on screen) */
.view--home { transition: opacity .2s linear, transform var(--spring), visibility 0s linear .2s; }
.view--home:not(.is-off) { transition: opacity .2s linear .24s, transform var(--spring) .24s, visibility 0s linear .24s; visibility: visible; }
.view--read { transition: opacity .2s linear, transform var(--spring), visibility 0s linear .2s; }
.view--read.is-on { transition: opacity .2s linear .24s, transform var(--spring) .24s, visibility 0s linear .24s; }

/* ---- hero on the page's 12 column lines: copy on 1-7, planet and pause button from column 8 ---- */
.hero--mars > .wrap > .hero-text { grid-template-columns: repeat(12, minmax(0, 1fr)); }
.hero--mars .hero__c { grid-column: 1 / 8; }
.planet { grid-column: 8 / 13; }
.pausebtn { grid-column: 8 / 13; justify-self: start; }
.demo { grid-column: 1 / -1; }
@media (min-width: 1024px) and (max-height: 820px) {
  .hero--mars > .wrap > .hero-text { grid-template-columns: repeat(12, minmax(0, 1fr)); }
  .hero--mars .hero__c { grid-column: 1 / 9; } .planet { grid-column: 9 / 13; } .pausebtn { grid-column: 9 / 13; }
}
@media (max-width: 1023px) {
  .hero--mars > .wrap > .hero-text { grid-template-columns: repeat(12, minmax(0, 1fr)); grid-template-rows: auto auto minmax(0, 1fr); }
  .hero--mars .hero__c, .planet { grid-column: 1 / -1; }
  .pausebtn { grid-column: 9 / 13; grid-row: 2; justify-self: start; align-self: end; margin: 0 0 var(--s-2); }
}
/* a phone's first screen holds the copy and the planet; the window (the cursor walkthrough) is a tablet and desktop part */
@media (max-width: 639px) { .demo { display: none; } .pausebtn { grid-column: 1 / -1; } .planet { min-height: 260px; } }

/* the centred nav is a 3-column grid; below the tablet width its toggle fell into the middle cell next to the logo */
@media (max-width: 1023px) { .nav--centre .nav__bar { display: flex; align-items: center; } .nav--centre .nav__toggle { margin-left: auto; } .nav--centre:not(.is-open) .nav__actions { margin-left: auto; } }
@media (max-width: 639px) { .nav.nav--centre:not(.is-open) .nav__bar > .nav__toggle { margin-left: auto; } }

/* #scale: the cover wall is the section's picture and carries it on its own (half the screen at least): beside the words on a
   laptop, under them on a tablet */
@media (min-width: 1024px) {
  #scale > .wrap { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gutter); align-content: start; }
  #scale .section-head { grid-column: 1 / 6; grid-row: 1; }
  #scale .pts { grid-column: 1 / 6; grid-row: 2; grid-template-columns: 1fr; margin-top: var(--s-5); }
  #scale .wall { grid-column: 6 / 13; grid-row: 1 / span 2; margin-top: 0; align-self: start; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
  #scale .wall .cv:nth-child(-n+15) { display: block; } #scale .wall .cv:nth-child(n+16) { display: none; }
}
@media (min-width: 640px) and (max-width: 1023px) {
  #scale .wall { grid-template-columns: repeat(5, minmax(0, 1fr)); grid-template-rows: repeat(3, minmax(0, 1fr)); gap: 8px; height: 51svh; margin-top: var(--s-4); }
  #scale .pts { margin-top: var(--s-4); }
  #scale .wall .cv { height: 100%; aspect-ratio: auto; }
  #scale .wall .cv:nth-child(-n+15) { display: block; } #scale .wall .cv:nth-child(n+16) { display: none; }
}

/* a tall tablet (820x1180): the close of the steps sits at the section's foot instead of leaving the screen half empty */
@media (min-width: 640px) and (max-width: 1023px) and (min-height: 1100px) {
  #start > .wrap { display: flex; flex-direction: column; }
  #start .grid { flex: 1 1 auto; grid-template-rows: auto minmax(0, 1fr); }
  #start .grid > :last-child { align-self: stretch; display: flex; flex-direction: column; justify-content: flex-end; }
}
@media (min-width: 640px) and (max-width: 1023px) and (min-height: 1100px) {
  #connect > .wrap { display: flex; flex-direction: column; }
  #connect .grid { flex: 1 1 auto; }
  #connect .grid > :last-child { display: flex; flex-direction: column; align-self: stretch; }
  #connect .dgp { flex: 1 1 auto; display: flex; flex-direction: column; }
  #connect .dgp .dg { flex: 1 1 auto; min-height: 0; }
}

/* nav: language switch (a 44px target each; the current language is the darker one) */
.nav__lang { display: flex; align-items: center; margin-right: var(--s-2, 8px); }
.nav__lang a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 10px; font-size: 14px; line-height: 1; color: var(--muted, #675d58); text-decoration: none; }
.nav__lang a + a::before { content: "/"; margin-right: 10px; margin-left: -10px; color: var(--muted, #675d58); opacity: .5; }
.nav__lang a[aria-current] { color: var(--ink, #1c1412); font-weight: 500; }
.nav__lang a:hover { color: var(--ink, #1c1412); }

/* steps: body copy in the ink (7:1), not the muted grey; English runs longer and the check reads it as body text */
.stp p { color: var(--ink); }
.nav__lang a { white-space: nowrap; }
@media (max-width: 1180px) and (min-width: 1024px) { .nav__lang a { padding: 0 6px; } .nav__lang a + a::before { margin-right: 6px; margin-left: -6px; } }
@media (min-width: 1024px) and (max-width: 1240px) {
  .nav--centre .nav__bar { grid-template-columns: auto 1fr auto; column-gap: 12px; }
  .nav--centre .nav__links { justify-self: center; }
  .nav--centre .nav__link { padding-left: 8px; padding-right: 8px; }
  .nav__lang { margin-right: 0; }
}
.stp p, .stp p .mono { color: var(--ink); }
.stp li > p, .stp li > p .mono { color: var(--ink); }

/* ===== round 4 ===== */
/* the name first: MARS with "A Reading Server" set as part of it (one lockup, not an eyebrow) */
.hero--mars h1.brand { max-width: none; margin: 0; font: var(--display-weight, 500) clamp(60px, 7vw, 104px)/0.96 var(--font-display); letter-spacing: var(--display-tracking-xl, -0.03em); }
.brand__mark { display: block; }
.brand__sub { display: block; margin-top: 0.1em; font-size: 0.4em; line-height: 1.15; letter-spacing: -0.01em; color: var(--accent); }
.hero__line { margin: 0; max-width: 20em; font: 500 clamp(24px, 2.7vw, 40px)/1.25 var(--font-text); letter-spacing: -0.01em; color: var(--ink); text-wrap: balance; word-break: auto-phrase; }
.hero--mars .hero__c { gap: var(--s-3); }
.hero--mars .hero-notice { margin-top: var(--s-2); }
@media (max-width: 639px) { .hero--mars h1.brand { font-size: 15vw; } .hero__line { font-size: 21px; } }
/* nav and footer: the same lockup, small */
.nav__logo .nav__name { display: inline-flex; flex-direction: row; align-items: baseline; gap: 10px; line-height: 1; white-space: nowrap; }
.nav__name b { font-weight: inherit; }
.nav__name small { font: 400 12px/1 var(--font-text); letter-spacing: 0; color: var(--muted); white-space: nowrap; }
.footer .nav__logo .nav__name small { font-size: 13px; }
.footer .nav__logo { font-size: 24px; }
@media (max-width: 639px) { .nav__name small { font-size: 11px; } }
/* comparison table */
#compare .section-head p { max-width: 46em; }
.cmp { margin-top: var(--s-6); overflow-x: auto; -webkit-overflow-scrolling: touch; padding: 0; }
.cmp:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.cmp table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 16px; line-height: 1.55; color: var(--ink); table-layout: fixed; }
.cmp th, .cmp td { padding: 20px 20px 20px 0; word-break: auto-phrase; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); font-weight: 400; overflow-wrap: break-word; }
.cmp thead th { padding-block: 14px; font: 500 18px/1.2 var(--font-display); letter-spacing: -0.01em; }
.cmp tbody th { width: 17%; font-weight: 500; }
.cmp thead th.cmp__corner { width: 17%; }
.cmp__src { margin: var(--s-4) 0 0; max-width: 70em; font-size: 14px; line-height: 1.7; color: var(--ink); }
.cmp__src a { color: inherit; text-decoration: underline; text-underline-offset: 3px; }
@media (max-width: 767px) {
  /* phones: each row becomes a block, the three products stacked under the feature name */
  .cmp { overflow: visible; display: block; }
  .cmp table, .cmp tbody, .cmp tr, .cmp th, .cmp td { display: block; width: 100%; min-width: 0; }
  .cmp thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .cmp tr { padding: 16px 0; border-bottom: 1px solid var(--line); }
  .cmp th, .cmp td { padding: 0; border: 0; }
  .cmp tbody th { width: auto; margin-bottom: 8px; font: 500 17px/1.3 var(--font-display); }
  .cmp td { padding: 4px 0; display: grid; grid-template-columns: 72px minmax(0, 1fr); column-gap: 12px; }
  .cmp td::before { content: attr(data-p); font-weight: 500; }
}

/* comparison: the two screens are filled by the card (rows share the height), so no empty tail */
#compare { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); }
#compare > .wrap { display: flex; flex-direction: column; }
#compare .cmp { flex: 1 1 auto; display: flex; align-items: stretch; }
#compare .cmp table { flex: 1 1 auto; height: auto; }
@media (max-width: 1279px) { .cmp th, .cmp td { padding-block: 14px; } .cmp table { font-size: 15px; } .cmp { margin-top: var(--s-5); } }
@media (max-width: 899px) { .cmp table { font-size: 14px; } }
/* a short laptop screen (1024 x 768): the name, line and lead share less height so the window below is not cut */
@media (min-width: 1024px) and (max-height: 820px) {
  .hero--mars h1.brand { font-size: clamp(48px, 5.4vw, 62px); }
  .hero__line { font-size: 26px; }
  .hero--mars .hero__lead { font-size: 17px; max-width: 40em; }
  .hero--mars .hero-notice { display: none; }
}

@media (max-width: 639px) {
  .footer .nav__logo { flex-wrap: wrap; }
  .footer .nav__logo .nav__name { display: contents; }
  .footer .nav__logo .nav__name small { flex-basis: 100%; margin-top: 2px; }
}

@media (max-width: 767px) { #compare { --h: 1 !important; grid-template-rows: auto; } }

/* ================= round 5 ================= */
/* ---- the app's own mark: its own width and height, never squeezed by the flex row ---- */
.nav__logo img.appmark { width: 32px; height: 32px; flex: none; aspect-ratio: 1 / 1; object-fit: contain; }
.footer .nav__logo img.appmark { width: 40px; height: 40px; }
@media (max-width: 639px) { .nav__logo img.appmark { width: 28px; height: 28px; } }

/* ---- the theme toggle: 44 px, sun in light, moon in dark ---- */
.theme-btn { appearance: none; display: inline-grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: var(--r-btn); background: transparent; color: var(--ink); cursor: pointer; transition: background-color .15s linear; }
.theme-btn:hover { background: color-mix(in oklab, var(--ink) 9%, transparent); }
.theme-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.theme-btn svg { grid-area: 1 / 1; }
.theme-btn .ic-moon { display: none; }
html[data-theme="dark"] .theme-btn .ic-sun { display: none; }
html[data-theme="dark"] .theme-btn .ic-moon { display: block; }
header.nav .nav__actions { gap: var(--s-2); }
@media (max-width: 420px) {
  html header.nav.nav--centre:not(.is-open) .nav__actions { display: flex !important; margin-left: auto; }
  html header.nav.nav--centre:not(.is-open) .nav__actions .nav__lang { display: none; }
  html header.nav.nav--centre:not(.is-open) .nav__bar > .nav__toggle { margin-left: 0; }
}

/* ---- the catchphrase under the name ---- */
.hero__line { max-width: none; font-size: clamp(26px, 3.3vw, 46px); line-height: 1.15; letter-spacing: -0.02em; text-wrap: balance; }
.hero__line .red { color: var(--accent); }
@media (max-width: 639px) { .hero--mars h1.brand { font-size: 15vw; } .hero__line { font-size: 24px; } }
@media (min-width: 1024px) and (max-height: 820px) { .hero__line { font-size: 28px; } }

/* ---- closing: the numerals on the dark ground ---- */
.nums--close { display: grid; grid-template-columns: repeat(3, minmax(0, auto)); justify-content: start; gap: var(--s-5) 56px; margin: var(--s-5) 0; }
.nums--close > div span { display: block; color: var(--muted); font-size: 15px; line-height: 1.5; max-width: 16em; }
.nums--close .dnum { height: clamp(48px, 5vw, 72px); }
.footer .dnum circle.off, .ground-inverse .dnum circle.off { fill: rgb(255 255 255 / .14); }
@media (max-width: 639px) { .nums--close { grid-template-columns: minmax(0, 1fr); } .nums--close > div { display: grid; grid-template-columns: 96px minmax(0, 1fr); align-items: center; gap: var(--s-3); } .nums--close .dnum { height: 40px; margin: 0; } }

/* ---- spacing: sections hold their content (unslop pass 1), they are not sized by the screen ---- */
:root { --sp: clamp(48px, 5.6vw, 88px); }
main > section.section:not(#scale), footer.closing { height: auto !important; min-height: 0 !important; padding-block: var(--sp) !important; display: block; }
main > section.section:not(#scale) > .wrap, footer.closing > .wrap { height: auto !important; min-height: 0; flex: none; }
#library .grid, #connect .grid, #start .grid { grid-template-rows: none !important; flex: none; }
#library .grid > :last-child, #connect .grid > :last-child, #start .grid > :last-child { align-self: start; }
#compare { display: block; }
#compare > .wrap { display: block; }
#compare .cmp { display: block; }
.section-head { margin-bottom: var(--s-5); }
.section-head p { margin-top: var(--s-2); }
@media (min-width: 1024px) {
  #scale > .wrap { grid-template-rows: auto auto minmax(0, 1fr); }
  #scale .wall { grid-row: 1 / span 3; }
}
/* the catchphrase breaks between sentences, never inside one */
.hero__line > span.s { display: inline-block; }

/* dark: the mark's night tile keeps a hairline so its shape reads on the dark nav */
html[data-theme="dark"] .nav__logo img.appmark { border-radius: 8px; box-shadow: 0 0 0 1px rgb(255 255 255 / .16); }
/* phones and tablets: the theme button stays in the bar (the kit hides every action but the primary button there); the language switch lives in the open menu */
@media (max-width: 1023px) {
  html .nav:not(.is-open) .nav__actions > .theme-btn { display: inline-grid; }
  html header.nav.nav--centre.is-open .nav__actions { display: flex !important; }
  html header.nav.nav--centre.is-open .nav__actions .nav__lang { display: inline-flex; }
}
@media (max-width: 639px) { .hero--mars { padding-bottom: 60px; } }
@media (max-width: 639px) { .hero--mars h1.brand { font-size: 14vw; } .hero__line { font-size: 22px; } .hero--mars .hero-notice { margin-top: 0; } }

/* ---- dark theme: the same palette variables, inverted. The inverse bands go darker than the paper so they still read as bands. ---- */
html[data-theme="dark"] {
  color-scheme: dark;
  --p-bg: #1a1411; --p-surface: #231b18; --p-ink: #f1e8e3; --p-muted: #b8ada7;
  --p-accent: #f0694a; --p-accent-ink: #1a1411; --p-action: #c9341a; --p-action-ink: #fbf6f2;
  --p-inv-bg: #0b0706; --p-inv-surface: #17100e; --p-inv-ink: #f6f3ef; --p-inv-muted: #b3aba7;
  --p-inv-accent: #ef6a4c; --p-inv-accent-ink: #0b0706; --p-inv-action: #c9341a; --p-inv-action-ink: #fbf6f2;
}
html[data-theme="dark"] .dnum circle.off { fill: rgb(255 255 255 / .14); }
html[data-theme="dark"] .mx, html[data-theme="dark"] .term { box-shadow: 0 0 0 1px rgb(255 255 255 / .09), 0 30px 60px -30px rgb(0 0 0 / .7); }
html[data-theme="dark"] .btn--secondary { border-color: rgb(241 232 227 / .28); }

/* compare: note and source index */
.cmp__srcs { margin-top: var(--s-3, 12px); max-width: 70em; font-size: 14px; line-height: 1.7; color: var(--ink); }
.cmp__srcs summary { min-height: 44px; display: inline-flex; align-items: center; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.cmp__srcs summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.cmp__grp { margin-top: var(--s-3, 12px); }
.cmp__grp h3 { margin: 0 0 4px; font: 500 14px/1.5 var(--font-text); }
.cmp__grp ul { margin: 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 0 16px; }
.cmp__grp a { display: inline-flex; align-items: center; min-height: 32px; color: inherit; text-decoration: underline; text-underline-offset: 3px; }
@media (pointer: coarse) { .cmp__grp a { min-height: 44px; } }

/* dark: the dot grain on the tonal bands and the diagram panel */
html[data-theme="dark"] .tonal::before { background-image: radial-gradient(rgb(255 255 255 / .09) 1px, transparent 1.4px); }
html[data-theme="dark"] .dgp { background-image: radial-gradient(rgb(255 255 255 / .09) 1px, transparent 1.4px); }
/* reduced motion: nothing loops, so the pause button has nothing to pause */
@media (prefers-reduced-motion: reduce) { .pausebtn { display: none; } }
/* compare: the source index shows its state with a chevron */
.cmp__srcs summary { list-style: none; gap: 8px; }
.cmp__srcs summary::-webkit-details-marker { display: none; }
.cmp__srcs summary::before { content: ""; flex: none; width: 7px; height: 7px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(-45deg); transition: transform .2s ease; }
.cmp__srcs[open] summary::before { transform: rotate(45deg); }
@media (prefers-reduced-motion: reduce) { .cmp__srcs summary::before { transition: none; } }

/* video: the launch film, in the same frame as the screens and the terminal */
.vid { color: #f1e8e3; border-radius: var(--r-lg); overflow: hidden; background: #0b0706; box-shadow: 0 0 0 1px rgb(28 20 18 / .5), 0 30px 60px -30px rgb(28 20 18 / .55); }
.vid__el { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; background: #0b0706; }
.vid__el:focus-visible { outline: none; }
.vid:has(.vid__el:focus-visible) { outline: 2px solid var(--accent); outline-offset: 3px; }
.vid__el a { color: #f1e8e3; text-decoration: underline; text-underline-offset: 3px; }
html { scroll-padding-top: var(--nav); }
html[data-theme="dark"] .vid { box-shadow: 0 0 0 1px rgb(255 255 255 / .09), 0 30px 60px -30px rgb(0 0 0 / .7); }
