/* Lingways shell: the frame every page shares. The page's width and edges, where a page and its sections start,
   the header with its menu, the buttons and the footer.
   Sizes and weights come from type.css and colours from palette.css, which load first.
   The home pages get this file built into them (build.py); every other page links it, last of its stylesheets.
   The header's and the footer's markup have one source each as well, src/header.html and src/footer.html. */
:root {
  --frame: 1128px;   /* the widest the content gets; narrower screens leave a gutter each side */
  --page-top: 40px;  /* from the header down to a page's first line */
  --band: 88px;      /* above and below each section of a page */
  --gutter-l: max(16px, env(safe-area-inset-left, 0px));
  --gutter-r: max(16px, env(safe-area-inset-right, 0px));
}
@media (max-width: 700px) {
  :root { --page-top: 32px; --band: 56px; }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
img { max-width: 100%; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { margin: 0; background: var(--navy); color: var(--ivory); }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--sky); outline-offset: 3px; border-radius: 6px; }
.inner { max-width: calc(var(--frame) + 32px); margin: 0 auto; padding-left: var(--gutter-l); padding-right: var(--gutter-r); }

/* header: the live site's menu (Home, Shop, The founder, Lingways Blog) plus Features, the language switch and Join; sticky on a computer,
   on a phone the menu takes its own row and the header scrolls away (the chapters then fill whole screens).
   It is built from plain boxes (role="banner", role="navigation"), not <header> and <nav>, so that the older pages'
   rules for those two elements cannot reach it, and its rules start at .top so they outrank those pages' own. */
.es { display: none; }
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 10; background: var(--deep); }
/* the header is solid, in the footer's deep navy (owner, 2026-11-22), so its text has the same contrast whatever
   scrolls under it, and the page sits between two bars of one colour */
.top { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 9; background: var(--deep);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 60%, transparent); }
.top .inner { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 22px; min-height: 64px; padding-block: 10px; }
.top :is(a, button) { touch-action: manipulation; text-underline-offset: 6px; }
.top .brand { display: flex; margin: 0; font-family: var(--font); align-items: center; gap: 10px; text-decoration: none; font-weight: var(--w-label); font-size: 20px; letter-spacing: -0.01em; }
.top .brand img { display: block; width: 24px; height: 31px; }
.top .menu { margin: 0 0 0 auto; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 22px; font-size: var(--t-small); font-weight: var(--w-label); }
.top .menu a { display: inline; text-decoration: none; color: var(--muted); padding-block: 6px; }
.top .menu a:hover, .top .menu a[aria-current="page"] { color: var(--ivory); text-decoration: underline; text-underline-offset: 6px; }
/* the language switch: shown only (spans) on the pages without a Spanish version, working buttons on the others */
.top .lang { display: inline-flex; align-items: stretch; gap: 0; margin: 0; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; font: var(--w-label) var(--t-small)/1.6 var(--font); padding: 2px; }
.top .lang :is(span, button) { margin: 0; padding: 3px 9px; border: 0; border-radius: 999px; background: none; color: var(--muted); font: inherit; }
.top .lang button { appearance: none; cursor: pointer; }
.top .lang :is(span, button):is([aria-current], [aria-pressed="true"]) { background: var(--ivory-fill); color: var(--navy); }
@media (max-width: 960px) {
  .top .menu { order: 4; width: 100%; margin-left: 0; gap: 4px 18px; }
  .top .lang { margin-left: auto; }
}
@media (max-width: 700px) {
  .top { position: relative; top: 0; }
  .top .inner { gap: 6px 10px; padding-block: 12px 8px; }
  .top .lang { order: 2; margin-left: auto; }
  .top .join-top { order: 3; height: 36px; padding: 0 12px; }
  .top .wide-only { display: none; }
  .top .brand { font-size: 19px; }
  .top .menu { order: 4; width: 100%; gap: 2px 13px; }
}
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 48px; padding: 0 22px; border-radius: 999px;
  font: var(--w-label) var(--t-ui) var(--font); text-decoration: none; cursor: pointer; border: 1px solid transparent; white-space: nowrap; }
.btn-main { background: var(--ivory-fill); color: var(--navy); }
.btn-main:hover { background: #ffffff; }
.btn-quiet { background: transparent; color: var(--ivory); border-color: var(--line); }
.btn-quiet:hover { border-color: var(--sky); }
.btn-quiet svg { width: 14px; height: 14px; fill: currentColor; }
.top .btn { height: 38px; padding: 0 16px; font-size: var(--t-small); }
.top a.btn-main, .top a.btn-main:hover { color: var(--navy); }

/* footer: the live site's footer, its layout and colours as they are on lingways.com. Like the header it is built
   from plain boxes with roles, and its rules start at .site-footer so they outrank the older pages' own. */
.site-footer { display: block; width: 100%; max-width: none; margin: 0; padding: 40px 0; background: var(--deep); color: #f1eee7; font: var(--w-read) var(--t-ui)/1.6 var(--font); }
.site-footer a { touch-action: manipulation; text-underline-offset: auto; }
.site-footer .site-footer-top { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin: 0 0 28px; }
.site-footer .site-footer-top p { margin: 0; font-size: var(--t-small); color: #b9c7d3; }
.site-footer .site-brand { display: inline-flex; align-items: center; gap: 9px; color: #f1eee7; text-decoration: none; font: var(--w-head) 25px/1 var(--font); letter-spacing: -.5px; white-space: nowrap; }
.site-footer .site-brand img { display: block; width: 28px; height: 40px; object-fit: contain; }
.site-footer .lw-foot-groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(145px, 1fr)); gap: 1.4rem; margin: 1.5rem 0; }
.site-footer .lw-foot-groups strong { color: inherit; font-size: var(--t-ui); }
.site-footer .foot-links { display: grid; align-content: start; justify-content: start; gap: .45rem; margin: .55rem 0; }
.site-footer .foot-links a { color: inherit; text-decoration: none; font-size: var(--t-ui); line-height: 1.55; touch-action: manipulation; }
.site-footer .foot-links a:hover { text-decoration: underline; }
.site-footer .site-small { font-size: var(--t-small); color: #b9c7d3; margin: 22px 0 0; }
@media (max-width: 600px) {
  .site-footer { padding: 30px 0; }
  .site-footer .site-footer-top { align-items: flex-start; flex-direction: column; gap: 18px; }
  .site-footer .site-brand { font-size: 22px; }
  .site-footer .site-brand img { width: 23px; height: 33px; }
}

/* ---- older pages ----
   The pages copied from lingways.com (body.site-page) each set their own width, gutters and spacing: 1080px wide
   here, a narrow centred column there, 48px between sections where the home page has 88px. Below, all of them take
   the frame above: the same left and right edge as the header, the same distance from the header to the first
   line, the same space above and below each section. */
.site-container, .site-page main > .wrap, .site-page main.wrap, .site-page .section > .wrap, .site-page .article > .wrap,
.site-page > .hero > .wrap, .site-page > p.wrap, .site-page.aligned-founder main, .site-page .lw-copy {
  width: min(var(--frame), calc(100% - var(--gutter-l) - var(--gutter-r))); max-width: none; margin-left: auto; margin-right: auto; padding-left: 0; padding-right: 0; }

/* where a page starts */
.site-page .lw-copy { padding-top: var(--page-top); padding-bottom: var(--band); }
.site-page .hero, .site-page main > .section:first-child { padding-top: var(--page-top); }
/* the archived privacy page opens with a one-line notice: that line is the page's first, the headline follows close under it */
.site-page > p.wrap { margin-top: var(--page-top); margin-bottom: 0; }
.site-page > p.wrap + .hero { padding-top: 24px; }
.site-page :is(.lw-copy, .lw-copy > article, .hero, .hero > .wrap, .hero > div, main > .section:first-child > .wrap) > :first-child { margin-top: 0; }
/* the text pages keep a readable line: their words start at the frame's left edge and stop at 50rem */
.site-page .lw-copy > * { max-width: 50rem; }

/* where a section starts */
.site-page .section, .site-page.page-blog .articles, .site-page main > section.grid { padding-top: var(--band); padding-bottom: var(--band); }
/* the blog's closing card is a card, not a section: its words keep clear of its border on every side */
.site-page.page-blog .support { padding: 32px; }

/* those pages colour and underline every link in their text; a button is not one of those links */
.site-page :is(a, button).btn { text-decoration: none; }
.site-page :is(a, button).btn-main, .site-page :is(a, button).btn-main:hover { color: var(--navy); }
.site-page :is(a, button).btn-quiet { color: var(--ivory); }
.site-page .lw-copy .btn { margin: .5rem 0 1rem; }
/* their labels can be long, most of all in Spanish: on a narrow screen such a label takes a second line, not the page's width */
.site-page .btn:not(.join-top) { max-width: 100%; height: auto; min-height: 48px; padding-block: 10px; white-space: normal; text-align: center; }
