/* site.css — the homepage and /work ("Brief | Answer"); the case story (case/card-matcher.html) links it
   for .page, .nav, .h1, .lede and .foot and keeps its own story styles inline. The tokens and .brand .btn .tick .said come
   from tokens.css, which all three pages link first; a locale's fonts come after both, in the I18N:HEAD
   block (the case story, English only, has its own font link). The homepage is ported from the approved mockup (mock9.mjs, the v-home view); /work, which
   the mockup has no view of, reuses its nav, results rows, closing and footer and adds a row list of
   the demos on the same 7:5 columns. No uppercase labels, no gradients, no shadows, no entrance or
   scroll motion. */
html{scroll-padding-top:16px;}
.page{max-width:1240px;margin:0 auto;padding:0 32px;}

/* ---------- top bar ---------- */
.nav{display:flex;align-items:center;gap:26px;padding:18px 0;border-bottom:1px solid var(--rule);}
.nav .who{color:var(--muted);font-size:15px;white-space:nowrap;}
.nav nav{margin-inline-start:auto;display:flex;align-items:center;gap:24px;font-size:15px;}
.nav nav > a:not(.btn){text-decoration:none;}
.nav nav > a:not(.btn):hover,.nav nav > a[aria-current=page]{text-decoration:underline;text-underline-offset:4px;}

/* the language menu is langMenu() in lib/i18n.mjs (<details class="lang">), in the .langm look */
.lang{position:relative;}
.lang summary{list-style:none;cursor:pointer;display:inline-flex;align-items:center;min-height:32px;}
.lang summary::-webkit-details-marker{display:none;}
.lang summary::after{content:"";display:inline-block;width:6px;height:6px;margin-inline-start:8px;border-inline-end:1.5px solid currentColor;border-bottom:1.5px solid currentColor;transform:translateY(-2px) rotate(45deg);}
.lang ul{position:absolute;inset-inline-end:0;z-index:30;margin-top:6px;list-style:none;display:grid;gap:2px;min-width:150px;padding:6px;background:var(--surface);border:1px solid var(--ink);border-radius:8px;font-size:14.5px;}
.lang li a{display:block;padding:6px 10px;color:var(--ink);text-decoration:none;border-radius:4px;}
.lang li a:hover{background:var(--paper);}

/* ---------- hero: the claim on the left, the working answer on the right ---------- */
.hero{padding:44px 0 70px;}
.h1{font-family:var(--cond);font-weight:600;font-size:clamp(2.7rem,4.6vw,4.1rem);line-height:1;letter-spacing:-.015em;text-wrap:balance;}
.h1 span{display:block;}
.h1 .then{font-weight:500;color:var(--faint);}
/* scripts with no condensed cut: the locale's --cond already starts with its Plex Sans (or Noto) cut */
.h1:lang(ar),.h1:lang(ja),.h1:lang(ko),.h1:lang(zh-Hans){line-height:1.3;letter-spacing:0;font-size:clamp(2.3rem,3.9vw,3.4rem);}
.hero .h1{margin-bottom:22px;}
.hero-grid{display:grid;grid-template-columns:minmax(0,4.6fr) minmax(0,7.4fr);gap:56px;align-items:start;}
.lede{font-size:1.1rem;line-height:1.5;max-width:44ch;}
.lede b{font-weight:600;}
.actions{display:flex;flex-wrap:wrap;align-items:center;gap:12px;margin-top:26px;}
.avail{margin-top:14px;font-size:.95rem;color:var(--muted);}
.verify a,.next a,.qa a,.more a,.foot .lab a,.brief .fallback a,.brief .after a{text-underline-offset:4px;}
.claims{list-style:none;margin-top:26px;border-top:1px solid var(--rule);}
.claims li{display:flex;align-items:center;gap:12px;padding:9px 0;border-bottom:1px solid var(--rule-2);font-weight:600;}
.verify{margin-top:10px;font-size:.93rem;color:var(--muted);}

.answer .intro{font-size:.98rem;color:var(--muted);margin-bottom:10px;}
.answer .intro i{display:inline-block;width:8px;height:8px;border-radius:50%;margin-inline-end:7px;background:var(--ink);}
.answer .intro i.case{background:var(--ok);}
/* one row where the tabs fit; where they do not (601 to 684 px, 901 to 1165 px), a second row, never a sideways scroll */
.tabs{display:flex;flex-wrap:wrap;gap:6px;margin-bottom:12px;}
.tabs button{flex:none;display:inline-flex;align-items:center;gap:7px;min-height:36px;font:500 13.5px/1 var(--sans);color:var(--ink);background:transparent;border:1px solid var(--rule);border-radius:6px;padding:9px 9px;cursor:pointer;white-space:nowrap;}
.tabs button:hover{border-color:var(--ink);}
.tabs button[aria-selected=true]{background:var(--ink);border-color:var(--ink);color:#fff;}
.tabs i{width:8px;height:8px;border-radius:50%;background:var(--ink);}
.tabs i.case{background:var(--ok);}
.tabs button[aria-selected=true] i{background:#fff;}
.tabs button[aria-selected=true] i.case{background:#7FD3A7;}
.vp{border:1px solid var(--ink);border-radius:12px;overflow:hidden;background:var(--surface);}
.vp-bar{display:flex;align-items:center;gap:10px;padding:9px 12px;border-bottom:1px solid var(--rule);font-size:13.5px;}
.vp-bar .state{font-weight:600;font-size:12.5px;padding:3px 7px;border-radius:4px;background:var(--rule-2);color:var(--ink);white-space:nowrap;}
.vp-bar .state.live{background:var(--ok-tint);color:var(--ok);}
.vp-bar .url{font-family:var(--mono);font-size:12.5px;color:var(--muted);flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.vp-bar a{text-underline-offset:3px;white-space:nowrap;}
.vp-stage{position:relative;aspect-ratio:16/10;overflow:hidden;background:var(--rule-2);}
/* the poster is a left-to-right screenshot: anchored left on every page, right-to-left ones too */
.vp-stage img{position:absolute;top:0;left:0;width:138%;max-width:none;height:auto;}
.vp-stage iframe{position:absolute;top:0;left:0;width:125%;height:125%;border:0;transform:scale(.8);transform-origin:0 0;background:#fff;}
.vp-stage .run{position:absolute;inset-inline-start:12px;bottom:12px;}
/* once the demo has loaded (site.js goLive), the poster and "Run it live" step aside; stopLive brings them back */
.vp-stage.on picture,.vp-stage.on .run{display:none;}
.panel[hidden]{display:none;}
/* a short fade answers the visitor's pick; nothing moves on first paint (site.js adds .picked) */
.answer.picked .panel{animation:swap .18s ease-out;}
@keyframes swap{from{opacity:0;}to{opacity:1;}}
/* "Built for" and "What it does" in a two-column list; the kind label sits under the second column,
   outside the list (a subgrid shares the label column's width) */
.capbox{display:grid;grid-template-columns:auto minmax(0,1fr);column-gap:14px;margin-top:14px;font-size:.95rem;}
.cap{grid-column:1/-1;display:grid;grid-template-columns:subgrid;row-gap:4px;}
.kindline{grid-column:2;margin-top:4px;}
.cap dt{font-weight:600;color:var(--muted);}
.cap dd b{font-weight:600;}
.kind{display:inline-flex;align-items:center;gap:6px;font-size:.84rem;font-weight:500;padding:3px 8px;border-radius:4px;background:var(--rule-2);color:var(--ink);}
.kind.case{background:var(--ok-tint);color:var(--ok);}

/* ---------- sections ---------- */
.sec{padding:76px 0 0;}
.sec > h2,.closing h2{font-family:var(--cond);font-weight:600;font-size:clamp(1.9rem,3.6vw,2.7rem);line-height:1.05;letter-spacing:-.01em;}
.sec > .sub{color:var(--muted);margin-top:8px;max-width:62ch;}
.sec h2:lang(ar),.sec h2:lang(ja),.sec h2:lang(ko),.sec h2:lang(zh-Hans),.closing h2:lang(ar),.closing h2:lang(ja),.closing h2:lang(ko),.closing h2:lang(zh-Hans){line-height:1.3;letter-spacing:0;}

/* client results: the client's problem, the result in words, what I did; the client's words beside it */
.ledger{list-style:none;margin-top:28px;border-top:1px solid var(--ink);}
.ledger > li{display:grid;grid-template-columns:minmax(0,7fr) minmax(0,5fr);gap:16px 56px;padding:30px 0;border-bottom:1px solid var(--rule);align-items:start;}
.what .p{font-family:var(--cond);font-size:1.5rem;font-weight:600;line-height:1.2;max-width:30ch;}
.what .r{display:flex;gap:10px;align-items:flex-start;margin-top:12px;font-weight:600;}
.what .r .tick{margin-top:5px;}
.what .d{margin-top:6px;}
.what .f{margin-top:2px;color:var(--muted);font-size:.93rem;}
.tags{display:flex;flex-wrap:wrap;gap:6px;margin-top:12px;}
.ledger .q{padding-inline-start:18px;border-inline-start:2px solid var(--ink);}
.ledger .q blockquote{font-size:1.14rem;line-height:1.45;}
/* a right-to-left page: the client's English words (dir="ltr", ruling R17) align to the rule, which
   sits on the right, so the quote and its source read as one block */
[dir=rtl] .ledger .q blockquote{text-align:right;}
.ledger .q figcaption{margin-top:8px;font-size:.86rem;line-height:1.4;color:var(--muted);}
.ledger details{margin-top:14px;font-size:.95rem;}
.ledger summary{cursor:pointer;display:inline-block;text-decoration:underline;text-underline-offset:4px;text-decoration-color:var(--faint);}
.ledger summary:hover{text-decoration-color:var(--ink);}
.ledger details ul{list-style:none;margin-top:12px;display:grid;gap:8px;max-width:76ch;}
.ledger details li{display:flex;gap:10px;align-items:flex-start;}
.ledger details .tick{margin-top:5px;}

/* send your brief */
.brief{display:grid;grid-template-columns:minmax(0,7fr) minmax(0,5fr);gap:56px;margin-top:28px;align-items:start;}
.sheet{display:grid;gap:18px;background:var(--surface);border:1px solid var(--ink);border-radius:12px;padding:28px;}
.sheet label{display:grid;gap:7px;font-size:.95rem;font-weight:500;}
.sheet input,.sheet textarea{font:inherit;font-weight:400;color:var(--ink);background:var(--paper);border:1px solid var(--faint);border-radius:8px;padding:12px 14px;width:100%;}
.sheet textarea{min-height:150px;resize:vertical;}
.sheet ::placeholder{color:var(--faint);opacity:1;}
.sheet .send{display:flex;flex-wrap:wrap;gap:12px 18px;align-items:center;}
.sheet .after{font-size:.95rem;color:var(--muted);}
.sheet .fallback{display:grid;gap:10px;justify-items:start;padding-top:16px;border-top:1px solid var(--rule-2);font-size:.95rem;}
.sheet .fallback[hidden]{display:none;}
.next h3{font-size:1.05rem;font-weight:600;}
.next ol{list-style:none;margin-top:14px;display:grid;gap:14px;counter-reset:step;}
.next li{display:grid;grid-template-columns:2.2rem minmax(0,1fr);}
.next li::before{counter-increment:step;content:counter(step);font-weight:600;color:var(--faint);font-variant-numeric:tabular-nums;}
.next > p{margin-top:22px;color:var(--muted);}

/* before you write */
.qa{margin-top:24px;border-top:1px solid var(--ink);}
.qa > div{display:grid;grid-template-columns:minmax(0,5fr) minmax(0,7fr);gap:6px 56px;padding:20px 0;border-bottom:1px solid var(--rule);}
.qa dt{font-weight:600;font-size:1.08rem;}
.qa dd{max-width:60ch;}

/* more work, by the problem it solves */
.groups{list-style:none;margin-top:24px;border-top:1px solid var(--ink);}
.groups > li{display:grid;grid-template-columns:minmax(0,5fr) minmax(0,7fr);gap:10px 56px;padding:22px 0;border-bottom:1px solid var(--rule);align-items:start;}
.groups h3{font-family:var(--cond);font-size:1.4rem;font-weight:600;line-height:1.2;max-width:22ch;}
/* the group title opens that group's section on /work */
.groups h3 a{text-decoration:underline;text-decoration-color:var(--rule);text-decoration-thickness:1px;text-underline-offset:5px;}
.groups h3 a:hover{text-decoration-color:var(--ink);}
.groups h3:lang(ar),.groups h3:lang(ja),.groups h3:lang(ko),.groups h3:lang(zh-Hans),.grp h3:lang(ar),.grp h3:lang(ja),.grp h3:lang(ko),.grp h3:lang(zh-Hans),.what .p:lang(ar),.what .p:lang(ja),.what .p:lang(ko),.what .p:lang(zh-Hans){line-height:1.4;}
.groups .gt p{margin-top:6px;color:var(--muted);font-size:.95rem;}
.groups .gl{display:grid;gap:10px;}
.groups .lead{display:grid;gap:1px;text-decoration:none;}
.groups .lead b{font-weight:600;text-decoration:underline;text-decoration-color:var(--faint);text-underline-offset:4px;}
.groups .lead:hover b{text-decoration-color:var(--ink);}
.groups .lead span{color:var(--muted);font-size:.95rem;}
.groups .also{color:var(--muted);font-size:.93rem;margin-top:2px;}
/* "See all the work", then the fleet probe line (site.js; its strings are the fleet.* data-* attributes) */
.more{display:flex;flex-wrap:wrap;align-items:center;gap:8px 28px;margin-top:20px;color:var(--muted);font-size:.95rem;}
.more a{color:var(--ink);}
.more b{font-weight:600;color:var(--ink);}

/* ---------- /work: the title, the counts and the profile facts; the results rows above; the demos ----------
   The demo rows share the results rows' 7:5 columns, so the right column reads as one line down the
   page: the client's words beside a result, who it was built for beside a demo. */
.head{display:grid;grid-template-columns:minmax(0,7fr) minmax(0,5fr);gap:32px 56px;align-items:end;padding:44px 0 6px;}
.head .lede{margin-top:20px;max-width:52ch;}
.tally{margin-top:16px;color:var(--muted);}
.tally b{font-weight:600;color:var(--ink);}
.head .claims{margin-top:0;}
/* a result's own links: its case story, its anonymized proof */
.ledger .go{display:flex;flex-wrap:wrap;gap:4px 24px;margin-top:12px;font-size:.95rem;}
.ledger .go a{text-underline-offset:4px;}
/* the menu of groups: each title with its count */
.jump ul{list-style:none;display:grid;grid-template-columns:repeat(auto-fill,minmax(min(100%,340px),1fr));column-gap:56px;margin-top:24px;}
.jump a{display:flex;justify-content:space-between;align-items:baseline;gap:16px;padding:10px 0;border-bottom:1px solid var(--rule-2);text-decoration:none;}
.jump a span:first-child{text-decoration:underline;text-decoration-color:var(--faint);text-underline-offset:4px;}
.jump a:hover span:first-child{text-decoration-color:var(--ink);}
.jump .n{flex:none;color:var(--muted);font-size:.93rem;font-variant-numeric:tabular-nums;}
/* one section per group */
.grp{margin-top:64px;}
.grp h3{font-family:var(--cond);font-size:clamp(1.45rem,2.3vw,1.8rem);font-weight:600;line-height:1.15;max-width:30ch;}
.grp .gd{margin-top:6px;color:var(--muted);max-width:62ch;}
.rows{list-style:none;margin-top:20px;border-top:1px solid var(--ink);}
.demo{display:grid;grid-template-columns:minmax(0,7fr) minmax(0,5fr);gap:10px 56px;padding:18px 0 20px;border-bottom:1px solid var(--rule);align-items:start;}
/* the ledger number, then the title and the problem as one link to the framed page */
.demo .dm{display:grid;grid-template-columns:3.6rem minmax(0,1fr);align-items:baseline;}
.demo .w{color:var(--faint);font-size:.86rem;font-variant-numeric:tabular-nums;}
.demo .name{display:grid;gap:3px;text-decoration:none;}
.demo .name b{font-weight:600;text-decoration:underline;text-decoration-color:var(--faint);text-underline-offset:4px;}
.demo .name:hover b{text-decoration-color:var(--ink);}
.demo .name span{color:var(--muted);font-size:.95rem;max-width:68ch;}
.demo .dx{display:grid;gap:3px;justify-items:start;font-size:.93rem;color:var(--muted);}
.demo .dx b{font-weight:600;}
.demo .stack{color:var(--faint);}
.demo .code{margin-top:2px;color:var(--ink);text-underline-offset:4px;}

.closing{display:flex;flex-wrap:wrap;gap:14px 20px;align-items:center;margin-top:84px;padding:44px 0;border-top:1px solid var(--ink);}
.closing h2{flex:1 1 320px;}
.foot{display:flex;flex-wrap:wrap;gap:10px 26px;align-items:center;padding:22px 0 60px;border-top:1px solid var(--rule);font-size:.93rem;color:var(--muted);}
.foot a{text-decoration:none;}
.foot a:hover{text-decoration:underline;text-underline-offset:4px;}
.foot .lab{flex:1 1 100%;}
.foot .lab a{text-decoration:underline;text-decoration-color:var(--rule);}
.foot .end{margin-inline-start:auto;}
.sticky{display:none;}

@media (max-width:1100px){.nav .who{display:none;}}
/* 900 px and below: one column, and every control is a 44 px target */
@media (max-width:900px){
  .page{padding:0 20px;}
  .hero{padding:32px 0 52px;}
  .hero-grid,.brief{grid-template-columns:minmax(0,1fr);gap:40px;}
  .actions .btn{flex:1 1 100%;min-height:48px;}
  .ledger > li{grid-template-columns:minmax(0,1fr);gap:18px;}
  .qa > div{grid-template-columns:minmax(0,1fr);}
  .groups > li{grid-template-columns:minmax(0,1fr);}
  .head{grid-template-columns:minmax(0,1fr);gap:28px;padding-top:32px;}
  .demo{grid-template-columns:minmax(0,1fr);gap:8px;}
  .demo .dm{grid-template-columns:3.2rem minmax(0,1fr);}
  .demo .dx{padding-inline-start:3.2rem;}
  .grp{margin-top:52px;}
  .nav nav > a{display:none;}
  .lang summary,.lang li a{display:flex;align-items:center;min-height:44px;}
  .tabs{padding-bottom:4px;}
  .tabs button{min-height:44px;}
  .vp-bar{padding-block:0;}
  .vp-bar a,.ledger summary,.more > a,.foot > a,.ledger .go a,.demo .code,.groups h3 a{display:inline-flex;align-items:center;min-height:44px;gap:.3em;}
  /* the footer links: an 18 px padding makes even "X" (9 px) a 44 px box, and an equal negative margin
     takes it back, so in the row each link is as wide as its word: the space between two words is the
     36 px column gap whatever their length, and a link that starts a line starts on the column edge.
     The gap is twice the padding, so two boxes meet and never overlap; a box at a line's start or end
     reaches 18 px into the page's 20 px side padding. */
  .foot{column-gap:36px;}
  .foot > a{min-width:44px;padding-inline:18px;margin-inline:-18px;justify-content:center;}
  .jump a{min-height:44px;align-items:center;}
  /* a link inside a sentence: padding on an inline box grows the tap area to 44 px, not the line */
  .verify a,.foot .lab a,.next > p a,.sheet .fallback a,.sheet .after a{padding-block:13px;}
  .demo .name{padding-block:4px;min-height:44px;}
  .vp-stage .run,.sheet .fallback .btn{min-height:44px;}
  .nav .brand{min-height:44px;}
  .groups .lead{padding-block:4px;}
  .vp-stage img{width:100%;}
  .sec{padding-top:60px;}
}
/* 600 px and below: the phone poster (build.mjs, the same breakpoint) in a 4:5 stage, and the live
   demo at the stage's own width */
@media (max-width:600px){
  .vp-stage{aspect-ratio:4/5;}
  .vp-stage iframe{width:100%;height:100%;transform:none;}
  /* the hero tabs: two columns, every tab on screen, nothing scrolls sideways. A label wraps inside its
     tab, hyphenated where the page's language allows and broken as a last resort, so a translation 1.3
     times the English still fits at 320 px. With an odd count the first tab takes the whole row, so no
     row holds one lonely tab: today the first demo on top, then two demos, then the two client
     projects side by side. */
  .tabs{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));overflow-x:visible;}
  .tabs button{white-space:normal;text-align:start;line-height:1.25;overflow-wrap:anywhere;-webkit-hyphens:auto;hyphens:auto;}
  .tabs button:first-child:nth-last-child(odd){grid-column:1/-1;}
  .tabs i{flex:none;}
}
/* 900 px and below, where the nav hides its "Send your brief": a bar once the hero's button has left
   the screen, hidden while the form or the closing section shows (site.js) */
@media (max-width:900px){
  body.past-cta:not(.at-form) .sticky{display:flex;position:fixed;inset-inline:12px;bottom:12px;z-index:90;min-height:50px;}
  .page{padding-bottom:84px;}
}
@media (max-width:640px){
  .sheet{padding:20px 16px;}
}
@media (prefers-reduced-motion:reduce){.answer.picked .panel{animation:none;}}
