/* Home, below the landing. Loads after public.css. The hero and the landing keep their rules.
   Paper, ink, paper, ink, paper: two ink bands, one picture per section, less air between them.
   Every scene holds its final state in CSS; JS adds .drive and walks the states, and nothing here fades. */
.section { padding-top: clamp(37px, 4.6vw, 48px); }
.section > h2 { font-size: clamp(34px, 4.4vw, 46px); max-width: 14em; }
.ink { margin-top: clamp(37px, 4.6vw, 48px); padding: clamp(34px, 4vw, 42px) var(--gutter); background: var(--ink); color: var(--paper); }
.ink .more:hover { color: var(--paper); text-decoration-thickness: 3px; }
.ink code { color: inherit; }
.ink :focus-visible { outline-color: var(--paper); }
.closing { padding-top: clamp(37px, 4.6vw, 48px); }
main > .closing:last-child { padding-bottom: clamp(41px, 5vw, 52px); }
/* Two heads share a line with their intro: the headline left, the sentence right, on one baseline. */
.race, .price { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); column-gap: clamp(27px, 4vw, 52px); align-items: end; }
.race > h2, .price > h2 { grid-column: 1; }
.race > .intro, .price > .intro { grid-column: 2; margin: 0 0 6px; max-width: 30em; }
.race > .lanes, .price > .ruler, .price > .after-price { grid-column: 1 / -1; }

/* ---------- The race. Two lanes: the same portrait beside each list, and the lists are the track. ---------- */
.lanes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: clamp(27px, 4vw, 52px); margin-top: 40px; }
.lane { --t: 174px; display: grid; grid-template-columns: var(--t) minmax(0, 1fr); grid-template-rows: auto auto auto; column-gap: 24px; align-content: start; }
.lane-head { grid-column: 1 / -1; padding-bottom: 12px; font: 700 18px/1.35 var(--body); }
.lane-pic { grid-column: 1; grid-row: 2 / span 2; align-self: start; }
.lane-pic picture { display: none; }
.lane-pic img { width: var(--t); height: var(--t); image-rendering: pixelated; }
.pname { display: block; margin-top: 10px; font-size: 15px; line-height: 1.35; color: var(--ink-2); overflow-wrap: anywhere; }
.pname span { display: none; }
.lane ol { grid-column: 2; }
.lane li { display: grid; grid-template-columns: 2.2em 1fr; align-items: center; min-height: 58px; padding: 14px 0; background: var(--dots) 0 0 / 100% 2px no-repeat; }
.lane .n { font: 560 28px/1 var(--display); font-variation-settings: "ELGR" 1, "ELSH" 2; }
.without ol { color: var(--ink-2); }
.with li { font-size: clamp(22px, 1.9vw, 30px); line-height: 1.2; font-weight: 700; }
.with .n { font-size: 1.4em; }
.with .after { grid-column: 2; margin: 28px 0 0; max-width: 24em; }
.after a { display: inline-block; margin-top: 10px; }
.lane .added { display: inline-block; margin-top: 10px; padding: 2px 8px 3px; background: var(--ink); color: var(--paper); font: 700 15px/1.35 var(--body); }
/* Final state (no JS, reduced motion): the workaround arrives at step six, CrossUpload sits at File added. */
.without .lane-pic picture:nth-of-type(6), .with .lane-pic picture:nth-of-type(1) { display: block; }
.without .pname span:nth-child(6), .with .pname span:nth-child(1) { display: inline; }
/* Driven: the step is the number of rows already read. Each step is a different engraving, never a blend. */
.lane.drive .lane-pic picture { display: none; }
.lane.drive .pname span { display: none; }
.with.drive .lane-pic picture:nth-of-type(1) { display: block; }
.with.drive .pname span:nth-child(1) { display: inline; }
.lane.drive .added { display: none; }
.without.drive[data-d="0"] .lane-pic picture:nth-of-type(1), .without.drive[data-d="1"] .lane-pic picture:nth-of-type(1), .without.drive[data-d="2"] .lane-pic picture:nth-of-type(2), .without.drive[data-d="3"] .lane-pic picture:nth-of-type(3), .without.drive[data-d="4"] .lane-pic picture:nth-of-type(4), .without.drive[data-d="5"] .lane-pic picture:nth-of-type(5), .without.drive[data-d="6"] .lane-pic picture:nth-of-type(6) { display: block; }
.without.drive[data-d="0"] .pname span:nth-child(1), .without.drive[data-d="1"] .pname span:nth-child(1), .without.drive[data-d="2"] .pname span:nth-child(2), .without.drive[data-d="3"] .pname span:nth-child(3), .without.drive[data-d="4"] .pname span:nth-child(4), .without.drive[data-d="5"] .pname span:nth-child(5), .without.drive[data-d="6"] .pname span:nth-child(6) { display: inline; }
.with.drive[data-d="2"] .added { display: inline-block; }
.lane.drive li { color: var(--ink-2); }
.lane.drive li.on { color: var(--ink); }
.lane.drive li.on .n { background: var(--ink); color: var(--paper); width: 1.15em; text-align: center; }
.lane.drive li.now { background-color: transparent; }
@media (hover: hover) { .lane li:hover { color: var(--ink); } }

/* ---------- Three steps: paper on ink, the listing lights line by line. ---------- */
.dev.ink { row-gap: 32px; }
.ink .steps li { color: var(--paper); }
.ink .steps p { color: #c3c9d9; }
.ink .steps .n { align-self: start; width: 1.15em; height: 1.15em; line-height: 1.15em; text-align: center; }
.ink .steps li.on .n { background: var(--paper); color: var(--ink); }
@media (hover: hover) { .ink .steps li:hover .n { background: var(--paper); color: var(--ink); } }
.ink .snippet .hit { background: var(--paper); color: var(--ink); }
.ink .snippet .hit::before { background: var(--ink); color: var(--paper); }
.dev.drive .snippet .hit { background: transparent; color: var(--paper); }
.dev.drive .snippet .hit::before { visibility: hidden; }
.dev.drive .snippet .hit.lit { background: var(--paper); color: var(--ink); }
.dev.drive .snippet .hit.lit::before { visibility: visible; }
.dev.drive .snippet pre:focus-visible .hit { background: var(--paper); color: var(--ink); }
.dev.drive .snippet pre:focus-visible .hit::before { visibility: visible; }

/* ---------- The wall: the documents themselves, at their own size, each one a link. ---------- */
.docs { display: flex; flex-wrap: wrap; gap: 40px 32px; margin-top: 40px; }
.doc a { display: block; text-decoration: none; }
.doc a:hover { color: inherit; }
/* A phone narrower than the car trims the door side and keeps the damage. Pictures are never scaled to fit. */
.doc { min-width: 0; max-width: 100%; }
.doc-pic { display: block; min-height: 200px; max-width: 100%; overflow: hidden; }
.doc-pic picture { display: flex; justify-content: flex-end; }
.doc-pic img { display: block; flex: none; max-width: none; width: auto; height: auto; image-rendering: pixelated; }
.doc-name { display: block; margin-top: 12px; font: 560 clamp(26px, 2.2vw, 34px)/1.05 var(--display); font-variation-settings: "ELGR" 1, "ELSH" 2; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: .13em; }
.doc a:hover .doc-name, .doc a:focus-visible .doc-name { font-variation-settings: "ELGR" 2, "ELSH" 8; text-decoration-thickness: 3px; }
/* The arrival: a document comes in through the ordered screen, a quarter, a half, three quarters, whole. */
/* The screen is paper laid over the picture, not a mask: a mask repaints the whole image on every step and stalls the scroll. */
.docs.drive .doc[data-q="0"] .doc-pic, .docs.drive .doc[data-q="1"] .doc-pic, .docs.drive .doc[data-q="2"] .doc-pic { position: relative; width: fit-content; }
.docs.drive .doc[data-q="0"] .doc-pic::after, .docs.drive .doc[data-q="1"] .doc-pic::after, .docs.drive .doc[data-q="2"] .doc-pic::after { content: ""; position: absolute; inset: 0; background-size: 4px 4px; background-repeat: repeat; }
.docs.drive .doc[data-q="0"] .doc-pic::after { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='4' height='4' viewBox='0 0 2 2' shape-rendering='crispEdges'%3E%3Cpath fill='%23f3f6f7' d='M1 0h1v1H1zM0 1h2v1H0z'/%3E%3C/svg%3E"); }
.docs.drive .doc[data-q="1"] .doc-pic::after { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='4' height='4' viewBox='0 0 2 2' shape-rendering='crispEdges'%3E%3Cpath fill='%23f3f6f7' d='M1 0h1v1H1zM0 1h1v1H0z'/%3E%3C/svg%3E"); }
.docs.drive .doc[data-q="2"] .doc-pic::after { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='4' height='4' viewBox='0 0 2 2' shape-rendering='crispEdges'%3E%3Cpath fill='%23f3f6f7' d='M1 1h1v1H1z'/%3E%3C/svg%3E"); }
.docs.drive .doc[data-q="0"] .doc-name, .docs.drive .doc[data-q="1"] .doc-name { color: var(--ink-2); }

/* ---------- The gates: five rules a file passes on its way down, one file that does not. ---------- */
.sec.ink { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); column-gap: clamp(27px, 4vw, 52px); }
.sec-text p { margin-top: 20px; max-width: 30em; }
.gates { --rail: 136px; position: relative; padding: 64px 0 0 calc(var(--rail) + 24px); align-self: start; }
.rail { position: absolute; left: 0; top: 0; bottom: 0; width: var(--rail); }
.file { position: absolute; left: 0; top: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; width: max-content; max-width: var(--rail); font-size: 13px; line-height: 1.3; }
.file.bad { left: 68px; }
.file.bad.stop, .gates:not(.drive) .file.bad { color: var(--laser); }
.file.done > span { visibility: hidden; }
.file.bad > span { visibility: hidden; } /* named only once it is caught; before that the two labels would cross */
.file.bad.stop > span, .gates:not(.drive) .file.bad > span { visibility: visible; }
/* Without JS the bad file stands where the third rule would stop it; with JS the rail measures the rows. */
.gates:not(.drive) .file.bad { top: 196px; }
.gates:not(.drive) .file.bad .x { display: block; }
.glyph { position: relative; display: block; width: 40px; height: 52px; background: currentColor; clip-path: polygon(0 0, 26px 0, 40px 14px, 40px 52px, 0 52px); }
.glyph::after { content: ""; position: absolute; left: 2px; top: 2px; width: 36px; height: 48px; background: var(--ink); clip-path: polygon(0 0, 23px 0, 36px 13px, 36px 48px, 0 48px); }
.file.done .glyph::after { display: none; }
.file.bad .glyph::after { background: var(--ink); }
.x { display: none; position: absolute; left: 18px; top: 24px; width: 3px; height: 3px; background: var(--laser); box-shadow: -3px -3px 0 var(--laser), 3px -3px 0 var(--laser), -3px 3px 0 var(--laser), 3px 3px 0 var(--laser), -6px -6px 0 var(--laser), 6px -6px 0 var(--laser), -6px 6px 0 var(--laser), 6px 6px 0 var(--laser); z-index: 1; }
.file.stop .x { display: block; }
.file span { overflow-wrap: anywhere; }
.gates .rows { align-self: auto; }
.gates .rows li { margin-left: calc(-1 * (var(--rail) + 24px)); padding: 16px 0 16px calc(var(--rail) + 24px); font-size: clamp(19px, 1.6vw, 23px); line-height: 1.25; color: #c3c9d9; background: var(--dots) 0 0 / 100% 2px no-repeat; }
.gates .rows li.on, html:not(.js) .gates .rows li, .gates:not(.drive) .rows li { color: var(--paper); }
@media (hover: hover) { .gates .rows li:hover { color: var(--paper); } }
.delivered { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; min-height: 92px; margin-left: calc(-1 * (var(--rail) + 24px)); padding: 16px 0 0 calc(var(--rail) + 24px); background: var(--dots) 0 0 / 100% 2px no-repeat; font-size: 15px; }
.delivered strong { background: var(--paper); color: var(--ink); padding: 4px 10px 5px; white-space: nowrap; }
/* Final state: the good file is the delivery copy, solid; the bad file never got past the third rule. */
.gates:not(.drive) .file.good { visibility: hidden; }
.gates.drive .delivered { visibility: hidden; }
.gates.drive.done .delivered { visibility: visible; }
.gates.drive .file.good { visibility: visible; }

/* ---------- Pricing: four plans on the quantization ruler, volume as density. ---------- */
.ruler { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); column-gap: clamp(20px, 2.4vw, 40px); margin-top: 36px; }
.ruler li { min-width: 0; }
.ruler b { display: block; font: 560 clamp(30px, 2.8vw, 44px)/1 var(--display); font-variation-settings: "ELGR" 1, "ELSH" 2; }
.ruler .pl-price { display: block; margin-top: 8px; font-weight: 700; }
.ruler .band { display: block; height: 80px; margin: 16px 0 14px; image-rendering: pixelated; background-repeat: repeat; }
.ruler li:nth-child(1) .band { background-image: var(--b1); }
.ruler li:nth-child(2) .band { background-image: var(--b2); }
.ruler li:nth-child(3) .band { background-image: var(--b3); }
.ruler li:nth-child(4) .band { background-image: var(--b4); }
.ruler span { display: block; font-size: 16px; line-height: 1.4; }
.ruler span + span { margin-top: 4px; }
.ruler .pl-price + .band + span { font-weight: 700; font-size: 17px; }
.after-price { margin-top: 28px; }

/* ---------- Narrower screens ---------- */
@media (max-width: 1199px) {
  .sec.ink { grid-template-columns: minmax(0, 1fr); row-gap: 28px; }
  .gates { --rail: 124px; }
}
@media (max-width: 1023px) {
  .race, .price { display: block; }
  .race > .intro, .price > .intro { margin: 20px 0 0; }
  .lanes { grid-template-columns: minmax(0, 1fr); row-gap: 48px; margin-top: 36px; }
  .lane { --t: 116px; column-gap: 16px; }
  /* Phone: the portrait keeps pace with the rows beneath it, and never takes more than a third of the screen. */
  .lane-pic { position: sticky; top: 12px; }
  .with li { font-size: 20px; }
  .with .after { margin-top: 20px; }
}
@media (max-width: 720px) {
  .ruler { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 36px; column-gap: 24px; }
  .ruler .band { height: 56px; }
  .gates { --rail: 100px; padding-top: 48px; }
  .file.bad { left: 52px; }
  .file.good > span { display: none; } /* the delivered row names it; two labels in a 100 px rail would collide */
  .glyph { width: 32px; height: 42px; clip-path: polygon(0 0, 21px 0, 32px 11px, 32px 42px, 0 42px); }
  .glyph::after { width: 28px; height: 38px; clip-path: polygon(0 0, 18px 0, 28px 10px, 28px 38px, 0 38px); }
  .x { left: 14px; top: 19px; }
  .file { font-size: 12px; }
  .gates .rows li { font-size: 18px; }
}
@media (max-width: 560px) {
  .docs { gap: 32px 24px; margin-top: 32px; }
  .lane li { min-height: 52px; padding: 12px 0; }
  .lane .n { font-size: 24px; }
  .pname { font-size: 13px; }
}

/* ---------- Clips ---------- */
.watch { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); column-gap: clamp(27px, 4vw, 52px); align-items: end; }
.watch > h2 { grid-column: 1; }
.watch > .intro { grid-column: 2; margin: 0 0 6px; max-width: 30em; }
.watch > .clips, .watch > .after-price { grid-column: 1 / -1; }
@media (max-width: 1023px) { .watch { display: block; } .watch > .intro { margin: 20px 0 0; } }

/* ---------- Hero kicker: what it is, for whom, in one line above the headline. ---------- */
.kicker { margin-bottom: 14px; font: 700 16px/1.35 var(--body); color: var(--ink-2); }
.kicker a { color: inherit; }
.hero .lead { font-size: 18px; }
.hero .fine code { font-size: .95em; }

/* ---------- Open source: paper band, command block on ink. ---------- */
.oss-body { max-width: 46em; }
.oss .intro { margin-top: 16px; }
.oss-cmd { margin: 24px 0 16px; padding: 18px 20px; background: var(--ink); color: var(--paper); overflow-x: auto; font-size: 15px; line-height: 1.55; }
.oss-cmd code { color: inherit; white-space: pre; }
/* Phones: the one-paragraph explanation sits right under the headline, before the portrait. */
@media (max-width: 1023px) { .hero .lead { order: 1; margin-top: 16px; } }

/* ---------- The walkthrough video in "See it in action". ---------- */
.watch .walk, .watch .after-price { grid-column: 1 / -1; }
.watch .walk { margin: 28px 0 0; max-width: 1160px; }
.watch .walk video { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; background: var(--ink); box-shadow: 0 0 0 2px var(--ink); }
.watch .walk figcaption { margin-top: 10px; }
.race > .race-video { grid-column: 1 / -1; margin: 28px 0 0; max-width: 1160px; }
.race-video video { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; background: var(--ink); box-shadow: 0 0 0 2px var(--ink); }
.race-video figcaption { margin-top: 10px; }

/* Hero: copy on the left, the 20-second film on the right, above the fold. */
.hero { grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); grid-template-rows: auto; grid-template-areas: "copy video"; align-items: center; padding-bottom: 40px; }
.hero h1 { font-size: clamp(40px, 9cqi, 88px); }
.hero-video { grid-area: video; margin: 0; min-width: 0; }
.hero-video video { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; background: var(--ink); box-shadow: 0 0 0 2px var(--ink); }
.hero-video figcaption { margin-top: 10px; }
@media (max-width: 1023px) {
  .hero { align-items: stretch; }
  .hero-video { order: 2; margin-top: 24px; }
  .hero .lead { order: 3; margin-top: 24px; }
}
