/* The home page's story, acts II and III (frontier/growth/site/STORY.md). The same night table as the hero, continuing:
   no band of another colour between the acts; one key light from the upper left; the page's own type and colours.
   Loaded in the body, after the hero, so the first screen never waits for it. Every rule is under .st. */

.st{--st-band:#030509;position:relative;margin-inline:calc(var(--gut,12px) * -1);margin-top:calc(var(--gap,0px) * -1);--st-W:clamp(300px,27vw,420px);--st-H:calc(var(--st-W) * 1.2941);--st-peach:#f5aa8c;color:var(--on-night)}
.st *,.st *::before,.st *::after{box-sizing:border-box}

/* ---------- the table, continuing down the page ----------
   The hero's last band is the dark of its own photograph (#030509 on a phone, #0E1017 on a wide screen: site.css,
   the hero's --o-night). Act II starts in exactly that colour and the table's grain comes up through it slowly; only
   the table's dark, far side is shown, so the light keeps falling away from the hero's lamp, as in the photograph. */
@media(min-width:700px) and (min-aspect-ratio:6/5){.st{--st-band:#0E1017}}
/* the hero (z-index 26) darkens the first lines below its foot; this lays its own colour back over them, so there is
   no line where the hero ends: the same colour carries on and only then gives way to the table */
.st::before{content:"";position:absolute;left:0;right:0;top:0;height:min(120px,calc(clamp(64px,7vw,110px) - 6px));z-index:27;pointer-events:none;background:linear-gradient(180deg,var(--st-band) 0,var(--st-band) 55%,rgba(0,0,0,0) 100%)}
.st-act{position:relative;isolation:isolate}
.st-page{z-index:3}
.st-page{overflow-x:hidden;overflow-x:clip;background:linear-gradient(180deg,var(--st-band) 0,var(--st-band) 30%,#050A1A 100%);padding:clamp(64px,7vw,110px) var(--og,20px) clamp(20px,2.4vw,40px)}
.st-page::before,.st-shelf::before{content:"";position:absolute;inset:0;z-index:-1;background:no-repeat center/cover;opacity:0;transition:opacity 1.2s var(--e-land,ease)}
/* the plate's edges fall away into the page's own night, so the table has no edge of its own */
/* round 4: the lamp comes back. Warm from the upper left where the act begins, falling off to the cool dark table at
   the lower right; the table's grain shows wherever the light reaches. Act III stands in the same light, weaker. */
.st-page::before{background-size:cover;background-position:left top;-webkit-mask-image:linear-gradient(180deg,transparent 0,rgba(0,0,0,.55) 5%,#000 12%,#000 78%,transparent 100%);mask-image:linear-gradient(180deg,transparent 0,rgba(0,0,0,.55) 5%,#000 12%,#000 78%,transparent 100%)}
.st-page.is-near::before{background-image:url(table-wide-v1.webp);opacity:1}
@media (max-width:699px){.st-page.is-near::before{background-image:url(table-tall-v1.webp);background-size:cover;background-position:left top}}
@media (scripting:none){.st-page::before{background-image:url(table-wide-v1.webp);opacity:.92}.st-sheet{background-image:url(paper-v1.webp);background-size:100% auto}}

/* ---------- Act II: the words ---------- */
.st-page__in{position:relative;display:grid;grid-template-columns:calc(var(--st-W) * 1.42 + 40px) minmax(300px,520px);grid-template-rows:1fr auto auto 1fr;grid-template-areas:"stage ." "stage words" "stage ctas" "stage .";column-gap:clamp(36px,5vw,88px);align-items:center;justify-content:center;max-width:1320px;margin:0 auto}
.st-words{grid-area:words;position:relative;z-index:2}
.st-h{margin:0 0 .42em;font:520 clamp(2.6rem,1.3rem + 3.3vw,4.6rem)/.98 var(--display);letter-spacing:-.022em;font-variation-settings:"opsz" 144;color:var(--on-night);text-wrap:balance}
.st-h em{display:block;font-style:italic;font-weight:400;color:var(--st-peach);letter-spacing:-.03em}
.st-line{margin:0 0 30px;max-width:27em;min-height:4.6em;font:400 var(--t-lead)/1.55 var(--text);color:var(--on-night-2);text-wrap:pretty}
/* round 6 (R8-S7d): the buttons follow the stage in the page; on a wide screen they sit under the words */
.st-ctas{grid-area:ctas;position:relative;z-index:2;display:flex;flex-wrap:wrap;gap:12px}
.st-btn{min-height:52px}

/* ---------- Act II: the stage, the paper and the tabs ---------- */
.st-stage{grid-area:stage;position:relative;margin:0;height:calc(var(--st-H) + 104px);touch-action:pan-y;-webkit-user-select:none;user-select:none}
.st-canvas{position:absolute;z-index:1;display:block;touch-action:pan-y}
.st-page.is-dragging .st-canvas{cursor:grabbing!important}
/* the right-hand page's place: the canvas measures it; with scripts off it is the page itself */
.st-desk{position:absolute;left:calc(var(--st-W) * .42 + 40px);top:44px;width:var(--st-W);height:var(--st-H);z-index:0}
.st-sheet{position:absolute;inset:0;padding:7% 8%;background:#FCFAF4;color:var(--ink);font:400 .72rem/1.38 var(--text);overflow:hidden;box-shadow:2px 3px 2px rgba(6,10,28,.45),10px 18px 34px -8px rgba(6,10,28,.6)}
/* round 5 (R8-M2): all four sheets are always in the page, in order, each with its heading and its sentence. With a
   script the quiz shows (until the canvas takes over) and the other three are words for screen readers only; with no
   script all four lie one under another on the table. */
.st-sheet:not(.st-sheet--quiz),.st-sheet .st-sheet__line{position:absolute;clip-path:inset(50%);width:1px;height:1px;padding:0;overflow:hidden;white-space:nowrap;box-shadow:none;background:none}
.st-sheet__go{font-size:.64rem;color:var(--ink-2);margin:.6em 0}
.st-turn.is-waiting{visibility:hidden}
@media (scripting:none){
  .st-page .st-stage{height:auto!important}
  .st-desk{position:static;width:var(--st-W);height:auto;margin:0 auto}
  .st-sheet,.st-sheet:not(.st-sheet--quiz){position:relative;inset:auto;clip-path:none;width:auto;height:auto;min-height:calc(var(--st-H) * .7);padding:7% 8%;margin:0 0 34px;overflow:visible;white-space:normal;background:#FCFAF4 url(paper-v1.webp) 0 0/100% auto;box-shadow:2px 3px 2px rgba(6,10,28,.45),10px 18px 34px -8px rgba(6,10,28,.6)}
  .st-sheet:not(.st-sheet--quiz) .st-sheet__line{position:static;clip-path:none;width:auto;height:auto;overflow:visible;white-space:normal;margin:0 0 .9em;font:italic 400 .9rem/1.4 var(--display);color:var(--ink-2)}
  .st-tabs,.st-cornerbtn,.st-turn{display:none!important}
}
.st-sheet__run{margin:0 0 .6em;font-size:.68rem;color:var(--ink-2);border-bottom:1px solid rgba(20,41,94,.3);padding-bottom:.4em}
.st-sheet__t{margin:.2em 0 .7em;font:600 1.05rem/1.2 var(--text);color:var(--ink)}
.st-quiz{margin:0;padding-left:1.2em}.st-quiz>li{margin:0 0 .9em}.st-quiz p{margin:0 0 .3em}
.st-quiz ul{margin:0;padding:0;list-style:none;display:grid;grid-template-columns:1fr 1fr;gap:.1em 1em;font-size:.66rem}
.st-sheet__note{font-size:.66rem;color:var(--ink-2);margin-top:.4em}
/* once the canvas draws the paper, the sheets are words for screen readers only */
.st-page.is-live .st-sheet{display:block;clip-path:inset(50%);width:1px;height:1px;padding:0;overflow:hidden;white-space:nowrap;box-shadow:none;background:none}

.st-tabs{position:absolute;z-index:3;left:calc(var(--st-W) * .5 + 40px);top:calc(44px + var(--st-H) + 6px);display:flex;gap:10px}
.st a.st-tab{position:relative;display:inline-block;padding:15px 14px 9px;min-height:44px;border-radius:0 0 7px 7px;background:#EFE8D8;color:var(--ink);font:600 var(--t-micro)/1.2 var(--text);text-decoration:none;box-shadow:1px 3px 2px rgba(6,10,28,.45),6px 12px 18px -8px rgba(6,10,28,.7);transform:translateY(-6px);transition:transform var(--t-quick,220ms) var(--e-land,ease)}
.st-tab::before{content:"";position:absolute;left:0;right:0;top:0;height:7px;background:linear-gradient(180deg,rgba(6,10,28,.28),rgba(6,10,28,0))}
.st-page.is-near a.st-tab{background-image:url(paper-v1.webp);background-size:280px auto}
.st a.st-tab:hover{transform:translateY(-2px)}
.st a.st-tab[aria-pressed="true"]{transform:translateY(0);background-color:#FCFAF4}
.st-tab[aria-pressed="true"]::after{content:"";position:absolute;left:14px;right:14px;bottom:6px;height:2px;border-radius:2px;background:var(--ink)}
.st-tab:focus-visible,.st-turn:focus-visible{outline:3px solid var(--focus-night,#A6C8FF);outline-offset:3px}
/* round 6 (R8-S7): every control on the table shows its focus. The light ring sits on a dark band of its own, so it
   keeps its contrast on lit wood as well as in the dark (about 12:1 against the band) */
.st-stage:focus{outline:none}
.st-stage:focus-visible{outline:3px solid var(--focus-night,#A6C8FF);outline-offset:4px;border-radius:10px;box-shadow:0 0 0 10px rgba(3,5,9,.92)}
.st a.st-tab:focus-visible{outline:3px solid var(--focus-night,#A6C8FF);outline-offset:3px;box-shadow:0 0 0 9px rgba(3,5,9,.92);z-index:1}
.st-cornerbtn:focus-visible{box-shadow:0 0 0 2px rgba(3,5,9,.92),0 0 0 8px rgba(3,5,9,.92)}
.st-ctas .tc-btn:focus-visible{outline:3px solid var(--focus-night,#A6C8FF);outline-offset:3px;box-shadow:0 0 0 9px rgba(3,5,9,.92)}
.st-turn{display:inline-flex;align-items:center;gap:10px;margin:-10px 0 26px;padding:10px 2px;min-height:44px;border:0;background:none;color:var(--on-night);font:600 var(--t-body)/1 var(--text);cursor:pointer;text-decoration:underline;text-decoration-thickness:1.5px;text-underline-offset:7px;text-decoration-color:rgba(244,238,226,.45)}
.st-turn:hover{text-decoration-color:var(--on-night)}
.st-turn[hidden]{display:none}

/* ---------- Act II: tablets and phones ---------- */
@media (max-width:1099px){
  .st{--st-W:min(360px,42vw)}
  .st-page__in{grid-template-columns:minmax(0,1fr);grid-template-areas:"h" "line" "turn" "stage" "ctas";justify-items:start;max-width:760px}
  .st-page .st-words{display:contents}
  .st-page .st-h{grid-area:h;margin-bottom:28px}.st-page .st-line{grid-area:line;margin:0 0 4px}.st-page .st-turn{grid-area:turn}.st-page .st-ctas{grid-area:ctas}
  .st-stage{width:100%;margin-bottom:18px}
  .st-desk{left:50%}
  .st-tabs{left:calc(50% + var(--st-W) * .06)}
}
@media (max-width:699px){
  .st{--st-W:min(300px,calc(100vw - 92px))}
  .st-page{padding-top:84px}
  .st-desk{left:44px;top:34px}
  .st-stage{height:calc(var(--st-H) + 96px)}
  .st-tabs{left:44px;top:calc(34px + var(--st-H) + 6px);gap:6px}
  .st-tab{padding:15px 10px 9px}
  .st-line{min-height:6.2em}
  .st-ctas{width:100%}.st-ctas .tc-btn{flex:1 1 100%}
}

/* ---------- Act III: the shelf ---------- */
.st-shelf.bk{background:transparent;margin:0;font-size:17px;overflow-x:visible;padding:clamp(20px,2.6vw,44px) var(--og,20px) clamp(72px,8vw,120px)}
.st-shelf::before{background-size:cover;background-position:left top;-webkit-mask-image:linear-gradient(180deg,transparent 0,#000 18%,#000 70%,transparent 100%);mask-image:linear-gradient(180deg,transparent 0,#000 18%,#000 70%,transparent 100%)}
.st-shelf.is-near::before{background-image:url(table-wide-v1.webp);opacity:.4}
@media (max-width:699px){.st-shelf.is-near::before{background-image:url(table-tall-v1.webp)}}
.st-shelf__in{max-width:1320px;margin:0 auto}
.st-shelf__head{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.05fr);gap:24px clamp(32px,5vw,80px);align-items:end}
.st-h--shelf{margin:0;font-size:clamp(2.25rem,1.2rem + 2.8vw,3.9rem)}
.st-shelf .bk-find{margin:0}
.st-shelf .bk-lookup,.st-shelf .bk-hits{display:none!important}
.st-shelf .bk-say{min-height:3.1em;margin-top:8px}
/* the bookshop's own sentence before (or without) the bookshop's stylesheet: the same look, from the page's tokens */
.st-shelf .bk-sr{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
.st-shelf:not(.is-case) .bk-line{display:flex;flex-wrap:wrap;align-items:baseline;gap:6px 10px;margin:0;font:440 clamp(22px,2.1vw,29px)/1.35 var(--display);color:var(--on-night-2)}
.st-shelf:not(.is-case) .bk-pick select{appearance:none;-webkit-appearance:none;background:transparent;border:0;border-bottom:2px solid var(--brass);border-radius:0;color:var(--on-night);font:520 clamp(22px,2.1vw,29px)/1.3 var(--display);padding:2px 8px 2px 2px;min-height:44px;max-width:100%}
.st-shelf:not(.is-case) .bk-pick select option{color:var(--ink);background:var(--ivory);font:16px var(--text)}
.st-shelf:not(.is-case) .bk-show{min-height:44px;padding:0 18px;border:1.5px solid var(--on-night-3);border-radius:10px;background:transparent;color:var(--on-night);font:600 var(--t-small)/1 var(--text);cursor:pointer}
.st-case-wrap{position:relative;margin-top:clamp(24px,3vw,40px)}
/* the closed book from Act II, lying at the left edge of the shelf, turned toward it */
.st-shelf.is-case .st-shelf.is-near .st-shelf #case[hidden]{display:none}
/* round 4, ruling 10: the bookcase's height is held before it arrives (story.ts STORY_CASE sets the numbers) */
.st-shelf #case{height:var(--st-case-wide,654px);overflow:hidden}
.st-shelf .bay{height:var(--st-bay,300px)}
.st-shelf .bay .scroller{height:100%}
.st-shelf .bay .track{height:100%}
@media (max-width:899px){.st-shelf #case{height:var(--st-case-phone,324px)}}
/* the bookshop's no-script button is not needed once the story's script runs, so the sentence keeps one height */
.st-shelf.has-js .bk-show{display:none}
.st-shelf .bk-case{display:flex;flex-direction:column;padding:0}
.st-shelf .bk-case .bk-shelf[data-off]{display:none}
.st-shelf.is-case .bk-shelf>h3,.st-shelf.is-case .bk-shelf .bk-group{display:none}
.st-shelf .bk-case .shelf{width:100%}
.st .st-shelf a.tc-btn--main,.st .st-shelf a.tc-btn--main:visited{color:var(--ink)}
.st-shelf__foot{display:flex;flex-wrap:wrap;align-items:center;gap:14px 28px;margin-top:clamp(22px,3vw,36px)}
.st-promises{margin:0;max-width:38em;font:400 var(--t-small)/1.5 var(--text);color:var(--on-night-2)}
@media (max-width:899px){
  .st-shelf__head{grid-template-columns:minmax(0,1fr)}
  .st-shelf.is-case }

@media (prefers-reduced-motion:reduce){
  .st-page::before,.st-shelf::before,.st-tab{transition:none}
}

/* round 4: the lifted corner is the control on the paper (the canvas takes the tap or drag; this is its keyboard twin) */
.st-cornerbtn{position:absolute;z-index:4;left:calc(var(--st-W) * .42 + 40px + var(--st-W) - 64px);top:calc(44px + var(--st-H) - 64px);width:64px;height:64px;padding:0;border:0;border-radius:6px;background:none;pointer-events:none}
.st-cornerbtn:focus-visible{outline:3px solid var(--focus-night,#A6C8FF);outline-offset:2px}
.st-cornerbtn[hidden]{display:none}
@media (max-width:1099px){.st-cornerbtn{left:calc(50% + var(--st-W) - 64px)}}
@media (max-width:699px){.st-cornerbtn{left:calc(44px + var(--st-W) - 64px);top:calc(34px + var(--st-H) - 64px)}.st-page .st-turn{margin:0 0 14px}}
.st-canvas--base{z-index:0;pointer-events:none}
/* the block that followed the hero's buttons (moved here, word for word) */
.st-after-hero{padding:clamp(20px,3vw,40px) var(--og,20px) clamp(36px,5vw,64px)}
.st-after-hero .tc-hero__after{max-width:1320px;margin:0 auto;padding:0}
/* on the home page only part of the bookcase shows, so the bookshop's count of every book for a class would not be
   true of what is on screen: the count lives on the bookshop's own page (round 4, ruling 4) */
.st-shelf .bk-say{display:none}
/* round 4, smoothness: each canvas is its own composited layer, so redrawing the moving sheet never repaints the
   table, its masked plate or the words around it */
.st-canvas{will-change:transform;transform:translateZ(0)}

.st-canvas--lo{pointer-events:none;z-index:2}

/* hotfix, 4 Dec 2026: the moving sheet's canvas reaches above and beside the stage, and on narrow screens it was
   taking the taps meant for the button and links in the words. Those controls sit above it. */
.st-turn,.st-ctas{position:relative;z-index:3}
