/* MOBILE (eve-v4/MOBILE.md, Stan 2026-11-09: "1M Palo Alto on mobile as well, and no static"). Every rule in this file
   sits inside a phone media query (the breakpoints the site already uses: 800 px for the home, 700 px for the chapters),
   so the desktop renders exactly as before. Loaded last on every page, so it settles the phone's cascade in one place. */

/* ---- 1. Basics: the masthead, type floors (nothing under 12 px, body copy 16 px), tap targets (44 px), safe areas. ---- */
@media (max-width:800px){
  :root{--safe-t:env(safe-area-inset-top,0px);--safe-b:env(safe-area-inset-bottom,0px);--safe-l:env(safe-area-inset-left,0px);--safe-r:env(safe-area-inset-right,0px);--phone-gutter:20px}
  html,body{overflow-x:clip}
  /* The masthead: brand and the call on row one, the sections and sound on row two; every control 44 px tall. */
  :root:root body .masthead{display:grid;grid-template-columns:1fr auto;grid-template-rows:44px 44px;align-content:start;row-gap:0;column-gap:12px;height:auto;min-height:0;
    padding:calc(6px + var(--safe-t)) calc(var(--phone-gutter) + var(--safe-r)) 4px calc(var(--phone-gutter) + var(--safe-l));margin:0;width:100%;max-width:none;box-sizing:border-box}
  :root:root body .masthead .brand{grid-column:1;grid-row:1;justify-self:start;display:grid;align-content:center;min-height:44px;min-width:44px;width:auto}
  :root:root body .masthead .brand img{width:80px}
  :root:root body .masthead .inquiry{grid-column:2;grid-row:1;justify-self:end;display:inline-flex;align-items:center;gap:8px;min-height:44px;padding:0 0 0 12px;margin:0;font-size:13px;letter-spacing:.01em;white-space:nowrap}
  /* FOUR: the nav row spans both columns (four chapter links no longer fit beside nothing; in column 1 alone they widened
     it and pushed "Przygotuj zapytanie" past the screen's edge on the chapters) */
  :root:root body .masthead nav{grid-column:1 / -1;grid-row:2;display:flex;align-items:stretch;gap:18px;margin:0}
  :root:root body .masthead nav a{display:inline-flex;align-items:center;min-height:44px;min-width:44px;padding:0;font-size:13px;letter-spacing:.01em;white-space:nowrap}
  :root:root body .masthead .sound-toggle{grid-column:2;grid-row:2;justify-self:end;display:inline-flex;align-items:center;gap:8px;min-height:44px;min-width:44px;padding:0 0 0 8px;font-size:13px}
  :root:root body .masthead .header-note{display:none}
}
@media (max-width:380px){
  :root:root body .masthead nav{gap:14px}
  /* the sound control keeps its icon and its name for assistive technology; the word goes on the narrowest phones */
  :root:root body .masthead .sound-toggle>span:not(.sound-icon){position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
  :root:root body .masthead .sound-toggle{justify-content:flex-end}
}

/* Home: the reading sections below the build. */
@media (max-width:800px){
  .ec .ec-eyebrow,.ec .ec-num,.ec .ec-tag,.ec-prepare h3{font-size:12px}
  .ec .ec-prepare h3{font-size:12px;line-height:16px}
  .ec p,.ec .ec-lede,.ec .ec-promise,.ec-prepare li{font-size:16px;line-height:1.55}
  .ec-footer,.ec-footer span{font-size:12px;line-height:1.6}
  .ec-footer{padding-bottom:calc(28px + var(--safe-b))}
  .ec-email{min-height:44px;display:inline-flex;align-items:center}
  .ec h3 a{display:inline-flex;align-items:center;min-height:44px;min-width:44px}
}

/* Chapters. */
@media (max-width:700px){
  body:has(.chapter) .eyebrow{font-size:12px}
  body:has(.chapter) .phone-scene-nav{font-size:12px;min-height:32px}
  body:has(.chapter) .engineering .annotation{font-size:12px}
  body:has(.chapter) .detail-content p{font-size:14px}
  body:has(.chapter) .prepare ul{font-size:16px;line-height:1.55}
  body:has(.chapter) .contact footer,body:has(.chapter) .contact footer span{font-size:12px;line-height:1.6}
  body:has(.chapter) .contact footer{padding-bottom:calc(16px + var(--safe-b))}
  body:has(.chapter) .other-chapters a{min-width:44px}
  body:has(.chapter) .other-chapters a,body:has(.chapter) .contact .email,body:has(.chapter) .prepare summary{min-height:44px;display:inline-flex;align-items:center}
  body:has(.chapter) .chapter .next{bottom:calc(24px + var(--safe-b))}
}

/* ---- 2-3. Home: the portrait story (world.js, schedule.js MOBILE 2-3). Words at the top, the picture in the middle, the
   instrument at the bottom under the thumb. Only transform and opacity move; no filter, blur or blend on a phone. ---- */
@media (max-width:800px){
  :root{--mast:calc(98px + var(--safe-t))}
  /* The picture: the canvas a little taller than the screen and lifted, so the work (the frames' middle) sits in the
     clear band between the promise and the card; the instrument's floor covers the bottom edge. */
  html.world-auto #world,html.world-auto .world-snap,html.world-auto .world-first{top:-13%;height:113%}
  html.world-auto .world-vignette{display:none}
  html.world-auto .world-pin::before{height:30%;background:linear-gradient(#102922f0,#102922c0 45%,#10292200)}
  html.world-auto .world-pin::after{height:56%;background:linear-gradient(#10292200,#102922b3 34%,#102922f2 62%,#102922)}
  html.world-auto .world-progress{display:none}

  /* The promise from frame zero (the desktop's words and lighting): dim, "jeden", "harmonogram" and the full stop light
     gold as each lane completes, the whole line at the finale. The old opening title is not the phone's any more. */
  html:is(.world-auto,.world-still) .world-copy{left:calc(var(--phone-gutter) + var(--safe-l));right:calc(var(--phone-gutter) + 52px);top:calc(var(--mast) + 6px);max-width:none;opacity:1;transform:none}
  html:is(.world-auto,.world-still) .world-copy::before{inset:-40px -40px -60px -40px;background:radial-gradient(ellipse 70% 60% at 30% 40%,#102922c8 0%,#1029228c 45%,#10292200 80%)}
  html:is(.world-auto,.world-still) .world-copy :is(.world-opening-title,.world-opening-description,.world-closing-eyebrow){display:none}
  html:is(.world-auto,.world-still) .world-copy h1{font-size:clamp(34px,9.6vw,42px);line-height:1.04;letter-spacing:-.01em;opacity:1}
  html:is(.world-auto,.world-still) .world-copy .world-closing-title{display:block}
  html:is(.world-auto,.world-still) .world-copy h1 em{color:inherit}
  html:is(.world-auto,.world-still) .world-copy h1 .hl-0{opacity:calc(.58 + .42 * var(--world-promise,1))}
  html:is(.world-auto,.world-still) .world-copy h1 .hl{--lit:max(var(--world-promise,1),var(--hl-n,1));opacity:calc(.58 + .42 * var(--lit));color:color-mix(in oklab,var(--gold) calc(100% * var(--lit)),var(--paper))}
  html:is(.world-auto,.world-still) .world-copy h1 .hl-1{--hl-n:var(--hl-1,1)}
  html:is(.world-auto,.world-still) .world-copy h1 .hl-2{--hl-n:var(--hl-2,1)}
  html:is(.world-auto,.world-still) .world-copy h1 .hl-3{--hl-n:var(--hl-3,1)}
  /* The finale: the thesis, the gate and the done line under the promise (the card has gone by then). */
  html:is(.world-auto,.world-still) .world-copy .world-endcap{display:block;position:relative;pointer-events:none}
  html:is(.world-auto,.world-still) .world-copy .world-endcap .other-chapters{display:none}
  html:is(.world-auto,.world-still) .world-copy .world-thesis{display:block;margin:16px 0 0;max-width:30em;font-size:16px;line-height:1.5;color:var(--muted);opacity:var(--world-promise,1)}
  html:is(.world-auto,.world-still) .world-copy .world-thesis br{display:none}
  html:is(.world-auto,.world-still) .world-copy .world-endcap-foot{display:flex;align-items:center;flex-wrap:wrap;gap:8px 20px;margin:20px -52px 0 0}
  html:is(.world-auto,.world-still) .world-copy .world-gate{display:inline-flex;align-items:center;gap:14px;height:48px;padding:0 20px;visibility:hidden;pointer-events:auto;
    border:1px solid color-mix(in oklab,var(--gold) calc(100% * var(--gate,0)),transparent);background:color-mix(in oklab,#0a1c17 calc(70% * var(--gate,0)),transparent);
    font-size:15px;letter-spacing:.02em;color:var(--gold);opacity:clamp(0,calc(var(--gate,0) * 2.5),1);text-decoration:none}
  html:is(.world-auto,.world-still) .world-copy .world-more{display:inline-flex;align-items:center;gap:10px;min-height:48px;font-size:14px;color:var(--muted);opacity:var(--world-promise,1);visibility:hidden;pointer-events:auto}
  html:is(.world-auto.world-ended,.world-still) .world-copy .world-more{visibility:visible}
  html:is(.world-auto,.world-still) .world-copy .world-more span{color:var(--gold)}
  html:is(.world-auto,.world-still) .world-copy .world-closing{display:none}
  html:is(.world-auto,.world-still) .world-copy .world-done{display:none;margin:14px 0 0;font-size:14px;line-height:1.5;color:var(--gold)}
  html:is(.world-auto.world-ended,.world-still) .world-copy .world-done{display:block}

  /* The pause control: 44 px, beside the promise. */
  html.world-auto .world-pin .timeline-toggle{top:calc(var(--mast) + 4px);bottom:auto;right:calc(var(--phone-gutter) + var(--safe-r) - 4px);width:44px;height:44px}

  /* The instrument: the plot (three lanes over the gold axis, five stages, the playhead), the chapter links as tabs. */
  html.sched-on .sched{display:grid;position:absolute;z-index:3;left:calc(var(--phone-gutter) + var(--safe-l));right:calc(var(--phone-gutter) + var(--safe-r));bottom:calc(8px + var(--safe-b));
    grid-template-columns:minmax(0,1fr);grid-template-rows:auto 52px;row-gap:6px}
  /* FOUR (story/EVE-v2.md): four lanes in the plot's old height (4 x 12 px for 3 x 16 px), so the picture keeps its share. */
  html.sched-on .sched-plot{display:grid;position:relative;grid-row:1;grid-template-rows:repeat(4,12px) 45px}
  html.sched-on .sched-end{display:none}
  html.sched-on .sched-tracks{display:contents}
  html.sched-on .sched-lane{position:relative}
  html.sched-on .sched-lane::before{content:"";position:absolute;left:0;right:0;top:calc(50% + 1px);height:1px;background:#ffffff14}
  html.sched-on .sched-bar{position:absolute;left:calc(var(--a) * 100%);width:calc((var(--b) - var(--a)) * 100%);top:calc(50%);height:3px;padding:0;border:0;background:#dec38c2e;pointer-events:none}
  html.sched-on .sched-fill{position:absolute;inset:0;display:block;background:var(--gold);transform:scaleX(0);transform-origin:left;opacity:.6}
  html.sched-on .sched-lane.is-live .sched-fill{opacity:1}
  html.sched-on .sched-lane.is-live .sched-bar{height:4px;margin-top:-.5px}
  html.sched-on .sched-tick{position:absolute;z-index:1;left:calc(var(--at) * 100%);top:0;bottom:0;width:1px;padding:0;border:0;background:none;color:#f0eee45c;pointer-events:none}
  html.sched-on .sched-tick span{display:none}
  html.sched-on .sched-tick::after{content:"";position:absolute;left:0;top:calc(50% - 4px);width:1px;height:9px;background:currentColor}
  html.sched-on .sched-tick.is-past{color:var(--gold)}
  html.sched-on .sched-axis{position:relative;grid-row:5;margin:0;padding:0;list-style:none;border-top:1px solid #dec38c80}
  html.sched-on .sched-axis li{display:contents}
  html.sched-on .sched-stage{position:absolute;top:0;bottom:0;left:calc(var(--a) * 100%);width:calc((var(--b) - var(--a)) * 100%);box-sizing:border-box;padding:0 0 0 8px;border:0;border-left:1px solid #dec38c4d;background:none;text-align:left;
    font:inherit;font-size:0;line-height:0;color:transparent;overflow:hidden}
  html.sched-on .sched-stage span{display:flex;align-items:center;height:100%;font-size:12px;line-height:1;letter-spacing:.14em;color:var(--gold);opacity:.6;font-variant-numeric:tabular-nums}
  html.sched-on .sched-stage[aria-current]{background:linear-gradient(180deg,#dec38c26,#dec38c00 85%)}
  html.sched-on .sched-stage[aria-current] span{opacity:1;font-weight:600}
  html.sched-on .sched-stage:focus-visible{outline:2px solid var(--gold);outline-offset:-2px}
  html.sched-on .sched-head{position:absolute;z-index:2;left:0;top:-4px;width:1px;height:52px;margin-left:-.5px;pointer-events:none;background:var(--gold);will-change:transform}
  html.sched-on .sched-head::after{content:"";position:absolute;left:50%;bottom:-4px;width:7px;height:7px;translate:-50% 0;border-radius:50%;background:var(--gold);box-shadow:0 0 0 4px #dec38c2e}
  html.sched-on .sched.is-final .sched-head{background:none}
  html.sched-still .sched-head{display:none}
  html.sched-on .sched-merge{position:absolute;z-index:1;left:80%;width:20%;top:0;height:48px;pointer-events:none}
  html.sched-on .sched-merge svg{position:absolute;inset:0;width:100%;height:100%;overflow:visible}
  html.sched-on .sched-merge path{fill:none;stroke-linecap:round}
  html.sched-on .sched-merge-track path{stroke:#dec38c2e;stroke-width:2}
  html.sched-on .sched-merge-track path:last-child{stroke-width:4}
  html.sched-on .sched-merge-clip{position:absolute;inset:-12px 0;overflow:hidden;transform:translateX(-100%);will-change:transform}
  html.sched-on .sched-merge-in{position:absolute;inset:12px 0;transform:translateX(100%);will-change:transform}
  html.sched-on .sched-merge-gold path{stroke:var(--gold);stroke-width:2}
  html.sched-on .sched-merge-gold path.trunk{stroke-width:4}
  html.sched-on .sched-merge-gold path.glow{stroke:#dec38c26;stroke-width:9}
  html.sched-on .sched-merge-cap{display:none}

  /* The chapter links: four tabs, always there (the desktop's lane heads). */
  html.sched-on body .sched .world-steps{position:static;grid-row:2;display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:6px;left:auto;right:auto;bottom:auto}
  html.sched-on body .sched .world-steps a{display:flex;align-items:center;gap:8px;height:52px;padding:0 10px;border:0;border-top:1px solid #dec38c40;background:#0b1f19cc;backdrop-filter:none;opacity:1;transform:none;pointer-events:auto;transition:none}
  html.sched-on body .sched .world-steps a::before,html.sched-on body .sched .world-steps a::after{display:none}
  html.sched-on body .sched .world-steps a>*{opacity:1;translate:none;position:static}
  html.sched-on .sched .world-steps .step-number{font-size:12px;letter-spacing:.12em;color:var(--gold);opacity:.8}
  html.sched-on .sched .world-steps b{font-size:20px;line-height:1;color:var(--paper);white-space:nowrap}
  html.sched-on .sched .world-steps .step-arrow{margin-left:auto;font-size:14px;color:var(--gold);opacity:.6}
  html.sched-on .sched .world-steps small{display:none}
  html.sched-on .sched .world-steps a[aria-current]{border-top-color:var(--gold)}
  html.sched-on .sched .world-steps a[aria-current] b{color:var(--gold)}
  html.sched-on .sched .world-steps a:focus-visible{outline:2px solid var(--gold);outline-offset:2px}

  /* The stage card: full width at one dock; its words cross-fade on a stage change (schedule.js), the scope items light
     on the clock and the latest one stands in the card's last row (each item is seen as its piece is built). */
  html.sched-on .sched-pins{display:block;position:absolute;inset:0;z-index:2;pointer-events:none}
  html.sched-on .sched-leaders{position:absolute;inset:0;width:100%;height:100%;overflow:visible}
  html.sched-on .sched-leaders line{stroke:var(--gold);stroke-width:1;opacity:0}
  html.sched-on .sched-leaders .sched-dot{fill:var(--gold);opacity:0}
  html.sched-on .sched-leaders .sched-ring{fill:none;stroke:var(--gold);stroke-width:1.5;opacity:0;transform-box:fill-box;transform-origin:center}
  html.sched-on .sched-leaders .sched-riser{stroke:var(--gold);stroke-width:1;opacity:0}
  html.sched-on .sched-card{position:absolute;left:0;top:0;box-sizing:border-box;width:calc(100vw - 2 * var(--phone-gutter) - var(--safe-l) - var(--safe-r));opacity:0;visibility:hidden;will-change:transform,opacity;pointer-events:none;
    background:#0a1c17eb;border:1px solid #dec38c2e;border-top-color:var(--gold)}
  html.sched-on .sched-card-rule{display:none}
  html.sched-on .sched-pin{position:absolute;left:0;top:0;box-sizing:border-box;width:calc(100vw - 2 * var(--phone-gutter) - var(--safe-l) - var(--safe-r));padding:14px 16px 13px;opacity:0;visibility:hidden;will-change:transform,opacity;background:none;border:1px solid #0000;color:var(--paper)}
  html.sched-on .sched-pin p{margin:0}
  html.sched-on .sched-pin-lane{font-size:12px;line-height:14px;font-weight:500;letter-spacing:.16em;text-transform:uppercase;color:var(--gold)}
  html.sched-on .sched-pin-stage{margin-top:6px !important;font-family:"Instrument Serif","Instrument Serif fallback",serif;font-size:25px;line-height:1.05;color:var(--paper)}
  html.sched-on .sched-pin-stage span{margin-right:8px;font-family:Manrope,"Manrope fallback",sans-serif;font-size:12px;letter-spacing:.14em;color:var(--gold);vertical-align:.4em}
  html.sched-on .sched-pin-line{margin-top:8px !important;font-size:16px;line-height:1.42;color:#f0eee4d6}
  html.sched-on .sched-pin ol{display:grid;list-style:none;margin:10px 0 0;padding:9px 0 0;border-top:1px solid #ced6c826}
  html.sched-on .sched-pin li{grid-area:1/1;display:grid;grid-template-columns:30px 1fr;font-size:14px;line-height:1.4;color:#f0eee4e6;opacity:0;transition:opacity var(--m-feedback) var(--m-ease-out)}
  html.sched-on .sched-pin li i{font-style:normal;font-size:12px;line-height:20px;letter-spacing:.1em;color:var(--gold);font-variant-numeric:tabular-nums}
  html.sched-on .sched-pin li.is-in:not(:has(~ li.is-in)){opacity:1}
  html.sched-on .sched-pin ol:not(:has(.is-in)) li:first-child{opacity:.45}
}
/* R10 4 (ART-fable-r10 4): the card's sub-step swaps in sequence. The lines share one grid cell and crossed over 180 ms
   both ways, so mid-swap two lines stood legible on top of each other ("2.2 Fundamenty..." over 2.1). Now the old line
   goes over 180 ms and the new one comes in over 220 ms once it has gone (a transition delay on the way in only). */
@media (max-width:800px){
  html.sched-on .sched-pin li{transition:opacity 120ms var(--m-ease-out) 0s}
  html.sched-on .sched-pin li.is-in:not(:has(~ li.is-in)){transition:opacity 160ms var(--m-ease-out) 120ms}   /* R12 2: 120 out, 160 in (was 180/220) */
}
@media (max-width:800px) and (prefers-reduced-motion:reduce){html.sched-on .sched-pin li,html.sched-on .sched-pin li.is-in:not(:has(~ li.is-in)){transition:none}}
/* FOUR (story/EVE-v2.md, Stan 2026-11-11): four tabs in the width of three. Each tab stacks its number over its name (the
   arrow goes: the whole tab is the link), the names at 17 px, and the fourth says „Magazyn” as the chapter nav does
   (its " energii" stays in the link's text for assistive technology, only visually clipped). */
@media (max-width:800px){
  html.sched-on body .sched .world-steps a{flex-direction:column;align-items:flex-start;justify-content:center;gap:3px;padding:0 8px;min-width:0}
  html.sched-on .sched .world-steps .step-number{font-size:12px;line-height:12px}
  html.sched-on .sched .world-steps b{font-size:17px;line-height:1.05;max-width:100%}
  html.sched-on .sched .world-steps .step-arrow{display:none}
  html.sched-on .sched .world-steps .lane-long{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
}

/* ---- 4. Chapters: the tour plays itself on a phone (chapters/autoplay.js MOBILE 4). Each scene is exactly one screen,
   so every rest shows one scene whole; the timeline writes the scroll, the page itself does not scroll until the closer. */
@media (max-width:700px){
  /* (no overflow: hidden on the root here: on a phone it makes a scroll write pan the visual viewport, and the fixed
     masthead slid with it; the gestures hold every touch move instead) */
  html.chapter-auto:not(.chapter-free){overscroll-behavior:none}
  html.chapter-auto .chapter{height:var(--chapter-viewport-height,100svh);min-height:0}
  html.chapter-auto .chapter .next{display:none}
  html.chapter-auto body > .chapter-toggle{position:fixed;z-index:12;right:calc(16px + var(--safe-r));bottom:calc(20px + var(--safe-b));width:44px;height:44px}
}
/* MOBILE 5: the calm version (reduced motion, low tier): the same promise, thesis and gate as the finale, standing. */
@media (max-width:800px){
  html.world-still .world-copy{--gate:1}
  html.world-still .world-copy .world-gate{visibility:visible}
}
@media (max-width:700px){
  /* while a scene's phone animation is open, its own close button holds the bottom edge: the pause control steps above it */
  html.chapter-auto body:is(.interaction-active,.cutaway-active) > .chapter-toggle{transform:translateY(-64px)}
  html.chapter-auto body > .chapter-toggle{transition:transform var(--m-feedback,.18s) var(--m-ease-out,ease-out)}
}

/* CRISP 6 (ART-fable-bright2 6; Stan 2026-11-10: "light, colourful and very crisp"): the phone's picture gets the top of
   the screen to itself. It lay under everything (a scrim from the top for the headline, a scrim from the bottom for the
   card and the instrument), cover-cropped to ~500 px of the scene: about a third of the screen showed picture, as a
   close-up of textures. Now the screen is three crisp parts: the masthead on the solid shell; the picture, 55 % of the
   screen's height, edge to edge, with nothing over it but the headline on its own small plate and the pause control,
   showing the whole 912 px band (objects, not textures); and the shell below it with the stage card and the instrument.
   No scrim, no gradient; the card, a crisp plate, may rest its top edge on the picture's last rows. At the finale the
   thesis, the done line and the gate stand on the shell where the card was. Only transform and opacity move. */
@media (max-width:800px){
  :root{--pic-h:55svh;--shell:#0e251e;--instr:calc(147px + 8px + var(--safe-b))}
  html:is(.world-auto,.world-still) .world-pin{background:var(--shell)}
  html:is(.world-auto,.world-still) body .masthead{background:var(--shell)}
  html:is(.world-auto,.world-still) body .masthead::before{display:none}
  html.world-auto #world,html.world-auto .world-snap,html.world-auto .world-first{left:0;top:var(--mast);width:100%;height:var(--pic-h);inset:var(--mast) 0 auto 0}
  html.world-auto .world-first img{width:100%;height:100%;object-fit:cover}
  html.world-auto .world-pin::before,html.world-auto .world-pin::after{display:none}
  /* the headline: smaller, on a crisp plate at the picture's top-left corner */
  html:is(.world-auto,.world-still) body .world-copy{left:0;right:auto;top:var(--mast);width:max-content;max-width:calc(100vw - 64px);padding:12px 18px 14px calc(var(--phone-gutter) + var(--safe-l));box-sizing:border-box;background:var(--shell);border:1px solid #dec38c33;border-left:0;border-top:0}
  html:is(.world-auto,.world-still) body .world-copy::before,html:is(.world-auto,.world-still) body .world-copy::after{display:none}
  html:is(.world-auto,.world-still) body .world-copy h1{font-size:clamp(26px,7.4vw,32px);line-height:1.06;text-shadow:none}
  html:is(.world-auto,.world-still) body .world-copy p{text-shadow:none}
  html:is(.world-auto,.world-still) body .world-copy h1 .hl-0{opacity:calc(.74 + .26 * var(--world-promise,1))}
  html:is(.world-auto,.world-still) body .world-copy h1 .hl{opacity:calc(.74 + .26 * var(--lit))}
  /* the finale's words: on the shell under the picture, where the card stood */
  html:is(.world-auto,.world-still) body .world-copy .world-endcap{position:absolute;left:calc(var(--phone-gutter) + var(--safe-l));top:calc(100svh - var(--mast) - var(--instr) - 14px);transform:translateY(-100%);
    box-sizing:border-box;width:calc(100vw - 2 * var(--phone-gutter) - var(--safe-l) - var(--safe-r));padding:14px 16px 12px;background:#0a1c17;border:1px solid #dec38c2e;border-top-color:var(--gold);
    opacity:var(--world-promise,1);visibility:hidden}
  html:is(.world-auto.world-ended,.world-still) body .world-copy .world-endcap{visibility:visible}
  html:is(.world-auto,.world-still) body .world-copy .world-thesis{margin:0;font-size:16px;line-height:1.4;opacity:1}
  html:is(.world-auto,.world-still) body .world-copy .world-done{margin:8px 0 0;font-size:14px;line-height:1.4}
  html:is(.world-auto,.world-still) body .world-copy .world-endcap-foot{margin:10px 0 0}
  html:is(.world-auto,.world-still) body .world-copy .world-gate{height:46px}
  html:is(.world-auto,.world-still) body .world-copy .world-more{min-height:46px}
  html.world-auto .world-pin .timeline-toggle{top:calc(var(--mast) + 10px)}
  /* the instrument a little tighter (rows 14 px, tabs 46 px) and the card's paddings, so the card rests only its top edge on the picture */
  html.sched-on .sched{grid-template-rows:auto 46px}
  html.sched-on .sched-plot{grid-template-rows:repeat(4,11px) 45px}
  html.sched-on body .sched .world-steps a{height:46px}
  html.sched-on .sched-pin{padding:11px 16px 10px}
  html.sched-on .sched-pin-stage{margin-top:4px !important;font-size:24px}
  html.sched-on .sched-pin-line{margin-top:6px !important;line-height:1.38}
  html.sched-on .sched-pin ol{margin-top:8px;padding-top:7px}
  /* the instrument's tabs and the card: flat on the shell */
  html.sched-on body .sched .world-steps a{background:#0a1c17}
  html.sched-on .sched-card{background:#0a1c17}
}
@media (max-width:800px) and (max-height:780px){
  /* a short phone: the finale's block a little tighter, the gate and "Usługi" on one row */
  html:is(.world-auto,.world-still) body .world-copy .world-endcap{padding:10px 14px 8px}
  html:is(.world-auto,.world-still) body .world-copy .world-thesis{line-height:1.34}
  html:is(.world-auto,.world-still) body .world-copy .world-done{margin-top:6px}
  html:is(.world-auto,.world-still) body .world-copy .world-endcap-foot{flex-wrap:nowrap;gap:8px 14px;margin:8px 0 0}
  html:is(.world-auto,.world-still) body .world-copy .world-gate{padding:0 14px;gap:10px;font-size:14px;white-space:nowrap}
}

/* PHONE BRIGHT (ART-fable-phone-bright, 2026-11-10). 5: one shell on all three chapters: every scene title one size (it
   was 40, 35 or 24 px by composition and by an open animation), the pause control never moves (it stepped up 64 px while an
   animation's chip held the edge), the chip sits bottom left on the pause control's row, clear of it. */
@media (max-width:700px){
  html.chapter-auto body .chapter[data-composition] .scene-copy :is(h1,h2),
  html.chapter-auto body:is(.interaction-active,.cutaway-active) .chapter .scene-copy :is(h1,h2){font-size:34px;line-height:1.1}
  html.chapter-auto body:is(.interaction-active,.cutaway-active) > .chapter-toggle{transform:none}
  html.chapter-auto body .interaction-close,html.chapter-auto body .cutaway-close{left:calc(var(--phone-gutter,20px) + var(--safe-l,0px));right:auto;
    bottom:calc(100% - var(--chapter-viewport-height,100dvh) + 20px + var(--safe-b,0px));min-width:0;height:44px;padding:0 16px;gap:18px;box-sizing:border-box}
}
/* 2: "Rozłóż warstwy" on the light ground: the specimen film (re-grounded, droga-layers-src/light-ground.py) fills a light
   picture panel between the masthead and the shell, crisp edges as on every other scene; the title and the chip stand on
   the shell under it; the labels in paper on a heavy shell outline (they read over stone and ground alike). */
@media (max-width:700px){
  .layers-stage{background:#e4e5d8}
  .layers-stage .layers-frame{-webkit-mask-image:none;mask-image:none;filter:none}
  .layers-stage::after{top:auto;bottom:0;height:calc(var(--layers-shell,236px) + var(--safe-b,0px));background:#102922}
  .layers-stage .interaction-labels path{stroke:#102922;stroke-opacity:.8;stroke-width:1.25}
  .layers-stage .interaction-labels circle{fill:#102922;stroke:#f0eee4;stroke-width:1}
  .layers-stage .interaction-labels text{fill:#f7f5ec;stroke:#102922;stroke-width:5px;stroke-linejoin:round;paint-order:stroke;font-weight:600}
  .layers-stage.is-quick{transition:opacity .45s var(--m-ease-out,ease-out),visibility .45s}
}
/* 3-4 (home): the card's sub-step at 15 px (schedule.js gives every card the longest card's height on a phone, so it is
   never clipped); the schedule readable at arm's length: lane bars 6 px with round ends (the live one no thicker, so
   nothing jumps), the stage numbers 13 px, the current one brighter in the same gold. Colours as the shell has them. */
@media (max-width:800px){
  html.sched-on .sched-pin li{font-size:15px;line-height:1.4}
  html.sched-on .sched-bar,html.sched-on .sched-lane.is-live .sched-bar{top:calc(50% - 2px);height:6px;margin-top:0;border-radius:3px;overflow:hidden}
  html.sched-on .sched-stage span{font-size:13px;opacity:.7}
  html.sched-on .sched-stage[aria-current] span{opacity:1;font-weight:700;color:#f6dfaa}
}

/* LIVE1 (ART-fable-live1 6): the last card (Odbiór i serwis) holds two lines in a panel sized for the tallest card; its
   words sit on the panel's bottom edge (schedule.js) and end on the page's own call, "Przygotuj zapytanie" (the end cap's
   target, #kontakt), a 44 px gold-outlined row. Out of the tab order (the masthead's link is the keyboard's); the pins
   layer takes no touches, the link does while its card is up (a hidden card is visibility:hidden, so it takes none). Desktop has the gate under the headline instead. */
.sched-pin-cta{display:none}
@media (max-width:800px){
  html.sched-on .sched-pin-cta{display:flex;align-items:center;justify-content:space-between;box-sizing:border-box;height:44px;margin-top:12px;padding:0 14px;
    border:1px solid var(--gold);color:var(--gold);font-size:15px;letter-spacing:.02em;text-decoration:none;pointer-events:auto}
}

/* R11 4 (ART-fable-r11 4, p-06): the picture ends at the card's top edge (schedule.js --pic-cut, clip only, never a scale),
   so no sliver of film stands beside the card's corners. */
@media (max-width:800px){
  html.world-auto #world,html.world-auto .world-snap,html.world-auto .world-first{clip-path:inset(0 0 var(--pic-cut,0px) 0)}
}

/* R11 6 (ART-fable-r11 6): the phone headline is static too (line two in full gold from the first frame), and only the
   live lane bar carries its lane's colour; finished bars stand in a quiet gold, so one bar at a time is tinted. The bars
   stay 6 px (PHONE BRIGHT 3-4 already doubled Fable's suggested 3 px). */
@media (max-width:800px){
  html:is(.world-auto,.world-still) body .world-copy h1 .hl-0{opacity:1}
  html:is(.world-auto,.world-still) body .world-copy h1 .hl{opacity:1;color:var(--gold)}
  html.sched-on body .sched-lane .sched-fill{background:#dec38c;opacity:.42}
  html.sched-on body .sched-lane.is-live .sched-fill{background:var(--lane,var(--gold));opacity:1}
}

/* R12 5 (ART-fable-r12 5): the headline plate has no hairline edges on the phone. Its right edge ran from the plate's
   corner up to the nav as a stray vertical line over the picture (p-04, p-14); the opaque shell plate needs no edge. */
@media (max-width:800px){
  html:is(.world-auto,.world-still) body .world-copy{border:0}
  html.sched-on .sched-pin ol:not(:has(.is-in)) li:first-child{opacity:.55}   /* the upcoming sub-step, as on desktop */
}
