mirror of
https://github.com/bitbaum/heidi.git
synced 2026-12-04 05:37:48 +01:00
* CTAs speak as a command to the learner: «Frag Heidi» Buttons and links that start an action are imperatives addressed to the learner (owner's decision), so the brand phrase, the domain and the buttons say the same thing: «Frag Heidi» (was «Heidi fragen»), «Frag Heidi, warum», «Entdecke die Situationen», «Fang an», «Probier es aus», «Erstell dein Gratis-Konto», and the home, chat, plans, warm-up, practice, play, groups, languages and organisations doors alike. du-form in German (Sie kept on the organisations page, which addresses organisations as Sie), tu in fr/it, ti in rm, ты in ru; English only «Create your free account». Swiss German changes only where the imperative has a source: «Frag d Heidi» (verb «frage» in the gsw-zh pack; imperative «frag» in Wiktionary's Zurich conjugation table), «Lueg … aa» and «Mach …» (the pack's imperative topic). Other gsw labels keep their infinitives. Single-word tab-like labels («Üben», «Starten») and status texts unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019MDtmtfseicWGK2CMC2U5r * gsw: «Frög d Heidi» (Zurich imperative of fröge) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019MDtmtfseicWGK2CMC2U5r * Heidi Max next to Heidi Plus; owner payment settings and «Stripe einrichten» - paykit 0.7.0. One tier answer (lib/pay/tier.ts: free | plus | max from the entitlement's plan id; the one-time pass counts as plus), read by the caps (capsFor, HEIDI_CAP_MAX_*; Max defaults to 3x Plus), the model route (chainFor: HEIDI_MAX_MODELS first, else exactly the Plus route) and the Rückblick (REVIEW_EVERY_DAYS_BY_TIER: max 7, plus/free 30). - /plans: Free | Plus | Max | own key | Organisations on PlanPicker, Max priced from HEIDI_MAX_* (no price in code); review step per plan; without payment switched on the review says so instead of a pay button; a Stripe TEST key shows «Testmodus». - Back office Geld -> «Zahlungen» (/manage/money/payments): eight prices, sales, Stripe key and webhook secret in pay_settings (migration 0035), secrets sealed and never sent to the page; stored value over env over off. - «Stripe einrichten»: makes or finds Products/Prices, the customer-portal configuration (cancel, card, switch Plus/Max) and the webhook endpoint, storing its signing secret; idempotent, one result per step. - Webhook reads the plan from the subscription's Price, so portal switches move the tier. - Words in all seven dictionaries; changelog 2026-12-03. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019MDtmtfseicWGK2CMC2U5r * Paid allowances never below the tier below; Plus and Max cards list them - caps.ts: every paid allowance is at least the tier below (daily with 0 as no count; Plus dictation per 30 days at least free's daily x 30). Plus daily defaults to 3x free (300), Max to 3x Plus (900); voice 1200/3600 s. - plan-cards.ts: one paidBenefits shape for Plus and Max from capsFor: questions a day, Heidi's voice minutes, dictations per 30 days, the Rückblick rhythm, then Max's two «bald» lines, then «Alles aus …». The free card says Heidi's own voice comes with Plus and Max. - All seven dictionaries; changelog lines for the fix. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019MDtmtfseicWGK2CMC2U5r --------- Co-authored-by: Claude <noreply@anthropic.com>
1260 lines
50 KiB
CSS
1260 lines
50 KiB
CSS
@import "tailwindcss";
|
||
@import "@bitbaum/chatkit/styles.css";
|
||
@import "@bitbaum/accountkit/styles.css";
|
||
@import "@bitbaum/bip-kit/styles.css";
|
||
@import "@bitbaum/paykit/styles.css";
|
||
|
||
/**
|
||
* Heidi — design tokens. The only place a colour, font or radius is defined.
|
||
*
|
||
* THE COW.
|
||
*
|
||
* A Swiss dairy cow is black and white and nothing else, and that is the whole
|
||
* palette: one ground, one ink, hard edges between them. It suits the subject
|
||
* (a dialect atlas is printed matter, not a dashboard) and it suits Swiss
|
||
* design, which has been grotesque type on white since Müller-Brockmann.
|
||
*
|
||
* It also solves dark mode properly rather than approximately. Most palettes
|
||
* need a second set of hand-picked colours for dark, which drift apart until
|
||
* one of them is wrong. Here dark mode is the SAME two values swapping roles —
|
||
* ink becomes ground, ground becomes ink. A cow is still a cow at night.
|
||
*
|
||
* One colour survives: Swiss red, and only for the isogloss — the line a
|
||
* dialect atlas draws where one form stops and another begins. It marks the
|
||
* thing being taught and the thing needing attention, and nothing else. A
|
||
* palette with one accent spends it carefully.
|
||
*
|
||
* Tier 1 primitives — raw values, never used by a component
|
||
* Tier 2 semantics — what components use, always
|
||
*
|
||
* Component classes never changed for this retheme. That is the point of the
|
||
* two tiers: the whole product changed appearance by editing this file.
|
||
*/
|
||
@theme {
|
||
/* Swiss International Style is grotesque type, not a serif — and now the
|
||
SAME grotesque on every device. The stack used to be the reader's own
|
||
("Helvetica Neue" first), which only Apple ships: Windows drew Arial,
|
||
Android drew Roboto, and the design existed only on a Mac. Inter is the
|
||
open grotesque closest to it, self-hosted by @bitbaum/design-tokens
|
||
(app/fonts.ts, generated), with Cyrillic for the Russian site. */
|
||
--font-heading:
|
||
var(--font-inter), "Helvetica Neue", Helvetica, system-ui, -apple-system,
|
||
"Segoe UI", Arial, sans-serif;
|
||
--font-sans:
|
||
var(--font-inter), "Helvetica Neue", Helvetica, system-ui, -apple-system,
|
||
"Segoe UI", Arial, sans-serif;
|
||
--font-mono:
|
||
var(--font-plex-mono), ui-monospace, "SF Mono", Menlo, Consolas,
|
||
"Liberation Mono", monospace;
|
||
|
||
/* Tight display tracking: grotesque headlines set close, the Swiss habit. */
|
||
--tracking-display: -0.025em;
|
||
--tracking-caps: 0.12em;
|
||
/**
|
||
* The phone breakpoint this project actually needs.
|
||
*
|
||
* Tailwind's smallest is `sm` at 640px, which is a tablet. Every real
|
||
* decision here is between a 320px phone and a 390px one — whether the
|
||
* wordmark fits beside the account control, whether a label can be a word —
|
||
* and there was no breakpoint to make it at. So there is one, named for
|
||
* what it is rather than for a device.
|
||
*/
|
||
--breakpoint-xs: 380px;
|
||
|
||
--spacing-shell: 72rem;
|
||
--spacing-measure: 66ch;
|
||
|
||
/*
|
||
* The height of the sticky site header — a DECISION, not a measurement.
|
||
*
|
||
* It used to be neither: the header had no height, so 69px emerged from
|
||
* `min-h-11` on the home link plus `py-3` plus the bottom border, and three
|
||
* other places guessed at it. Section headings carried `scroll-mt-20`,
|
||
* `scroll-mt-24` AND `scroll-mt-28` (2, 15 and 7 uses) — three different
|
||
* answers to "how far below the top does an anchor land", all of them
|
||
* clearing 69px by luck rather than by construction.
|
||
*
|
||
* Worse, the on-this-page rail pinned itself at `top: 0`, which is where the
|
||
* header already is. It never showed, because `SectionNavLayout` gave it a
|
||
* wrapper exactly its own height and a sticky element with no room to travel
|
||
* simply scrolls away — so the rail's whole mobile treatment (the blur, the
|
||
* z-index, the border) was styling for a state that could not happen.
|
||
*
|
||
* Written here, everything that needs to clear the header reads the same
|
||
* value, and `header.test.ts` fails if the rendered header stops matching.
|
||
*/
|
||
--header-height: 4.3125rem; /* 69px */
|
||
|
||
/*
|
||
* The type scale, fluid.
|
||
*
|
||
* It was `text-[2.75rem] sm:text-7xl lg:text-8xl` written out at each
|
||
* headline, which is three hand-picked sizes and two guesses about what
|
||
* happens between them — and the guess was wrong: at 390px the home
|
||
* headline ran off the right edge of the phone, because 2.75rem of
|
||
* "Schweizerdeutsch" is wider than a 350px column.
|
||
*
|
||
* `clamp` removes the guess. The middle term is the size the text WANTS at
|
||
* a given viewport; the outer two stop it being unreadable on a watch or
|
||
* absurd on a monitor. One token per role, so a headline is `text-display`
|
||
* everywhere and the scale is decided here, once.
|
||
*/
|
||
--text-display: clamp(2.25rem, 7.2vw, 5.5rem);
|
||
--text-title: clamp(1.875rem, 4.4vw, 3.25rem);
|
||
--text-section: clamp(1.5rem, 2.6vw, 2rem);
|
||
--text-lead: clamp(1.0625rem, 1.4vw, 1.25rem);
|
||
/*
|
||
* The one headline a page opens with — the home page, a personal greeting.
|
||
*
|
||
* `text-display` starts at 2.25rem, and 2.25rem of «Schweizerdeutsch» in
|
||
* the heavy weight is wider than the 280px column of a 320px phone. This
|
||
* one is sized from the viewport all the way down, so the longest word of
|
||
* the product's own name fits on the narrowest phone and still opens the
|
||
* page at a size nothing else on it reaches.
|
||
*/
|
||
--text-hero: clamp(1.75rem, 8.8vw, 5rem);
|
||
/*
|
||
* The eyebrow / label size, which was `text-[11px]` and `text-[10px]`
|
||
* scattered across three dozen components.
|
||
*
|
||
* Two problems, and the second is why it is a token. Ten and eleven pixels
|
||
* are below what anybody reads on a phone — a responsive audit flagged them
|
||
* on every page — and a size written as an arbitrary value in each component
|
||
* cannot be changed anywhere. This file is the only source for type, and a
|
||
* caption is type.
|
||
*
|
||
* 12px is the floor rather than a preference: it is the smallest size that
|
||
* survives a phone held at arm's length on a tram, which is where this
|
||
* product is read.
|
||
*/
|
||
--text-caption: 0.75rem;
|
||
|
||
/*
|
||
* The navigation bar's own size, one notch under body text.
|
||
*
|
||
* A token for a single role rather than a rounding to `text-sm`, because the
|
||
* 13px is LOAD-BEARING: the bar was rebuilt to fit a measured 1024px French
|
||
* layout with sixteen pixels to spare, and a pixel per label across the row
|
||
* is enough to spend that. Rounding it up would silently undo the
|
||
* measurement the restructure was for.
|
||
*
|
||
* So it is written down here, where the next person changing the nav can see
|
||
* that the size is a decision and read why.
|
||
*/
|
||
--text-nav: 0.8125rem;
|
||
|
||
/* Tier 1 — primitives. Two of them, and the greys between. */
|
||
--primitive-white: #ffffff;
|
||
--primitive-black: #0d0d0d;
|
||
--primitive-grey-50: #f6f6f6;
|
||
--primitive-grey-100: #ededed;
|
||
--primitive-grey-200: #dcdcdc;
|
||
--primitive-grey-400: #a3a3a3;
|
||
--primitive-grey-600: #6b6b6b;
|
||
--primitive-grey-800: #2b2b2b;
|
||
/* Two near-blacks for dark mode's layers: a card has to read as lying ON
|
||
the page, and on a black page a border alone does not say that. */
|
||
--primitive-grey-900: #1b1b1b;
|
||
--primitive-grey-950: #131313;
|
||
/* The isogloss. Swiss red, and the only colour in the product. */
|
||
--primitive-red: #d8232a;
|
||
--primitive-red-tint: #fdecec;
|
||
/*
|
||
* The same red as an INK, for text that is read at length.
|
||
*
|
||
* The rule below — "reserving red for the isogloss is what keeps it
|
||
* meaningful" — was right and stopped being true. Flag red spread to every
|
||
* primary button, every selected option, every error, every eyebrow label
|
||
* AND every dialect word: one practice screen carried three solid red
|
||
* blocks before the learner had answered anything, and it was reported,
|
||
* fairly, as aggressive. A colour that means five things means none.
|
||
*
|
||
* So the hue stays — still the only colour here — and each MEANING gets its
|
||
* own role: this deep ink for dialect text, black for actions, flag red only
|
||
* where alarm is the right message.
|
||
*/
|
||
--primitive-red-ink: #9b1c22;
|
||
|
||
/* Tier 2 — semantics (light: white cow, black patches) */
|
||
--color-surface-page: var(--primitive-white);
|
||
--color-surface-raised: var(--primitive-grey-50);
|
||
--color-surface-sunk: var(--primitive-grey-100);
|
||
/*
|
||
* DEPTH, in the cow's own two values — no new hue.
|
||
*
|
||
* Every surface here was a 1px box on a flat page, and boxes inside boxes
|
||
* was the whole vocabulary: nothing was nearer than anything else, so
|
||
* nothing said "start here". Three roles fix that without a third colour:
|
||
*
|
||
* sky the top of a page that opens with a headline; fades into the page
|
||
* card what lies ON the page and can be acted on
|
||
* shadow-card / shadow-lift how far above the page it lies
|
||
*
|
||
* A lifted card is reserved for the ONE thing a screen wants done next.
|
||
*/
|
||
--color-surface-sky: var(--primitive-grey-100);
|
||
--color-surface-card: var(--primitive-white);
|
||
--shadow-card: 0 1px 2px rgb(13 13 13 / 0.05), 0 6px 16px -10px rgb(13 13 13 / 0.14);
|
||
--shadow-lift: 0 1px 2px rgb(13 13 13 / 0.06), 0 18px 40px -18px rgb(13 13 13 / 0.28);
|
||
--color-fg-primary: var(--primitive-black);
|
||
--color-fg-secondary: var(--primitive-grey-800);
|
||
--color-fg-muted: var(--primitive-grey-600);
|
||
--color-border-subtle: var(--primitive-grey-200);
|
||
--color-border-strong: var(--primitive-black);
|
||
--color-accent: var(--primitive-red);
|
||
--color-accent-tint: var(--primitive-red-tint);
|
||
/* Links and marks are ink, not a third colour — underlines carry the
|
||
affordance. Reserving red for the isogloss is what keeps it meaningful. */
|
||
--color-link: var(--primitive-black);
|
||
--color-link-tint: var(--primitive-grey-100);
|
||
--color-dialect: var(--primitive-red-ink);
|
||
--color-ok: var(--primitive-black);
|
||
--color-on-accent: var(--primitive-white);
|
||
/* What you press. Black: a page of red buttons is a page shouting. */
|
||
--color-action: var(--primitive-black);
|
||
--color-on-action: var(--primitive-white);
|
||
/* What floats over every page — the dock's «Üben | Frag Heidi» pill.
|
||
Black on the white page, like an action. In dark it does NOT flip to
|
||
white like an action does: a white slab that never leaves the corner of
|
||
a dark screen was reported as a bug, and a control that is always there
|
||
should be the quietest thing on the page, not the loudest. */
|
||
--color-float: var(--primitive-black);
|
||
--color-on-float: var(--primitive-white);
|
||
/* The dimming behind a dialog, a sheet or an open menu. Black in BOTH
|
||
themes — never flipped. It was `fg-primary` at 20–40%, which in dark mode
|
||
is white: every dialog laid a white haze over a dark page. */
|
||
--color-scrim: var(--primitive-black);
|
||
/* Something went wrong — the one place flag red is the right message. */
|
||
--color-danger: var(--primitive-red);
|
||
/* An answer, judged — in Heidi's own two colours, no third. Right is INK
|
||
(the action colour: solid black, white in dark); wrong is the flag red
|
||
the theme already reserves for "something went wrong". What tells them
|
||
apart from an unanswered button is the mark (✓ / ✕) and the fill, not a
|
||
green that belongs to no other screen. Aliases, so dark follows. */
|
||
--color-correct: var(--color-action);
|
||
--color-correct-tint: var(--color-surface-sunk);
|
||
--color-on-correct: var(--color-on-action);
|
||
--color-incorrect: var(--color-danger);
|
||
--color-incorrect-tint: var(--color-accent-tint);
|
||
--color-on-incorrect: var(--color-on-accent);
|
||
/* WORDS that say "wrong", on the incorrect tint. Flag red on its own tint
|
||
is 4.4:1 — under the 4.5 that body text needs — so the words take the
|
||
deep red ink and the outline and the cross keep the flag red. Dark keeps
|
||
its lifted red, 5.8:1 on the dark tint (set in both dark blocks). */
|
||
--color-incorrect-ink: var(--primitive-red-ink);
|
||
/* A Swiss flag is white on red in every theme — deliberately not flipped
|
||
in dark mode, unlike every other token here. */
|
||
--color-flag: var(--primitive-red);
|
||
--color-flag-cross: var(--primitive-white);
|
||
|
||
/* The language map (`language-map.tsx`): land, the lines between areas,
|
||
the hatch that tells the other national languages apart, the lakes and
|
||
the area under the pointer. Its own roles because the surfaces it would
|
||
borrow are all near-black in dark, where twenty areas then read as one. */
|
||
--color-map-land: var(--primitive-grey-100);
|
||
--color-map-edge: var(--primitive-grey-600);
|
||
--color-map-hatch: var(--primitive-grey-600);
|
||
--color-map-water: var(--primitive-white);
|
||
--color-map-hover: var(--primitive-red-tint);
|
||
|
||
/* Hard edges. A cow's patches have no corner radius. */
|
||
--radius-control: 2px;
|
||
}
|
||
|
||
/* BIP Kit owns typed record structure; these local mappings keep Heidi's
|
||
monochrome dialect-atlas design and dark-mode roles. */
|
||
.bp-roadmap,
|
||
.bp-changelog {
|
||
--bp-font-sans: var(--font-sans);
|
||
--bp-font-mono: var(--font-mono);
|
||
--bp-size: 1rem;
|
||
--bp-leading: 1.65;
|
||
--bp-measure: 66ch;
|
||
--bp-flow: 1.75rem;
|
||
--bp-radius-sm: 0;
|
||
--bp-fg: var(--color-fg-primary);
|
||
--bp-fg-muted: var(--color-fg-secondary);
|
||
--bp-fg-faint: var(--color-fg-muted);
|
||
--bp-border: var(--color-border-subtle);
|
||
--bp-accent: var(--color-accent);
|
||
--bp-bg: transparent;
|
||
}
|
||
|
||
/* The sign-in error screen is @bitbaum/accountkit's SignInError; it takes
|
||
its look from these, the same way the chat does. */
|
||
:root {
|
||
--acct-fg: var(--color-fg-primary);
|
||
--acct-fg-2: var(--color-fg-secondary);
|
||
--acct-fg-3: var(--color-fg-muted);
|
||
--acct-line: var(--color-border-subtle);
|
||
--acct-line-2: var(--color-border-strong);
|
||
--acct-action: var(--color-action);
|
||
--acct-on-action: var(--color-on-action);
|
||
--acct-focus: var(--color-action);
|
||
--acct-radius-sm: var(--radius-control);
|
||
--acct-font: var(--font-sans);
|
||
}
|
||
|
||
/* The chat is @bitbaum/chatkit; it takes its look from these. Each points at
|
||
a token above, so dark mode flips it with nothing else to keep in sync.
|
||
The send button is the action colour (black), like every button here. */
|
||
:root {
|
||
--ck-page: var(--color-surface-page);
|
||
--ck-bg: var(--color-surface-page);
|
||
--ck-raised: var(--color-surface-raised);
|
||
--ck-overlay: var(--color-surface-raised);
|
||
--ck-fg: var(--color-fg-primary);
|
||
--ck-fg-2: var(--color-fg-secondary);
|
||
--ck-fg-3: var(--color-fg-muted);
|
||
--ck-muted: var(--color-fg-muted);
|
||
--ck-line: var(--color-border-subtle);
|
||
--ck-line-2: var(--color-border-strong);
|
||
--ck-accent: var(--color-action);
|
||
--ck-on-accent: var(--color-on-action);
|
||
--ck-danger: var(--color-danger);
|
||
--ck-on-danger: var(--color-on-accent);
|
||
--ck-warning: var(--color-accent);
|
||
--ck-radius: var(--radius-control);
|
||
--ck-radius-sm: var(--radius-control);
|
||
--ck-font: var(--font-sans);
|
||
--ck-mono: var(--font-mono);
|
||
}
|
||
|
||
/* The plan screens (/plans, its review step) are @bitbaum/paykit/react.
|
||
The same tokens: black action, the cow's lines and surfaces, and the
|
||
danger red for the one warning. No orange: that is Bitcoin's. */
|
||
:root {
|
||
--pk-fg: var(--color-fg-primary);
|
||
--pk-muted: var(--color-fg-secondary);
|
||
--pk-surface: var(--color-surface-page);
|
||
--pk-raised: var(--color-surface-raised);
|
||
--pk-line: var(--color-border-subtle);
|
||
--pk-line-strong: var(--color-border-strong);
|
||
--pk-action: var(--color-action);
|
||
--pk-on-action: var(--color-on-action);
|
||
--pk-badge: var(--color-action);
|
||
--pk-on-badge: var(--color-on-action);
|
||
--pk-warning: var(--color-danger);
|
||
--pk-focus: var(--color-action);
|
||
--pk-radius: var(--radius-control);
|
||
--pk-font: var(--font-sans);
|
||
--pk-display: var(--font-heading);
|
||
}
|
||
|
||
/* Five tiers (Free, Plus, Max, own key, Organisations) do not fit a phone as
|
||
equal slivers: «Organisationen» alone is wider than a fifth of it. One row
|
||
that scrolls sideways, each tab as wide as its name (fleet "One shape per
|
||
kind": many choices are one line that scrolls). paykit 0.7 lays out two
|
||
rows only for four tabs; this belongs in its styles.css, and goes when it
|
||
is there. */
|
||
@media (max-width: 40rem) {
|
||
.pk-switch[data-count="5"] {
|
||
grid-auto-columns: max-content;
|
||
overflow-x: auto;
|
||
scrollbar-width: none;
|
||
}
|
||
.pk-switch[data-count="5"] .pk-switch-tab {
|
||
white-space: nowrap;
|
||
padding-inline: 0.75rem;
|
||
}
|
||
}
|
||
|
||
/* Dark: the same cow, the other way round. Only the role of the two values
|
||
swaps — there is no second palette to keep in sync with the first. */
|
||
@media (prefers-color-scheme: dark) {
|
||
:root:not([data-theme="light"]) {
|
||
--color-surface-page: var(--primitive-black);
|
||
--color-surface-raised: #161616;
|
||
--color-surface-sunk: #202020;
|
||
--color-surface-sky: var(--primitive-grey-900);
|
||
--color-surface-card: var(--primitive-grey-950);
|
||
/* A shadow on black is invisible; in dark the lift is a hairline of
|
||
light along the card's edge instead. */
|
||
--shadow-card: 0 0 0 1px rgb(255 255 255 / 0.05);
|
||
--shadow-lift: 0 0 0 1px rgb(255 255 255 / 0.1), 0 24px 48px -24px rgb(0 0 0 / 0.9);
|
||
--color-fg-primary: var(--primitive-white);
|
||
--color-fg-secondary: #d4d4d4;
|
||
--color-fg-muted: var(--primitive-grey-400);
|
||
--color-border-subtle: #2e2e2e;
|
||
/* Not pure white: a white hairline on black is the loudest thing on the
|
||
screen, around a box that is not the point. The text stays white. */
|
||
--color-border-strong: var(--primitive-grey-400);
|
||
/* Lifted off the flag red: #d8232a on black fails contrast, this passes. */
|
||
--color-accent: #ff5a5f;
|
||
--color-accent-tint: #2a1112;
|
||
--color-link: var(--primitive-white);
|
||
--color-link-tint: #202020;
|
||
--color-dialect: #ec8a8f;
|
||
--color-ok: var(--primitive-white);
|
||
--color-on-accent: var(--primitive-black);
|
||
--color-action: var(--primitive-white);
|
||
--color-on-action: var(--primitive-black);
|
||
--color-float: #202020;
|
||
--color-on-float: var(--primitive-white);
|
||
--color-danger: #ff5a5f;
|
||
--color-incorrect-ink: #ff5a5f;
|
||
/* Land lifted well off the page, edges and hatch light enough to count
|
||
the areas, lakes as dark as the page, a hover that is visibly red. */
|
||
--color-map-land: #2e2e2e;
|
||
--color-map-edge: #8c8c8c;
|
||
--color-map-hatch: #b0b0b0;
|
||
--color-map-water: #0d0d0d;
|
||
--color-map-hover: #5c2326;
|
||
}
|
||
}
|
||
:root[data-theme="dark"] {
|
||
--color-surface-page: var(--primitive-black);
|
||
--color-surface-raised: #161616;
|
||
--color-surface-sunk: #202020;
|
||
--color-surface-sky: var(--primitive-grey-900);
|
||
--color-surface-card: var(--primitive-grey-950);
|
||
/* A shadow on black is invisible; in dark the lift is a hairline of
|
||
light along the card's edge instead. */
|
||
--shadow-card: 0 0 0 1px rgb(255 255 255 / 0.05);
|
||
--shadow-lift: 0 0 0 1px rgb(255 255 255 / 0.1), 0 24px 48px -24px rgb(0 0 0 / 0.9);
|
||
--color-fg-primary: var(--primitive-white);
|
||
--color-fg-secondary: #d4d4d4;
|
||
--color-fg-muted: var(--primitive-grey-400);
|
||
--color-border-subtle: #2e2e2e;
|
||
/* Not pure white — see the media query above; the two blocks agree. */
|
||
--color-border-strong: var(--primitive-grey-400);
|
||
--color-accent: #ff5a5f;
|
||
--color-accent-tint: #2a1112;
|
||
--color-link: var(--primitive-white);
|
||
--color-link-tint: #202020;
|
||
--color-dialect: #ec8a8f;
|
||
--color-ok: var(--primitive-white);
|
||
--color-on-accent: var(--primitive-black);
|
||
--color-action: var(--primitive-white);
|
||
--color-on-action: var(--primitive-black);
|
||
--color-float: #202020;
|
||
--color-on-float: var(--primitive-white);
|
||
--color-danger: #ff5a5f;
|
||
--color-incorrect-ink: #ff5a5f;
|
||
--color-map-land: #2e2e2e;
|
||
--color-map-edge: #8c8c8c;
|
||
--color-map-hatch: #b0b0b0;
|
||
--color-map-water: #0d0d0d;
|
||
--color-map-hover: #5c2326;
|
||
}
|
||
|
||
/**
|
||
* A grid column that is allowed to be narrower than its contents.
|
||
*
|
||
* THE DEFECT THIS EXISTS FOR. A grid track defaults to `auto`, and an `auto`
|
||
* track's automatic minimum is MIN-CONTENT — it refuses to be narrower than
|
||
* the widest unbreakable thing in it. One `truncate` line (which is
|
||
* `white-space: nowrap`, so its min-content is the whole sentence), one long
|
||
* compound, one URL, and the column becomes as wide as that string. The column
|
||
* drags the grid, the grid drags the page, and the reader on a phone is
|
||
* dragging the whole document sideways to read a card.
|
||
*
|
||
* Measured, not theorised: `/portal` with eleven ordinary saved words was
|
||
* 516px wide in a 360px viewport, and 912px once one of the words had been
|
||
* kept from a link. Nothing on that page was doing anything unusual.
|
||
*
|
||
* `grid-cols-2` and friends already spell `minmax(0, 1fr)`; a bare `grid` is
|
||
* the one that does not, and a bare `grid` is what a one-column-on-a-phone
|
||
* layout is. So this is that missing spelling, named, with the reason next to
|
||
* it. Put it on any grid whose base layout is a single column — the `sm:` and
|
||
* `lg:` column utilities that come later still win where they apply.
|
||
*/
|
||
@utility grid-cols-safe {
|
||
grid-template-columns: minmax(0, 1fr);
|
||
}
|
||
|
||
/*
|
||
* How far below the top an anchored heading comes to rest.
|
||
*
|
||
* ONE ANSWER, REPLACING THREE. `scroll-mt-20`, `scroll-mt-24` and
|
||
* `scroll-mt-28` were all in use — 2, 15 and 7 headings — and every one of
|
||
* them cleared the 69px header by accident rather than by intent, so a reader
|
||
* following two table-of-contents links on two pages got two different gaps.
|
||
*
|
||
* On a phone the on-this-page rail is sticky UNDER the header, so a heading
|
||
* has both to clear: the header plus one row of controls (`min-h-11` plus the
|
||
* strip's own `py-1.5`). From `lg` the rail moves into the margin and stops
|
||
* being in the way, so only the header counts.
|
||
*
|
||
* `--header-height` is the shared value; nothing here restates it.
|
||
*/
|
||
@utility scroll-mt-anchor {
|
||
scroll-margin-top: calc(var(--header-height) + 3.5rem + 0.5rem);
|
||
|
||
/* Nested INSIDE the utility: `@utility` cannot itself be nested in an
|
||
`@media`, and Tailwind rejects the file outright if it is. */
|
||
@media (width >= 64rem) {
|
||
scroll-margin-top: calc(var(--header-height) + 0.75rem);
|
||
}
|
||
}
|
||
|
||
/*
|
||
* The sky: the tinted top of a page that opens with a headline.
|
||
*
|
||
* Full-bleed inside the shell's own padding, and it FADES into the page
|
||
* rather than ending at a rule, so the headline sits in light instead of in
|
||
* a box. Dark mode is the same gradient from the other end of the palette.
|
||
*/
|
||
@utility bg-sky {
|
||
background-image: linear-gradient(
|
||
to bottom,
|
||
var(--color-surface-sky),
|
||
var(--color-surface-page)
|
||
);
|
||
}
|
||
|
||
/*
|
||
* A photograph ends by fading into the sky ground, not at an edge — so the
|
||
* headline under it sits on the ground's own colour, whatever the picture.
|
||
*/
|
||
@utility photo-fade {
|
||
background-image: linear-gradient(to bottom, transparent, var(--color-surface-sky));
|
||
}
|
||
|
||
/*
|
||
* THE TYPE SCALE, AS ROLES. One headline per screen, and everything else
|
||
* clearly smaller.
|
||
*
|
||
* Every page set its own title — `text-title font-semibold` here,
|
||
* `font-extrabold leading-[1.05]` there — and section headings were close
|
||
* enough in size to the title that a screen had no first thing. Three roles,
|
||
* written once:
|
||
*
|
||
* headline the one line a screen opens with — with `text-hero` on a
|
||
* scene, `text-title` on a page of prose
|
||
* subhead the name of a section under it
|
||
* kicker the small mono label above either
|
||
*
|
||
* The family sans, heavy and set close, like the headlines of the sister
|
||
* sites. Body text stays at its own size; nothing between a subhead and the
|
||
* headline exists.
|
||
*/
|
||
@utility headline {
|
||
font-family: var(--font-heading);
|
||
font-weight: 800;
|
||
line-height: 1.02;
|
||
letter-spacing: var(--tracking-display);
|
||
color: var(--color-fg-primary);
|
||
text-wrap: balance;
|
||
}
|
||
@utility subhead {
|
||
font-family: var(--font-heading);
|
||
font-size: var(--text-section);
|
||
font-weight: 700;
|
||
line-height: 1.15;
|
||
letter-spacing: var(--tracking-display);
|
||
color: var(--color-fg-primary);
|
||
}
|
||
@utility kicker {
|
||
font-family: var(--font-mono);
|
||
font-size: var(--text-caption);
|
||
text-transform: uppercase;
|
||
letter-spacing: var(--tracking-caps);
|
||
color: var(--color-fg-muted);
|
||
}
|
||
|
||
/*
|
||
* A SCENE: the photograph a main page opens with (`shared/scene.tsx`).
|
||
*
|
||
* The picture is the page — edge to edge, as tall as the screen under the
|
||
* header — and the words stand ON it, at its foot.
|
||
*
|
||
* THE THEME'S INK ON A VEIL OF THE THEME'S PAGE, as on Solon. By day the
|
||
* words are black on a white veil, by night white on a black one: a scene
|
||
* reads as part of the page it opens, in either theme, and the picture is
|
||
* clear everywhere the words are not. (The white-on-black-in-both-themes
|
||
* version before it put a black band under every day photograph.) The veil
|
||
* is `--scene-veil`, the page colour as channels, so one gradient serves
|
||
* both themes; `scene-ink` lifts the one ink that is too light to read on a
|
||
* veil over an unknown picture — the muted grey — to the secondary.
|
||
*
|
||
* THE NUMBERS ARE FOR THE WORST PICTURE: black under the white veil, white
|
||
* under the black one. The weakest ink on a scene is the secondary (#2b2b2b
|
||
* by day, #d4d4d4 by night). By day it needs a veil of 58% over black for
|
||
* 4.5:1; by night 67% over white. Under the first line of words the veil is
|
||
* never thinner than 72% (it reaches that 7rem into the block, whose words
|
||
* start 8rem in), so by day the secondary reads at ≥ 7:1 and by night at
|
||
* ≥ 5.3:1, and the primary ink at more, whatever a photographer found.
|
||
*/
|
||
@utility scene-ink {
|
||
--color-fg-muted: var(--color-fg-secondary);
|
||
}
|
||
/* The veil belongs to the WORDS, not to the picture: it is the ground of the
|
||
block they stand in, and that block opens with 7rem of nothing over which
|
||
the veil arrives. However many lines a language needs, the first of them
|
||
starts where it is already at full depth. */
|
||
@utility scene-foot {
|
||
background-image: linear-gradient(
|
||
to bottom,
|
||
rgb(var(--scene-veil) / 0) 0,
|
||
rgb(var(--scene-veil) / 0.38) 3.5rem,
|
||
rgb(var(--scene-veil) / 0.72) 7rem,
|
||
rgb(var(--scene-veil) / 0.86) 100%
|
||
);
|
||
}
|
||
/*
|
||
* ON A WIDE SCREEN THE VEIL IS ONLY WHERE THE WORDS ARE. A scene's words are
|
||
* a column at the left of a 72rem shell; veiling the full width behind them
|
||
* put three quarters of a 1280px photograph under it. From 80rem the veil is
|
||
* `scene-shade`, a layer behind the words (so its mask does not touch them):
|
||
* full depth from the left edge to 60% of the width — the headline is 16ch
|
||
* of at most 5rem and ends before that at every width from 80rem up
|
||
* (`scene-words` holds their column to it) — then clear by 90%, and arriving
|
||
* from above over 5rem. Under the words it is never thinner than 74%.
|
||
*/
|
||
@utility scene-foot-side {
|
||
background-image: linear-gradient(
|
||
to bottom,
|
||
rgb(var(--scene-veil) / 0) 0,
|
||
rgb(var(--scene-veil) / 0.38) 3.5rem,
|
||
rgb(var(--scene-veil) / 0.72) 7rem,
|
||
rgb(var(--scene-veil) / 0.86) 100%
|
||
);
|
||
@media (width >= 80rem) {
|
||
background-image: none;
|
||
}
|
||
}
|
||
@utility scene-shade {
|
||
display: none;
|
||
@media (width >= 80rem) {
|
||
display: block;
|
||
background-image: linear-gradient(to right, rgb(var(--scene-veil) / 0.86) 0, rgb(var(--scene-veil) / 0.74) 60%, rgb(var(--scene-veil) / 0) 90%);
|
||
mask-image: linear-gradient(to bottom, transparent 0, rgb(0 0 0 / 0.55) 2.5rem, black 5rem);
|
||
}
|
||
}
|
||
/* A night photograph shown in both themes, where no day one of the place is
|
||
worth showing: the scene wears the dark theme in either — white ink on a
|
||
black veil — as Solon's `alwaysDark` section does. A white veil over a
|
||
night picture only made it look foggy. The same values as the dark theme;
|
||
the muted ink is lifted as `scene-ink` does. */
|
||
@utility scene-night {
|
||
--scene-veil: 13 13 13;
|
||
--color-fg-primary: var(--primitive-white);
|
||
--color-fg-secondary: #d4d4d4;
|
||
--color-fg-muted: #d4d4d4;
|
||
--color-action: var(--primitive-white);
|
||
--color-on-action: var(--primitive-black);
|
||
--color-border-subtle: #2e2e2e;
|
||
--color-border-strong: var(--primitive-grey-400);
|
||
--color-link: var(--primitive-white);
|
||
color: var(--primitive-white);
|
||
}
|
||
/* A day photograph shown in the dark theme too, where no evening one of the
|
||
place is worth showing: a little quieter, so a bright noon does not glare
|
||
out of a black page. On the picture's box, not the picture, whose own
|
||
`filter` is the settle animation's. */
|
||
@utility scene-dim {
|
||
filter: none;
|
||
}
|
||
/* The words keep to the part the shade covers at full depth: their column
|
||
ends at 60% of the window, wherever the 72rem shell puts its left edge, so
|
||
a long headline wraps there instead of running out over the bare picture. */
|
||
@utility scene-words {
|
||
@media (width >= 80rem) {
|
||
max-width: calc(60vw - max(2rem, (100vw - 72rem) / 2 + 2rem));
|
||
}
|
||
}
|
||
/* On a phone the bar of the dock lies on the last 3rem of the screen: the
|
||
scene ends above it, so its button is never under the bar. */
|
||
@utility scene-full {
|
||
min-height: max(30rem, calc(100svh - var(--header-height) - var(--dock-height, 3rem)));
|
||
@media (width >= 40rem) {
|
||
min-height: max(34rem, calc(100svh - var(--header-height)));
|
||
}
|
||
}
|
||
/* The calmer opener of a tool page: the place is there, the work is on the
|
||
same screen. */
|
||
@utility scene-calm {
|
||
min-height: clamp(14rem, 34svh, 22rem);
|
||
}
|
||
|
||
/*
|
||
* QUIET MOTION, and none for a reader who asked for less.
|
||
*
|
||
* A scene's picture settles (it comes up out of the dark, and its colour
|
||
* with it — never larger than its box, so nothing overflows mid-way), its
|
||
* words fade in once, and a section below lifts into place as it enters the
|
||
* screen.
|
||
*
|
||
* The words FADE, they do not rise. A scene carries the page's one button,
|
||
* and it used to travel 14px up over 0.7s just as a reader aimed at it:
|
||
* «Start» on `/en/situations/small-talk` moved under the finger (reported
|
||
* 2026-12-02). Opacity moves nothing. The last is a scroll-driven animation, so it needs no script and
|
||
* runs only where the browser has it; everywhere else the section is simply
|
||
* there. The resting state is the finished state in every case.
|
||
*/
|
||
@keyframes scene-settle {
|
||
from { opacity: 0.5; filter: saturate(0.6); }
|
||
to { opacity: 1; filter: saturate(1); }
|
||
}
|
||
@keyframes fade-in {
|
||
from { opacity: 0; }
|
||
to { opacity: 1; }
|
||
}
|
||
@keyframes rise-in {
|
||
from { transform: translateY(14px); opacity: 0; }
|
||
to { transform: translateY(0); opacity: 1; }
|
||
}
|
||
@media (prefers-reduced-motion: no-preference) {
|
||
.scene-settle { animation: scene-settle 1400ms cubic-bezier(0.2, 0.7, 0.2, 1) both; }
|
||
.scene-rise { animation: fade-in 500ms 80ms cubic-bezier(0.2, 0.7, 0.2, 1) both; }
|
||
@supports (animation-timeline: view()) {
|
||
.reveal {
|
||
animation: rise-in linear both;
|
||
animation-timeline: view();
|
||
animation-range: entry 0% entry 35%;
|
||
}
|
||
}
|
||
}
|
||
|
||
/*
|
||
* Shown in one theme only — a picture taken by day, and its counterpart at
|
||
* night. On the same selectors as the dark tokens above, so the system's
|
||
* setting and the reader's own choice in the settings both decide. The hidden
|
||
* one is `display: none`, which is what keeps a lazy image from loading.
|
||
*/
|
||
:root {
|
||
/* The scene's veil: the light page colour, as channels (see "A SCENE"). */
|
||
--scene-veil: 255 255 255;
|
||
}
|
||
.only-dark {
|
||
display: none;
|
||
}
|
||
@media (prefers-color-scheme: dark) {
|
||
:root:not([data-theme="light"]) .only-light {
|
||
display: none;
|
||
}
|
||
:root:not([data-theme="light"]) .only-dark {
|
||
display: block;
|
||
}
|
||
:root:not([data-theme="light"]) {
|
||
--scene-veil: 13 13 13;
|
||
}
|
||
:root:not([data-theme="light"]) .scene-dim {
|
||
filter: brightness(0.8) saturate(0.92);
|
||
}
|
||
}
|
||
:root[data-theme="dark"] .only-light {
|
||
display: none;
|
||
}
|
||
:root[data-theme="dark"] .only-dark {
|
||
display: block;
|
||
}
|
||
:root[data-theme="dark"] {
|
||
--scene-veil: 13 13 13;
|
||
}
|
||
:root[data-theme="dark"] .scene-dim {
|
||
filter: brightness(0.8) saturate(0.92);
|
||
}
|
||
|
||
/*
|
||
* One card, and one lifted card.
|
||
*
|
||
* `card` is what lies on the page; `card-lift` is the single thing a screen
|
||
* wants done next. Written once here so that no two components can disagree
|
||
* about what a card is — border, ground and shadow were retyped per file.
|
||
*/
|
||
@utility card {
|
||
border: 1px solid var(--color-border-subtle);
|
||
border-radius: var(--radius-control);
|
||
background-color: var(--color-surface-card);
|
||
box-shadow: var(--shadow-card);
|
||
}
|
||
@utility card-lift {
|
||
border: 1px solid var(--color-border-subtle);
|
||
border-radius: var(--radius-control);
|
||
background-color: var(--color-surface-card);
|
||
box-shadow: var(--shadow-lift);
|
||
}
|
||
|
||
/*
|
||
* One selected state, for every tile and chip that is a CHOICE.
|
||
*
|
||
* A chosen tile used to be a solid black slab — the same shape and weight as
|
||
* the button that starts the sitting, so a screen with three choices made had
|
||
* four primaries. Now a choice at rest is light, and a chosen one is a dark
|
||
* outline, a faint tint and a check mark on its corner; the filled block is
|
||
* left to the one button a screen wants pressed.
|
||
*
|
||
* The state is read from the attribute that already says it to a screen
|
||
* reader (`aria-pressed`, `aria-current`, `aria-checked`), so the eye and the
|
||
* accessibility tree cannot disagree. The mark is a tab IN the corner, inside
|
||
* the tile's padding: it costs the label no width, so a known word keeps its
|
||
* line, and it adds nothing to the tile's scroll width for the audit to find.
|
||
*/
|
||
@utility choice {
|
||
position: relative;
|
||
border: 1px solid var(--color-border-subtle);
|
||
border-radius: var(--radius-control);
|
||
background-color: var(--color-surface-card);
|
||
color: var(--color-fg-primary);
|
||
transition: border-color 150ms;
|
||
&:hover {
|
||
border-color: var(--color-border-strong);
|
||
}
|
||
&:is([aria-pressed="true"], [aria-current], [aria-checked="true"]) {
|
||
border-color: var(--color-fg-primary);
|
||
box-shadow: inset 0 0 0 1px var(--color-fg-primary);
|
||
background-color: var(--color-surface-sunk);
|
||
}
|
||
&:is([aria-pressed="true"], [aria-current], [aria-checked="true"])::after {
|
||
content: "✓";
|
||
position: absolute;
|
||
top: 0;
|
||
right: 0;
|
||
display: grid;
|
||
width: 0.875rem;
|
||
height: 0.875rem;
|
||
place-items: center;
|
||
border-bottom-left-radius: 0.375rem;
|
||
background-color: var(--color-fg-primary);
|
||
color: var(--color-surface-page);
|
||
font-size: 0.5625rem;
|
||
font-weight: 700;
|
||
line-height: 1;
|
||
}
|
||
}
|
||
|
||
/*
|
||
* Somebody who has practised here before does not need the first-visit
|
||
* pitch's button: their next step is the card above it. The page stays the
|
||
* same page — headline, chat, everything — with one primary action, not two.
|
||
*/
|
||
[data-home]:has([data-welcome-back]) [data-first-visit] {
|
||
display: none;
|
||
}
|
||
|
||
html {
|
||
color-scheme: light dark;
|
||
scroll-behavior: smooth;
|
||
}
|
||
@media (prefers-reduced-motion: reduce) {
|
||
html {
|
||
scroll-behavior: auto;
|
||
}
|
||
}
|
||
|
||
body {
|
||
background-color: var(--color-surface-page);
|
||
color: var(--color-fg-primary);
|
||
font-family: var(--font-sans);
|
||
-webkit-font-smoothing: antialiased;
|
||
text-rendering: optimizeLegibility;
|
||
|
||
/**
|
||
* THE BACKSTOP, AND IT IS NOT THE FIX.
|
||
*
|
||
* Every sideways-scrolling page found so far has been fixed at its cause —
|
||
* see `grid-cols-safe` above and `wrap-anywhere` on the transcript — and
|
||
* `scripts/audit/responsive.mjs` walks every page at every phone width to
|
||
* keep it that way. This line is what the NEXT one degrades into.
|
||
*
|
||
* Without it, one stray unbreakable string turns the entire document into a
|
||
* horizontal scroller: the header rule stops at the screen edge, every
|
||
* paragraph on the page shifts, and the reader drags the whole site left and
|
||
* right to read one card. With it, the same mistake clips one element and
|
||
* leaves the rest of the page where it belongs. Neither is correct; one is
|
||
* a defect in a card and the other is a defect in the site.
|
||
*
|
||
* `clip`, NOT `hidden`. `overflow: hidden` makes the body a scroll
|
||
* container, which silently kills `position: sticky` (the composer pins
|
||
* itself to the bottom of the chat that way) and forces the other axis to
|
||
* `auto`. `clip` does neither — it clips and nothing else. Baseline in every
|
||
* browser this site supports, and older than the `:has()` the chat chrome
|
||
* already depends on.
|
||
*/
|
||
overflow-x: clip;
|
||
}
|
||
|
||
/*
|
||
* Focus in INK, not flag red.
|
||
*
|
||
* A text field is focused for as long as somebody types in it, so its focus
|
||
* ring is not a moment but the normal state of the chat — and in the composer
|
||
* it stacked with a red `focus-within` border into two nested red rectangles
|
||
* around every message being written. Reported as "why so much aggressive
|
||
* red"; this was the part #113 kept. The ring stays 2px and offset, and ink
|
||
* clears 3:1 against every surface here in both themes, which is what a focus
|
||
* indicator has to do; being red was never part of that job.
|
||
*/
|
||
:focus-visible {
|
||
outline: 2px solid var(--color-fg-primary);
|
||
outline-offset: 2px;
|
||
border-radius: var(--radius-control);
|
||
}
|
||
|
||
h1,
|
||
h2,
|
||
h3 {
|
||
text-wrap: balance;
|
||
}
|
||
|
||
/**
|
||
* Swiss cow, as a ground rather than a picture.
|
||
*
|
||
* Tried first as a repeating RULE between sections, at 13px tall, and it read
|
||
* as a dotted border — a patch needs enough area to show an irregular
|
||
* silhouette, and at rule height every shape collapses to a dash. So the motif
|
||
* goes where there is room: behind a page header, never in a line.
|
||
*
|
||
* 6% black on white, which leaves body text at --color-fg-secondary far above
|
||
* any contrast threshold; the pattern is felt, not read. The SVG lives here
|
||
* because globals.css is the only place a visual value belongs.
|
||
*/
|
||
.bg-hide {
|
||
background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22560%22%20height%3D%22240%22%20viewBox%3D%220%200%20560%20240%22%3E%3Cg%20fill%3D%22%230d0d0d%22%20opacity%3D%220.06%22%3E%3Cpath%20d%3D%22M-32%2028C16%20-14%20126%20-22%20154%2026c22%2038-30%2070-90%2064C16%2084-14%2060-32%2028Z%22%2F%3E%3Cpath%20d%3D%22M240%20-30c64-10%20118%2028%20112%2074-6%2042-74%2058-122%2032-42-22-48-90%2010-106Z%22%2F%3E%3Cpath%20d%3D%22M420%2054c48-22%20106%204%20112%2042%206%2036-38%2060-90%2054-48-6-74-34-68-60%204-16%2020-26%2046-36Z%22%2F%3E%3Cpath%20d%3D%22M96%20154c54-16%20122%206%20132%2042%2010%2032-38%2054-100%2052-58-4-92-26-90-52%204-20%2026-32%2058-42Z%22%2F%3E%3Cpath%20d%3D%22M336%20166c42-12%2086%2010%2090%2038%202%2026-32%2044-78%2042-42-4-64-22-60-44%202-16%2022-28%2048-36Z%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E");
|
||
background-size: 560px 240px;
|
||
background-repeat: repeat;
|
||
}
|
||
|
||
/* The pattern is decoration, and decoration that moves under a reader who has
|
||
asked for less of it is not decoration, it is noise. */
|
||
@media (prefers-contrast: more) {
|
||
.bg-hide {
|
||
background-image: none;
|
||
}
|
||
}
|
||
|
||
/**
|
||
* The full-screen chat, escaping the site chrome.
|
||
*
|
||
* A chat that fills the viewport needs the page NOT to scroll — the transcript
|
||
* scrolls instead — and it needs the footer out of the way. The obvious way to
|
||
* get that is a second root layout, and it is the wrong way twice over:
|
||
* `app/[locale]/layout.tsx` is deliberately the only root layout because
|
||
* `<html lang>` has to carry the real language of the page, and navigating
|
||
* between two root layouts costs a full document reload — so every trip from
|
||
* the home page into the chat would throw away the app and start again.
|
||
*
|
||
* So the page marks itself and the chrome responds. No JavaScript, no second
|
||
* tree, and nothing to flash on hydration because it is in the first stylesheet
|
||
* the browser sees. `:has()` is in every browser this site supports.
|
||
*/
|
||
body:has([data-chrome="chat"]) {
|
||
/* Both, because the layout's `min-h-screen` is `100vh` and would otherwise
|
||
win on a phone: `vh` measures the viewport WITHOUT the browser toolbar, so
|
||
the body ends up taller than the screen and the composer hides under it.
|
||
`dvh` is the one that tracks the toolbar sliding away. */
|
||
/* `--app-height` is what the on-screen keyboard leaves visible, published by
|
||
`use-keyboard-viewport.ts`; `dvh` until it is. */
|
||
height: var(--app-height, 100dvh);
|
||
min-height: var(--app-height, 100dvh);
|
||
overflow: hidden;
|
||
}
|
||
|
||
/* Relative, not sticky: inside a viewport-height page there is nothing to
|
||
stick to. NOT static — the header's menus hang off it (`top-full`) and its
|
||
z-index only applies to a positioned box. At `static` the menus were placed
|
||
below the bottom of the screen and drawn under the conversation list: "the
|
||
menu does not open on /chat". */
|
||
body:has([data-chrome="chat"]) > header {
|
||
position: relative;
|
||
}
|
||
|
||
/* Not `display: none` on a real page — but this footer is site navigation that
|
||
the chat's own list and header already provide, and keeping it would mean
|
||
the composer sits above a wall of links nobody scrolls to from a chat. */
|
||
body:has([data-chrome="chat"]) > footer {
|
||
display: none;
|
||
}
|
||
|
||
/* min-height: 0 is the load-bearing line. A flex child defaults to
|
||
`min-height: auto` and refuses to shrink below its content, so without it
|
||
the transcript pushes the page taller instead of scrolling inside it. */
|
||
body:has([data-chrome="chat"]) > main {
|
||
display: flex;
|
||
flex-direction: column;
|
||
min-height: 0;
|
||
}
|
||
|
||
/**
|
||
* The exercise session screen (`session/frame.tsx`): the whole screen, like
|
||
* an app. No site header and no footer — the screen has its own close button
|
||
* — and the body is exactly the visible height, so only the question scrolls
|
||
* and the answer bar stays under the thumb.
|
||
*/
|
||
body:has([data-chrome="session"]) {
|
||
height: var(--app-height, 100dvh);
|
||
min-height: var(--app-height, 100dvh);
|
||
overflow: hidden;
|
||
}
|
||
|
||
body:has([data-chrome="session"]) > header,
|
||
body:has([data-chrome="session"]) > footer {
|
||
display: none;
|
||
}
|
||
|
||
body:has([data-chrome="session"]) > main {
|
||
display: flex;
|
||
flex-direction: column;
|
||
min-height: 0;
|
||
}
|
||
|
||
/* The launcher pill — Üben and Frag Heidi — would sit on the answer bar,
|
||
and one of its halves is the screen already open. The dock itself stays:
|
||
"Frag Heidi, warum" under an explanation opens it from here. */
|
||
body:has([data-chrome="session"]) [data-dock="heidi"] [data-dock-launcher] {
|
||
display: none;
|
||
}
|
||
|
||
/* The account forms (sign in, create an account, your account), on a phone
|
||
only. The pill sat on the form's own buttons — "email me a link" and
|
||
"forgot your password?" were under it at 390px — and signing in is the one
|
||
thing the person came to this page for. The chat stays a tap away in the
|
||
menu sheet, and the dock is back on the page they land on. Desktop keeps
|
||
the pill: it is in the corner, nowhere near a form 28rem wide. */
|
||
@media (width < 40rem) {
|
||
body:has([data-chrome="account"]) [data-dock="heidi"] [data-dock-launcher] {
|
||
display: none;
|
||
}
|
||
}
|
||
|
||
/* Plans and Settings, at every width. Both are read card by card or
|
||
paragraph by paragraph, and the launcher cut the Free card at 390 and 768,
|
||
the Privacy paragraph at 390 and «Contact us» at 1366 (QA, 2026-12-02): a
|
||
page that is read has no end to reserve room at. Heidi stays in the menu
|
||
sheet. Every other page keeps the launcher and ends above it
|
||
(`--dock-room`, below). */
|
||
body:has([data-chrome="plans"], [data-chrome="settings"]) [data-dock="heidi"] [data-dock-launcher] {
|
||
display: none;
|
||
}
|
||
|
||
body:has([data-chrome="session"]) #loki-feedback-host {
|
||
display: none;
|
||
}
|
||
|
||
/**
|
||
* The chat dock is on EVERY page but one.
|
||
*
|
||
* Heidi floats bottom-right on every page, phone and desktop, because chat is
|
||
* how people use this product. It used to stand down on the three pages that
|
||
* hold a conversation — the home fold, the full-screen chat, a group — on the
|
||
* argument that a button next to a chat box is the same offer twice. In use
|
||
* that read as "the chat is gone": the home page is where most visits start,
|
||
* and on a phone its chat box sits below the fold. A group's thread is a
|
||
* conversation with the group, not a private one with Heidi.
|
||
*
|
||
* So the one exception is the full-screen chat (`data-chrome="chat"`), which
|
||
* IS the chat window the dock would open. `display: none` rather than
|
||
* `visibility: hidden`, so the launcher takes no Tab stop there.
|
||
*/
|
||
body:has([data-chrome="chat"]) [data-dock="heidi"] {
|
||
display: none;
|
||
}
|
||
|
||
/**
|
||
* Where the launcher sits.
|
||
*
|
||
* Phone: a bar across the bottom edge, like an app's tab bar, and every page
|
||
* ends above it (`--dock-room` below), so it covers nothing and never has to
|
||
* move. It used to be a floating pill that slid away while the reader scrolled
|
||
* down AND whenever a control passed beneath it; the two rules flipped it in
|
||
* and out mid-scroll, and at rest it still sat on the paragraph being read
|
||
* (reported from a phone, 2026-11-25). Its own padding takes the iOS home
|
||
* indicator, so the buttons stay a full 48px tall above it.
|
||
*
|
||
* Laptop and tablet: the floating pill, off the edge by the safe area.
|
||
*/
|
||
[data-dock-launcher] {
|
||
bottom: 0;
|
||
padding-bottom: env(safe-area-inset-bottom);
|
||
}
|
||
@media (min-width: 640px) {
|
||
[data-dock-launcher] {
|
||
bottom: max(1rem, env(safe-area-inset-bottom));
|
||
padding-bottom: 0;
|
||
}
|
||
}
|
||
/**
|
||
* The floating pill never lies on a control (from 640px; on a phone it is a bar).
|
||
*
|
||
* `data-covering` is set by the dock while the pill's resting place is over a
|
||
* button, a link or a field of the page (`useCoversControl`): «Start» on
|
||
* /practice at 390px, the password field, the warm-up's «Try it» on a tablet.
|
||
* It slides below the edge and returns when the control has scrolled past.
|
||
* Focus brings it back for the same reason as above.
|
||
*/
|
||
@media (min-width: 640px) {
|
||
[data-dock-launcher] {
|
||
transition: transform 0.2s ease;
|
||
}
|
||
[data-dock-launcher][data-covering="true"]:not(:focus-within) {
|
||
transform: translateY(
|
||
calc(100% + max(1rem, env(safe-area-inset-bottom)) + 0.5rem)
|
||
);
|
||
}
|
||
}
|
||
|
||
/**
|
||
* Room for the launcher at the end of every page.
|
||
*
|
||
* `--dock-room` is the bar's height, its offset from the edge (which is the
|
||
* safe area on an iPhone) and a breath. The height is MEASURED: the dock
|
||
* publishes it as `--dock-height` (`usePublishHeight`), because the pill is
|
||
* 3rem only while its two labels fit on one line. 3rem is the fallback
|
||
* before the dock has run.
|
||
*
|
||
* The footer's last row — the legal links, each a 44px target — used to end
|
||
* exactly where the pill rests, so at the bottom of every page the two fought
|
||
* for the same strip. The footer ends one room higher, and `scroll-padding`
|
||
* keeps a link followed or a field focused from landing under the bar.
|
||
*/
|
||
:root {
|
||
/* Phone: the bar sits on the edge and its measured height already holds
|
||
the safe area. */
|
||
--dock-room: calc(var(--dock-height, 3rem) + 0.75rem);
|
||
}
|
||
@media (min-width: 640px) {
|
||
:root {
|
||
--dock-room: calc(var(--dock-height, 3rem) + max(1rem, env(safe-area-inset-bottom)) + 0.75rem);
|
||
}
|
||
}
|
||
html:has([data-dock="heidi"] [data-dock-launcher]):not(:has([data-chrome="plans"], [data-chrome="settings"])) {
|
||
scroll-padding-bottom: var(--dock-room);
|
||
}
|
||
body:has([data-dock="heidi"] [data-dock-launcher]):not(:has([data-chrome="plans"], [data-chrome="settings"])) > footer {
|
||
padding-bottom: var(--dock-room);
|
||
}
|
||
|
||
@media (prefers-reduced-motion: reduce) {
|
||
[data-dock-launcher] {
|
||
transition: none;
|
||
}
|
||
}
|
||
|
||
/**
|
||
* The Loki feedback widget steps aside while Heidi's chat is open.
|
||
*
|
||
* Both float bottom-right, and on a phone the open dock is full-screen: the
|
||
* widget's pencil sat on top of the conversation. The widget is for the
|
||
* site's owner and returns the moment the dock closes.
|
||
*/
|
||
body:has([data-dock="heidi"] [role="dialog"]) #loki-feedback-host {
|
||
display: none;
|
||
}
|
||
|
||
/**
|
||
* A task in full screen on a phone (`focus-surface.tsx`).
|
||
*
|
||
* The page behind stays where it was and does not scroll under the learner's
|
||
* thumb; minimising returns to it. Heidi's launcher and the feedback pencil
|
||
* both float bottom-right, exactly where the answer buttons and the chat box
|
||
* sit, so they step aside until the task is minimised or done.
|
||
*/
|
||
body:has([data-focus="open"]) {
|
||
overflow: hidden;
|
||
}
|
||
|
||
body:has([data-focus="open"]) [data-dock="heidi"] {
|
||
display: none;
|
||
}
|
||
|
||
body:has([data-focus="open"]) #loki-feedback-host {
|
||
display: none;
|
||
}
|
||
|
||
/*
|
||
* The end of a sitting (`sitting-celebration.tsx`): the check draws itself,
|
||
* then the day just earned lands in the week. Nothing moves for a reader who
|
||
* asked for less motion; the finished state is the resting state.
|
||
*/
|
||
@keyframes oc-draw {
|
||
from { stroke-dashoffset: 1; }
|
||
to { stroke-dashoffset: 0; }
|
||
}
|
||
@keyframes oc-land {
|
||
0% { transform: scaleX(0); }
|
||
70% { transform: scaleX(1.15); }
|
||
100% { transform: scaleX(1); }
|
||
}
|
||
@media (prefers-reduced-motion: no-preference) {
|
||
.oc-draw {
|
||
stroke-dasharray: 1;
|
||
animation: oc-draw 520ms cubic-bezier(0.65, 0, 0.35, 1) both;
|
||
}
|
||
.oc-draw-late { animation-delay: 380ms; }
|
||
.oc-land {
|
||
transform-origin: left center;
|
||
animation: oc-land 420ms 700ms cubic-bezier(0.34, 1.56, 0.64, 1) both;
|
||
}
|
||
}
|
||
|
||
/*
|
||
* Answering (`exercises/chrome.tsx`). The right option pops, a wrong one
|
||
* shakes once, the verdict strip rises into the bar. With reduced motion
|
||
* nothing moves — the colour and the mark carry it alone. The countdown on
|
||
* "Weiter" is not decoration but a clock, so it runs either way.
|
||
*/
|
||
@keyframes oc-pop {
|
||
0% { transform: scale(1); }
|
||
40% { transform: scale(1.04); }
|
||
100% { transform: scale(1); }
|
||
}
|
||
@keyframes oc-shake {
|
||
0%, 100% { transform: translateX(0); }
|
||
20% { transform: translateX(-6px); }
|
||
40% { transform: translateX(5px); }
|
||
60% { transform: translateX(-3px); }
|
||
80% { transform: translateX(2px); }
|
||
}
|
||
@keyframes oc-rise {
|
||
from { transform: translateY(8px); opacity: 0; }
|
||
to { transform: translateY(0); opacity: 1; }
|
||
}
|
||
@keyframes oc-countdown {
|
||
from { transform: scaleX(1); }
|
||
to { transform: scaleX(0); }
|
||
}
|
||
@media (prefers-reduced-motion: no-preference) {
|
||
.oc-pop { animation: oc-pop 260ms cubic-bezier(0.34, 1.56, 0.64, 1); }
|
||
.oc-shake { animation: oc-shake 360ms ease-in-out; }
|
||
.oc-verdict { animation: oc-rise 200ms ease-out; }
|
||
}
|
||
.oc-countdown {
|
||
transform-origin: left center;
|
||
animation-name: oc-countdown;
|
||
animation-timing-function: linear;
|
||
animation-fill-mode: forwards;
|
||
}
|
||
/* Reduced motion: no draining bar; «Weiter» counts the seconds instead
|
||
(`ContinueButton`, exercises/chrome.tsx). */
|
||
@media (prefers-reduced-motion: reduce) {
|
||
.oc-countdown { display: none; }
|
||
}
|
||
|
||
/*
|
||
* The language map (`_components/dialect/language-map.tsx`): the area under
|
||
* the pointer or the focus. On the path, because the link around it has no
|
||
* box of its own in an SVG; the page's own area keeps its red.
|
||
*/
|
||
.map-area:hover > path,
|
||
.map-area:focus-visible > path {
|
||
fill: var(--color-map-hover);
|
||
stroke: var(--color-accent);
|
||
}
|
||
/* The keyboard's place is louder than the pointer's: a thick red edge, so a
|
||
reader tabbing through the map sees where they are at a glance. */
|
||
.map-area:hover > path {
|
||
stroke-width: 2.5px;
|
||
}
|
||
.map-area:focus-visible > path {
|
||
stroke-width: 5px;
|
||
}
|
||
.map-area[aria-current="page"]:hover > path,
|
||
.map-area[aria-current="page"]:focus-visible > path {
|
||
fill: var(--color-accent);
|
||
}
|
||
|
||
/*
|
||
* A team poster (`join/[token]/poster`) prints as the sheet alone: the site's
|
||
* header, footer and the bar at the foot of the screen are for the screen.
|
||
*/
|
||
@media print {
|
||
body:has([data-poster]) > *:not(:has([data-poster])),
|
||
body:has([data-poster]) header,
|
||
body:has([data-poster]) footer,
|
||
body:has([data-poster]) nav {
|
||
display: none !important;
|
||
}
|
||
}
|