/*
 * TortoLingua — design tokens.
 *
 * Brand tokens aligned with tortolingua-landing (soft cream background, deep
 * ink typography, teal accent). Phase 1 keeps a pragmatic subset; the full
 * landing-theme audit will expand this file in Phase 1b when the landing
 * templates are rewritten from 11ty to Hugo.
 */

/*
 * Self-hosted font stack. All weights and subsets we ship are served from
 * /assets/fonts/ — no runtime request to fonts.googleapis.com, no
 * preconnect handshake, no second CSS file on the critical path. Covers
 * every non-CJK TortoLingua locale across latin / latin-ext / cyrillic
 * subsets. Japanese and Korean use the platform-native CJK stacks below;
 * preloading a Latin font for those scripts wastes bandwidth and produces
 * visibly mixed metrics inside a single heading.
 *
 * Weights in use:
 *   - Literata 700 (headings; LCP on blog posts + landing hero)
 *   - Literata italic 400 (blog blockquote)
 *   - Nunito Sans 400 (body copy; LCP on landing subtitle)
 *   - Nunito Sans 700 (UI emphasis, nav, cards — default browser "bold")
 *   - Nunito Sans 800 (landing eyebrow + step index, above-the-fold on home)
 *
 * The Nunito Sans woff2 is a variable font covering 200-1000; Google Fonts
 * CSS2 served the SAME file for 700 and 800, and so do we — two @font-face
 * declarations (one per weight) pointing to a single file. `local()` first
 * skips the download entirely when the user has the font installed.
 * `font-display: swap` paints the fallback immediately, and the tuned
 * Capsize fallback faces below keep the swap from shifting layout.
 */
@font-face {
  font-family: 'Literata';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: local('Literata Bold'),
       url('/assets/fonts/literata-700-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Literata';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: local('Literata Bold'),
       url('/assets/fonts/literata-700-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Literata';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: local('Literata Bold'),
       url('/assets/fonts/literata-700-cyrillic.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Literata';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: local('Literata Italic'),
       url('/assets/fonts/literata-italic-400-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Literata';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: local('Literata Italic'),
       url('/assets/fonts/literata-italic-400-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Literata';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: local('Literata Italic'),
       url('/assets/fonts/literata-italic-400-cyrillic.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Nunito Sans';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: local('Nunito Sans Regular'), local('NunitoSans-Regular'),
       url('/assets/fonts/nunitosans-400-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Nunito Sans';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: local('Nunito Sans Regular'), local('NunitoSans-Regular'),
       url('/assets/fonts/nunitosans-400-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Nunito Sans';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: local('Nunito Sans Regular'), local('NunitoSans-Regular'),
       url('/assets/fonts/nunitosans-400-cyrillic.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Nunito Sans';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: local('Nunito Sans Bold'), local('NunitoSans-Bold'),
       url('/assets/fonts/nunitosans-700-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Nunito Sans';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: local('Nunito Sans Bold'), local('NunitoSans-Bold'),
       url('/assets/fonts/nunitosans-700-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Nunito Sans';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: local('Nunito Sans Bold'), local('NunitoSans-Bold'),
       url('/assets/fonts/nunitosans-700-cyrillic.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
/*
 * Nunito Sans 800 is delivered by the SAME variable-font woff2 as 700 —
 * Google Fonts' CSS2 served an identical URL for both, and Nunito Sans
 * is a weight-axis variable font (200..1000), so the browser can
 * synthesise 800 from the 700 file. We reuse the files, declaring
 * `font-weight: 800` so rules picking 800 still match a real face.
 */
@font-face {
  font-family: 'Nunito Sans';
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: local('Nunito Sans ExtraBold'), local('NunitoSans-ExtraBold'),
       url('/assets/fonts/nunitosans-700-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Nunito Sans';
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: local('Nunito Sans ExtraBold'), local('NunitoSans-ExtraBold'),
       url('/assets/fonts/nunitosans-700-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Nunito Sans';
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: local('Nunito Sans ExtraBold'), local('NunitoSans-ExtraBold'),
       url('/assets/fonts/nunitosans-700-cyrillic.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

/*
 * Fallback font faces. While Literata / Nunito Sans fetch, the browser
 * renders Georgia / Arial in their place — different metrics, so once
 * the real font lands the layout shifts. These faces use Capsize-derived
 * `size-adjust` + `ascent-override` + `descent-override` + (for Nunito
 * Sans) `line-gap-override` so the pre-swap text box matches the
 * post-swap text box to the pixel — CLS near zero, PSI 100 on that
 * metric. Values computed via @capsizecss/core createFontStack against
 * the real font metrics from @capsizecss/metrics, so if we ever swap
 * the primary face we should regenerate these numbers.
 */
@font-face {
  font-family: 'Literata Fallback';
  src: local('Georgia');
  ascent-override: 109.3141%;
  descent-override: 28.6056%;
  size-adjust: 107.6714%;
}
@font-face {
  font-family: 'Nunito Sans Fallback';
  src: local('Arial'), local('ArialMT');
  ascent-override: 99.7134%;
  descent-override: 34.8159%;
  line-gap-override: 0%;
  size-adjust: 101.3906%;
}

:root {
  /* Brand palette (TortoLingua cream + teal) */
  --color-page-light: #f4f1e9;
  --color-page-dark: #0f1316;
  --color-surface-panel: rgba(255, 255, 255, 0.8);
  --color-surface-card: #ffffff;
  --color-surface-outline: #d2d9ce;
  --color-surface-outline-strong: rgba(16, 23, 24, 0.16);
  --color-surface-subtle: #e7ebe2;

  --color-text-primary: #1f2a1f;
  --color-text-secondary: #5b6958;
  --color-text-muted: rgba(31, 42, 31, 0.72);
  --color-text-inverse: #ffffff;

  --color-accent: #1b7c63;
  --color-accent-strong: #16684f;
  --color-accent-dark: #0f3f34;
  --color-accent-soft: rgba(27, 124, 99, 0.12);
  --color-accent-ink: #0f3f34;

  --color-code-bg: rgba(20, 27, 36, 0.05);
  --color-quote-rule: var(--color-accent);

  /* Typography stack — mirrors current landing (Literata display + Nunito Sans body).
     The "Fallback" faces (see @font-face above) render Georgia / Arial with
     Literata / Nunito Sans metrics so the swap from fallback → real font
     causes no layout shift. */
  --font-display:
    "Literata", "Literata Fallback", "Source Serif Pro", "Iowan Old Style", Georgia, serif;
  --font-copy:
    "Nunito Sans", "Nunito Sans Fallback", "Source Sans Pro", "Segoe UI", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-ui:
    "Nunito Sans", "Nunito Sans Fallback", "Segoe UI", -apple-system, BlinkMacSystemFont, sans-serif;
  /* The wordmark: Latin glyphs only, so ja/ko keep it too (not overridden). */
  --font-brand:
    "Literata", "Literata Fallback", "Source Serif Pro", "Iowan Old Style", Georgia, serif;
  --font-mono:
    "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  /* Typography scale */
  --type-display-lg: 3.25rem;   /* 52px — page heroes */
  --type-display-md: 2.5rem;    /* 40px — section hero */
  --type-heading-lg: 2rem;      /* 32px — post title */
  --type-heading-md: 1.5rem;    /* 24px — sub-heads / card titles */
  --type-heading-sm: 1.25rem;   /* 20px — h3 in post body */
  --type-body-lg: 1.1875rem;    /* 19px — lead paragraph */
  --type-body-md: 1.0625rem;    /* 17px — post body */
  --type-body-sm: 1rem;         /* 16px — cards / list text */
  --type-caption: 0.875rem;     /* 14px */
  --type-meta: 0.75rem;         /* 12px */

  /* Line heights */
  --leading-tight: 1.18;
  --leading-snug: 1.3;
  --leading-normal: 1.55;
  --leading-reading: 1.65;

  /* Spacing scale */
  --space-4: 0.25rem;
  --space-8: 0.5rem;
  --space-12: 0.75rem;
  --space-16: 1rem;
  --space-20: 1.25rem;
  --space-24: 1.5rem;
  --space-32: 2rem;
  --space-40: 2.5rem;
  --space-48: 3rem;
  --space-56: 3.5rem;
  --space-64: 4rem;
  --space-80: 5rem;
  --space-96: 6rem;

  /* Radius scale */
  --radius-card-sm: 1rem;        /* 16px — post cards */
  --radius-card-md: 1.5rem;      /* 24px — large cards */
  --radius-card-lg: 1.875rem;    /* 30px — hero cards */
  --radius-pill: 999px;

  /* Shadows */
  --shadow-card-soft: 0 1px 20px rgba(0, 0, 0, 0.04);
  --shadow-card-medium: 0 18px 44px rgba(17, 21, 23, 0.09);
  --shadow-card-deep: 0 32px 80px rgba(17, 21, 23, 0.16);
  --shadow-focus: 0 0 0 3px rgba(27, 124, 99, 0.3);

  /* Layout */
  --layout-width: 1180px;   /* header/footer shell */
  --content-width: 760px;   /* optimal reading measure */
  --list-width: 960px;      /* post archives */
  --header-offset: 4.5rem;
}

/*
 * CJK text needs script-native metrics and line breaking. Keep these stacks
 * local-first so the public site never adds a font request: the ja/ko pages
 * download no CJK font file. Headings (`--font-display`) take a system serif
 * (Mincho / Myeongjo) so they echo the Literata headings of the Latin locales
 * (tortolingua-web#550); body copy and UI stay on the system sans. The names
 * cover macOS/iOS, Windows, and Android/Linux Noto or Source Han
 * installations; iOS ships no Korean serif, so Korean there falls back to the
 * generic serif. Faces that ship a real bold come before single-weight ones
 * (AppleMyungjo, Batang). The wordmark keeps `--font-brand`.
 */
html:lang(ja) {
  --font-display: "Hiragino Mincho ProN", "Yu Mincho", YuMincho, "Noto Serif JP", "Noto Serif CJK JP", "Source Han Serif JP", serif;
  --font-copy: "Hiragino Sans", "Yu Gothic", YuGothic, "Noto Sans JP", sans-serif;
  --font-ui: "Hiragino Sans", "Yu Gothic", YuGothic, "Noto Sans JP", sans-serif;
  --leading-reading: 1.8;
}

html:lang(ko) {
  --font-display: "Nanum Myeongjo", NanumMyeongjo, "Noto Serif KR", "Noto Serif CJK KR", "Source Han Serif K", "AppleMyungjo", Batang, serif;
  --font-copy: "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", sans-serif;
  --font-ui: "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", sans-serif;
  --leading-reading: 1.75;
}
/*
 * TortoLingua Web — theme CSS (Phase 1 scaffold).
 *
 * Structure:
 *   1. Reset + base
 *   2. Typography defaults
 *   3. Layout shell (header, main, footer, language switcher)
 *   4. Home
 *   5. Post list + post card + pagination
 *   6. Post single (body typography)
 *   7. Taxonomy / list
 *   8. Error page (404)
 *   9. Utility + responsive
 *
 * BEM class contract: keep class names in sync with layouts/_default/*.html
 * and layouts/partials/*.html. When a layout adds a new block, add its
 * component section here rather than reaching for page-level one-offs.
 *
 * Phase 1b will expand this file to reach visual parity with the current
 * Eleventy landing (hero sections, feature cards, audience blocks, etc.).
 */

/* 1. Reset + base --------------------------------------------------------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(1200px 700px at 10% -20%, #ffffff 15%, transparent 60%),
    radial-gradient(1000px 600px at 100% 0%, #d9efe8 10%, transparent 55%),
    var(--color-page-light);
  color: var(--color-text-primary);
  font-family: var(--font-copy);
  font-size: var(--type-body-md);
  line-height: var(--leading-normal);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

html:lang(ko) {
  overflow-wrap: anywhere;
  word-break: keep-all;
}

/* Japanese has no spaces: break only at phrase boundaries (auto-phrase where
   supported) under strict kinsoku rules, and fall back to a mid-word break
   only for an unbreakable token such as a URL (tortolingua-web#503).
   `anywhere`, unlike `break-word`, also lowers min-content, so a flex or grid
   item holding a long phrase can shrink below a 360 px viewport
   (tortolingua-web#524). */
html:lang(ja) {
  overflow-wrap: anywhere;
  line-break: strict;
  word-break: auto-phrase;
}

html:lang(ja) h1,
html:lang(ja) h2,
html:lang(ja) h3,
html:lang(ko) h1,
html:lang(ko) h2,
html:lang(ko) h3 {
  letter-spacing: normal;
}

/* The Latin heading word-space fix (section 2) is for Literata only. */
html:lang(ja) :is(h1, h2, h3, h4, h5, h6, .error-page__title),
html:lang(ko) :is(h1, h2, h3, h4, h5, h6, .error-page__title) {
  word-spacing: normal;
}

img,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
  height: auto;
}

ul,
ol {
  padding: 0;
}

/* 2. Typography ----------------------------------------------------------- */

h1,
h2,
h3,
h4,
h5,
h6 {
  margin: 0 0 var(--space-16);
  font-family: var(--font-display);
  font-weight: 700;
  line-height: var(--leading-tight);
  color: var(--color-text-primary);
  letter-spacing: -0.01em;
  /* Literata 700 has a narrow word space, and the tightened tracking narrows
     it further: without this, words in a bold serif heading run together
     ("Apprenantsautonomes"). ja/ko reset it above. */
  word-spacing: 0.08em;
}

/* Balance heading lines so no single word is left alone on the last line
   (tortolingua-web#534). Line breaks only; the heading text is unchanged. */
h1,
h2,
h3 {
  text-wrap: balance;
}

h1 { font-size: var(--type-heading-lg); }
h2 { font-size: var(--type-heading-md); }
h3 { font-size: var(--type-heading-sm); }
h4 { font-size: var(--type-body-lg); }

p {
  margin: 0 0 var(--space-20);
  /* Avoids a lone word, or in Japanese a short tail, on the last line. */
  text-wrap: pretty;
}

a {
  color: var(--color-accent-strong);
  text-decoration: none;
  transition: color 0.15s ease;
}

a:hover,
a:focus-visible {
  color: var(--color-accent-dark);
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

a:focus-visible {
  outline: none;
  box-shadow: var(--shadow-focus);
  border-radius: 4px;
}

code,
kbd,
pre,
samp {
  font-family: var(--font-mono);
  font-size: 0.9375em;
}

/* 3. Layout shell --------------------------------------------------------- */

/*
 * The header sticks to the top only while the viewport is at least 20rem
 * wide. Enlarged text (200% makes a 390px phone 12rem wide) wraps the header
 * onto several rows; a sticky header that tall would cover the content under
 * it while scrolling (WCAG 1.4.10), so there it scrolls away with the page:
 * below 20rem the top offset turns hugely negative, which a sticky element
 * never reaches. At default text size every phone (320px and up) keeps it.
 */
.site-header {
  position: sticky;
  top: min(0px, (100vw - 20rem) * 1000);
  z-index: 10;
  backdrop-filter: saturate(180%) blur(10px);
  -webkit-backdrop-filter: saturate(180%) blur(10px);
  background: rgba(244, 241, 233, 0.85);
  border-bottom: 1px solid var(--color-surface-outline);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-24);
  max-width: var(--layout-width);
  margin: 0 auto;
  padding: var(--space-20) var(--space-24);
  flex-wrap: wrap;
}

.site-header__brand {
  display: inline-flex;
  align-items: center;
  gap: var(--space-8);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--type-heading-md);
  color: var(--color-text-primary);
  letter-spacing: -0.02em;
  line-height: 1;
}

.site-header__brand-text {
  /* The wordmark keeps the Latin brand serif (Literata) in every locale:
     the ja/ko display stacks are CJK system serifs whose Latin glyphs differ
     (tortolingua-web#550). It never splits between lines. */
  font-family: var(--font-brand);
  white-space: nowrap;
}

/* The brand mark scales with the wordmark (1.4em, the size the emoji it
   replaced took), never below the mark's 32px digital minimum
   (tortolingua-app docs/brand-assets), and never shrinks when the header
   is tight. The floor is in px, not rem: enlarged text already grows the
   mark through 1.4em, and a 2rem floor would double it past what fits. */
.site-header__brand-mark {
  display: block;
  flex: none;
  width: max(32px, 1.4em);
  height: max(32px, 1.4em);
}

.site-header__brand:hover,
.site-header__brand:focus-visible {
  color: var(--color-accent-strong);
  text-decoration: none;
}

.site-nav__list {
  display: flex;
  align-items: center;
  gap: var(--space-16);
  margin: 0;
  list-style: none;
}

.site-nav__link {
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: var(--type-caption);
  color: var(--color-text-secondary);
  padding: var(--space-8) var(--space-12);
  border-radius: var(--radius-pill);
  white-space: nowrap;
  transition: color 0.15s ease, background 0.15s ease;
}

.site-nav__link:hover,
.site-nav__link:focus-visible {
  color: var(--color-text-primary);
  background: var(--color-surface-outline);
  text-decoration: none;
}

.language-switcher {
  display: inline-flex;
  align-items: center;
  gap: var(--space-8);
  padding: var(--space-8) var(--space-12);
  border-radius: var(--radius-pill);
  border: 1px solid var(--color-surface-outline);
  background: rgba(255, 255, 255, 0.78);
  color: var(--color-accent-ink);
  font-size: var(--type-caption);
  font-weight: 700;
}

.language-switcher__label {
  font-family: var(--font-ui);
  color: var(--color-text-secondary);
  font-weight: 600;
}

.language-switcher__select {
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  outline: none;
  cursor: pointer;
  padding: var(--space-4) 0;
  /* Own arrow: the native one overlaps the last letters of long names. */
  appearance: none;
  -webkit-appearance: none;
  padding-inline-end: var(--space-24);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5l5-5' fill='none' stroke='%23566' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right var(--space-4) center;
  background-size: 12px 8px;
}

.language-switcher:focus-within {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

.site-main {
  flex: 1 0 auto;
  width: 100%;
  box-sizing: border-box;
  max-width: var(--layout-width);
  margin: 0 auto;
  /* The bottom padding is the only gap before the footer: one section gap. */
  padding: var(--space-48) var(--space-24) var(--space-32);
  /* The query container for the enlarged-text rules at the end of
     40-faq-legal-footer.css. */
  container: page / inline-size;
}

.site-footer {
  border-top: 1px solid var(--color-surface-outline);
  padding: var(--space-32) 0 var(--space-48);
  background: rgba(255, 255, 255, 0.3);
  container: page / inline-size;
}

.site-footer__inner {
  max-width: var(--layout-width);
  margin: 0 auto;
  padding: 0 var(--space-24);
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-16);
}

.site-footer__copy {
  margin: 0;
  flex: 0 0 auto;
  white-space: nowrap;
  font-family: var(--font-ui);
  font-size: var(--type-caption);
  color: var(--color-text-muted);
}

.site-footer__links {
  flex: 1 1 0;
  min-width: 0;
  text-align: center;
}

/* Inline items let `text-wrap: balance` spread the links evenly over the
   lines, so no link is left alone on the last line; each link stays whole. */
.site-footer__list {
  margin: 0;
  padding: 0;
  list-style: none;
  font-family: var(--font-ui);
  font-size: var(--type-caption);
  line-height: 2;
  text-wrap: balance;
}

.site-footer__list li {
  display: inline;
}

.site-footer__list li::after {
  content: " ";
}

.site-footer__list a {
  margin-inline: var(--space-8);
  color: var(--color-text-secondary);
  white-space: nowrap;
}

/* Keeps a short unit, such as a Korean particle pair "은/는", on one line. */
.nowrap {
  white-space: nowrap;
}

/* Below desktop width: one centered column in the footer. */
@media (max-width: 1023px) {
  .site-footer__inner {
    flex-direction: column;
    flex-wrap: wrap;
    justify-content: center;
    text-align: center;
  }

  .site-footer__copy,
  .site-footer__links {
    flex: 0 0 auto;
  }

  .site-footer__copy {
    white-space: normal;
    text-wrap: balance;
  }
}

/* Phones: the shell's 16 px gutter. Five links (home and /app/) cannot share
   lines without leaving one alone in several locales, so they stack in one
   centered column; three links stay on one line. */
@media (max-width: 600px) {
  .site-footer__inner {
    padding-inline: var(--space-16);
  }

  /* Taller touch targets: about 36 px per link instead of 28 px. A link
     still moves to the next line whole; only one wider than the footer
     itself (enlarged text) wraps inside instead of overflowing the page. */
  .site-footer__list a {
    display: inline-block;
    max-width: calc(100% - 2 * var(--space-4));
    margin-inline: var(--space-4);
    padding-block: var(--space-4);
    white-space: normal;
  }

  .site-footer__list:has(> li:nth-child(4)) li {
    display: block;
  }

  .site-footer__list:has(> li:nth-child(4)) li::after {
    content: none;
  }
}
/* 4. Home ---------------------------------------------------------------- */

.home-intro {
  max-width: var(--content-width);
  margin: 0 auto var(--space-56);
  text-align: left;
}

.home-intro__title {
  font-size: var(--type-display-md);
  margin-bottom: var(--space-16);
}

.home-intro__body {
  font-size: var(--type-body-lg);
  line-height: var(--leading-reading);
  color: var(--color-text-secondary);
}

.home-intro__body p:last-child {
  margin-bottom: 0;
}

.home-posts {
  max-width: var(--list-width);
  margin: 0 auto;
}

.home-posts__title {
  font-size: var(--type-heading-md);
  margin-bottom: var(--space-32);
  color: var(--color-text-primary);
}

.home-posts__more {
  margin-top: var(--space-32);
  text-align: center;
}

.home-posts__more-link {
  font-family: var(--font-ui);
  font-weight: 700;
  color: var(--color-accent-strong);
}

/* 5. Post list + post card ----------------------------------------------- */

.post-list {
  max-width: var(--list-width);
  margin: 0 auto;
}

.post-list__header {
  margin-bottom: var(--space-48);
  max-width: var(--content-width);
}

.post-list__title {
  font-size: var(--type-display-md);
  margin-bottom: var(--space-16);
}

.post-list__intro {
  font-size: var(--type-body-lg);
  line-height: var(--leading-reading);
  color: var(--color-text-secondary);
}

.post-list__items {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: var(--space-24);
}

.post-card {
  display: flex;
  background: var(--color-surface-card);
  border: 1px solid var(--color-surface-outline);
  border-radius: var(--radius-card-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  overflow: hidden;
}

.post-card:hover,
.post-card:focus-within {
  transform: translateY(-2px);
  box-shadow: var(--shadow-card-medium);
  border-color: var(--color-surface-outline-strong);
}

.post-card__link {
  display: flex;
  flex-direction: column;
  gap: var(--space-8);
  padding: var(--space-24);
  color: var(--color-text-primary);
  width: 100%;
}

.post-card__media {
  margin: calc(var(--space-24) * -1) calc(var(--space-24) * -1) var(--space-16);
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--color-surface-subtle);
}

.post-card__media picture,
.post-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.post-card__link:hover,
.post-card__link:focus-visible {
  color: var(--color-text-primary);
  text-decoration: none;
}

.post-card__title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--type-heading-sm);
  line-height: var(--leading-snug);
  letter-spacing: -0.01em;
}

.post-card__date,
.post-card__count {
  font-family: var(--font-ui);
  font-size: var(--type-meta);
  color: var(--color-text-muted);
}

.post-card__excerpt {
  margin: var(--space-8) 0 0;
  font-size: var(--type-body-sm);
  line-height: var(--leading-normal);
  color: var(--color-text-secondary);
}

/* A Korean word inside a Latin-script card ("에서" in an English excerpt)
   must not split between syllables. `keep-all` leaves Latin wrapping as it
   is, and `anywhere` still breaks a token that cannot fit. Japanese cards
   keep the phrase-based breaking set on html:lang(ja) in 00-base-shell.css,
   because keep-all would leave unspaced Japanese with almost no break
   points. */
:where(html:not(:lang(ja))) .post-card__title,
:where(html:not(:lang(ja))) .post-card__excerpt {
  word-break: keep-all;
  overflow-wrap: anywhere;
}

.pagination {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-8);
  justify-content: center;
  margin: var(--space-48) 0 0;
  padding: 0;
  list-style: none;
}

.pagination .page-item {
  display: inline-flex;
}

.pagination .page-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.5rem;
  height: 2.5rem;
  padding: 0 var(--space-12);
  border-radius: var(--radius-pill);
  font-family: var(--font-ui);
  font-size: var(--type-caption);
  color: var(--color-text-secondary);
  background: transparent;
  border: 1px solid var(--color-surface-outline);
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.pagination .page-link:hover,
.pagination .page-link:focus-visible {
  background: var(--color-accent-soft);
  color: var(--color-accent-dark);
  border-color: var(--color-accent);
  text-decoration: none;
}

.pagination .page-item.active .page-link {
  background: var(--color-accent);
  color: var(--color-text-inverse);
  border-color: var(--color-accent);
}

/* Hugo's pager renders "first" / "previous" on page 1 (and "next" / "last"
   on the final page) as disabled items. They lead nowhere and only took
   room from the live targets, so they are not shown at all. */
.pagination .page-item.disabled {
  display: none;
}

/* The pager shows the same set at every width: "«", the page numbers and
   "»". Hugo's first/last jumps ("««", "»»") read as unclear marks and were
   dropped on narrow phones only, so the set changed with the width
   (tortolingua-web#588); previous/next and the numbers still reach every
   page. These selectors depend on the aria-labels ("First", "Previous",
   "Page N", "Next", "Last") of Hugo's built-in _internal/pagination.html
   as of Hugo 0.163.3; a Hugo upgrade must recheck them. */
.pagination .page-item:has(> .page-link[aria-label="First"]),
.pagination .page-item:has(> .page-link[aria-label="Last"]) {
  display: none;
}

/* Phone width: on a middle page the pager shows seven live items
   («, five numbers, »). Every target keeps 40px with a visible gap; when
   the items do not fit on one row the pager wraps to a second centered row
   instead of shrinking the targets. */
@media (max-width: 480px) {
  .pagination {
    gap: var(--space-8);
  }

  .pagination .page-link {
    padding: 0 var(--space-8);
  }
}

/* Narrow phones (tortolingua-web#564): a middle page shows seven 40px
   targets ("«", five numbers, "»"), which with 8px gaps need 328px, more
   than the 327px a 359px screen leaves. Below 360px the gap narrows to
   6px (316px), so they fit one row. Below 340px, where even that is too
   wide, a middle page also hides the numbers two pages away, leaving
   "« n-1 n n+1 »". Page one ("1 … 5 »") and the last page show six
   targets and fit one row at 320px. Targets stay 40px. */
@media (max-width: 359px) {
  .pagination {
    gap: 6px;
  }
}

@media (max-width: 339px) {
  .pagination:has(.page-item:not(.disabled) > .page-link[aria-label="Previous"]):has(.page-item:not(.disabled) > .page-link[aria-label="Next"])
    .page-item:has(> .page-link[aria-label^="Page"]):not(.active):not(:has(+ .active)):not(.active + .page-item) {
    display: none;
  }
}

/* 5a. Blog hub (/<lang>/blog/ head URL) ---------------------------------- */

/*
 * Rendered from layouts/partials/blog/hub.html. Sections: hero → category
 * tiles → recent posts (reuses .post-card) → language switcher. Paginated
 * sub-pages (/blog/page/2/ …) still use the plain post-list styling above.
 * Per tortolingua/tortolingua-web#6.
 */

.blog-hub {
  max-width: var(--list-width);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: var(--space-64);
}

.blog-hub__hero {
  max-width: var(--content-width);
}

.blog-hub__title {
  font-size: var(--type-display-md);
  line-height: var(--leading-tight);
  letter-spacing: -0.02em;
  margin: 0 0 var(--space-16);
}

.blog-hub__intro {
  font-size: var(--type-body-lg);
  line-height: var(--leading-reading);
  color: var(--color-text-secondary);
}

.blog-hub__intro p {
  margin: 0 0 var(--space-16);
}

.blog-hub__intro p:last-child {
  margin-bottom: 0;
}

.blog-hub__section {
  display: flex;
  flex-direction: column;
  gap: var(--space-24);
}

.blog-hub__section-title {
  font-family: var(--font-display);
  font-size: var(--type-heading-lg);
  line-height: var(--leading-snug);
  letter-spacing: -0.01em;
  margin: 0;
}

/* Tile grid — shared between category + language variants. */
.blog-hub__tiles {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--space-20);
}

.blog-hub__tiles--categories {
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}

.blog-hub__tiles--languages {
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
}

.blog-hub__tile {
  display: flex;
  background: var(--color-surface-card);
  border: 1px solid var(--color-surface-outline);
  border-radius: var(--radius-card-sm);
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.blog-hub__tile:hover,
.blog-hub__tile:focus-within {
  transform: translateY(-2px);
  box-shadow: var(--shadow-card-medium);
  border-color: var(--color-surface-outline-strong);
}

.blog-hub__tile-link {
  display: flex;
  flex-direction: column;
  gap: var(--space-8);
  padding: var(--space-24);
  width: 100%;
  color: var(--color-text-primary);
}

.blog-hub__tile-link:hover,
.blog-hub__tile-link:focus-visible {
  color: var(--color-text-primary);
  text-decoration: none;
}

.blog-hub__tile-title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--type-heading-md);
  line-height: var(--leading-snug);
  letter-spacing: -0.01em;
}

.blog-hub__tile-desc {
  margin: 0;
  font-size: var(--type-body-sm);
  line-height: var(--leading-normal);
  color: var(--color-text-secondary);
}

/* Language tiles are compact: the code sits above the name, so a 160px
   column still holds the longest name ("Українська", "Português") on one
   line and every tile in a row keeps the same height (tortolingua-web#588).
   Between 380px and 600px two wide columns put code and name side by side;
   below 380px the code returns above the name (tortolingua-web#536). */
.blog-hub__tile--language .blog-hub__tile-link {
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-4);
}

.blog-hub__lang-code {
  font-family: var(--font-ui);
  font-size: var(--type-caption);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-accent);
}

/* A language name is one word and never breaks inside it. */
.blog-hub__lang-name {
  min-width: 0;
  overflow-wrap: normal;
  word-break: normal;
  hyphens: none;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--type-body-md);
  color: var(--color-text-primary);
}

/* Current-language tile: flatten interaction, keep it readable as a marker. */
.blog-hub__tile--current {
  background: var(--color-surface-subtle);
  border-color: transparent;
  box-shadow: none;
}

.blog-hub__tile--current:hover,
.blog-hub__tile--current:focus-within {
  transform: none;
  box-shadow: none;
  border-color: transparent;
}

.blog-hub__tile--current .blog-hub__tile-link {
  cursor: default;
}

.blog-hub__tile--current .blog-hub__lang-code {
  color: var(--color-text-muted);
}

.blog-hub__tile--current .blog-hub__lang-name {
  color: var(--color-text-secondary);
}

/* Recent posts reuses .post-list__items grid; override gap to match hub rhythm. */
.blog-hub__recent {
  gap: var(--space-20);
}

/* Related posts under single articles (tortolingua/tortolingua-web#18).
   Reuses the .post-card grid from .post-list__items so card chrome stays
   visually identical to the blog hub. Extra top margin separates it from
   the article body / .post__footer. */
.related-posts {
  margin-top: var(--space-48);
  padding-top: var(--space-32);
  border-top: 1px solid var(--color-surface-outline);
}

.related-posts__title {
  margin: 0 0 var(--space-24);
  font-family: var(--font-display);
  font-size: var(--type-heading-lg);
  color: var(--color-text-primary);
}

.related-posts__grid {
  gap: var(--space-20);
}

/* More posts under single articles (tortolingua/tortolingua#834).
   Sibling of .related-posts — softer separator so the two sections
   read as a connected tail rather than two heavy blocks. */
.more-posts {
  margin-top: var(--space-32);
  padding-top: var(--space-24);
  border-top: 1px solid var(--color-surface-outline);
}

.more-posts__title {
  margin: 0 0 var(--space-24);
  font-family: var(--font-display);
  font-size: var(--type-heading-lg);
  color: var(--color-text-primary);
}

.more-posts__grid {
  gap: var(--space-20);
}

.blog-hub__cta {
  margin-top: var(--space-8);
  display: flex;
  justify-content: flex-start;
}

.blog-hub__cta-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-8);
  padding: var(--space-12) var(--space-24);
  border-radius: var(--radius-pill);
  background: var(--color-accent);
  color: var(--color-text-inverse);
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: var(--type-body-sm);
  text-decoration: none;
  transition: background 0.2s ease, transform 0.2s ease;
}

.blog-hub__cta-link:hover,
.blog-hub__cta-link:focus-visible {
  background: var(--color-accent-strong);
  color: var(--color-text-inverse);
  text-decoration: none;
  transform: translateY(-1px);
}

@media (max-width: 900px) {
  .blog-hub {
    gap: var(--space-48);
  }

  .blog-hub__title {
    font-size: var(--type-heading-lg);
  }

  .blog-hub__section-title {
    font-size: var(--type-heading-md);
  }
}

@media (max-width: 600px) {
  .blog-hub__tiles--categories {
    grid-template-columns: 1fr;
  }

  .blog-hub__tiles--languages {
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: var(--space-12);
  }

  .blog-hub__tile-link {
    padding: var(--space-20);
  }

  /* Narrower side padding and code-to-name gap keep a full name such as
     "Українська" inside its tile at 390px. */
  .blog-hub__tile--language .blog-hub__tile-link {
    flex-direction: row;
    align-items: baseline;
    gap: var(--space-8);
    padding: var(--space-16);
  }

  .blog-hub__cta {
    justify-content: stretch;
  }

  .blog-hub__cta-link {
    width: 100%;
    justify-content: center;
  }
}

/* Below ~380px two tiles per row leave about 100px of text width: put the
   code above the name so "Українська" or "Português" fits instead of
   running past the tile edge (tortolingua-web#536). */
@media (max-width: 379px) {
  .blog-hub__tile--language .blog-hub__tile-link {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-4);
    padding: var(--space-12) var(--space-16);
  }
}

/* 6. Post single --------------------------------------------------------- */

.post--single {
  max-width: var(--content-width);
  margin: 0 auto;
}

.post__header {
  margin-bottom: var(--space-32);
  padding-bottom: var(--space-32);
  border-bottom: 1px solid var(--color-surface-outline);
}

.post__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-16);
  margin-top: var(--space-16);
}

.post__meta > * {
  margin: 0;
}

.post__authors {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-8);
  list-style: none;
  margin: 0;
  padding: 0;
}

.post__authors li a {
  font-family: var(--font-ui);
  font-size: var(--type-meta);
  color: var(--color-text-secondary);
}

.post__hero {
  margin: 0 0 var(--space-48);
  border-radius: var(--radius-card-md);
  overflow: hidden;
  background: var(--color-surface-subtle);
  max-width: var(--layout-width);
  width: calc(100vw - (var(--space-32) * 2));
  margin-left: 50%;
  transform: translateX(-50%);
}

.post__hero picture,
.post__hero img {
  display: block;
  width: 100%;
  height: auto;
}

.post__footer {
  margin-top: var(--space-48);
  padding-top: var(--space-24);
  border-top: 1px solid var(--color-surface-outline);
}

.post__lastmod {
  font-family: var(--font-ui);
  font-size: var(--type-meta);
  color: var(--color-text-muted);
  margin: 0;
}

@media (max-width: 900px) {
  .post__hero {
    width: calc(100vw - (var(--space-16) * 2));
  }
}

.post__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--type-display-md);
  line-height: var(--leading-tight);
  letter-spacing: -0.02em;
  margin-bottom: var(--space-20);
  /* A long compound in a translated title must wrap on a 320 px phone
     (tortolingua-web#524). */
  overflow-wrap: break-word;
}

.post__date,
.post__author {
  font-family: var(--font-ui);
  font-size: var(--type-caption);
  color: var(--color-text-muted);
  margin: 0;
  line-height: 1;
}

.post__date {
  font-size: var(--type-meta);
}

.post__categories {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-8);
  list-style: none;
  margin: 0;
  padding: 0;
}

.post__categories li a {
  display: inline-flex;
  align-items: center;
  padding: var(--space-4) var(--space-12);
  border-radius: var(--radius-pill);
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: var(--type-meta);
  color: var(--color-accent-dark);
  background: var(--color-accent-soft);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.post__categories li a:hover,
.post__categories li a:focus-visible {
  background: var(--color-accent);
  color: var(--color-text-inverse);
  text-decoration: none;
}

.post__body {
  font-size: var(--type-body-md);
  line-height: var(--leading-reading);
  color: var(--color-text-primary);
}

.post__body > * + * {
  margin-top: var(--space-24);
}

.product-cta,
.tool-widget {
  margin-top: var(--space-32);
  padding: var(--space-24);
  border: 1px solid var(--color-surface-outline);
  border-radius: var(--radius-card-md);
  background: rgba(255, 255, 255, 0.88);
}

.product-cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-20);
  /* The accent stripe is straight (tortolingua-web#640). A 6px left border
     bent around the rounded corners into a crescent. Now the 1px left border
     takes the accent colour, and a 5px band painted in the padding box
     carries the rest. Its inner edge stays straight, and the corner curve
     only trims its ends. The extra 5px of start padding keeps the content
     where the 6px border had it. */
  border-left-color: var(--color-accent);
  padding-left: calc(var(--space-24) + 5px);
  background-image: linear-gradient(to right, var(--color-accent) 5px, transparent 5px);
  background-repeat: no-repeat;
  background-clip: padding-box;
}

/* Forced colours (high contrast) drop the painted band, so the stripe goes
   back to a 6px border there; its colour is then the system one anyway. */
@media (forced-colors: active) {
  .product-cta {
    border-left-width: 6px;
    padding-left: var(--space-24);
  }
}

/* A word longer than the box (a long Polish word in the heading at 200% text
   on a phone) breaks instead of pushing the card past the screen. */
.product-cta__copy {
  max-width: 680px;
  min-width: 0;
  overflow-wrap: anywhere;
}

.product-cta__eyebrow,
.tool-widget__eyebrow {
  margin: 0 0 var(--space-8);
  color: var(--color-accent-dark);
  font-family: var(--font-ui);
  font-size: var(--type-meta);
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.product-cta h2,
.tool-widget h2,
.post__body .product-cta h2,
.post__body .tool-widget h2 {
  margin: 0 0 var(--space-8);
  font-family: var(--font-display);
  font-size: var(--type-heading-md);
  line-height: var(--leading-snug);
}

.product-cta p,
.tool-widget p {
  color: var(--color-text-secondary);
  line-height: var(--leading-normal);
}

.product-cta__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-12);
}

/* A long localized label wraps inside the pill: keep it centered and
   give the wrapped lines room instead of clipping the pill shape. */
.product-cta__actions .landing-cta {
  padding-block: var(--space-8);
  text-align: center;
  line-height: var(--leading-snug);
}

/* Phones: two pills side by side left a wrapped label taller than its
   neighbour. Below 400px the actions form one full-width column with a
   narrower side padding; equal grid rows give both pills the height of
   the taller one (tortolingua-web#588). */
@media (max-width: 399px) {
  .product-cta__actions {
    display: grid;
    grid-auto-rows: 1fr;
  }

  .product-cta__actions .landing-cta {
    width: 100%;
    padding-inline: var(--space-16);
  }
}

.tool-widget__head {
  max-width: 760px;
}

.tool-widget__form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-16);
  margin-top: var(--space-20);
}

.tool-widget__form label {
  display: grid;
  gap: var(--space-8);
  color: var(--color-text-primary);
  font-family: var(--font-ui);
  font-size: var(--type-body-sm);
  font-weight: 700;
}

.tool-widget select,
.tool-widget input {
  width: 100%;
  min-height: 44px;
  padding: 0 var(--space-12);
  border: 1px solid var(--color-surface-outline-strong);
  border-radius: var(--radius-card-sm);
  background: var(--color-surface-card);
  color: var(--color-text-primary);
  font: inherit;
}

/* Same drawn chevron as the header language switcher, with room reserved
   for it, so a long answer ends in an ellipsis before the arrow instead of
   running into it. */
.tool-widget select {
  appearance: none;
  -webkit-appearance: none;
  padding-inline-end: calc(var(--space-12) * 2 + 12px);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5l5-5' fill='none' stroke='%23566' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right var(--space-12) center;
  background-size: 12px 8px;
}

.tool-widget__result {
  margin-top: var(--space-20);
  padding: var(--space-16);
  border-radius: var(--radius-card-sm);
  background: var(--color-accent-soft);
  color: var(--color-accent-ink);
  font-weight: 700;
  line-height: var(--leading-normal);
}

.tool-widget__result[data-fit-result] {
  /* No lone last word ("clear.") in the reading-fit verdict (tortolingua-web#638). */
  text-wrap: pretty;
}

.tool-widget__result[data-level="yellow"] {
  background: #fff5d6;
  color: #6f4b00;
}

.tool-widget__result[data-level="red"] {
  background: #ffe6df;
  color: #7d2b1a;
}

@media (max-width: 700px) {
  .product-cta__actions,
  .product-cta__actions .landing-cta,
  .tool-widget__form {
    width: 100%;
  }

  .product-cta__actions {
    flex-direction: column;
  }

  .tool-widget__form {
    grid-template-columns: 1fr;
  }
}

.post__body h2 {
  font-size: var(--type-heading-md);
  margin-top: var(--space-48);
}

.post__body h3 {
  font-size: var(--type-heading-sm);
  margin-top: var(--space-40);
}

.post__body h4 {
  font-size: var(--type-body-lg);
  margin-top: var(--space-32);
}

.post__body p,
.post__body ul,
.post__body ol {
  margin: 0 0 var(--space-24);
}

.post__body ul,
.post__body ol {
  padding-left: var(--space-24);
}

/* Card eyebrows sit inside the article body: keep the card's own tight gap
   to the heading instead of the body paragraph rhythm. */
.post__body .tool-widget__eyebrow,
.post__body .product-cta__eyebrow {
  margin: 0 0 var(--space-8);
}

.post__body li + li {
  margin-top: var(--space-8);
}

/*
 * Inline product CTA (`product-cta` shortcode) renders inside .post__body,
 * whose element rules above outrank the component's own spacing. Restore the
 * component spacing so the inline card matches the footer placement.
 */
.post__body .product-cta {
  margin: var(--space-32) 0;
}

.post__body .product-cta h2 {
  margin: 0 0 var(--space-8);
}

.post__body .product-cta p {
  margin: 0 0 var(--space-20);
}

.post__body .product-cta p.product-cta__eyebrow {
  margin: 0 0 var(--space-8);
}

.post__body .product-cta .landing-cta,
.post__body .product-cta .landing-cta:hover,
.post__body .product-cta .landing-cta:focus-visible {
  text-decoration: none;
}

.post__body .product-cta .landing-cta--primary,
.post__body .product-cta .landing-cta--primary:hover,
.post__body .product-cta .landing-cta--primary:focus-visible {
  color: var(--color-text-inverse);
}

.post__body .product-cta .landing-cta--secondary {
  color: var(--color-accent-ink);
}

.post__body .product-cta .landing-cta--secondary:hover,
.post__body .product-cta .landing-cta--secondary:focus-visible {
  color: var(--color-accent-dark);
}

.post__body img,
.post__body figure,
.post__body picture {
  margin: var(--space-32) 0;
  border-radius: var(--radius-card-sm);
  overflow: hidden;
}

.post__body figure img {
  margin: 0;
  border-radius: 0;
}

.post__body img.app-mobile-screenshot {
  display: block;
  width: min(100%, 360px);
  height: auto;
  margin: var(--space-32) auto;
  border: 1px solid var(--color-surface-outline);
  border-radius: var(--radius-card-md);
  box-shadow: var(--shadow-card-soft);
}

.post__body figcaption {
  font-family: var(--font-ui);
  font-size: var(--type-caption);
  color: var(--color-text-muted);
  text-align: center;
  margin-top: var(--space-8);
}

.post__body blockquote {
  margin: var(--space-32) 0;
  padding: var(--space-16) var(--space-24);
  border-left: 4px solid var(--color-quote-rule);
  background: var(--color-accent-soft);
  border-radius: 0 var(--radius-card-sm) var(--radius-card-sm) 0;
  font-family: var(--font-display);
  font-style: italic;
  font-size: var(--type-body-lg);
  line-height: var(--leading-snug);
  color: var(--color-text-primary);
}

.post__body blockquote p:last-child {
  margin-bottom: 0;
}

.post__body code {
  background: var(--color-code-bg);
  padding: 0.125rem 0.375rem;
  border-radius: 4px;
  font-size: 0.9em;
}

.post__body pre {
  background: var(--color-page-dark);
  color: var(--color-text-inverse);
  padding: var(--space-20);
  border-radius: var(--radius-card-sm);
  overflow-x: auto;
  font-size: var(--type-caption);
  line-height: 1.5;
}

.post__body pre code {
  background: transparent;
  padding: 0;
  border-radius: 0;
  color: inherit;
}

.post__body hr {
  border: 0;
  height: 1px;
  background: var(--color-surface-outline);
  margin: var(--space-48) 0;
}

.post__body a {
  color: var(--color-accent-strong);
  text-decoration: underline;
  text-underline-offset: 0.2em;
  text-decoration-thickness: 1px;
}

.post__body a:hover,
.post__body a:focus-visible {
  color: var(--color-accent-dark);
  text-decoration-thickness: 2px;
}

.post__body table {
  display: block;
  width: 100%;
  max-width: 100%;
  margin: var(--space-32) 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-collapse: collapse;
  font-size: var(--type-body-sm);
}

.post__body:lang(ko) table,
.post__body:lang(ja) table {
  overflow-wrap: normal;
}

/* Korean keeps words whole, so on a phone the auto table layout gave the
   first column one word per line ("한 글자 안의 / 자모 / 알아보기") while
   the second had room. A minimum width keeps such a label to two lines
   (tortolingua-web#588). */
@media (max-width: 480px) {
  .post__body:lang(ko) :is(th, td):first-child {
    min-width: 7em;
  }
}

/* The kana reading article's example sentences in the first column use a
   deliberate learner space ("ねこが います。"); a break there reads as two
   entries. Keep those cells on one line and let the table's own horizontal
   scroll take any overflow. Scoped to that article: other Japanese tables
   keep wrapping, so they do not start to scroll (tortolingua-web#536). */
.post[data-bundle="hiragana-katakana-reading-practice"] .post__body:lang(ja) td:first-child {
  white-space: nowrap;
}

/* With the first column on one line, the second (a plain Japanese
   explanation) is what must fit (tortolingua-web#564). It keeps breaking
   between phrases; `anywhere` only lowers its min-content width, so the
   table can shrink to a 320px screen without scrolling inside it, and a
   phrase splits only when it alone is wider than the cell. On a narrow
   phone the cells pad 8px a side. Below 340px the longest phrase
   (伝えています。, seven characters) no longer fits beside the first column
   at 16px and would leave す。 alone on a line, so the table text steps
   down to 14px there. */
.post[data-bundle="hiragana-katakana-reading-practice"] .post__body:lang(ja) td:last-child {
  overflow-wrap: anywhere;
}

@media (max-width: 480px) {
  .post[data-bundle="hiragana-katakana-reading-practice"] .post__body:lang(ja) :is(th, td) {
    padding-inline: var(--space-8);
  }
}

@media (max-width: 339px) {
  .post[data-bundle="hiragana-katakana-reading-practice"] .post__body:lang(ja) table {
    font-size: var(--type-caption);
  }
}

.post__body .false-friends-table-wrap {
  width: 100%;
  margin: var(--space-32) 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.post__body .false-friends-table-wrap table {
  display: table;
  min-width: 760px;
  margin: 0;
}

.post__body th,
.post__body td {
  padding: var(--space-12) var(--space-16);
  text-align: left;
  border-bottom: 1px solid var(--color-surface-outline);
  vertical-align: top;
}

.post__body th {
  font-family: var(--font-ui);
  font-weight: 700;
  background: var(--color-accent-soft);
  color: var(--color-text-primary);
}

.post__body tr:last-child td {
  border-bottom: none;
}

.post__body iframe {
  width: 100%;
  aspect-ratio: 16 / 9;
  height: auto;
  border: 0;
  border-radius: var(--radius-card-sm);
  margin: var(--space-32) 0;
}

.post__body video {
  width: 100%;
  height: auto;
  border-radius: var(--radius-card-sm);
  margin: var(--space-32) 0;
}
/* Cognates reference surface ---------------------------------------------- */

.cognates-page,
.cognates-index {
  max-width: var(--content-width);
  margin: 0 auto;
  /* The query container for the enlarged-text rules at the end of this file. */
  container: cognates / inline-size;
}

.cognates-breadcrumbs {
  position: relative;
  margin-bottom: var(--space-24);
  color: var(--color-text-muted);
  font-size: var(--type-body-sm);
}

/*
 * One line of crumbs: each ancestor keeps its trailing "/" (nowrap), and the
 * current page takes the remaining width and ends with an ellipsis instead of
 * wrapping onto a line of its own.
 */
.cognates-breadcrumbs__list {
  display: flex;
  gap: var(--space-8);
  list-style: none;
  margin: 0;
  padding: 0;
}

.cognates-breadcrumbs__item {
  display: inline-flex;
  align-items: center;
  flex: none;
  gap: var(--space-8);
  white-space: nowrap;
}

.cognates-breadcrumbs__item:last-child {
  flex: 0 1 auto;
  min-width: 0;
}

.cognates-breadcrumbs__item:last-child > span {
  overflow: hidden;
  text-overflow: ellipsis;
}

.cognates-breadcrumbs__item:not(:last-child)::after {
  content: "/";
  content: "/" / "";
  color: var(--color-surface-outline-strong);
}

/*
 * Phones: only "← parent" is visible; the H1 right below names the current
 * page. The other crumbs are visually hidden, not removed, so screen readers
 * still read the whole trail; a hidden link that gets keyboard focus shows
 * itself (same clip pattern as .landing-access-promise__text).
 */
@media (max-width: 600px) {
  .cognates-breadcrumbs__item:not(:nth-last-child(2)):not(:focus-within) {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }

  .cognates-breadcrumbs__item:nth-last-child(2) {
    min-width: 0;
  }

  .cognates-breadcrumbs__item:nth-last-child(2)::before {
    content: "←";
    content: "←" / "";
  }

  .cognates-breadcrumbs__item:nth-last-child(2)::after {
    content: none;
  }

  .cognates-breadcrumbs__item:nth-last-child(2) > a {
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

.cognates-breadcrumbs a {
  color: var(--color-accent-strong);
  text-underline-offset: 0.2em;
}

.cognates-breadcrumbs a:hover,
.cognates-breadcrumbs a:focus-visible {
  color: var(--color-accent-dark);
  text-decoration-thickness: 2px;
}

.cognates-page__header,
.cognates-index__header {
  margin-bottom: var(--space-32);
  padding-bottom: var(--space-32);
  border-bottom: 1px solid var(--color-surface-outline);
}

.cognates-page__title,
.cognates-index__title {
  font-family: var(--font-display);
  font-weight: 700;
  /* Narrow phones scale down so an unbreakable "30 споріднених" fits the line. */
  font-size: min(var(--type-display-md), 10.5vw);
  line-height: var(--leading-tight);
  margin-bottom: var(--space-16);
}

.cognates-page__description,
.cognates-index__description {
  font-size: var(--type-body-lg);
  line-height: var(--leading-snug);
  color: var(--color-text-secondary);
  margin: 0;
}

.cognates-page__intro,
.cognates-index__body {
  font-size: var(--type-body-md);
  line-height: var(--leading-reading);
  color: var(--color-text-primary);
}

.cognates-page__intro > * + *,
.cognates-index__body > * + * {
  margin-top: var(--space-24);
}

.cognates-page__intro h2,
.cognates-index__body h2 {
  font-size: var(--type-heading-md);
  margin-top: var(--space-48);
}

.cognates-page__intro p,
.cognates-index__body p {
  margin: 0 0 var(--space-24);
}

.cognates-page__intro a,
.cognates-index__body a,
.cognates-list__sources a {
  color: var(--color-accent-strong);
  text-decoration: underline;
  text-underline-offset: 0.2em;
  text-decoration-thickness: 1px;
}

.cognates-page__intro a:hover,
.cognates-page__intro a:focus-visible,
.cognates-index__body a:hover,
.cognates-index__body a:focus-visible,
.cognates-list__sources a:hover,
.cognates-list__sources a:focus-visible {
  color: var(--color-accent-dark);
  text-decoration-thickness: 2px;
}

.cognates-page__list {
  margin-top: var(--space-48);
}

.cognates-page__list-title {
  font-size: var(--type-heading-md);
  margin-bottom: var(--space-24);
}

.cognates-list,
.cognates-index__list {
  display: grid;
  /* One column as wide as the list: an implicit auto column would grow to
     the widest unbreakable phrase and push every card past a narrow screen. */
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-16);
  list-style: none;
  margin: 0;
  padding: 0;
}

.cognates-list {
  counter-reset: cognates;
}

.cognates-list__item {
  border: 1px solid var(--color-surface-outline);
  border-radius: 8px;
  background: var(--color-surface-card);
}

.cognates-list__item {
  counter-increment: cognates;
  padding: var(--space-20);
}

.cognates-list__pair {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--space-8);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--type-heading-sm);
  line-height: var(--leading-snug);
}

/* Fixed-width, end-aligned number so the words of items 1-30 share one edge.
   It is set in the pair's own face, a step smaller and muted, on the pair's
   baseline, so it reads as part of the heading and not as a small sans-serif
   label beside it (tortolingua-web#639). */
.cognates-list__pair::before {
  content: counter(cognates) ".";
  align-self: baseline;
  min-width: 3ch;
  text-align: end;
  font-variant-numeric: tabular-nums;
  font-size: 0.8em;
  color: var(--color-text-muted);
}

.cognates-list__sep {
  color: var(--color-text-muted);
}

.cognates-list__ipa {
  font-family: var(--font-ui);
  font-weight: 400;
  font-size: var(--type-caption);
  color: var(--color-text-muted);
}

.cognates-list__gloss,
.cognates-list__etymology,
.cognates-list__note,
.cognates-list__sources {
  margin: var(--space-12) 0 0;
}

.cognates-list__gloss {
  color: var(--color-text-secondary);
  font-family: var(--font-ui);
  font-size: var(--type-body-sm);
}

.cognates-list__etymology,
.cognates-list__sources {
  color: var(--color-text-muted);
  font-size: var(--type-caption);
  line-height: var(--leading-snug);
}

.cognates-list__note {
  font-size: var(--type-body-md);
  line-height: var(--leading-reading);
}

/*
 * Sources row: the label sits in its own column and the links wrap in the
 * second one, so a wrapped link lines up under the first link. Each link but
 * the first carries its separator in a leading strip as wide as the gap; the
 * links box clips only its left side, so the separator of a link that starts
 * a line falls outside it and a line never starts or ends with "·". Text may
 * still overflow up, down and to the right (200% text zoom), and long link
 * text wraps instead of being cut. The left padding, cancelled by an equal
 * negative margin, keeps the focus ring (3px) inside the clip. The pages are
 * Ukrainian and Polish only, so a physical left side is the start side.
 */
.cognates-list__sources {
  --cognates-source-gap: 1.25em;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  column-gap: var(--space-8);
  align-items: baseline;
}

.cognates-list__sources-label {
  white-space: nowrap;
}

.cognates-list__source-links {
  display: flex;
  flex-wrap: wrap;
  column-gap: var(--cognates-source-gap);
  row-gap: var(--space-4);
  min-width: 0;
  margin-left: calc(-1 * var(--space-4));
  padding-left: var(--space-4);
  clip-path: inset(-1em -100vw -1em 0);
}

.cognates-list__source-link {
  position: relative;
  margin-inline-start: calc(-1 * var(--cognates-source-gap));
  padding-inline-start: var(--cognates-source-gap);
  overflow-wrap: anywhere;
}

.cognates-list__source-link::before {
  content: "·";
  content: "·" / "";
  position: absolute;
  inset-block: 0;
  inset-inline-start: 0;
  width: var(--cognates-source-gap);
  text-align: center;
}

.cognates-page__placeholder {
  padding: var(--space-20);
  border: 1px solid var(--color-surface-outline);
  border-radius: 8px;
  background: var(--color-surface-subtle);
}

.cognates-index__list {
  margin-top: var(--space-32);
}

/*
 * Section and pair cards look like the site's .landing-card (large radius,
 * translucent white on the page background, heading-font title without an
 * underline); the title link covers the whole card.
 */
.cognates-index__item {
  position: relative;
  padding: var(--space-20);
  border: 1px solid var(--color-surface-outline);
  border-radius: var(--radius-card-md);
  background: rgba(255, 255, 255, 0.84);
}

.cognates-index__item:hover {
  border-color: var(--color-accent-strong);
}

.cognates-index__item-title {
  margin: 0 0 var(--space-8);
  font-size: var(--type-heading-sm);
  line-height: var(--leading-snug);
}

.cognates-index__link {
  color: var(--color-text-primary);
  text-decoration: none;
}

.cognates-index__link:focus-visible {
  outline: none;
}

.cognates-index__link::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
}

/* The keyboard focus ring outlines the whole card, not only the title. */
.cognates-index__link:focus-visible::after {
  outline: 2px solid var(--color-accent-strong);
  outline-offset: 2px;
}

.cognates-index__item:hover .cognates-index__link {
  color: var(--color-accent-dark);
}

.cognates-index__item-description {
  margin: 0;
  color: var(--color-text-secondary);
  line-height: var(--leading-normal);
}

.cognates-page > .product-cta {
  margin-top: var(--space-48);
}

/*
 * Enlarged text (200% on a phone leaves the page about 10rem wide; at the
 * default size it is 18rem or more on every phone): a word longer than its
 * line breaks, and short phrases kept on one line (`.nowrap` in the title,
 * notes and pair titles) and the "← parent" crumb may wrap, so nothing is
 * wider than the screen (WCAG 1.4.10). At the default size the rule never
 * applies, and words and those phrases stay whole.
 */
@container cognates (max-width: 16rem) {
  .cognates-page > *,
  .cognates-index > * {
    overflow-wrap: anywhere;
  }

  .cognates-page__title .nowrap,
  .cognates-list__note .nowrap,
  .cognates-index__link .nowrap {
    white-space: normal;
  }

  .cognates-breadcrumbs__item:nth-last-child(2) {
    flex-shrink: 1;
    white-space: normal;
  }
}
/* 7. Taxonomy / list -------------------------------------------------- */

.taxonomy-list {
  max-width: var(--list-width);
  margin: 0 auto;
}

/* 8. Error page (404) --------------------------------------------------- */

.error-page {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: var(--space-56) 0;
  text-align: center;
}

.error-page__code {
  font-size: var(--type-display-lg);
  margin: 0 0 var(--space-16);
  color: var(--color-text-secondary);
  letter-spacing: -0.02em;
}

.error-page__title {
  margin: 0 0 var(--space-24);
  /* Set like every other page heading, although it stays a paragraph under
     the "404" h1. */
  font-family: var(--font-display);
  font-size: var(--type-heading-md);
  font-weight: 700;
  line-height: var(--leading-tight);
  letter-spacing: -0.01em;
  word-spacing: 0.08em;
  color: var(--color-text-primary);
}

.error-page__body {
  font-size: var(--type-body-lg);
  line-height: var(--leading-reading);
  color: var(--color-text-secondary);
  margin: 0 0 var(--space-32);
}

.error-page__actions {
  margin: 0;
}

/* "Back to home" is the FAQ page's component (.landing-cta--secondary
   .faq-breadcrumb__link in layouts/404.html); it has no own style here. */

/* 9. Utility + responsive ---------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

@media (max-width: 900px) {
  .site-main {
    padding: var(--space-32) var(--space-20);
  }

  .post__title,
  .home-intro__title,
  .post-list__title {
    font-size: var(--type-heading-lg);
  }

  .post__body {
    font-size: var(--type-body-sm);
  }
}

@media (max-width: 600px) {
  .site-main {
    padding: var(--space-24) var(--space-16) var(--space-32);
  }

  .site-header__inner {
    gap: var(--space-8) var(--space-12);
    padding: var(--space-12) var(--space-16);
  }

  /* Brand and language switcher share the first row, the menu takes the
     next one. The brand keeps its full width; the switcher takes what is
     left (up to its own width, pushed to the end) and truncates a long
     language name instead of covering the wordmark. Only when less than
     4.5rem would be left (enlarged text on a phone) does it move to a row of
     its own. The wordmark is capped at 10vw so that at 200% text it still
     fits a 320px screen; at default text size the cap never applies. */
  .site-header__brand {
    flex: none;
    font-size: min(var(--type-heading-md), 10vw);
  }

  .language-switcher {
    flex: 1 1 4.5rem;
    margin-inline-start: auto;
    max-width: max-content;
  }

  /* The menu is a size container, so the app button below can compare its
     row with the full menu width (100cqw). */
  .site-nav {
    order: 1;
    flex: 1 0 100%;
    min-width: 0;
    container-type: inline-size;
  }

  /* The whole menu wraps, never a single item (tortolingua-web#534). One gap
     between all items, the app button included. */
  .site-nav__list {
    flex-wrap: wrap;
    gap: var(--space-8);
  }

  .site-nav__link {
    display: inline-flex;
    align-items: center;
    box-sizing: border-box;
    justify-content: center;
    min-width: 44px;
    min-height: 44px; /* touch target */
    padding: var(--space-8);
    font-size: 0.875rem;
  }

  /* The app button keeps the 44px touch target, but its green pill is drawn
     at the height of a menu row, with room beside the label. The start margin
     equals a link's side padding, so the pill sits as far from the previous
     label as one label from the next. */
  .site-nav__list .site-nav__link--app {
    position: relative;
    isolation: isolate;
    margin-inline-start: var(--site-nav-app-offset);
    padding-inline: var(--space-12);
    background: transparent;
  }

  .site-nav__list {
    --site-nav-app-offset: var(--space-8);
  }

  /* On the narrowest phones the whole-menu wrap can still leave the app
     button alone on the second row (uk, ko and pl at 320px,
     tortolingua-web#636). It then spans that row, a deliberate second row
     instead of a stray tail. Its item always grows into the rest of its row,
     which is invisible. The button itself widens only when that item is
     within 20px of the full menu width, which means it is alone on the row:
     any item sharing the row takes at least 44px plus the gap. Elsewhere the
     clamp resolves to the 44px touch-target floor and nothing changes. */
  .site-nav__item:has(> .site-nav__link--app) {
    flex: 1 0 auto;
  }

  .site-nav__list .site-nav__link--app {
    min-width: clamp(
      44px,
      (100% - 100cqw + 20px) * 1000,
      100% - var(--site-nav-app-offset)
    );
  }

  .site-nav__list .site-nav__link--app::before {
    content: "";
    position: absolute;
    inset: 6px 0;
    z-index: -1;
    border-radius: var(--radius-pill);
    background: var(--color-accent);
  }

  .site-nav__list .site-nav__link--app:hover,
  .site-nav__list .site-nav__link--app:focus-visible {
    background: transparent;
  }

  .site-nav__list .site-nav__link--app:hover::before,
  .site-nav__list .site-nav__link--app:focus-visible::before {
    background: var(--color-accent-strong);
  }

  .language-switcher {
    gap: 0;
    min-width: 0;
    padding: var(--space-4) var(--space-8);
  }

  .language-switcher__label {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }

  .language-switcher__select {
    width: auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .post-list__items {
    grid-template-columns: 1fr;
  }

  .post__header {
    margin-bottom: var(--space-32);
    padding-bottom: var(--space-24);
  }

  .post__title {
    font-size: var(--type-heading-lg);
  }

  .home-intro,
  .home-posts {
    margin-inline: 0;
  }
}

/* Narrowest phones: a smaller wordmark and a tighter switcher leave room for
   the full current language name ("Português", "Українська") beside the
   brand; a longer name still truncates rather than covering the wordmark. */
@media (max-width: 359px) {
  .site-header__inner {
    column-gap: var(--space-8);
  }

  .site-header__brand {
    gap: var(--space-4);
    font-size: min(1.125rem, 10vw);
  }

  .language-switcher {
    padding-inline: var(--space-8) var(--space-4);
    font-size: 0.8125rem;
  }

  /* The select is as wide as its longest name; the end padding keeps 10px
     between that name and the 10px arrow, so a slightly wider fallback font
     still does not run the label into the arrow. */
  .language-switcher__select {
    padding-inline-end: 20px;
    background-position: right 0 center;
    background-size: 10px 7px;
  }

  .site-nav__list {
    gap: var(--space-4);
  }

  .site-nav__link {
    padding-inline: 6px;
  }

  .site-nav__list {
    --site-nav-app-offset: 6px;
  }

  .site-nav__list .site-nav__link--app {
    padding-inline: var(--space-12);
  }
}

/* Community page: the shared .site-main container, .landing-eyebrow and
   .landing-card (tortolingua-web#534). One reading column, centred in the
   container like the /app/ product pages, not pinned to the left edge. */
.community {
  width: 100%;
  max-width: 880px;
  margin-inline: auto;
}

.community__hero {
  /* The hero spans the same column as the cards below it, so their right
     edges line up (tortolingua-web#638). */
  margin-bottom: 2.5rem;
}

/* Same H1 size and rhythm as the other landing pages (/mission/, /app/). */
.community__title {
  margin: 0.5rem 0 1rem;
  font-family: var(--font-display);
  font-size: clamp(2rem, 4.2vw, 3.2rem);
  line-height: 1.08;
  letter-spacing: -0.015em;
}

.community__lead {
  color: var(--color-text-secondary);
  font-size: clamp(1.1rem, 2vw, 1.35rem);
  line-height: 1.65;
}

.community__volunteer-note {
  display: block;
  padding: 0.75rem 1rem;
  border: 1px solid #c58b3b;
  border-radius: 0.75rem;
  background: #faf6ee;
  color: #1f2a24;
  font-weight: 700;
}

.community__content {
  color: var(--color-text-secondary);
  line-height: 1.75;
}

.community__content :is(ul, ol) {
  padding-inline-start: 1.5em;
}

.community__content > :last-child {
  margin-bottom: 0;
}

.community__content h2 {
  margin-top: 3rem;
}

.community-routes__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.community-route {
  display: flex;
  flex-direction: column;
}

.community .community-route p {
  flex: 1;
  margin-bottom: var(--space-16);
}

.community-route__link {
  font-weight: 700;
}

.community-route__pending,
.community-routes__privacy {
  color: #54645b;
  font-size: 0.94rem;
}

.community-routes__privacy {
  margin: 1.25rem 0 0;
}

.community .community-contact h2,
.community .community-contact p {
  margin-block: 0;
}

.community .community-contact p {
  margin-top: 0.75rem;
}

.community-contact {
  margin-top: 3rem;
}

.community-contact__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.25rem;
}

/* The buttons carry short labels at the standard CTA size; the address is
   written out under them, where it may wrap like any text. */
.community .community-contact .community-contact__address {
  margin-top: var(--space-12);
  font-size: var(--type-caption);
  overflow-wrap: anywhere;
}

@media (max-width: 680px) {
  .community-routes__grid {
    grid-template-columns: 1fr;
  }

  .community-contact__actions .landing-cta {
    width: 100%;
  }
}
/* 10. Landing (home) -------------------------------------------------- */
/*
 * Landing visuals ported from tortolingua-landing (11ty). Classes are
 * prefixed with `.landing-*` so they don't collide with the blog theme.
 * Uses the same brand tokens (cream page, teal accent) — shapes come from
 * `--radius-card-*` + `--shadow-card-*`, typography from `--font-display`
 * + `--font-copy`. The old landing's one-off `:root --accent` values map
 * to tokens.css equivalents.
 */

.landing-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.75fr);
  gap: var(--space-32);
  margin: 0 auto var(--space-24);
  padding: var(--space-32);
  background: var(--color-surface-panel);
  border: 1px solid var(--color-surface-outline);
  border-radius: var(--radius-card-lg);
  box-shadow: var(--shadow-card-medium);
}

.landing-hero--home {
  /* A wider copy column keeps the three hero buttons in one row at desktop
     width in every language (uk, sr and pl have the longest labels). The
     uk row leaves only about 18 px spare at 1180-1440 px, so any hero label
     change must recheck the row at 1440. */
  grid-template-columns: minmax(0, 1.9fr) minmax(280px, 0.75fr);
  grid-template-areas:
    "copy proof"
    "points proof";
  grid-template-rows: auto 1fr;
  row-gap: var(--space-24);
}

.landing-hero--home .landing-hero__copy {
  grid-area: copy;
}

.landing-hero__copy {
  display: grid;
  align-content: start;
}

.landing-eyebrow {
  margin: 0 0 var(--space-12);
  color: var(--color-accent);
  font-family: var(--font-ui);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  /* A wrapped eyebrow splits into even lines instead of leaving one word
     on the last line (tortolingua-web#589). */
  text-wrap: balance;
}

html:lang(ja) .landing-eyebrow,
html:lang(ko) .landing-eyebrow {
  letter-spacing: 0.02em;
  text-transform: none;
}

.landing-hero__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2rem, 4.2vw, 3.2rem);
  line-height: 1.08;
  letter-spacing: -0.015em;
}

.landing-hero__subtitle {
  margin: var(--space-16) 0 0;
  color: var(--color-text-secondary);
  max-width: 720px;
  font-size: var(--type-body-lg);
  line-height: var(--leading-reading);
  text-wrap: pretty;
}

/* The access badge is a row of check-marked parts with no box, at every
   width (tortolingua-web#650, #652). It spans the column, so its width does
   not depend on the language. Parts wrap whole; the check is drawn with
   borders, so it needs no font glyph in any script. */
.landing-access-promise {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: var(--space-4) var(--space-24);
  margin: var(--space-16) 0 0;
  padding: 0;
  color: var(--color-accent-dark);
  font-family: var(--font-ui);
  font-size: var(--type-body-sm);
  font-weight: 700;
  line-height: var(--leading-snug);
}

.landing-actions {
  margin-top: var(--space-20);
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-12);
}

.landing-actions--offset {
  margin-top: var(--space-16);
}

.landing-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: var(--space-8) var(--space-20);
  border-radius: var(--radius-pill);
  text-decoration: none;
  font-family: var(--font-ui);
  font-weight: 700;
  /* A label that wraps stays centred and splits into even lines. */
  text-align: center;
  text-wrap: balance;
  transition: transform 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

.landing-cta:hover,
.landing-cta:focus-visible {
  transform: translateY(-1px);
  text-decoration: none;
}

.landing-cta--primary {
  background: var(--color-accent);
  color: var(--color-text-inverse);
}

.landing-cta--primary:hover,
.landing-cta--primary:focus-visible {
  background: var(--color-accent-strong);
  color: var(--color-text-inverse);
  box-shadow: var(--shadow-card-soft);
}

.landing-cta--secondary {
  background: var(--color-surface-card);
  color: var(--color-accent-ink);
  border: 1px solid var(--color-surface-outline);
}

.landing-cta--secondary:hover,
.landing-cta--secondary:focus-visible {
  background: var(--color-accent-soft);
  border-color: var(--color-accent);
  color: var(--color-accent-dark);
}

.landing-cta--unavailable {
  background: var(--color-surface-card);
  color: var(--color-text-secondary);
  border: 1px solid var(--color-surface-outline);
  cursor: default;
}

.landing-hero--home .landing-hero__points {
  grid-area: points;
  align-self: start;
}

.landing-hero__points {
  width: 100%;
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: var(--space-8);
}

.landing-hero__points li {
  padding: var(--space-12) var(--space-16);
  border: 1px solid var(--color-surface-outline);
  border-radius: var(--radius-card-sm);
  background: rgba(255, 255, 255, 0.7);
  line-height: var(--leading-normal);
  text-wrap: pretty;
}

/* Japanese breaks the supported-language list only between names. Below
   360 px the box holds about 12 full-width characters at body size, while
   most pairs of names need 13-14, so the list fell to one name per line; at
   15 px a line holds two names (tortolingua-web#534). */
@media (max-width: 359px) {
  html:lang(ja) .landing-hero--home .landing-hero__points li {
    font-size: 0.9375rem;
  }
}

.landing-hero__panel {
  display: grid;
  gap: var(--space-12);
  align-content: start;
}

/* The mission hero's single promise badge sits centred beside the copy, not
   pinned to the card's top-right corner with an empty column below it
   (tortolingua-web#638). */
.mission-page .landing-hero__panel {
  align-content: center;
}

.landing-hero--home .landing-hero__proof {
  grid-area: proof;
}

.landing-hero__proof {
  display: grid;
  gap: var(--space-16);
  align-content: start;
  justify-items: center;
  min-width: 0;
}

.landing-proof {
  display: grid;
  gap: var(--space-12);
  width: min(100%, 250px);
  margin: 0;
}

.landing-proof__frame {
  padding: var(--space-8);
  overflow: hidden;
  border: 1px solid rgba(23, 33, 28, 0.32);
  border-radius: 30px;
  background: #17211c;
  box-shadow: var(--shadow-card-medium);
}

.landing-hero__screenshot {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1290 / 2796;
  border-radius: 22px;
}

.landing-proof__caption {
  display: grid;
  gap: var(--space-4);
  text-align: center;
  text-wrap: balance;
}

.landing-proof__caption strong {
  font-family: var(--font-display);
  font-size: var(--type-heading-sm);
  line-height: var(--leading-tight);
}

.landing-proof__caption span {
  color: var(--color-text-secondary);
  font-size: var(--type-body-sm);
  line-height: var(--leading-normal);
}

.landing-stat {
  padding: var(--space-16) var(--space-20);
  border-radius: var(--radius-card-md);
  border: 1px solid var(--color-surface-outline);
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.9), #eaf6f1);
  box-shadow: inset 0 1px 0 #ffffff;
}

.landing-stat strong {
  display: block;
  margin-bottom: var(--space-8);
  font-family: var(--font-display);
  font-size: var(--type-heading-sm);
}

.landing-stat span {
  display: block;
  color: var(--color-text-secondary);
  line-height: var(--leading-normal);
}

.landing-section {
  margin-top: var(--space-32);
}

.landing-section__heading {
  margin-bottom: var(--space-20);
}

.landing-section__heading :is(h1, h2) {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.55rem, 3vw, 2.2rem);
  line-height: 1.15;
}

/* Each sentence of the mission heading (landing-text.html "Sentences") is
   one box: the heading breaks between its sentences first, and a sentence
   that is wider than the line still wraps inside itself
   (tortolingua-web#589). */
.landing-sentence {
  display: inline-block;
}

.landing-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-16);
}

.landing-grid--two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

/* Cards with a button: the text grows so the buttons of a row line up. */
.landing-grid--two .landing-card {
  display: flex;
  flex-direction: column;
}

.landing-grid--two .landing-card > p {
  flex-grow: 1;
}

/* A row of three heading + text cards (home why, audience and FAQ rows,
   /mission/): each card is a two-row subgrid, so every heading of the row
   takes the height of the tallest one and the texts start on one line
   (tortolingua-web#589). Below 900 px the cards stack and size alone. */
@media (min-width: 901px) {
  .landing-grid:not(.landing-grid--two) {
    row-gap: 0;
  }

  .landing-grid:not(.landing-grid--two) > .landing-card {
    display: grid;
    grid-row: span 2;
    grid-template-rows: subgrid;
    row-gap: 0;
    align-content: start;
  }
}

.landing-card {
  background: rgba(255, 255, 255, 0.84);
  border: 1px solid var(--color-surface-outline);
  border-radius: var(--radius-card-md);
  padding: var(--space-20);
}

.landing-card h3 {
  margin: 0 0 var(--space-8);
  font-size: var(--type-heading-sm);
}

.landing-card p {
  margin: 0;
  color: var(--color-text-secondary);
  line-height: var(--leading-normal);
  text-wrap: pretty;
}

.landing-card--wide {
  padding: var(--space-24);
}

.landing-card__lead {
  max-width: 760px;
  font-size: var(--type-body-md);
  line-height: 1.65;
}

.landing-mission-card .landing-card__body > p {
  max-width: var(--content-width);
}

.landing-mission-card h3 {
  margin-top: var(--space-20);
}

.landing-mission-card .landing-actions {
  margin-top: var(--space-20);
}

/* Full-width home cards on a desktop (tortolingua-web#589): the text keeps a
   reading measure and the card's button sits on the right, centred on the
   text, so the right part of the card is not left empty. A card with no
   button (the reading-paths intro) keeps the full width, so its edges line
   up with the card row below it (tortolingua-web#637). The blog card is
   stacked: its post list takes the full width and the button sits under
   it on the left, as in the other cards with actions, instead of alone on
   the right beside an empty strip (tortolingua-web#637). */
@media (min-width: 901px) {
  .home .landing-card--wide {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-32);
  }

  .home .landing-card--wide > .landing-card__body,
  .home .landing-card--wide > .landing-card__lead {
    flex: 0 1 68ch;
    min-width: 0;
    max-width: 68ch;
  }

  .home .landing-card--wide > .landing-card__body > p {
    max-width: none;
  }

  .home .landing-card--wide > .landing-actions {
    flex: 0 0 auto;
    margin-top: 0;
  }

  /* The blog card is found by its section, so it stays stacked even in a
     language whose post list is empty. */
  .home [aria-labelledby="landing-blog-title"] > .landing-card--wide {
    display: block;
  }

  /* The list takes the card's width; the lead above it keeps the 68ch
     reading measure. */
  .home [aria-labelledby="landing-blog-title"] > .landing-card--wide > .landing-card__body {
    max-width: none;
  }

  .home [aria-labelledby="landing-blog-title"] > .landing-card--wide > .landing-card__body > .landing-card__lead {
    max-width: 68ch;
  }
}

/* Japanese breaks only between phrases. Below 360 px the wide card's padding
   left about 14 full-width characters per line: the 12-character promise
   heading split inside 壁がない and the promise fell into short lines. The
   16 px card padding of the narrowest phones (40-faq-legal-footer.css) and a
   16 px promise keep the heading on one line and fill the promise lines
   (tortolingua-web#563). */
@media (max-width: 359px) {
  html:lang(ja) .landing-mission-card .landing-card__lead ~ p {
    font-size: 1rem;
  }
}

.landing-post-list {
  display: grid;
  gap: var(--space-8);
  margin: var(--space-16) 0 var(--space-20);
  padding: 0;
  list-style: none;
}

.landing-post-list__item {
  border: 1px solid var(--color-surface-outline);
  border-radius: var(--radius-card-sm);
  background: rgba(255, 255, 255, 0.7);
  transition: border-color 150ms ease, background 150ms ease;
}

.landing-post-list__item:hover,
.landing-post-list__item:focus-within {
  border-color: var(--color-accent);
  background: var(--color-accent-soft);
}

.landing-post-list__link {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-12);
  padding: var(--space-12) var(--space-16);
  color: var(--color-text-primary);
  text-decoration: none;
  justify-content: space-between;
  align-items: center;
}

.landing-post-list__link:hover,
.landing-post-list__link:focus-visible {
  color: var(--color-accent-dark);
  text-decoration: none;
}

.landing-post-list__title {
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: var(--type-body-sm);
}

.landing-post-list__date {
  font-family: var(--font-ui);
  font-size: var(--type-meta);
  color: var(--color-text-muted);
}

.landing-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-16);
}

.landing-step {
  padding: var(--space-24) var(--space-20) var(--space-20);
  border-radius: var(--radius-card-md);
  border: 1px solid var(--color-surface-outline);
  background: #fffdfa;
}

.landing-step__index {
  display: inline-block;
  margin-bottom: var(--space-12);
  color: var(--color-accent);
  font-family: var(--font-ui);
  font-size: 0.86rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.landing-step h3 {
  margin: 0 0 var(--space-8);
  font-size: var(--type-heading-sm);
}

.landing-step p {
  margin: 0;
  color: var(--color-text-secondary);
  line-height: var(--leading-normal);
  text-wrap: pretty;
}

/* The final panel has one layout in every language (tortolingua-web#589):
   on a desktop a fixed grid, heading 2fr and the buttons stacked in the 1fr
   column; below 900 px the buttons sit under the heading. Before, a wrapping
   flex row put the buttons beside or under the heading by label length. */
.landing-cta-panel {
  margin-top: var(--space-32);
  padding: var(--space-32) var(--space-32) var(--space-32);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-20);
  border-radius: var(--radius-card-lg);
  border: 1px solid var(--color-surface-outline);
  background:
    radial-gradient(500px 220px at 0% 0%, #ffffff, transparent 70%),
    linear-gradient(135deg, #e6f4ee, #ffffff);
}

.landing-cta-panel__copy {
  max-width: 720px;
}

.landing-cta-panel h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 2.8vw, 2rem);
  line-height: 1.2;
  text-wrap: balance;
}

/* Below 360 px the heading is 20 px: at 22.4 px "Відкрийте застосунок,"
   no longer fits the 254 px line of a 320 px phone, and balancing left
   "Відкрийте" and "перший" each alone on a line (tortolingua-web#637). A rem
   size, so enlarged text still scales it. */
@media (max-width: 359px) {
  .landing-cta-panel h2 {
    font-size: 1.25rem;
  }
}

.landing-cta-panel .landing-actions {
  margin-top: 0;
}

@media (min-width: 901px) {
  .landing-cta-panel {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
    align-items: center;
    column-gap: var(--space-32);
  }

  .landing-cta-panel .landing-actions {
    flex-direction: column;
    align-items: stretch;
  }
}

/* 11. App download / beta conversion --------------------------------- */

.site-nav__link--app {
  background: var(--color-accent);
  color: var(--color-text-inverse);
}

.site-nav__link--app:hover,
.site-nav__link--app:focus-visible {
  background: var(--color-accent-strong);
  color: var(--color-text-inverse);
}

.app-platforms {
  margin-top: 0;
}

.app-platforms__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-16);
}

.app-platform {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-16);
  padding: var(--space-24);
  border: 1px solid var(--color-surface-outline);
  border-radius: var(--radius-card-md);
  background: rgba(255, 255, 255, 0.86);
}

.app-platform__badge {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 var(--space-12);
  border-radius: var(--radius-pill);
  background: var(--color-accent-soft);
  color: var(--color-accent-dark);
  font-family: var(--font-ui);
  font-size: var(--type-meta);
  font-weight: 800;
}

.app-platform h3 {
  margin: 0;
  font-size: var(--type-heading-sm);
}

.app-platform p {
  margin: 0;
  color: var(--color-text-secondary);
  line-height: var(--leading-normal);
  text-wrap: pretty;
}

.app-platform__actions {
  margin-top: auto;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-12);
}

.app-platform__note {
  font-size: var(--type-body-sm);
}

.app-promo {
  margin-top: var(--space-32);
  padding: var(--space-24);
  border: 1px solid var(--color-surface-outline);
  border-radius: var(--radius-card-md);
  background: rgba(255, 255, 255, 0.82);
}

.app-promo h2 {
  margin: 0 0 var(--space-8);
  font-family: var(--font-display);
  font-size: var(--type-heading-md);
  color: var(--color-text-primary);
}

.app-promo p {
  color: var(--color-text-secondary);
  line-height: var(--leading-normal);
}

.app-promo {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-20);
  flex-wrap: wrap;
}

.app-promo__copy {
  max-width: 740px;
}

/* The last paragraph's base bottom margin made the space under the text
   larger than above it, so the copy and its button sat above the card's
   centre (tortolingua-web#589). */
.app-promo__copy > :last-child {
  margin-bottom: 0;
}

/* The Japanese promo heading (30 full-width characters) breaks only between
   phrases: scale it with the viewport so each phrase fits the card on a phone
   instead of splitting mid-phrase (tortolingua-web#524). At 320 px it still
   takes three lines; a shorter heading is the owner decision of
   tortolingua-web#567 (Н-49). */
@media (max-width: 600px) {
  html:lang(ja) .app-promo h2 {
    font-size: min(var(--type-heading-md), 5.2vw);
  }
}

.app-use-cases__intro {
  max-width: 760px;
  margin: var(--space-8) 0 0;
  color: var(--color-text-secondary);
  font-size: var(--type-body-md);
  line-height: var(--leading-normal);
}

.app-use-cases__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-16);
}

.app-use-case-card {
  display: flex;
}

.app-use-case-card__link {
  display: flex;
  width: 100%;
  flex-direction: column;
  gap: var(--space-12);
  padding: var(--space-24);
  border: 1px solid var(--color-surface-outline);
  border-radius: var(--radius-card-md);
  background: rgba(255, 255, 255, 0.86);
  color: var(--color-text-primary);
  transition: transform 150ms ease, border-color 150ms ease, box-shadow 150ms ease;
}

.app-use-case-card__link:hover,
.app-use-case-card__link:focus-visible {
  color: var(--color-text-primary);
  border-color: var(--color-accent);
  box-shadow: var(--shadow-card-soft);
  text-decoration: none;
  transform: translateY(-1px);
}

.app-use-case-card__eyebrow,
.app-use-case-card__cta {
  font-family: var(--font-ui);
  font-size: var(--type-meta);
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.app-use-case-card__eyebrow {
  color: var(--color-accent-dark);
}

.app-use-case-card h3 {
  margin: 0;
  font-size: var(--type-heading-sm);
}

.app-use-case-card p {
  margin: 0;
  color: var(--color-text-secondary);
  line-height: var(--leading-normal);
}

.app-use-case-card__cta {
  margin-top: auto;
  color: var(--color-accent-strong);
}

.app-product-page {
  max-width: var(--layout-width);
  margin: 0 auto;
}

.app-product-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(280px, 0.95fr);
  gap: var(--space-32);
  /* The copy starts at the top of the tall reader image instead of floating
     at its vertical centre with ~280 px of air above the eyebrow at 1440
     (tortolingua-web#638). */
  align-items: start;
  margin-bottom: var(--space-48);
}

.app-product-hero--text {
  grid-template-columns: minmax(0, 1fr);
}

.app-product-hero__copy {
  max-width: 720px;
}

.app-product-hero__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: var(--type-display-md);
  line-height: var(--leading-tight);
  /* Long German compounds must wrap at 320 px (tortolingua-web#524). */
  overflow-wrap: break-word;
}

.app-product-hero__subtitle {
  margin: var(--space-16) 0 0;
  color: var(--color-text-secondary);
  font-size: var(--type-body-lg);
  line-height: var(--leading-reading);
}

.app-product-hero__media {
  justify-self: center;
  width: min(100%, 360px);
  margin: 0;
  border: 1px solid var(--color-surface-outline);
  border-radius: var(--radius-card-md);
  overflow: hidden;
  background: var(--color-surface-subtle);
  box-shadow: var(--shadow-card-soft);
}

.app-product-hero__media img {
  display: block;
  width: 100%;
  height: auto;
}

.app-product-content {
  max-width: var(--content-width);
  margin: 0 auto;
}

.app-product__body {
  padding-bottom: var(--space-24);
}

@media (max-width: 900px) {
  .app-use-cases__grid,
  .app-product-hero {
    /* minmax(0, ...) so one wide item cannot push the track past a 320 px
       viewport (tortolingua-web#524). */
    grid-template-columns: minmax(0, 1fr);
  }
}

/* The badge sits above the H1 on the app page, so it owns the gap below it. */
.landing-section__heading > .landing-access-promise {
  margin: 0 0 var(--space-16);
}

/* A wrapped badge breaks between parts and the separator travels with its
   part; no part ever breaks inside itself. */
.landing-access-promise__part {
  display: inline-flex;
  align-items: baseline;
  white-space: nowrap;
  gap: var(--space-8);
}

.landing-access-promise__part::before {
  content: "";
  flex: none;
  width: 0.3em;
  height: 0.6em;
  margin-inline-start: 0.15em;
  border: solid var(--color-accent);
  border-width: 0 2px 2px 0;
  transform: translateY(-0.12em) rotate(45deg);
}

/* The checks replace the separators. Japanese parts are joined by <wbr>,
   which would be an extra item in the row. */
.landing-access-promise__sep,
.landing-access-promise wbr {
  display: none;
}

/* On a phone the home hero is centred, so the row is centred under the
   buttons with a tighter gap and the caption size; on /app/ it stays at the
   left, as the H1 below it does. On wider screens both start at the left
   edge of the buttons and the H1. */
@media (max-width: 600px) {
  .landing-access-promise {
    justify-content: center;
    gap: var(--space-4) var(--space-16);
    font-size: var(--type-caption);
  }

  .landing-section__heading > .landing-access-promise {
    justify-content: flex-start;
  }
}

/* Subtitle under a section H2: a 12 px gap, as on the /app/ intros. */
.landing-section__heading > :is(h1, h2) + p {
  margin: var(--space-12) 0 0;
}

/* The home reading-paths intro is a wide lead card under the heading, as
   the mission and blog intros are (tortolingua-web#563). Its 16 px bottom
   margin, the same as the grid gap, sets it apart from the two path cards
   below, and its lines are balanced instead of leaving a short last line. */
.landing-reading-paths-intro {
  margin-bottom: var(--space-16);
}

.landing-reading-paths-intro .landing-card__lead {
  text-wrap: balance;
}

.landing-access-promise__text {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
/* 12. FAQ page ------------------------------------------------------- */

.faq-breadcrumb {
  display: flex;
  margin-bottom: var(--space-20);
}

.faq-breadcrumb__link {
  gap: var(--space-8);
  font-size: var(--type-caption);
}

.faq-breadcrumb__icon {
  width: 18px;
  height: 18px;
  fill: currentColor;
  flex-shrink: 0;
}

.faq-header {
  margin-bottom: var(--space-32);
}

.faq-header__title {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  line-height: 1.08;
  letter-spacing: -0.01em;
  margin: 0 0 var(--space-12);
}

.faq-header__subtitle {
  margin: 0;
  color: var(--color-text-secondary);
  font-size: var(--type-body-lg);
  line-height: var(--leading-reading);
}

.faq-list {
  display: grid;
  gap: var(--space-16);
}

.faq-item {
  background: rgba(255, 255, 255, 0.84);
  border: 1px solid var(--color-surface-outline);
  border-radius: var(--radius-card-md);
  padding: var(--space-24);
}

.faq-item h2 {
  margin: 0 0 var(--space-8);
  font-family: var(--font-display);
  font-size: var(--type-heading-sm);
  line-height: 1.3;
}

.faq-item p {
  margin: 0;
  color: var(--color-text-secondary);
  line-height: var(--leading-reading);
}

.faq-item--with-screenshot {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--space-24);
  align-items: center;
}

.faq-item__text {
  min-width: 0;
}

.faq-item__screenshot {
  width: 320px;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: var(--radius-card-sm);
  border: 1px solid var(--color-surface-outline);
  box-shadow: var(--shadow-card-medium);
}

/* The illustrations are full phone screens, taller than the point each answer
   makes. One 4:3 frame shows the informative band of every one: from the top,
   the screen header (with the word tooltip) and the first eight reader lines,
   ending between two lines, or the language list; from the bottom, the audio
   player. The frame matches the width/height attributes, and its 320 px keeps
   the reader text legible on wide screens. */
.faq-item__screenshot--crop-top {
  object-position: top;
}

/* The audio shot's frame stops just above the bottom edge: the 4:3 band of
   the 780x1688 file then starts at row 1069, mid-way in the bare gap between
   two reader lines (rows 1060-1079, the same in every UI locale, past the
   learning-word shading of the line above), instead of halving a line, and
   still holds the player, its buttons and the tab bar's icons, losing only
   the bar's bottom padding. 96.92% of the 1103 rows the band can move is row
   1069; the app's capture fails if text or shading comes within 9 rows of
   it, so change both together. */
.faq-item__screenshot--crop-bottom {
  object-position: center 96.92%;
}

/* 12. Legal pages (privacy-policy, terms-of-service) ---------------- */

/* The page is as wide as the reading measure plus the card's padding and
   border, centred like the other single-column pages: header and card share
   the same edges and the card has no empty strip beside its text at wide
   viewports (tortolingua-web#635). Below that width it fills the shell. */
.legal {
  display: flex;
  flex-direction: column;
  gap: var(--space-16);
  width: 100%;
  max-width: calc(65ch + 2 * var(--space-32) + 2px);
  margin-inline: auto;
}

.legal__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-12);
  flex-wrap: wrap;
}

.legal__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.55rem, 3.5vw, 2.2rem);
  line-height: 1.1;
}

.legal__nav {
  display: inline-flex;
  flex-wrap: wrap;
  gap: var(--space-12);
}

.legal__nav-link {
  color: var(--color-accent-ink);
  font-family: var(--font-ui);
  font-size: var(--type-caption);
  font-weight: 600;
  text-decoration: none;
}

.legal__nav-link:hover,
.legal__nav-link:focus-visible {
  text-decoration: underline;
}

.legal__content {
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid var(--color-surface-outline);
  border-radius: var(--radius-card-md);
  padding: var(--space-32);
  line-height: var(--leading-reading);
}

/* The text keeps a reading measure of about 80 characters, not the shell's
   ~150 at 1440 px (tortolingua-web#563); the card above is sized to it. */
.legal__content > * {
  max-width: 65ch;
}

.legal__last-updated {
  font-family: var(--font-ui);
  color: var(--color-text-muted);
  font-size: var(--type-caption);
  margin: 0 0 var(--space-20);
}

.legal__content h2 {
  margin: var(--space-24) 0 var(--space-8);
  font-size: var(--type-heading-sm);
  font-family: var(--font-display);
}

.legal__content h2:first-of-type {
  margin-top: 0;
}

.legal__content p {
  margin: 0 0 var(--space-16);
  line-height: var(--leading-reading);
}

.legal__content ul {
  margin: 0 0 var(--space-16);
  padding-left: var(--space-24);
}

.legal__content li {
  margin-bottom: var(--space-8);
  line-height: var(--leading-normal);
}

/* 13. Landing responsive ------------------------------------------- */

@media (max-width: 900px) {
  .landing-hero {
    grid-template-columns: 1fr;
    padding: var(--space-28) var(--space-24);
  }

  .landing-hero--home {
    grid-template-areas:
      "copy"
      "proof"
      "points";
    grid-template-rows: auto;
    row-gap: var(--space-32);
  }

  .landing-grid,
  .landing-steps,
  .app-platforms__grid {
    grid-template-columns: 1fr;
  }

  .faq-item--with-screenshot {
    grid-template-columns: 1fr;
  }

  .faq-item__screenshot {
    width: 100%;
    max-width: 320px;
    justify-self: center;
  }

  .landing-cta-panel {
    padding: var(--space-24);
  }
}

/* Phones: one inner padding for every card of the home, /app/ and /mission/
   pages, the hero and the final panel included, so the text of all cards
   starts at one left edge and their full-width buttons have one width
   (tortolingua-web#589). The narrowest phones take 16 px, for line room. */
@media (max-width: 600px) {
  :root {
    --landing-card-padding: var(--space-20);
  }
}

@media (max-width: 379px) {
  :root {
    --landing-card-padding: var(--space-16);
  }
}

@media (max-width: 600px) {
  .landing-hero,
  .landing-card,
  .landing-card--wide,
  .landing-step,
  .landing-cta-panel,
  .app-platform,
  .app-promo,
  .app-use-case-card__link {
    padding: var(--landing-card-padding);
  }

  .landing-hero {
    gap: var(--space-20);
  }

  .landing-hero__title {
    font-size: clamp(1.65rem, 7.2vw, 2rem);
  }

  .landing-hero__subtitle {
    margin-top: var(--space-12);
    font-size: var(--type-body-md);
    line-height: var(--leading-normal);
  }

  /* Stacked buttons: one grid row each, all as tall as the tallest, so a
     label that still wraps does not leave one button taller than the rest
     (tortolingua-web#589). */
  .landing-actions {
    margin-top: var(--space-16);
    display: grid;
    grid-auto-rows: 1fr;
  }

  /* Without this the final panel's action column shrinks to its content
     and the buttons end up narrower than the hero's. */
  .landing-cta-panel {
    align-items: stretch;
  }

  .landing-cta-panel .landing-actions {
    width: 100%;
    margin-top: 0;
  }

  .landing-cta {
    width: 100%;
  }

  /* The three platform buttons on /app/ take the card's full width. */
  .app-platform__actions {
    align-self: stretch;
  }

  .landing-access-promise {
    margin-top: var(--space-12);
  }

  .landing-proof {
    width: min(76vw, 250px);
  }

  .landing-post-list__link {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-4);
  }

  .legal__content {
    padding: var(--space-20);
  }

  .legal__header {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* Narrow phones: less side padding and a 16 px label, so more labels, such
   as "Download on the App Store", fit on one line (tortolingua-web#589). */
@media (max-width: 379px) {
  .landing-cta {
    padding-inline: var(--space-12);
    font-size: var(--type-body-sm);
  }
}

/* Below 360 px a full-width home button is about 254 px wide: a 15 px label
   and 8 px sides fit the longest home labels on one line, such as "Read
   language-learning guides" (tortolingua-web#589). */
@media (max-width: 359px) {
  .landing-cta {
    padding-inline: var(--space-8);
    font-size: 0.9375rem;
  }
}

/* 14. Footer (extended with social links) -------------------------- */

.site-footer__inner {
  gap: var(--space-20);
}

.site-footer__social {
  display: inline-flex;
  align-items: center;
  gap: var(--space-8);
}

.site-footer__social-link {
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-pill);
  border: 1px solid var(--color-surface-outline);
  background: rgba(255, 255, 255, 0.79);
  color: var(--color-accent-ink);
  box-shadow: var(--shadow-card-soft);
  transition: border-color 150ms ease, background-color 150ms ease;
}

.site-footer__social-link:hover,
.site-footer__social-link:focus-visible {
  border-color: var(--color-accent);
  background: var(--color-surface-card);
  text-decoration: none;
}

.site-footer__social-icon {
  width: 20px;
  height: 20px;
  display: block;
  fill: currentColor;
}

.site-footer__social-icon--telegram {
  margin-left: -2px;
}

.site-footer__social-icon--bluesky {
  width: 22px;
  height: 22px;
}

/* 15. Enlarged text --------------------------------------------------- */

/*
 * Enlarged text (200% on a phone leaves the page about 10rem wide; at the
 * default size it is 18rem or more on every phone 320 px and wider) on every
 * page outside the header (tortolingua-web#629, the cognates pages: #620):
 * - a word longer than its line breaks (a display-font heading word such as
 *   "TortoLingua", a German compound, an e-mail address), so its box no
 *   longer pushes the page past the screen (WCAG 1.4.10);
 * - tables and code keep whole words and their own horizontal scroll;
 * - the home hero, the FAQ cards and the blog hub's language tiles take one
 *   column as wide as the page, not as wide as their longest unbreakable
 *   line (the tiles' 130px columns clipped the language names);
 * - phrases kept on one line (the access-promise parts, `.nowrap`) may wrap.
 * At the default size on a 320 px or wider screen the rules never apply:
 * words and phrases stay whole. A narrower screen (280 px) gets them at the
 * default size too, which only helps it reflow.
 */
@container page (max-width: 16rem) {
  .site-main > *,
  .site-footer__inner {
    overflow-wrap: anywhere;
  }

  .site-main :is(table, pre) {
    overflow-wrap: normal;
  }

  .landing-hero,
  .faq-list,
  .faq-item--with-screenshot,
  .blog-hub__tiles--languages {
    grid-template-columns: minmax(0, 1fr);
  }

  .blog-hub__tile--language .blog-hub__tile-link {
    flex-wrap: wrap;
  }

  .landing-access-promise__part,
  .site-main .nowrap {
    white-space: normal;
  }
}
/* 50. Print version of reading-text pages (tortolingua-web#436) --------
   Opt-in: the "Print this page" control and every print rule below apply
   only to pages whose front matter sets `print_version = true`, which adds
   `print-version` to <body>. Pages without it print exactly as before. */

.print-link-wrap {
  margin: var(--space-12, 12px) 0 0;
}

.print-link {
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  font-size: var(--type-caption, 0.9rem);
  text-decoration: underline;
  text-underline-offset: 0.2em;
  cursor: pointer;
}

@media print {
  @page {
    size: A4;
    margin: 18mm 16mm;
  }

  body.print-version {
    background: #fff;
    color: #000;
    font-size: 12pt;
    line-height: 1.5;
  }

  /* Chrome: header, footer, app hand-offs and everything that only makes
     sense on screen. */
  body.print-version .site-header,
  body.print-version .site-footer,
  body.print-version .print-link-wrap,
  body.print-version .landing-actions,
  body.print-version .product-cta,
  body.print-version .app-promo,
  body.print-version .related-posts,
  body.print-version .more-posts,
  body.print-version .post__hero,
  body.print-version .app-product-hero__media {
    display: none !important;
  }

  /* One column, full page width, nothing clipped. */
  body.print-version .site-main,
  body.print-version .post,
  body.print-version .post__body,
  body.print-version .app-product-page,
  body.print-version .app-product-hero,
  body.print-version .app-product-content,
  body.print-version .app-product__body {
    display: block;
    width: auto;
    max-width: none;
    margin: 0;
    padding: 0;
    overflow: visible;
    background: none;
    box-shadow: none;
    border: 0;
  }

  body.print-version .post__body *,
  body.print-version .app-product__body * {
    max-width: 100%;
    overflow: visible;
    overflow-wrap: anywhere;
  }

  body.print-version pre {
    white-space: pre-wrap;
  }

  body.print-version table {
    width: 100%;
    table-layout: fixed;
  }

  body.print-version h1,
  body.print-version h2,
  body.print-version h3 {
    break-after: avoid;
  }

  body.print-version details,
  body.print-version blockquote {
    break-inside: avoid;
  }

  /* Answers: always shown. The inline script opens <details> while printing;
     this keeps the content visible in engines that hide closed details. */
  body.print-version details > :not(summary) {
    display: block;
  }

  body.print-version details::details-content {
    content-visibility: visible;
    display: block;
  }

  body.print-version a {
    color: inherit;
    text-decoration: underline;
  }
}
