/* moduleone.ai/os, round 3 — the grid, the additions to the v8 opening, overrides of the components. Loaded last.
   plan-runda-3.md §1, §2.5, §3.1, §4.1. Nothing here holds a page color outside the tokens of site.css. */

/* ── 1. tokens: one column with the measure of the headline, on the camera's axis; a stage of 212 px under the bar ── */
:root{
  --wrap:1328px;
  --gut:clamp(20px,3.4vw,80px);
  --uk-wrap:var(--wrap); --uk-gut:var(--gut);
  --hero-fs:clamp(2.4rem,5.4vw,4.6rem);           /* the same formula as .title h1 in hero.css */
  --col:calc(var(--hero-fs)*11.06);               /* the measure of the headline: 814 px at 1440 */
  --demo-zone:212px;                              /* the stage under the bar, where the demo plays */
  --uk-land:calc(var(--band) + var(--demo-zone)); /* 250: a chapter lands here and the contents stick here */
  --uk-chap:var(--demo-zone);                    /* a chapter lands under the demo stage; less folds the case away */
  --uk-sub:50px;
  --uk-lead:0px;
  --v9-hero-pad:var(--demo-zone);                 /* "Works with" → README.md */
  --v9-end:120px;
  --uk-toc:196px; --dm-gutter:24px;               /* the contents and the gutter of the progress line */
  --uk-gap:16px;
}
@media (max-width:1345px){:root{--uk-toc:176px;--uk-gap:16px}}
@media (max-width:899px){:root{--demo-zone:38px;--uk-land:calc(var(--band) + 38px + var(--uk-strip) + 24px);--uk-chap:68px;--uk-sub:40px;--v9-hero-pad:40px}}
@media (max-width:699px){:root{--uk-chap:56px;--uk-sub:36px;--v9-end:80px}}

.zk{margin-top:0}
.uk-lay{padding-bottom:var(--v9-end)}
.uk-h{max-width:none}
.uk-hd{display:block}
.uk-hd .uk-p{max-width:41rem}
.uk-ql{max-width:none}

/* ── 2. three layouts ── */
/* A, from 1346 px: contents in the left margin, the column on the camera's axis, the right margin empty (cards from other Macs) */
@media (min-width:1346px){
  .uk-lay{grid-template-columns:minmax(0,1fr) var(--col) minmax(0,1fr);column-gap:0}
  .uk-lay>.uk-toc{grid-column:1;justify-self:start}
  .uk-lay>.uk-main{grid-column:2}
}
/* B, 900–1345 px: contents, then the column 40 px after it; short chapter names */
@media (min-width:900px) and (max-width:1345px){
  .uk-lay{grid-template-columns:calc(var(--uk-toc) + var(--dm-gutter)) minmax(0,1fr);column-gap:var(--uk-gap)}
  .uk-main{max-width:814px}
  .uk-t{display:none}.uk-s{display:inline}
}
@media (min-width:1346px){.uk-t{display:inline}.uk-s{display:none}}
/* A and B: the contents are always unfolded (the progress line needs all nine items); the list ends where the gutter starts */
@media (min-width:900px){
  .uk-toc{box-sizing:content-box;width:calc(var(--uk-toc) + var(--dm-gutter));margin:-4px 0 -4px -10px;padding:4px 0 4px 10px}
  .uk-toc-f,.uk-toc-l{width:var(--uk-toc)}
  .uk-toc-c>a{margin-inline:-10px 0}
  .uk-toc-subs{grid-template-rows:1fr;transition:none}
  .uk-toc-subs ol{visibility:visible;transition:none}
  .uk-toc-subs li:last-child{padding-bottom:4px}
}
/* C, up to 899 px: the strip */
@media (max-width:899px){
  .uk-main{padding-top:40px}
  .uk-toc{transition:transform .2s var(--ease)}
  html.mos-roll .uk-toc{transition:transform .2s var(--ease)}
  /* the open line: the strip, once it reaches the line, stands right under it (demo.js sets --dm-push); its ground is opaque and
     a band of it covers the page from the bar down to the strip, so no cut line of text and no ghost of a drawing shows */
  .dm-on .uk-toc{background:var(--page);-webkit-backdrop-filter:none;backdrop-filter:none}
  html.demo-line .uk-toc{transform:translateY(var(--dm-push,0px))}
  html.demo-line.strip-reach .uk-toc::before{content:"";position:absolute;left:0;right:0;bottom:100%;height:var(--dm-cover,38px);background:var(--page)}
}

/* ── 3. the opening: the headline block in the middle of the first screen, the line above it, "Works with" under the paragraph ── */
.v9-eyebrow{position:absolute;left:0;right:0;bottom:100%;margin:0 0 18px;font:500 .8125rem/1 var(--mono);color:var(--muted);text-align:center}
.mp-meet{--mp-gap:60px}
@media (max-width:699px){.mp-meet{--mp-gap:50px}}
.title .uk-works{margin-top:26px}
@media (max-width:699px){.title .uk-works{margin-top:22px}}
html.mo:not(.page-open) .v9-eyebrow,html.mo:not(.page-open) .title .uk-works{opacity:0}
.v9-eyebrow,.title .uk-works{transition:opacity .5s ease-out .15s}
html.restored .v9-eyebrow,html.restored .title .uk-works{transition:none}
@media (prefers-reduced-motion:reduce){.v9-eyebrow,.title .uk-works{transition:none}}
@media (min-width:900px){
  .title{top:max(250px,calc(50% - 23px))}
  .a2{--a2-title-top:max(250px,calc(50% - 23px))}
}
@media (max-width:640px){.title{width:calc(100% - 2*var(--gut))}}
/* logos: the official files as <img>, never recolored (zrodla-logotypow.md) */
.uk-works li[data-brand="claude-code"] img{width:146px;height:20px}
.uk-works li[data-brand="codex"]{gap:0}
.uk-works li[data-brand="codex"] img{width:30px;height:30px;margin:-3px 4px -3px -5px}
.uk-works li{font-size:17px}
@media (max-width:699px){.uk-works li{font-size:16px}}

/* the end of the cream gap under the headline: .below starts --v9-hero-pad under "Works with" (v9.js measures it exactly) */
:root{--hero-h:calc(max(250px,50svh - 115px) + 336px)}
@media (min-width:900px){:root{--hero-h:calc(max(250px,50svh - 23px) + 296px + var(--v9-hero-pad))}}
@media (max-width:640px){:root{--hero-h:calc(max(250px,50svh - 150px) + 325px)}}
.below{margin-top:calc(var(--hero-h) - 100svh)}
.mo .below{margin-top:calc(var(--hero-h) - 100svh)}

/* ── 4. the closing on the same left edge as the column ── */
@media (min-width:1346px){.zk-in{box-sizing:border-box;width:min(var(--wrap),100% - 2*var(--gut));padding-left:calc((min(var(--wrap),100% - 2*var(--gut)) - var(--col))/2)}}
@media (min-width:900px) and (max-width:1345px){.zk-in{box-sizing:border-box;padding-left:calc(var(--uk-toc) + var(--dm-gutter) + var(--uk-gap))}}
@media (min-width:900px){.zk{--zk-h:500 calc(clamp(2.5rem,7.5vw,6.75rem)*.984)/.97 var(--sans)}}

/* ── 5. the figure in Glauka's card: top right corner of her card, never on the page beside it ── */
@media (min-width:641px){
  .mos-pet{z-index:2;top:calc(var(--band) + 3px + 8px);right:calc(50% + var(--notch)/2 + var(--mos-wl) + 84px + 8px);width:48px;height:54px}
  .mos-petb{width:48px;height:52px}
  .mos-pet.mos-on~.mos-l{padding-right:62px}
}
@media (min-width:641px) and (max-width:1345px){.mos-pet{right:calc(50% + var(--notch)/2 + var(--mos-wl) - 360px + 8px)}}
