/* 2 stylesheets that index.html loads at this point of the cascade, inlined in order by Vite. *//* Hallmark · macrostructure: Marquee Hero (quiet, full first screen, one scene below) · tone: austere · anchor hue: existing theme
 * genre: editorial / modern-minimal · theme: locked Bookslop · nav: brand only · footer: compact colophon
 * Audience: readers practising typing. Action: read a full book. Existing Newsreader roman / IBM Plex.
 * Recovered Zen DNA: centred serif scale, one accent word, solid action, generous negative space.
 * User-required exceptions: centred typing headline, existing neutral palette and WebGL field.
 * No new imagery; no project memory or theme exports in this Welcome layout.
 * The hero fills the first screen. Scrolling dissolves it into one second scene. */
.landing.welcome-onepage {
 --quiet-space:clamp(16px,3.55svh,32px);
 --color-welcome-veil:color-mix(in srgb,var(--color-paper) 30%,transparent);
 position:relative;isolation:isolate;display:flex;flex-direction:column;
}
:root[data-theme="light"] .landing.welcome-onepage {
 --color-welcome-veil:color-mix(in srgb,var(--color-paper) 16%,transparent);
}

/* Animated background: the liquid-wave field fills the screen behind the page.
 * The renderer reads the two welcome tokens below and follows the saved theme. */
:root[data-welcome-liquid]{
 --color-welcome-accent:color-mix(in oklch,var(--color-accent) 70%,var(--color-muted));
 --color-welcome-glow:color-mix(in oklch,var(--theme-dark-glow) 60%,var(--color-paper));
}
:root[data-welcome-liquid][data-theme="light"]{--color-welcome-glow:color-mix(in oklch,var(--theme-light-glow) 55%,var(--color-paper))}
@supports(color:oklch(from red l c h)){
 :root[data-welcome-liquid]{--color-welcome-glow:oklch(from var(--theme-dark-glow) min(l,.48) calc(c * .55) h)}
 :root[data-welcome-liquid][data-theme="light"]{--color-welcome-glow:oklch(from var(--theme-light-glow) max(l,.70) calc(c * .45) h)}
}
.landing .welcome-atmosphere{position:fixed;inset:0;z-index:-1;width:100%;height:100%;overflow:clip;pointer-events:none;background:var(--color-paper)}
/* Sized to the large viewport, so mobile toolbars showing and hiding never resize
 * (and clear) the wave canvas. */
.landing.welcome-onepage .welcome-atmosphere{bottom:auto;height:100vh;height:100lvh}
.landing #welcome-gradient{position:absolute;inset:0;width:100%;height:100%}
.landing #welcome-gradient canvas{display:block;width:100%;height:100%;touch-action:auto!important;opacity:0;transition:opacity 300ms var(--ease-out)}
:root[data-shader-state="ready"] .landing #welcome-gradient canvas{opacity:1}
/* The waves start as plain page colour and bloom in through the shader's reveal once the headline entrance finishes. */
/* On phones the browser's toolbar areas show the plain page colour, so the waves
 * fade into it over the top 96px and the bottom 160px instead of ending in a hard line.
 * The bottom fade ends at the small viewport's bottom (100svh), the edge visible while
 * the toolbars show; the layer itself is 100lvh tall, so a fade at its own bottom sat
 * hidden behind the toolbar. Below 100svh the overlay stays solid page colour.
 * Page-colour gradients laid over the canvas do this without the per-frame cost
 * of masking the animated canvas. */
@media (max-width:767px), (hover:none) and (pointer:coarse) {
 .landing.welcome-onepage #welcome-gradient::before,
 .landing.welcome-onepage #welcome-gradient::after {
  content:'';position:absolute;left:0;right:0;z-index:1;height:96px;pointer-events:none;
  background:linear-gradient(var(--color-paper),color-mix(in srgb,var(--color-paper) 0%,transparent));
 }
 .landing.welcome-onepage #welcome-gradient::before { top:0; }
 .landing.welcome-onepage #welcome-gradient::after {
  top:calc(100svh - 160px);bottom:0;height:auto;
  background:linear-gradient(color-mix(in srgb,var(--color-paper) 0%,transparent),var(--color-paper) 160px);
 }
}
:root[data-shader-state="fallback"] .landing #welcome-gradient :is(canvas,div){display:none}
/* An even page-colour veil keeps the headline and key points readable over the waves. */
.landing .welcome-atmosphere::after{content:'';position:absolute;inset:0;background:var(--color-welcome-veil)}


/* The hero is exactly the first screen; the scenes below scroll normally. */
.landing.welcome-onepage .landing-hero {
 position:relative;flex:none;display:flex;flex-direction:column;min-width:0;
 min-height:100vh;min-height:100svh;
}
.landing.welcome-onepage .landing-scroll-cue {
 flex:none;display:flex;justify-content:center;padding:20px 0 24px;color:var(--color-muted);pointer-events:none;
}
.landing.welcome-onepage .landing-scroll-button {
 pointer-events:auto;display:grid;place-items:center;width:44px;height:44px;margin:-13px;padding:0;border:0;border-radius:999px;
 background:none;color:inherit;cursor:pointer;-webkit-tap-highlight-color:transparent;transition:color .2s ease;
}
.landing.welcome-onepage .landing-scroll-button:hover { color:var(--color-ink); }
.landing.welcome-onepage .landing-scroll-button:focus { outline:none; }
.landing.welcome-onepage .landing-scroll-cue svg { width:18px;height:18px;animation:landing-scroll-cue 2.4s ease-in-out infinite; }
@keyframes landing-scroll-cue { 0%,100% { transform:translateY(-3px);opacity:.55; } 50% { transform:translateY(3px);opacity:1; } }

/* A centred reading axis, with the existing brand as the only header content. */
.landing.welcome-onepage .landing-nav { background:var(--color-clear);flex:none; }
.landing.welcome-onepage .landing-wrap {
 flex:1;display:flex;flex-direction:column;min-width:0;width:100%;max-width:1200px;
 margin:0 auto;padding-inline:var(--site-header-padding);
}
.landing.welcome-onepage main { flex:1;display:flex;flex-direction:column;min-width:0; }
.landing.welcome-onepage .landing-stage {
 flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;
 min-width:0;gap:var(--quiet-space);padding-block:var(--quiet-space);
}
.landing.welcome-onepage .landing-heading { display:block;width:100%;padding:0;margin:0;text-align:center; }
.landing.welcome-onepage .landing-heading h1 {
 font-family:var(--font-display);font-style:normal;font-weight:400;
 font-size:clamp(64px,min(9.4vw,14.2svh),128px);line-height:1;letter-spacing:-.045em;
 text-wrap:balance;overflow-wrap:anywhere;min-width:0;
}
.landing.welcome-onepage .landing-heading h1>.headline-line { display:block;color:var(--color-ink); }
.landing.welcome-onepage .landing-heading h1>[data-character] { display:inline;color:inherit; }
/* Headline entrance: the document head script animates each .headline-word,
 * then the action, Zen-style. Until it starts they wait at its first frame;
 * the words are inline blocks so they can rise without changing layout. */
.landing.welcome-onepage .headline-word { display:inline-block;color:inherit; }
:root[data-welcome-pending] .landing.welcome-onepage :is(.headline-word,.landing-hero-action) { opacity:.001;transform:translateY(20px);filter:blur(4px); }
/* Only the words move during the entrance: the caret waits
 * until it has finished, unless typing starts first. */
:root[data-welcome-pending] .landing.welcome-onepage .landing-reader-copy:not(:has(.typed,.incorrect)) .landing-fluid-caret { opacity:0; }

/* The headline is the only passage. Its responsive display size stays stable while typing. */
.landing.welcome-onepage .landing-demo {
 position:relative;flex:none;width:100%;margin:0;padding:0;
 border:0;border-radius:0;background:var(--color-clear);box-shadow:none;
}
.landing.welcome-onepage .landing-reader { min-height:0;gap:0; }
.landing.welcome-onepage .landing-reader-copy { position:relative;min-height:0;padding:0;justify-content:center; }
.landing.welcome-onepage .landing-passage { width:100%;max-width:100%;white-space:normal;text-align:center;color:var(--color-ink); }
.landing.welcome-onepage .landing-passage [data-character] { position:relative; }
/* Once typing starts, the headline follows the reader's text levels: letters
 * still to type use the reader's upcoming ink and typed letters its full ink.
 * Until the first keystroke it stays in full ink, even with the field focused. */
.landing.welcome-onepage .landing-reader[data-typing-active="true"]:has(.landing-passage :is(.typed,.missing,.incorrect)) :is(.landing-passage,.landing-passage>.headline-line) { color:var(--reader-upcoming-ink); }
.landing.welcome-onepage .landing-passage [data-character].typed { color:var(--reader-typed-ink); }
/* A mistake at display size is only the letter in the error colour: no box,
 * underline or typed key, which would crowd the tall headline. */
.landing.welcome-onepage .landing-passage [data-character].incorrect { color:var(--color-error);background:none; }
.landing.welcome-onepage .landing-reader-copy .landing-passage .next::before { display:none; }
.landing.welcome-onepage .landing-fluid-caret {
 position:absolute;left:0;top:0;border-radius:1px;background:var(--color-accent);
 pointer-events:none;z-index:1;opacity:0;
}
.landing.welcome-onepage .landing-fluid-caret[data-incorrect="true"] { background:var(--color-error); }
.landing.welcome-onepage .landing-reader[data-typing-active="true"]:not([data-complete="true"]) .landing-fluid-caret { opacity:1; }

.landing.welcome-onepage .landing-hero-action { margin:0;max-width:100%; }
.landing.welcome-onepage .landing-hero-action .button {
 width:max-content;max-width:100%;min-height:64px;padding:18px 32px;gap:16px;
 border-radius:var(--radius-medium);font:500 18px/1.4 var(--font-body);white-space:nowrap;
 box-shadow:none;transition:transform var(--dur-fast) var(--ease-out);
}
.landing.welcome-onepage .landing-hero-action .button svg { width:20px;height:20px; }

/* Reading scene: the opening sentence of a starter book, set like a page.
 * With the scene script mounted, scrolling types it; without it the sentence
 * is simply there to read. */
/* The scroll scenes wait at their hidden first frame until the scene script
 * has mounted or given up, so a phone never shows their text while loading;
 * once mounted, each entrance plays when it scrolls into view. Without script
 * nothing is hidden: these root attributes are only set by script. */
:root:is([data-welcome-pending],[data-welcome-entered]) .landing.welcome-onepage:not([data-welcome-motion="ready"]) :is(.landing-read-passage,.landing-read-source,.landing-next h2,.landing-shelf>li,.landing-next-action) { opacity:.001; }
.landing.welcome-onepage .landing-read { position:relative;z-index:1;flex:none;min-width:0;min-height:100vh;min-height:100svh;display:flex; }
/* With the scene script mounted the reading scene pins for a long runway, so
 * scrolling types the sentence at a readable pace. Nothing else pins. */
.landing.welcome-onepage[data-welcome-scenes] .landing-read { display:block;height:520vh;height:520svh; }
.landing.welcome-onepage[data-welcome-scenes] .landing-read-pin { position:sticky;top:0;height:100vh;height:100svh; }
.landing.welcome-onepage .landing-read-pin {
 flex:1;display:flex;align-items:center;justify-content:center;width:100%;
 padding:clamp(48px,10svh,96px) var(--site-header-padding);
}
.landing.welcome-onepage .landing-read-figure { width:100%;max-width:960px;margin:0; }
.landing.welcome-onepage .landing-read-passage {
 margin:0;color:var(--color-ink);font:400 clamp(24px,min(3.5vw,5.4svh),48px)/1.32 var(--font-display);
 letter-spacing:-.015em;overflow-wrap:anywhere;
}
.landing.welcome-onepage .landing-read-passage [data-letter] {
 position:relative;color:color-mix(in srgb,var(--color-ink) 26%,transparent);transition:color 140ms var(--ease-out);
}
.landing.welcome-onepage .landing-read-passage [data-letter].typed { color:var(--color-ink); }
/* The reader's 2px caret sits before the next letter, or after the last one. */
.landing.welcome-onepage .landing-read-passage [data-letter].next::before,
.landing.welcome-onepage .landing-read-passage [data-letter].last::after {
 content:'';position:absolute;left:-2px;top:.14em;bottom:.14em;width:2px;border-radius:1px;background:var(--color-accent);
}
.landing.welcome-onepage .landing-read-passage [data-letter].last::after { left:auto;right:-2px; }
/* The credit sits flush with the passage: the book and chapter in quiet body text. */
.landing.welcome-onepage .landing-read figcaption { display:flex;flex-direction:column;gap:6px;margin-top:clamp(28px,4.8svh,44px); }
.landing.welcome-onepage .landing-read-source { color:var(--color-muted);font:400 14px/1.5 var(--font-body); }
.landing.welcome-onepage .landing-read cite { color:var(--color-body);font-style:normal; }
/* A deliberate mistake: the letter keeps its source character in the error
 * colour, with no box or typed key, until the scroll backspaces and retypes it. */
.landing.welcome-onepage .landing-read-passage [data-letter].incorrect { color:var(--color-error); }
.landing.welcome-onepage .landing-read-passage [data-letter].next.incorrect::before { background:var(--color-error); }
/* As in the reader, the caret is the error colour while a mistake is uncorrected. */
.landing.welcome-onepage .landing-read-passage [data-letter].after-mistake.next::before,
.landing.welcome-onepage .landing-read-passage [data-letter].after-mistake.last::after { background:var(--color-error); }
/* Line by line, like the reader: once the scene script groups the passage into
 * its wrapped lines, a fixed three-line window shows the line being typed in the
 * middle at full strength, with the previous and next lines smaller and dimmed.
 * Every line is the same height with the same room below it, so the
 * page never changes height; only the window slides when a line is finished. */
.landing.welcome-onepage .landing-read-passage.is-lined {
 --row:calc(1lh + .9em);
 position:relative;height:calc(var(--row) * 3);overflow:hidden;
}
.landing.welcome-onepage .landing-read-passage.is-lined .landing-read-line {
 position:absolute;left:0;right:0;top:0;display:block;white-space:pre;
 transform:translateY(calc((var(--index) - var(--line,0) + 1) * var(--row))) scale(var(--scale,1));
 transform-origin:left center;opacity:var(--fade,1);
 transition:transform 320ms var(--ease-out),opacity 320ms var(--ease-out);
}
.landing.welcome-onepage .landing-read-line[data-place="previous"],
.landing.welcome-onepage .landing-read-line[data-place="next"] { --scale:.8;--fade:.45; }
.landing.welcome-onepage .landing-read-line[data-place="away"] { --scale:.8;--fade:0; }
/* Closing scene: one statement and the same action.
 * Its own page-colour wash rises with it, so small text stays readable over the waves. */
.landing.welcome-onepage .landing-next {
 position:relative;z-index:1;flex:none;display:flex;flex-direction:column;min-width:0;
 min-height:100vh;min-height:100svh;
 background:linear-gradient(to bottom,transparent,color-mix(in srgb,var(--color-paper) 38%,transparent) 32svh);
}
.landing.welcome-onepage .landing-next-inner {
 flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;
 gap:clamp(32px,6svh,64px);width:100%;max-width:1200px;margin:0 auto;
 padding:clamp(72px,14svh,144px) var(--site-header-padding) clamp(32px,6svh,64px);
}
.landing.welcome-onepage .landing-next h2 {
 font-size:clamp(44px,min(5.6vw,9svh),80px);line-height:1;letter-spacing:-.04em;
 text-align:center;text-wrap:balance;
}
/* The scroll fade splits the heading into [data-word] spans; only the second line is a block. */
.landing.welcome-onepage .landing-next h2>span:not([data-word]) { display:block;color:var(--color-accent); }
.landing.welcome-onepage .landing-next h2 [data-word] { display:inline-block; }
/* The three starter classics as their historical covers; each opens its book, downloading it first when missing. */
.landing.welcome-onepage .landing-shelf {
 display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:clamp(16px,3.2vw,40px);
 width:100%;max-width:760px;margin:0;padding:0;list-style:none;
}
.landing.welcome-onepage .landing-shelf-book { display:flex;flex-direction:column;gap:6px;min-width:0;color:inherit;text-decoration:none;text-align:center; }
/* Keep the shared link hover's panel and colour change off the covers. */
.landing.welcome-onepage .landing-shelf-book:hover { background:transparent;color:inherit; }
.landing.welcome-onepage .landing-shelf-book img {
 display:block;width:100%;height:auto;aspect-ratio:413/640;object-fit:cover;margin-bottom:10px;
 border-radius:4px;background:var(--color-surface);
 box-shadow:0 1px 2px color-mix(in srgb,#000 30%,transparent),0 18px 40px -18px color-mix(in srgb,#000 70%,transparent);
 transition:filter var(--dur-slow) var(--ease-out);
}
@media (hover:hover) {
 .landing.welcome-onepage .landing-shelf-book:hover img { filter:brightness(1.08); }
}
.landing.welcome-onepage .landing-shelf-title { color:var(--color-ink);font:400 clamp(15px,1.5vw,19px)/1.25 var(--font-display);letter-spacing:-.01em;overflow-wrap:anywhere;text-wrap:balance; }
.landing.welcome-onepage .landing-next-action .button {
 width:max-content;max-width:100%;min-height:56px;padding:14px 28px;gap:14px;
 border-radius:var(--radius-medium);font:500 17px/1.4 var(--font-body);white-space:nowrap;box-shadow:none;
}
.landing.welcome-onepage .landing-next-action .button svg { width:18px;height:18px; }

/* Policy links sit quietly at the bottom of the second scene. */
.landing.welcome-onepage .landing-colophon { flex:none;display:flex;flex-direction:column;align-items:center;gap:20px;padding:20px 0 16px; }
.landing.welcome-onepage .landing-footer { flex:none;margin:0;padding:0;justify-content:center; }
.landing.welcome-onepage .landing-footer nav { justify-content:center;gap:0 24px; }
.landing.welcome-onepage .landing-footer .policy-link { color:var(--color-body); }
.landing.welcome-onepage :is(a,button):focus-visible { outline:2px solid var(--color-accent);outline-offset:4px;box-shadow:none; }
@media(max-width:767px) {
 .landing.welcome-onepage { --quiet-space:clamp(16px,3.2svh,24px); }
 .landing.welcome-onepage .landing-wrap { padding-inline:20px; }
 .landing.welcome-onepage .landing-heading h1 { font-size:clamp(40px,13vw,72px);line-height:1.02; }
 .landing.welcome-onepage .landing-demo { width:100%; }
 .landing.welcome-onepage .landing-hero-action .button { min-height:56px;padding:16px 28px;font-size:17px;gap:12px; }
 .landing.welcome-onepage .landing-colophon { width:100%;gap:20px;padding-block:20px 16px; }
 .landing.welcome-onepage .landing-footer nav { gap:0 24px; }
 .landing.welcome-onepage .landing-scroll-cue { padding:16px 0 20px; }
 .landing.welcome-onepage .landing-read-pin { padding-inline:20px; }
 .landing.welcome-onepage .landing-read-passage { font-size:clamp(24px,min(7vw,4.4svh),32px); }
 .landing.welcome-onepage .landing-read-source { font-size:13px; }
 .landing.welcome-onepage .landing-next-inner { padding-inline:20px;gap:32px; }
 .landing.welcome-onepage .landing-next h2 { font-size:clamp(36px,11vw,60px);line-height:1.02; }
 .landing.welcome-onepage .landing-shelf { gap:12px; }
 .landing.welcome-onepage .landing-shelf-title { font-size:14px; }
 .landing.welcome-onepage .landing-shelf-author { font-size:11px; }
}
@media(max-width:767px) and (max-height:700px) {
 .landing.welcome-onepage { --quiet-space:16px; }
 .landing.welcome-onepage .landing-scroll-cue { padding:10px 0 14px; }
 .landing.welcome-onepage .landing-colophon { gap:12px;padding-block:12px 12px; }
}
@media(min-width:768px) and (max-height:700px) {
 .landing.welcome-onepage { --quiet-space:20px; }
 .landing.welcome-onepage .landing-scroll-cue { padding:12px 0 16px; }
 .landing.welcome-onepage .landing-next-inner { gap:28px;padding-top:56px; }
 .landing.welcome-onepage .landing-heading h1 { font-size:clamp(64px,12.5svh,88px); }
 .landing.welcome-onepage .landing-hero-action .button { min-height:56px;padding-block:14px; }
 .landing.welcome-onepage .landing-colophon { gap:12px;padding-block:12px 12px; }
}
@media(forced-colors:active) { .landing.welcome-onepage .welcome-atmosphere { display:none; } }
/* The shared caret supplies positioning; character highlights only change ink.
   Avoid turning a different inline span into a positioned box on every key. */
.reader[data-caret-style] :is(.typing-passage,.rapid-word) .current { position:static; }
