@layer ui-sdk;

/* Дьөгүөр — a quiet northern reading room for the Yakut dictionary.
   Onest is the UI / sans font (self-hosted latin, cyrillic and cyrillic-ext
   subsets). Noto Serif stays for dictionary example quotes and other serif
   roles. Noto Sans Sakha remains as a fallback (Indigenous ӈԓӄ, real italic).
   No remote font servers. */

/* Onest: latin + cyrillic + cyrillic-ext (Google Fonts unicode-ranges).
   Sakha letters ҥҕөһү live in cyrillic-ext. Variable weight 100–900. */
@font-face {
  font-family: "Onest";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("fonts/onest-cyrillic-ext.woff2") format("woff2");
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}

@font-face {
  font-family: "Onest";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("fonts/onest-cyrillic.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
  font-family: "Onest";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("fonts/onest-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: "Noto Serif";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("fonts/noto-serif-yakut.woff2") format("woff2");
}

@font-face {
  font-family: "Noto Sans Sakha";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("fonts/noto-sans-yakut.woff2") format("woff2");
}

@font-face {
  font-family: "Noto Fallback";
  src: local("Times New Roman");
  size-adjust: 100%;
  ascent-override: 106.9%;
  descent-override: 29.3%;
  line-gap-override: 0%;
}

@font-face {
  font-family: "Noto Sans Fallback";
  src: local("Arial");
  size-adjust: 100%;
  ascent-override: 106.9%;
  descent-override: 29.3%;
  line-gap-override: 0%;
}

:root {
  color-scheme: light;
  --serif: "Noto Serif", "Noto Serif Yakut", "PT Serif", "Noto Fallback", Georgia, "Times New Roman", "Liberation Serif", serif;
  --sans: "Onest", "Noto Sans Sakha", "Noto Sans", "Noto Sans Yakut", "PT Sans", "Noto Sans Fallback", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Liberation Sans", sans-serif;
  font-family: var(--sans);
  font-synthesis: none;
  color: var(--ink);
  background: var(--bg);
  /* Ink — warm paper, stronger type, crimson used for the word and links only. */
  --bg: #F0EADC;
  --surface: #FCF9F1;
  --sunken: #E9E0CD;
  --ink: #16130F;
  --ink-soft: #4A433A;
  --ink-faint: #6B645A;
  --line: #D2C6B1;
  --line-strong: #AD9B7E;
  --accent: #9A1F18;
  --accent-strong: #7A1611;
  --on-accent: #F7F3EA;
  --logo: #9A1F18;
  --logo-pad: transparent;
  --wash: rgba(154, 31, 24, 0.07);
  --mark: rgba(154, 31, 24, 0.2);
  --skeleton: #E8E0D2;
  --shadow: 0 1px 2px rgba(22, 19, 15, 0.06), 0 18px 44px -26px rgba(22, 19, 15, 0.35);
  --aurora-a: transparent;
  --aurora-b: transparent;
  --aurora-c: transparent;
  --fade: rgba(240, 234, 220, 0);
  --star-opacity: 0;
  --header: rgba(252, 249, 241, 0.86);
  --header-solid: #FCF9F1;
  --header-line: #D3CAB8;
  --header-shadow: 0 1px 0 rgba(22, 19, 15, 0.04), 0 8px 24px -14px rgba(22, 19, 15, 0.28);
  --ochre: #805C28;
  --footer-bg: #253750;
  --footer-ink: #FCF9F1;
  --footer-soft: #D8D3C8;
  --footer-accent: #E7BE82;
  --band-daily: #E7D4A4;
  --band-daily-ink: #16130F;
  --band-daily-soft: #4A433A;
  --band-daily-accent: #9A1F18;
  --band-daily-mark: #805C28;
}

html[data-palette="cobalt"] {
  --bg: #F3F5F8;
  --surface: #FFFFFF;
  --sunken: #E6EBF2;
  --ink: #0D1520;
  --ink-soft: #3A4656;
  --ink-faint: #5B6A7C;
  --line: #D5DCE6;
  --line-strong: #B7C2D0;
  --accent: #1A4E96;
  --accent-strong: #133A70;
  --on-accent: #F3F5F8;
  --logo: #1A4E96;
  --logo-pad: transparent;
  --wash: rgba(26, 78, 150, 0.08);
  --mark: rgba(26, 78, 150, 0.18);
  --skeleton: #E2E7EE;
  --shadow: 0 1px 2px rgba(13, 21, 32, 0.06), 0 18px 44px -26px rgba(13, 21, 32, 0.28);
  --fade: rgba(243, 245, 248, 0);
  --header: rgba(250, 252, 255, 0.86);
  --header-solid: #FAFCFF;
  --header-line: #CBD4E0;
  --header-shadow: 0 1px 0 rgba(13, 21, 32, 0.04), 0 8px 24px -14px rgba(13, 21, 32, 0.26);
  --band-daily: #D8E2EF;
  --band-daily-ink: #0D1520;
  --band-daily-soft: #3A4656;
  --band-daily-accent: #1A4E96;
  --band-daily-mark: #1A4E96;
}

html[data-theme="dark"],
html[data-palette="ink"][data-theme="dark"] {
    color-scheme: dark;
    --bg: #101928;
    --surface: #202C40;
    --sunken: #0A1220;
    --ink: #F6F1E8;
    --ink-soft: #CFD3D7;
    --ink-faint: #AEB8C7;
    --line: #3B4960;
    --line-strong: #62738B;
    --accent: #F07870;
    --accent-strong: #FF9A93;
    --on-accent: #20141A;
    --logo: #F07870;
    --logo-pad: #F7F3EA;
    --wash: rgba(240, 120, 112, 0.12);
    --mark: rgba(240, 120, 112, 0.28);
    --skeleton: #2B3A50;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.35), 0 22px 52px -30px rgba(0, 0, 0, 0.95);
    --fade: rgba(16, 25, 40, 0);
    --star-opacity: 0;
    --header: rgba(25, 37, 55, 0.92);
    --header-solid: #192537;
    --header-line: #3B4960;
    --header-shadow: 0 1px 0 rgba(0, 0, 0, 0.3), 0 10px 28px -14px rgba(0, 0, 0, 0.8);
    --ochre: #DDBD86;
    --footer-bg: #263C59;
    --footer-ink: #F6F1E8;
    --footer-soft: #D2D6DC;
    --footer-accent: #E8C28A;
    --band-daily: #253750;
    --band-daily-ink: #F6F1E8;
    --band-daily-soft: #D2D6DC;
    --band-daily-accent: #E8C28A;
    --band-daily-mark: #E8C28A;
}

html[data-palette="cobalt"][data-theme="dark"] {
    color-scheme: dark;
    --bg: #0A1018;
    --surface: #121A26;
    --sunken: #080C12;
    --ink: #E8EEF6;
    --ink-soft: #B0BCCB;
    --ink-faint: #8A97A8;
    --line: #1C2734;
    --line-strong: #2C3A4C;
    --accent: #7AA7F0;
    --accent-strong: #9BC0FF;
    --on-accent: #0A1018;
    --logo: #7AA7F0;
    --logo-pad: #F3F5F8;
    --wash: rgba(122, 167, 240, 0.12);
    --mark: rgba(122, 167, 240, 0.28);
    --skeleton: #1A2430;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 22px 52px -30px rgba(0, 0, 0, 0.95);
    --fade: rgba(10, 16, 24, 0);
    --header: rgba(20, 29, 42, 0.86);
    --header-solid: #141D2A;
    --header-line: #243246;
    --header-shadow: 0 1px 0 rgba(0, 0, 0, 0.3), 0 10px 28px -14px rgba(0, 0, 0, 0.8);
    --band-daily: #152033;
    --band-daily-ink: #E8EEF6;
    --band-daily-soft: #B0BCCB;
    --band-daily-accent: #7AA7F0;
    --band-daily-mark: #7AA7F0;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]):not([data-palette="cobalt"]) {
    color-scheme: dark;
    --bg: #101928;
    --surface: #202C40;
    --sunken: #0A1220;
    --ink: #F6F1E8;
    --ink-soft: #CFD3D7;
    --ink-faint: #AEB8C7;
    --line: #3B4960;
    --line-strong: #62738B;
    --accent: #F07870;
    --accent-strong: #FF9A93;
    --on-accent: #20141A;
    --logo: #F07870;
    --logo-pad: #F7F3EA;
    --wash: rgba(240, 120, 112, 0.12);
    --mark: rgba(240, 120, 112, 0.28);
    --skeleton: #2B3A50;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.35), 0 22px 52px -30px rgba(0, 0, 0, 0.95);
    --fade: rgba(16, 25, 40, 0);
    --star-opacity: 0;
      --header: rgba(25, 37, 55, 0.92);
    --header-solid: #192537;
    --header-line: #3B4960;
    --header-shadow: 0 1px 0 rgba(0, 0, 0, 0.3), 0 10px 28px -14px rgba(0, 0, 0, 0.8);
    --ochre: #DDBD86;
    --footer-bg: #263C59;
    --footer-ink: #F6F1E8;
    --footer-soft: #D2D6DC;
    --footer-accent: #E8C28A;
    --band-daily: #253750;
    --band-daily-ink: #F6F1E8;
    --band-daily-soft: #D2D6DC;
    --band-daily-accent: #E8C28A;
    --band-daily-mark: #E8C28A;
}
  html[data-palette="cobalt"]:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0A1018;
    --surface: #121A26;
    --sunken: #080C12;
    --ink: #E8EEF6;
    --ink-soft: #B0BCCB;
    --ink-faint: #8A97A8;
    --line: #1C2734;
    --line-strong: #2C3A4C;
    --accent: #7AA7F0;
    --accent-strong: #9BC0FF;
    --on-accent: #0A1018;
    --logo: #7AA7F0;
    --logo-pad: #F3F5F8;
    --wash: rgba(122, 167, 240, 0.12);
    --mark: rgba(122, 167, 240, 0.28);
    --skeleton: #1A2430;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 22px 52px -30px rgba(0, 0, 0, 0.95);
    --fade: rgba(10, 16, 24, 0);
      --header: rgba(20, 29, 42, 0.86);
    --header-solid: #141D2A;
    --header-line: #243246;
    --header-shadow: 0 1px 0 rgba(0, 0, 0, 0.3), 0 10px 28px -14px rgba(0, 0, 0, 0.8);
    --band-daily: #152033;
    --band-daily-ink: #E8EEF6;
    --band-daily-soft: #B0BCCB;
    --band-daily-accent: #7AA7F0;
    --band-daily-mark: #7AA7F0;
}
}

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

html {
  font-size: 100%;
  line-height: 1.5;
  scroll-behavior: smooth;
  scroll-padding-top: 5.25rem;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background-color: var(--bg);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.55;
}

::selection {
  color: var(--on-accent);
  background: var(--accent);
  text-shadow: none;
}

::-moz-selection {
  color: var(--on-accent);
  background: var(--accent);
  text-shadow: none;
}

img,
svg { max-width: 100%; }

svg { flex: none; }

a {
  color: inherit;
  text-decoration: none;
}

a:hover { color: var(--accent); }

a:focus-visible,
button:focus-visible,
input:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

h1,
h2,
h3,
p,
ul,
ol {
  margin: 0;
}

ul,
ol {
  padding: 0;
  list-style: none;
}

h1,
h2,
h3 {
  font-weight: 400;
  text-wrap: balance;
}

p { text-wrap: pretty; }

.wrap {
  width: min(calc(100% - 2.5rem), 72rem);
  margin-inline: auto;
}

@media (max-width: 480px) {
  .wrap { width: calc(100% - 2rem); }
}

@media (max-width: 359px) {
  .wrap { width: calc(100% - 1.5rem); }
  .explore,
  #empty > .note { width: min(calc(100% - 1.5rem), 72rem); }
}

/* Header ------------------------------------------------------------------ */

.top {
  position: sticky;
  top: 0;
  z-index: 200;
  border-bottom: 1px solid var(--line);
  background-color: var(--bg);
}

.top-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.55rem 1rem;
  min-height: 4.25rem;
  padding-block: 0.65rem;
}

.nav {
  display: flex;
  align-items: center;
  gap: 0.35rem 0.85rem;
  min-width: 0;
}

.nav-dict {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--ink-soft);
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
}

.nav-dict:hover { color: var(--accent); }

.nav-dict[aria-current="page"] {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 0.22em;
}

.nav-purpose {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--ink-soft);
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
}

.nav-purpose:hover { color: var(--accent); }

.header-tools {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin-left: auto;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink-soft);
  cursor: pointer;
  flex: none;
}

.theme-toggle:hover {
  color: var(--ink);
  border-color: var(--line-strong);
  background: var(--wash);
}

.theme-toggle .theme-icon {
  display: block;
  width: 1.25rem;
  height: 1.25rem;
  background: currentColor;
  -webkit-mask: url("theme-moon.svg") center / contain no-repeat;
  mask: url("theme-moon.svg") center / contain no-repeat;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .theme-icon {
    -webkit-mask-image: url("theme-sun.svg");
    mask-image: url("theme-sun.svg");
  }
}

html[data-theme="dark"] .theme-toggle .theme-icon {
  -webkit-mask-image: url("theme-sun.svg");
  mask-image: url("theme-sun.svg");
}

html[data-theme="light"] .theme-toggle .theme-icon {
  -webkit-mask-image: url("theme-moon.svg");
  mask-image: url("theme-moon.svg");
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  min-width: 0;
  min-height: 48px;
}

.brand:hover .brand-name, .brand:hover .brand-mark { color: var(--accent-strong); }

.brand-mark {
  width: 2rem;
  height: 2rem;
  padding: 0.12rem;
  color: var(--logo);
  background: var(--logo-pad);
  border-radius: 0.4rem;
  box-sizing: content-box;
}

.brand-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1;
}

.brand-name {
  color: var(--logo);
  font-family: var(--serif);
  font-size: 1.5rem;
  font-weight: 400;
  letter-spacing: -0.045em;
  white-space: nowrap;
  transition: color 0.15s ease;
}

.brand-sub {
  margin-top: 0.28rem;
  color: var(--ink-soft);
  font-size: 0.63rem;
  font-weight: 700;
  letter-spacing: 0.145em;
  line-height: 1.2;
  text-transform: uppercase;
  white-space: nowrap;
}

.langs {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  margin-left: auto;
}

.langs a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  min-width: 44px;
  padding: 0 0.85rem;
  border-radius: 999px;
  color: var(--ink-soft);
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease;
}

.langs a:hover {
  color: var(--ink);
  background: var(--wash);
}

.langs a[aria-current="page"] {
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
}

/* Mobile header: one 56 px row, native <details> locale/menu disclosure. */
.locale-menu { display: none; position: relative; }

.locale-menu-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  min-width: 76px;
  min-height: 44px;
  padding: 0 0.6rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink-soft);
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  list-style: none;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
}

.locale-menu-btn::-webkit-details-marker { display: none; }

.locale-menu[open] .locale-menu-btn {
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 35%, var(--line));
}

.locale-menu-caret {
  font-size: 0.7rem;
  line-height: 1;
  transform: translateY(-1px);
}

.locale-menu-panel {
  position: absolute;
  z-index: 40;
  top: calc(100% + 8px);
  right: 0;
  min-width: 208px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}

.locale-menu-link {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 44px;
  padding: 0 0.6rem;
  border-radius: 10px;
  color: var(--ink-soft);
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
}

.locale-menu-link:hover {
  color: var(--ink);
  background: var(--wash);
}

.locale-menu-link[aria-current="page"] { color: var(--accent); }

.locale-menu-check {
  display: inline-block;
  width: 1em;
  flex: 0 0 1em;
  color: var(--accent);
  font-size: 0.8rem;
}

.locale-menu-rule {
  margin: 4px 6px;
  border: 0;
  border-top: 1px solid var(--line);
}

@media (max-width: 640px) {
  .top-inner {
    flex-wrap: nowrap;
    min-height: 56px;
    height: 56px;
    padding-block: 0;
    gap: 0.5rem;
  }

  .nav { gap: 0; margin-left: auto; }

  .nav-purpose,
  .nav-dict,
  .header-tools > .langs { display: none; }

  .header-tools { gap: 0.3rem; margin-left: 0; }

  .locale-menu { display: block; }

  .brand-sub { display: none; }
}

/* Anchors under the sticky header. */
#purpose,
body[data-page="word"] .hom-banner[id^="hom-"] { scroll-margin-top: 72px; }

body[data-page="word"] .sense[id^="sense-"] { scroll-margin-top: 96px; }

/* Skip link --------------------------------------------------------------- */

.skip {
  position: fixed;
  z-index: 50;
  top: 0.75rem;
  left: 0.75rem;
  padding: 0.7rem 1rem;
  border-radius: 0.6rem;
  color: var(--bg);
  background: var(--ink);
  font-size: 0.9rem;
  font-weight: 600;
  transform: translateY(-180%);
  transition: transform 0.15s ease;
}

.skip:focus {
  color: var(--bg);
  transform: translateY(0);
}

/* Hero -------------------------------------------------------------------- */

.hero {
  position: relative;
  max-width: 46rem;
  padding: clamp(1.9rem, 7vw, 4.2rem) 0 clamp(1.4rem, 4vw, 2.4rem);
}

.hero-title {
  font-family: var(--serif);
  font-size: clamp(2.7rem, 10vw, 5.1rem);
  line-height: 0.95;
  letter-spacing: -0.045em;
}

.hero-brand { display: block; }

.hero-sub {
  display: block;
  margin-top: 0.8rem;
  color: var(--ink-soft);
  font-family: var(--sans);
  font-size: 0.9rem;
  font-weight: 400;
  letter-spacing: 0;
  line-height: 1.4;
  text-transform: none;
}

.lede {
  max-width: 35rem;
  margin-top: 1.05rem;
  color: var(--ink-soft);
  font-size: 1.02rem;
  line-height: 1.62;
}

.hero-star {
  position: absolute;
  top: clamp(0.25rem, 3vw, 1.25rem);
  right: 0;
  width: clamp(9rem, 27vw, 17rem);
  height: auto;
  color: var(--accent);
  opacity: var(--star-opacity);
  pointer-events: none;
}

.page-hero {
  padding-top: clamp(1.8rem, 5vw, 3.2rem);
}

.page-hero.is-after-search { padding-top: 1.35rem; }

.landing-search { max-width: 46rem; margin-top: clamp(1.1rem, 3.2vw, 2rem); }

/* Lab-first landing, based on the Nov 2026 Дьөгүөр site ---------------------- */

.eyebrow,
.section-label {
  color: var(--ink-soft);
  font-family: var(--sans);
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.5;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

body[data-page="home"] .hero {
  max-width: none;
  padding: clamp(4rem, 7.5vw, 7rem) 0 5rem;
}

body[data-page="home"] .hero .eyebrow { margin: 0; }

body[data-page="home"] .hero h1 {
  margin-top: 2rem;
  max-width: 100%;
  font-family: var(--serif);
  font-size: clamp(3rem, 6.8vw, 6rem);
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: -0.055em;
}

.hero-line { display: block; }

body[data-page="home"] .hero h1 em {
  color: var(--logo);
  font-style: normal;
}

.hero-bottom {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 3rem;
  margin-top: 3rem;
}

.hero-intro {
  max-width: 39rem;
  margin: 0;
  color: var(--ink-soft);
  font-family: var(--serif);
  font-size: 1.125rem;
  line-height: 1.65;
}

.text-link {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  min-height: 2.75rem;
  padding-block: 0.5rem;
  border-bottom: 1px solid currentColor;
  color: var(--accent);
  font-size: 1rem;
  white-space: nowrap;
  text-decoration: none;
}

.text-link:hover { color: var(--accent-strong); }

.text-link svg {
  width: 1.25rem;
  height: 1.25rem;
  flex-shrink: 0;
}

.purpose {
  display: grid;
  grid-template-columns: 1fr 3fr;
  gap: 3rem;
  padding-block: 5rem 6rem;
  border-top: 1px solid var(--line);
}

.purpose .section-label { padding-top: 0.75rem; }

.purpose-copy { max-width: 59rem; }

.purpose h2 {
  max-width: 24ch;
  font-family: var(--serif);
  font-size: clamp(2rem, 3.6vw, 3.75rem);
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: -0.045em;
}

.purpose-copy > p {
  margin-top: 2rem;
  max-width: 39rem;
  color: var(--ink-soft);
  font-family: var(--serif);
  font-size: 1.125rem;
  line-height: 1.75;
}

.home-dict {
  display: grid;
  grid-template-columns: 1fr 3fr;
  gap: 3rem;
  padding-block: 4rem 5rem;
  border-top: 1px solid var(--line);
}

.home-dict .section-label { padding-top: 0.75rem; }

.home-dict-body { max-width: 46rem; min-width: 0; }

.home-dict-body > h2 {
  margin: 0 0 1.25rem;
  font-family: var(--serif);
  font-size: clamp(1.6rem, 3vw, 2.25rem);
  font-weight: 400;
  letter-spacing: -0.035em;
  line-height: 1.2;
}

.home-dict .search-panel { margin: 0; }

.home-dict .stage { margin-top: 1.5rem; }

body.is-searching .hero,
body.is-searching .purpose {
  display: none;
}

body.is-searching .home-dict {
  grid-template-columns: 1fr;
  padding-top: 1.75rem;
  border-top: 0;
}

body.is-searching .home-dict .section-label { display: none; }

.dict-page { margin-top: 1.15rem; }

.dict-page .lede { margin-top: 0.55rem; }

.dict-page .letter-index { margin-top: 1.25rem; }

.kicker {
  color: var(--ink-soft);
  font-family: var(--sans);
  font-size: 0.9rem;
  font-weight: 400;
  letter-spacing: 0;
  line-height: 1.45;
  text-transform: none;
}


.page-title {
  max-width: 18ch;
  margin-top: 0.7rem;
  font-family: var(--serif);
  font-size: clamp(2.15rem, 6.5vw, 3.8rem);
  line-height: 1.02;
  letter-spacing: -0.04em;
  overflow-wrap: anywhere;
  hyphens: auto;
}

.letter-title {
  max-width: none;
  font-size: clamp(3.5rem, 9vw, 5.5rem);
  line-height: 0.9;
  letter-spacing: -0.05em;
}

/* Search ------------------------------------------------------------------ */

.search-panel {
  max-width: 46rem;
  padding: 6px;
  border: 1px solid var(--line-strong);
  border-radius: 1.25rem;
  background: var(--surface);
}

.search-row {
  position: relative;
  display: flex;
  align-items: center;
  border-radius: 0.9rem;
}

.search-row:focus-within {
  box-shadow: inset 0 0 0 2px var(--accent);
}

.search-icon {
  position: absolute;
  left: 1rem;
  color: var(--ink-soft);
  pointer-events: none;
}

.search-row input {
  width: 100%;
  min-width: 0;
  height: 3.9rem;
  margin: 0;
  padding: 0 3.9rem 0 3rem;
  border: 0;
  border-radius: 0.9rem;
  background: transparent;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  font-weight: 400;
  line-height: 1.2;
  appearance: none;
}

.search-row.has-value input { padding-right: 6.6rem; }

.search-row input::placeholder {
  color: var(--ink-faint);
  opacity: 1;
}

.search-row input:focus { outline: none; }

.search-row input::-webkit-search-decoration,
.search-row input::-webkit-search-cancel-button { display: none; }

.search-go {
  position: absolute;
  right: 5px;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 0.85rem;
  color: var(--on-accent);
  background: var(--accent);
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease;
}

.search-go:hover { background: var(--accent-strong); }

.search-go:active { transform: scale(0.97); }

.search-clear {
  position: absolute;
  right: 3.55rem;
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: var(--ink-soft);
  background: var(--sunken);
  cursor: pointer;
}

.search-clear::after {
  content: "";
  position: absolute;
  inset: -3px;
}

.search-clear:hover {
  color: var(--ink);
  background: var(--line);
}

.search-keys {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-top: 4px;
  padding: 0.6rem 0.5rem 0.35rem;
  border-top: 1px solid var(--line);
}

.keys-label {
  padding-left: 2px;
  color: var(--ink-soft);
  font-family: var(--sans);
  font-size: 0.63rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  line-height: 1.4;
  text-transform: uppercase;
}

.keys {
  display: grid;
  grid-template-columns: repeat(5, minmax(44px, 1fr));
  gap: 8px;
}

.key {
  min-height: 44px;
  min-width: 44px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  color: var(--ink);
  background: var(--bg);
  font-family: var(--serif);
  font-size: 1.28rem;
  line-height: 1;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.key:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.key:active { background: var(--wash); }

.search-mini {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  max-width: 36rem;
  margin-top: 1.25rem;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
}

.search-mini .search-icon { left: 0.95rem; }

.search-mini input {
  flex: 1;
  min-width: 0;
  height: 44px;
  margin: 0;
  padding: 0 0.35rem 0 2.4rem;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 0.95rem;
  appearance: none;
}

.search-mini input::placeholder { color: var(--ink-faint); opacity: 1; }
.search-mini input:focus { outline: none; }

.search-mini:focus-within {
  border-color: transparent;
  box-shadow: 0 0 0 2px var(--accent);
}

.search-mini button {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: var(--on-accent);
  background: var(--accent);
  font-family: var(--sans);
  font-size: 1.15rem;
  line-height: 1;
  cursor: pointer;
}

.search-mini button:hover { background: var(--accent-strong); }

.search-mini-go {
  display: block;
  width: 0.55rem;
  height: 0.55rem;
  margin-left: -1px;
  border-right: 1.7px solid currentColor;
  border-top: 1.7px solid currentColor;
  transform: rotate(45deg);
}

/* Results ----------------------------------------------------------------- */

.stage {
  max-width: 46rem;
  margin-top: 1.15rem;
}

.count {
  min-height: 1.45em;
  color: var(--ink-soft);
  font-size: 0.82rem;
  letter-spacing: 0.01em;
}

.results:empty { display: none; }

.result {
  position: relative;
  display: block;
  padding: 0.9rem 2.4rem 0.9rem 0.55rem;
  margin-inline: -0.55rem;
  border-radius: 0.65rem;
  transition: background 0.15s ease;
}

.result + .result { border-top: 1px solid var(--line); border-radius: 0; }

.result:hover { background: var(--wash); }

.result-word {
  font-family: var(--serif);
  font-size: 1.3rem;
  line-height: 1.2;
  letter-spacing: -0.025em;
  overflow-wrap: anywhere;
}

.result-pos {
  margin-left: 0.55rem;
  color: var(--ink-soft);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  white-space: nowrap;
}

.result-gloss {
  display: block;
  margin-top: 0.15rem;
  color: var(--ink-soft);
  font-size: 0.94rem;
  line-height: 1.45;
}

.result-arrow {
  position: absolute;
  top: 50%;
  right: 0.45rem;
  color: var(--ink-faint);
  transform: translateY(-50%);
  transition: transform 0.15s ease, color 0.15s ease;
}

.result:hover .result-arrow {
  color: var(--accent);
  transform: translate(2px, -50%);
}

mark {
  padding: 0 0.08em;
  border-radius: 2px;
  color: inherit;
  background: var(--mark);
}

.invite,
.note {
  margin-top: 0.75rem;
  color: var(--ink-soft);
  font-size: 0.9rem;
  line-height: 1.55;
}

.result-skeleton {
  padding: 1rem 0;
  border-top: 1px solid var(--line);
}

.sk-line {
  display: block;
  height: 0.7rem;
  border-radius: 999px;
  background: var(--skeleton);
  animation: breathe 1.3s ease-in-out infinite;
}

.sk-word {
  width: 30%;
  height: 1.05rem;
  margin-bottom: 0.6rem;
}

.sk-gloss { width: 64%; }

@keyframes breathe {
  50% { opacity: 0.45; }
}

/* Sections ---------------------------------------------------------------- */

.block { margin-top: 2.15rem; }

.section-head {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.65rem;
}

.section-title {
  flex: none;
  color: var(--ink-soft);
  font-family: var(--sans);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  line-height: 1.4;
  text-transform: uppercase;
}

.section-head::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.inline-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0 0.85rem;
}

.inline-list li {
  display: flex;
  align-items: center;
}

.inline-list a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0;
  font-family: var(--serif);
  font-size: 1.02rem;
}

.inline-list a:hover {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.letter-index {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(48px, 1fr));
  gap: 8px;
  max-width: 46rem;
}

.letter-index a {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 48px;
  min-width: 44px;
  border: 1px solid var(--line);
  border-radius: 0.65rem;
  background: var(--surface);
  font-family: var(--serif);
  font-size: 1.06rem;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.letter-index a:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--wash);
}



.link-list li:first-child a { border-top: 1px solid var(--line); }

.link-list a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 52px;
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--line);
  font-family: var(--serif);
  font-size: 1.06rem;
  line-height: 1.3;
}

.link-list svg {
  color: var(--ink-faint);
  transition: transform 0.15s ease, color 0.15s ease;
}

.link-list a:hover svg {
  color: var(--accent);
  transform: translateX(2px);
}

/* Word page --------------------------------------------------------------- */

.crumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  margin-top: 1.1rem;
  color: var(--ink-soft);
  font-size: 0.78rem;
  font-weight: 600;
}

.crumb a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  min-width: 44px;
  min-height: 44px;
  padding: 0 0.15rem;
}

.crumb a:hover { color: var(--accent); }

.crumb span { color: var(--line-strong); }

.entry { padding-bottom: 1.5rem; }

.entry-layout {
  display: grid;
  gap: 1.75rem;
}

.entry-head { min-width: 0; }

.entry-title {
  margin-top: 0.35rem;
  font-family: var(--serif);
  font-size: clamp(2.4rem, 7vw, 3.6rem);
  line-height: 1.02;
  letter-spacing: -0.04em;
  overflow-wrap: anywhere;
  max-width: 22ch;
}

.entry-title.is-long {
  font-size: clamp(2.2rem, 8vw, 3.7rem);
  line-height: 1.02;
}

.entry-title.is-xlong {
  font-size: clamp(1.65rem, 6vw, 2.8rem);
  line-height: 1.08;
  letter-spacing: -0.03em;
}

.entry-body { min-width: 0; }

.trans + .trans { margin-top: 1.6rem; }

.trans-title {
  margin-bottom: 0.35rem;
  color: var(--ink-soft);
  font-family: var(--sans);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  line-height: 1.4;
  text-transform: uppercase;
}

.gloss li {
  padding: 0.7rem 0;
  border-top: 1px solid var(--line);
  font-size: 1.06rem;
  line-height: 1.58;
}

.sense + .sense {
  margin-top: 1.35rem;
  padding-top: 1.15rem;
  border-top: 1px solid var(--line);
}

.sense-kicker {
  margin: 0 0 0.2rem;
  color: var(--ink-faint);
  font-family: var(--sans);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  line-height: 1.4;
}

.examples {
  margin: 0.85rem 0 0;
  padding: 0;
  list-style: none;
}

.examples li { margin-top: 0.55rem; }

.ex-sah {
  display: block;
  font-size: 1.02rem;
  line-height: 1.45;
}

.ex-ru,
.ex-en {
  display: block;
  margin-top: 0.12rem;
  color: var(--ink-soft);
  font-size: 0.92rem;
  line-height: 1.4;
}

.related-list { max-width: 44rem; }

.related-list li:first-child a { border-top: 1px solid var(--line); }

.related-list a {
  display: block;
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--line);
}

.related-list a:hover .related-word { color: var(--accent); }

.related-word {
  display: block;
  font-family: var(--serif);
  font-size: 1.12rem;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.related-gloss {
  display: block;
  margin-top: 0.1rem;
  color: var(--ink-soft);
  font-size: 0.88rem;
  line-height: 1.45;
}

.back {
  display: flex;
  flex-wrap: wrap;
  gap: 0.15rem 1.4rem;
  margin-top: 2rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--line);
}

.back a {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 44px;
  color: var(--accent);
  font-size: 0.9rem;
  font-weight: 600;
}

.back a:hover { text-decoration: underline; text-underline-offset: 0.2em; }

/* Browse --------------------------------------------------------------- */

.letter-rail {
  display: none;
  flex-wrap: wrap;
  gap: 4px;
  max-width: 46rem;
  margin: 0.9rem 0 1.25rem;
  padding: 4px 0;
}

.letter-rail a {
  flex: none;
  display: grid;
  place-items: center;
  min-width: 44px;
  min-height: 44px;
  padding: 0 0.5rem;
  border-radius: 0.5rem;
  color: var(--ink-soft);
  font-family: var(--serif);
  font-size: 0.98rem;
  line-height: 1;
}

.letter-rail a:hover {
  color: var(--accent);
  background: var(--wash);
}

.letter-rail a[aria-current="page"] {
  color: var(--on-accent);
  background: var(--accent);
}

.letter-drawer {
  max-width: 46rem;
  margin: 0.9rem 0 1.25rem;
  border: 1px solid var(--line);
  border-radius: 0.8rem;
  background: var(--surface);
}

.letter-drawer summary {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-height: 48px;
  padding: 0 0.9rem;
  color: var(--ink-soft);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  line-height: 1.3;
  text-transform: uppercase;
  list-style: none;
  cursor: pointer;
}

.letter-drawer summary::-webkit-details-marker { display: none; }

.letter-drawer summary::after {
  content: "";
  width: 7px;
  height: 7px;
  margin-left: auto;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
  transition: transform 0.15s ease;
}

.letter-drawer[open] summary::after {
  transform: rotate(225deg) translateY(-2px);
}

.drawer-current {
  color: var(--accent);
  font-family: var(--serif);
  font-size: 1rem;
  letter-spacing: 0;
  line-height: 1;
  text-transform: none;
}

.letter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(44px, 1fr));
  gap: 4px;
  padding: 0 0.55rem 0.6rem;
}

.letter-grid a {
  display: grid;
  place-items: center;
  min-height: 44px;
  border-radius: 0.5rem;
  color: var(--ink-soft);
  font-family: var(--serif);
  font-size: 1rem;
  line-height: 1;
}

.letter-grid a:hover {
  color: var(--accent);
  background: var(--wash);
}

.letter-grid a[aria-current="page"] {
  color: var(--on-accent);
  background: var(--accent);
}

.word-list {
  max-width: 46rem;
  border-top: 1px solid var(--line);
}

.word-list li {
  border-bottom: 1px solid var(--line);
  content-visibility: auto;
  contain-intrinsic-size: auto 56px;
}

@media (max-width: 640px) {
  .word-list .word-gloss {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
}

.word-list a {
  display: block;
  padding: 0.8rem 0.45rem;
  margin-inline: -0.45rem;
  border-radius: 0.55rem;
  transition: background 0.15s ease;
}

.word-list a:hover { background: var(--wash); }

.word-list b {
  display: block;
  font-family: var(--serif);
  font-size: 1.18rem;
  font-weight: 400;
  line-height: 1.3;
  letter-spacing: -0.02em;
  overflow-wrap: anywhere;
}

.word-list span {
  display: block;
  margin-top: 0.1rem;
  color: var(--ink-soft);
  font-size: 0.89rem;
  line-height: 1.45;
}

.word-list .word-gloss span { display: inline; }

.pager {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  max-width: 46rem;
  margin-top: 1.75rem;
}

.pager-link {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 48px;
  padding: 0 0.8rem;
  border: 1px solid var(--line);
  border-radius: 0.65rem;
  color: var(--accent);
  background: var(--surface);
  font-size: 0.9rem;
  font-weight: 600;
}

.pager-link:hover { border-color: var(--accent); }

.pager-next { margin-left: auto; }

/* Documents ------------------------------------------------------------- */

.doc {
  max-width: 42rem;
  padding: clamp(1.9rem, 6vw, 3.4rem) 0 1rem;
}

.doc h1 {
  margin-top: 0.7rem;
  font-family: var(--serif);
  font-size: clamp(2.5rem, 9vw, 4rem);
  line-height: 1;
  letter-spacing: -0.045em;
  overflow-wrap: anywhere;
  hyphens: auto;
}

.doc-body {
  margin-top: 1.65rem;
  color: var(--ink-soft);
  font-size: 1.02rem;
  line-height: 1.7;
}

.doc-body p + p,
.doc-body h2 { margin-top: 1.5rem; }

.doc-body h2 {
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.4;
}

.doc-body a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--line-strong);
  text-underline-offset: 0.2em;
}

.doc-body a:hover {
  color: var(--accent);
  text-decoration-color: var(--accent);
}

/* Footer ------------------------------------------------------------------ */

.foot {
  margin-top: clamp(2.5rem, 6vw, 4rem);
}

.foot-panel {
  border-top: 1px solid var(--line);
  padding: 1.75rem 0 1.4rem;
  color: var(--ink-soft);
  font-size: 0.8rem;
}

.foot-brand {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
}

.foot-brand .brand-mark {
  flex: none;
  margin-top: 0.2rem;
}

.foot-id { min-width: 0; }

.foot-wordmark {
  margin: 0;
  color: var(--logo);
  font-family: var(--serif);
  font-size: clamp(1.55rem, 3.2vw, 1.85rem);
  font-weight: 400;
  letter-spacing: -0.045em;
  line-height: 1.15;
}

.foot-tagline {
  max-width: 28rem;
  margin: 0.3rem 0 0;
  color: var(--ink-soft);
  font-family: var(--serif);
  font-size: 0.98rem;
  line-height: 1.5;
}

.foot-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.15rem 1.25rem;
  margin-top: 1.35rem;
}

.foot-links { display: flex; flex-wrap: wrap; column-gap: 1.1rem; row-gap: 0.35rem; }

.foot-links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

.foot-links a:hover {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.entry-source {
  margin: 1.35rem 0 0;
  color: var(--ink-faint);
  font-size: 0.75rem;
  font-weight: 400;
  line-height: 1.45;
}

.entry-source a,
.entry-source a:hover {
  color: inherit;
  font-weight: 400;
  text-decoration: none;
}

.entry-source a:hover {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

/* Home explore (examples, letters, translators) --------------------------- */

#empty > .note {
  width: min(calc(100% - 2.5rem), 72rem);
  margin: 1.5rem auto 0;
}

.explore {
  display: grid;
  grid-template-columns: 1fr 3fr;
  gap: 3rem;
  width: min(calc(100% - 2.5rem), 72rem);
  margin: 0 auto;
  padding-block: 3rem;
  border-top: 1px solid var(--line);
}

.explore > .section-label {
  margin: 0;
  padding-top: 0.75rem;
  font-weight: 600;
}

.explore-body { min-width: 0; max-width: 52rem; }

h2.section-label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1em;
}

.word-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.7rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.word-card {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-height: 7.25rem;
  padding: 0.95rem 1rem 1.05rem;
  border: 1px solid var(--line);
  border-radius: 0.9rem;
  background: var(--surface);
  text-decoration: none;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.word-card:hover {
  border-color: var(--accent);
  background: var(--wash);
  color: inherit;
}

.word-card-term {
  display: block;
  margin-bottom: 0.45rem;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.4rem;
  letter-spacing: -0.035em;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.word-card:hover .word-card-term { color: var(--accent); }

.word-card-gloss {
  display: block;
  color: var(--ink-soft);
  font-size: 0.84rem;
  line-height: 1.4;
}

.word-card-gloss[lang="en"] { color: var(--ink-faint); }

.explore .letter-index {
  max-width: none;
  gap: 0.45rem;
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.explore .letter-index li,
.explore .letter-index a,
.explore .letter-index button {
  min-width: 0;
}

.explore .letter-index a,
.explore .letter-index button {
  padding-inline: 0.15rem;
}

.letter-index button {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  min-height: 48px;
  min-width: 44px;
  padding: 0;
  appearance: none;
  -webkit-appearance: none;
  border: 1px solid var(--line);
  border-radius: 0.65rem;
  background: var(--surface);
  color: inherit;
  font-family: var(--serif);
  font-size: 1.06rem;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.letter-index button:hover,
.letter-index button:focus-visible {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--wash);
}



.intent-cards {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.intent-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 44px;
  padding: 1.05rem 1.15rem 1.15rem;
  border: 1px solid var(--line);
  border-radius: 0.9rem;
  background: var(--surface);
  text-decoration: none;
  transition: color 0.15s ease;
}

.intent-card:hover { color: inherit; }

.intent-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.2rem;
  min-width: 0;
}

.intent-title {
  display: block;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.28rem;
  letter-spacing: -0.03em;
  line-height: 1.2;
}

.intent-card:hover .intent-title { color: var(--accent); }

.intent-desc,
.intent-dir {
  display: block;
  color: var(--ink-soft);
  font-family: var(--sans);
  font-size: 0.92rem;
  font-weight: 400;
  letter-spacing: 0;
  line-height: 1.4;
  text-transform: none;
}

.intent-card svg {
  flex: none;
  color: var(--ink-faint);
  transition: color 0.15s ease, transform 0.15s ease;
}

.intent-card:hover svg {
  color: var(--accent);
  transform: translateX(2px);
}

@media (min-width: 640px) {
  .word-cards {
    grid-template-columns: repeat(4, 1fr);
    gap: 0.85rem;
  }

  .word-card {
    min-height: 7.6rem;
    padding: 1.1rem 1.15rem 1.15rem;
  }

  .word-card-term { font-size: 1.5rem; }

  .explore .letter-index {
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 0.5rem;
  }

  .intent-card { padding: 1.2rem 1.35rem; }

  .intent-title { font-size: 1.36rem; }
}

@media (max-width: 359px) {
  .word-cards { gap: 0.55rem; }
  .word-card { min-height: 6.6rem; padding: 0.8rem 0.75rem 0.9rem; }
  .word-card-term { font-size: 1.25rem; }
}

/* Wider screens ----------------------------------------------------------- */

@media (max-width: 47rem) {
  .nav-purpose { display: none; }

  body[data-page="home"] .hero {
    padding-block: 3rem 4rem;
  }

  body[data-page="home"] .hero h1 {
    margin-top: 1.5rem;
    font-size: clamp(2.5rem, 9.8vw, 4.5rem);
    line-height: 1.12;
    letter-spacing: -0.05em;
  }

  .hero-bottom {
    display: block;
    margin-top: 2rem;
  }

  .hero-intro {
    max-width: 35rem;
    font-size: 1rem;
    line-height: 1.7;
  }

  .hero-bottom .text-link { margin-top: 2rem; }

  .purpose,
  .home-dict {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    padding-block: 3rem 4rem;
  }

  .explore {
    grid-template-columns: 1fr;
    gap: 1rem;
    padding-block: 2.35rem;
    width: min(calc(100% - 2rem), 72rem);
  }

  .purpose .section-label,
  .home-dict .section-label,
  .explore > .section-label { padding-top: 0; }

  .purpose h2 {
    max-width: 25ch;
    font-size: clamp(2rem, 5.7vw, 3rem);
  }

  .purpose-copy > p { font-size: 1rem; }

  .foot-panel { padding-top: 1.5rem; }
}

@media (max-width: 479px) {
  /* The long dictionary subtitle collides with the language switcher on a narrow bar. */
  .brand-sub { display: none; }

  .foot-links { gap: 1.4rem; }
  .brand-name { font-size: 1.22rem; }
  .langs a {
    padding: 0 0.8rem;
    font-size: 0.8rem;
  }

  .search-panel { padding: 8px; }
  .search-keys {
    gap: 0.55rem;
    padding: 0.7rem 0.4rem 0.5rem;
  }
  .key {
    min-height: 48px;
    font-size: 1.32rem;
  }
}

@media (max-width: 359px) {
  .brand-name { font-size: 1.2rem; }
  .brand-mark { width: 1.65rem; height: 1.65rem; }
  .langs a { padding: 0 0.7rem; font-size: 0.78rem; }
}


@media (min-width: 480px) {
}

@media (min-width: 640px) {
  .search-keys {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 0.9rem;
    padding: 0.55rem 0.65rem 0.5rem;
  }

  .keys { width: min(20rem, 58%); gap: 6px; }

}

@media (min-width: 720px) {
  .letter-drawer { display: none; }
  .letter-rail { display: flex; }
}

@media (min-width: 900px) {
  .entry-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 1.75rem;
    align-items: start;
  }

  .entry-head {
    position: static;
  }

  .related-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 2rem;
    max-width: none;
  }

  .related-list li:nth-child(2) a { border-top: 1px solid var(--line); }

  .doc-body { font-size: 1.06rem; }
}


/* Motion and print -------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .sk-line { animation: none; }
}

@media print {
  body {
    background: #fff;
    color: #000;
  }

  .top,
  .search-panel,
  .search-mini,
  .foot,
  .skip,
  .crumb,
  .pager,
  .back,
  .theme-toggle,
  .hero-bottom .text-link { display: none !important; }

  .wrap { width: 100%; }

  a[href]::after { content: none !important; }

  .entry-layout { display: block; }

  .entry-head {
    position: static;
    padding-bottom: 1rem;
    border-bottom: 1px solid #000;
  }

  .gloss li,
  .word-list li { break-inside: avoid; }
}

/* UI SDK wrappers are unknown elements until they upgrade. Keep layout unchanged. */
ui-toggle,
ui-toolbar-button,
ui-toolbar-link,
ui-segmented-control-item,
ui-toolbar:not(.keys) {
  display: contents;
}

.result.is-active,
.result[aria-selected="true"] {
  background: var(--wash);
}

.key:focus-visible,
.letter-index a:focus-visible {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--wash);
  outline: none;
}


/* Homepage conversation card: first, above the fold, native composer. */
.home-chat {
  padding: 0.75rem 0 3.25rem;
}

.chat-card {
  display: flex;
  flex-direction: column;
  max-width: 46rem;
  margin: 0 auto;
  border: 1px solid var(--line);
  border-radius: 1.15rem;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.chat-card-head {
  padding: 1.35rem 1.45rem 0.35rem;
}

.chat-card-head .section-label { padding-top: 0; }

.chat-card-head h2 {
  margin: 0.4rem 0 0;
  font-family: var(--serif);
  font-size: clamp(1.9rem, 3.6vw, 2.7rem);
  font-weight: 400;
  letter-spacing: -0.045em;
  line-height: 1.12;
  text-wrap: balance;
}

.chat-card-lede {
  margin: 0.7rem 0 0;
  max-width: 28rem;
  color: var(--ink-soft);
  font-size: 1.02rem;
  line-height: 1.6;
}

.chat-card-stage {
  flex: 0 0 auto;
  min-height: 0;
  padding: 0.45rem 1.45rem 0.15rem;
}

.chat-examples-label {
  margin: 0 0 0.4rem;
  color: var(--ink-faint);
  font-family: var(--sans);
  font-size: 0.68rem;
  font-weight: 650;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.chat-examples {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.chat-examples a {
  display: inline-block;
  padding: 0.28rem 0.7rem 0.3rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 0.98rem;
  letter-spacing: -0.02em;
  line-height: 1.3;
  text-decoration: none;
}

.chat-examples a:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.chat-composer {
  margin: 0;
  padding: 0.8rem 0.9rem 1rem;
  padding-bottom: max(1rem, env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: var(--surface);
  border-radius: 0 0 1.15rem 1.15rem;
}

.chat-composer .search-row {
  border: 1px solid var(--line-strong);
  background: var(--bg);
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.chat-composer .search-row:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}

.chat-composer .search-row input {
  font-size: 1.05rem;
  padding-left: 1.1rem;
}

.chat-composer .search-keys {
  margin-top: 0.75rem;
}

.chat-composer .key,
.key {
  font-family: var(--serif);
}

@media (max-width: 52rem) {
  .home-chat { padding: 0.35rem 0 1.25rem; }
  .chat-card {
    border-radius: 0.95rem;
  }
  .chat-card-head { padding: 1.1rem 1.1rem 0.2rem; }
  .chat-card-head h2 { font-size: clamp(1.7rem, 8vw, 2.1rem); }
  .chat-card-stage { padding: 0.35rem 1.1rem 0.1rem; }
  .chat-composer { border-radius: 0 0 0.95rem 0.95rem; padding: 0.75rem 0.7rem max(0.9rem, env(safe-area-inset-bottom)); }
}

@media (prefers-reduced-motion: reduce) {
  .chat-composer .search-row { transition: none; }
}


/* Word-page colour comes from the shared ink / cobalt palette on :root. */

body[data-page="word"] .entry {
  padding-bottom: 3rem;
}

body[data-page="word"] .entry-head {
  max-width: 680px;
  padding-bottom: 1.35rem;
  margin-bottom: 0.35rem;
  border-bottom: 1px solid var(--line);
}

body[data-page="word"] .entry-pos {
  margin: 0.55rem 0 0;
  color: var(--ink-faint);
  font-family: var(--sans);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  font-style: italic;
}

body[data-page="word"] .entry-tr {
  margin: 0.4rem 0 0;
  max-width: 680px;
  font-size: 17px;
  line-height: 1.5;
  font-weight: 400;
  color: var(--ink-soft);
}

body[data-page="word"] .def-ru,
body[data-page="word"] .def-en,
body[data-page="word"] .entry-tr {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  align-items: baseline;
  column-gap: 0.65rem;
}

body[data-page="word"] .tr-lang {
  display: inline;
  min-width: 0;
  margin-right: 0;
  color: var(--ink-faint);
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-style: normal;
  line-height: 1.4;
}

body[data-page="word"] .entry-body {
  max-width: none;
}

body[data-page="word"] .sense-list {
  max-width: 680px;
}

body[data-page="word"] .sense + .sense {
  margin-top: 48px;
  padding-top: 32px;
  border-top: 1px solid var(--line);
}

body[data-page="word"] .sense-kicker {
  display: flex;
  align-items: baseline;
  gap: 0.55rem;
  margin: 0 0 0.45rem;
  color: var(--ink-faint);
  font-family: var(--sans);
  font-size: 14px;
  letter-spacing: 0.02em;
  line-height: 22px;
}

body[data-page="word"] .sense-num {
  font-weight: 700;
  font-size: 14px;
  line-height: 22px;
  color: var(--ink-faint);
  letter-spacing: 0;
  font-variant-numeric: tabular-nums;
}

body[data-page="word"] .sense-pos {
  font-size: 14px;
  line-height: 22px;
  font-style: normal;
  color: var(--ink-faint);
}

body[data-page="word"] .hom-banner {
  margin: 2.1rem 0 0.85rem;
  padding-top: 0.4rem;
}

body[data-page="word"] .hom-banner:first-child { margin-top: 0.4rem; }

body[data-page="word"] .hom-mark {
  display: inline-block;
  color: var(--ink-soft);
  font-family: var(--serif);
  font-size: 1.15rem;
  font-weight: 550;
  letter-spacing: 0.04em;
}

body[data-page="word"] .sense-title {
  margin: 0 0 12px;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 24px;
  line-height: 32px;
  font-weight: 650;
  letter-spacing: -0.01em;
}

body[data-page="word"] .def-sah,
body[data-page="word"] .sense-definition {
  margin: 0 0 12px;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 19px;
  line-height: 1.5;
  font-weight: 400;
  max-width: 680px;
}

body[data-page="word"] .def-ru,
body[data-page="word"] .def-en {
  margin: 0 0 16px;
  color: var(--ink-soft);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.5;
  max-width: 680px;
}

body[data-page="word"] .examples {
  margin: 16px 0 0;
  padding: 0 0 0 20px;
  list-style: none;
  display: grid;
  gap: 0;
}

body[data-page="word"] .examples li { margin: 0; }

body[data-page="word"] .examples > li + li { margin-top: 9px; }

body[data-page="word"] .cite {
  max-width: 640px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

body[data-page="word"] .cite,
body[data-page="word"] .sense-title,
body[data-page="word"] .def-sah,
body[data-page="word"] .ex-sah { overflow-wrap: anywhere; }

body[data-page="word"] .cite-meta { display: inline; }

body[data-page="word"] .ex-sah {
  display: inline;
  margin: 0;
  font-family: var(--serif);
  font-size: 16px;
  font-style: normal;
  font-weight: 400;
  line-height: 1.55;
  color: var(--ink);
}

body[data-page="word"] .ex-ru,
body[data-page="word"] .ex-en {
  display: block;
  margin: 0.15rem 0 0;
  color: var(--ink-soft);
  font-family: var(--sans);
  font-size: 14px;
  font-style: normal;
  font-weight: 400;
  line-height: 1.5;
}

body[data-page="word"] .ex-src {
  display: inline;
  margin: 0;
  color: var(--ink-faint);
  font-family: var(--sans);
  font-size: 13px;
  font-style: normal;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
  line-height: 1.4;
  font-variant: normal;
}

body[data-page="word"] .ex-src::before {
  content: " — ";
}

body[data-page="word"] .more-examples {
  margin: 12px 0 0;
}

body[data-page="word"] .more-examples summary {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0;
  color: var(--accent);
  font-size: 14px;
  line-height: 22px;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  border: 0;
  background: none;
}

body[data-page="word"] .more-examples summary::-webkit-details-marker { display: none; }

body[data-page="word"] .more-examples summary::after {
  content: "";
  width: 0.4rem;
  height: 0.4rem;
  margin-left: 0.45rem;
  border-right: 1.4px solid currentColor;
  border-bottom: 1.4px solid currentColor;
  transform: rotate(45deg);
  transition: transform 120ms ease;
}

body[data-page="word"] .more-examples[open] summary::after {
  transform: rotate(225deg);
  margin-top: 0.25rem;
}

body[data-page="word"] .more-examples .examples { margin-top: 16px; }

body[data-page="word"] .phrases {
  margin-top: 1.5rem;
  padding-top: 0.4rem;
}

body[data-page="word"] .phrases-title {
  margin: 0 0 0.85rem;
  color: var(--ink-faint);
  font-family: var(--sans);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

body[data-page="word"] .phrase {
  margin: 0 0 1.35rem;
  padding: 0;
}

body[data-page="word"] .phrase-lemma {
  margin: 0 0 0.3rem;
  font-family: var(--serif);
  font-size: 1.15rem;
  font-weight: 650;
  letter-spacing: -0.02em;
  line-height: 1.3;
}

body[data-page="word"] .phrase-see {
  color: var(--ink-faint);
  font-family: var(--sans);
  font-size: 0.8rem;
  font-weight: 500;
  font-style: italic;
  letter-spacing: 0;
}

body[data-page="word"] .phrase-def {
  margin: 0 0 0.25rem;
  font-size: 1rem;
  line-height: 1.55;
}

body[data-page="word"] .phrase-ru {
  margin: 0 0 0.45rem;
  color: var(--ink-soft);
  font-size: 0.94rem;
  line-height: 1.5;
}

body[data-page="word"] .entry-toc {
  display: none;
}

/* Phones/tablets: the same TOC inside a closed native disclosure. */
body[data-page="word"] .entry-toc-m { margin: 0 0 1.35rem; }

body[data-page="word"] .entry-toc-m > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  min-height: 48px;
  padding: 0 0.9rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink-soft);
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 600;
  line-height: 21px;
  cursor: pointer;
  list-style: none;
  touch-action: manipulation;
}

body[data-page="word"] .entry-toc-m > summary::-webkit-details-marker { display: none; }

body[data-page="word"] .entry-toc-m > summary::after {
  content: "";
  width: 0.4rem;
  height: 0.4rem;
  flex: 0 0 auto;
  border-right: 1.4px solid currentColor;
  border-bottom: 1.4px solid currentColor;
  transform: rotate(45deg);
}

body[data-page="word"] .entry-toc-m[open] > summary::after {
  transform: rotate(225deg);
}

body[data-page="word"] .entry-toc-m > .entry-toc {
  margin-top: 0.45rem;
  padding: 0 0 0.35rem;
}

body[data-page="word"] .entry-toc-m > .entry-toc ol {
  list-style: none;
  margin: 0;
  padding: 0;
  border-left: 0;
}

body[data-page="word"] .entry-toc-m > .entry-toc a {
  display: flex;
  align-items: flex-start;
  gap: 0.45rem;
  min-height: 44px;
  padding: 10px 0 10px 0.75rem;
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 21px;
  text-decoration: none;
  overflow-wrap: anywhere;
}

body[data-page="word"] .entry-toc-m > .entry-toc a:hover { color: var(--ink); }

@media (max-width: 1099.98px) {
  body[data-page="word"] .entry-toc-m { display: block; }

  body[data-page="word"] .entry-toc-m > .entry-toc { display: none; }

  body[data-page="word"] .entry-toc-m[open] > .entry-toc { display: block; }
}

@media (min-width: 1100px) {
  body[data-page="word"] .entry-toc-m { display: contents; }

  body[data-page="word"] .entry-toc-m::details-content {
    content-visibility: visible;
    display: block;
  }

  body[data-page="word"] .entry-toc-m > summary { display: none; }

  body[data-page="word"] .entry-toc-m > .entry-toc { display: block; }
}

@media (min-width: 1100px) {
  body[data-page="word"] main.wrap {
    width: min(calc(100% - 5rem), 42rem);
  }

  body[data-page="word"] main.wrap:has(.entry-body.has-toc) {
    width: min(calc(100% - 5rem), 58rem);
  }

  body[data-page="word"] .entry-body.has-toc {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 13.5rem;
    column-gap: 2.75rem;
    align-items: start;
  }

  body[data-page="word"] .entry-toc {
    display: block;
    grid-column: 2;
    grid-row: 1;
    position: sticky;
    top: 5.5rem;
    max-height: none;
    overflow: visible;
    padding: 0.15rem 0 1rem 0.2rem;
  }

  body[data-page="word"] .sense-list { grid-column: 1; grid-row: 1; }

  body[data-page="word"] .entry-toc ol {
    list-style: none;
    margin: 0;
    padding: 0;
    border-left: 0;
    max-height: calc(100dvh - 7rem);
    overflow: auto;
    scrollbar-width: thin;
  }

  body[data-page="word"] .entry-toc li { margin: 0; }

  body[data-page="word"] .entry-toc a {
    display: flex;
    gap: 0.45rem;
    align-items: flex-start;
    min-height: 44px;
    margin-left: -1px;
    padding: 10px 0 10px 0.75rem;
    border-left: 0;
    color: var(--ink-soft);
    font-size: 14px;
    line-height: 21px;
    text-decoration: none;
    transition: background 120ms ease, color 120ms ease, border-color 120ms ease;
  }

  body[data-page="word"] .entry-toc a:hover { color: var(--ink); }

  body[data-page="word"] .entry-toc a[aria-current="location"] {
    border-left: 0;
    background: var(--wash);
    color: var(--ink);
    font-weight: 600;
  }

  body[data-page="word"] .toc-n {
    flex: 0 0 20px;
    width: 20px;
    color: var(--ink-faint);
    font-variant-numeric: tabular-nums;
    font-weight: 600;
  }

  body[data-page="word"] .toc-hom {
    color: var(--ink-faint);
    font-size: 0.65rem;
    letter-spacing: 0.04em;
  }

  body[data-page="word"] .toc-label {
    display: block;
    min-width: 0;
    overflow-wrap: anywhere;
  }
}

@media (max-width: 767px) {
  body[data-page="word"] .sense + .sense {
    margin-top: 36px;
    padding-top: 32px;
  }

  body[data-page="word"] .sense-title {
    font-size: 21px;
    line-height: 29px;
  }

  body[data-page="word"] .def-sah,
  body[data-page="word"] .sense-definition {
    font-size: 17px;
    line-height: 1.5;
    margin-bottom: 10px;
  }

  body[data-page="word"] .def-ru,
  body[data-page="word"] .def-en {
    font-size: 16px;
    line-height: 1.5;
    margin-bottom: 14px;
  }

  body[data-page="word"] .ex-sah {
    font-size: 16px;
    line-height: 1.55;
  }

  body[data-page="word"] .ex-ru,
  body[data-page="word"] .ex-en {
    font-size: 14px;
    line-height: 1.5;
  }

  body[data-page="word"] .cite { padding: 0; }

  body[data-page="word"] .examples > li + li { margin-top: 8px; }
}

@media (max-width: 374px) {
  body[data-page="word"] main.wrap { width: calc(100% - 32px); }
}

@media (min-width: 375px) and (max-width: 1099.98px) {
  body[data-page="word"] main.wrap { width: calc(100% - 40px); }
}

@media (prefers-reduced-motion: reduce) {
  body[data-page="word"] .more-examples summary::after { transition: none; }
  body[data-page="word"] .entry-toc a { transition: none; }
}

/* Homepage: tight, even vertical rhythm between major sections. */
body[data-page="home"] {
  --section-gap: clamp(4rem, 5.5vw, 6rem);
}

@media (max-width: 52rem) {
  body[data-page="home"] {
    --section-gap: clamp(2.5rem, 8vw, 3.5rem);
  }
}

body[data-page="home"] .home-chat {
  padding: 0.75rem 0 0 !important;
}

body[data-page="home"] .hero {
  padding: clamp(1.75rem, 3vw, 2.75rem) 0 0 !important;
}

body[data-page="home"] .purpose {
  padding-block: var(--section-gap) 0 !important;
}

body[data-page="home"] .home-dict,
body[data-page="home"] .explore {
  padding-block: var(--section-gap) 0 !important;
}

body[data-page="home"] .explore:last-of-type {
  padding-bottom: var(--section-gap) !important;
}

.back-to-top {
  position: fixed;
  right: max(1rem, env(safe-area-inset-right));
  bottom: max(1rem, env(safe-area-inset-bottom));
  z-index: 35;
  width: 44px;
  height: 44px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink-soft);
  cursor: pointer;
}

.back-to-top[hidden] { display: none; }

.back-to-top:hover {
  color: var(--ink);
  border-color: var(--line-strong);
}

body:has(#palette-switcher) .back-to-top {
  bottom: calc(max(1rem, env(safe-area-inset-bottom)) + 4.25rem);
}

.palette-switcher {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 40;
  display: flex;
  gap: 0.35rem;
  padding: 0.35rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 0.55rem;
  color: var(--ink);
  font-size: 0.72rem;
  font-family: var(--sans);
}
.palette-switcher button {
  min-height: 2.75rem;
  min-width: 2.75rem;
  padding: 0 0.55rem;
  border: 0;
  border-radius: 0.35rem;
  background: transparent;
  color: var(--ink-soft);
  cursor: pointer;
}
.palette-switcher button.is-active,
.palette-switcher button:hover { background: var(--wash); color: var(--ink); }

img.brand-mark {
  background-color: var(--logo);
  -webkit-mask: url("/assets/brand-symbol.svg") center / contain no-repeat;
  mask: url("/assets/brand-symbol.svg") center / contain no-repeat;
  object-position: 64px 0;
}

/* Sakha Word Game — a quiet house-ad after the entry or the home sections. */
.game-promo {
  margin: clamp(2rem, 5vw, 3.25rem) 0;
}

.game-promo-link {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.5rem 1rem;
  max-width: 52rem;
  padding: 0.9rem 1rem;
  border: 1px solid var(--line);
  border-radius: 0.85rem;
  background: var(--surface);
  color: var(--ink);
  text-decoration: none;
  transition: border-color 160ms ease, background 160ms ease;
}

.game-promo-link:hover {
  border-color: var(--line-strong);
  color: var(--ink);
}

.game-promo-link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.game-promo-logo img {
  display: block;
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 0.75rem;
}

.game-promo-text {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}

.game-promo-name {
  font-family: var(--sans);
  font-size: 0.7rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.game-promo-invite {
  font-family: var(--serif);
  font-size: clamp(1rem, 1rem + 0.25vw, 1.15rem);
  line-height: 1.3;
  text-wrap: balance;
}

.game-promo-cta {
  justify-self: end;
  padding: 0.5rem 0.95rem;
  border: 1px solid var(--accent);
  border-radius: 999px;
  color: var(--accent);
  font-family: var(--sans);
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
}

.game-promo-link:hover .game-promo-cta {
  background: var(--accent);
  color: var(--on-accent);
}

@media (max-width: 560px) {
  .game-promo-link {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .game-promo-cta {
    grid-column: 2;
    justify-self: start;
    margin-top: 0.15rem;
  }
}

@media (min-width: 47.01rem) {
  body[data-page="home"] .game-promo {
    display: grid;
    grid-template-columns: 1fr 3fr;
    gap: 3rem;
    width: min(calc(100% - 2.5rem), 72rem);
    margin: clamp(2rem, 5vw, 3.25rem) auto;
  }

  body[data-page="home"] .game-promo-link {
    grid-column: 2;
  }
}

/* Phase 1 home polish (B2) + recent searches (R1), 2026-11-16 ------------ */

/* One 1120 px container for the three home sections; 180 px label column. */
@media (min-width: 768px) {
  .explore {
    grid-template-columns: 180px minmax(0, 1fr);
    gap: 3rem;
    width: min(calc(100% - 2.5rem), 70rem);
  }
  .explore-body { max-width: none; }
}

@media (max-width: 767px) {
  .explore {
    grid-template-columns: minmax(0, 1fr);
    gap: 1rem;
    width: min(calc(100% - 2rem), 70rem);
  }
  .explore > .section-label { padding-top: 0; }
}

/* The translate link belongs to the three ТЫЛБААС cards, 16 px below them. */
.explore-body .x-link { margin: 1rem 0 0; }

/* Search card: 20/24 px padding rhythm and a 52 px input. */
.chat-card-head { padding: 1.5rem 1.5rem 0.35rem; }
.chat-card-stage { padding: 0.45rem 1.5rem 0.15rem; }
.chat-examples { gap: 0.5rem; }
.chat-composer { padding: 0.85rem 1rem 1rem; }
.chat-composer .search-row input { height: 3.25rem; }
.chat-composer .search-keys { margin-top: 0.65rem; }

@media (max-width: 52rem) {
  .chat-card-head { padding: 1.25rem 1.25rem 0.25rem; }
  .chat-card-stage { padding: 0.35rem 1.25rem 0.1rem; }
  .chat-composer { padding: 0.7rem 0.75rem 0.85rem; }
}

/* Special-letter keys: 44x44 minimum with a visible focus ring. */
.key { min-width: 44px; min-height: 44px; }
.key:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-color: var(--accent);
  color: var(--accent);
  background: var(--wash);
}

/* ХОЛОБУР: 2 columns at >= 360, 1 below 340, 4 at >= 900. */
@media (min-width: 640px) and (max-width: 899px) {
  .word-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 900px) {
  .word-cards { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 339px) {
  .word-cards { grid-template-columns: minmax(0, 1fr); }
}

/* Alphabet: wrapping 44x44 targets on the same left edge as the cards. */
.explore .letter-index { grid-template-columns: repeat(auto-fill, minmax(48px, 1fr)); }
.explore .letter-index a,
.explore .letter-index button { min-width: 44px; min-height: 44px; }

/* САХА СУОЛА: one quiet line, 48 px above it, no promo shadow. */
body[data-page="home"] .game-promo { margin-top: 48px !important; }
.game-promo-link { box-shadow: none; }
@media (min-width: 390px) {
  .game-promo-link {
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 0.5rem 0.75rem;
    padding: 0.75rem 0.9rem;
  }
  .game-promo-cta {
    grid-column: auto;
    justify-self: end;
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    margin-top: 0;
  }
}

/* Recent searches: quiet row inside the search card, hidden until non-empty. */
.recent {
  padding: 0.25rem 1.5rem 1rem;
  border-top: 1px solid var(--line);
}
.recent[hidden] { display: none; }
.recent-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  min-height: 44px;
}
.recent-head .section-label { margin: 0; padding: 0; }
.recent-clear {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--ink-faint);
  cursor: pointer;
}
.recent-clear:hover { background: var(--wash); color: var(--ink); }
.recent-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0;
  padding: 0 0 0.25rem;
  list-style: none;
}
.recent-chip {
  min-height: 44px;
  padding: 0.35rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg);
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  cursor: pointer;
}
.recent-chip:hover { border-color: var(--accent); color: var(--accent); }
.recent-chip:focus-visible,
.recent-clear:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

@media (max-width: 52rem) {
  .recent { padding: 0.15rem 1.25rem 0.9rem; }
}

/* Example chips also clear the 44 px touch target floor. */
.chat-examples a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

/* Search clear keeps a 44 px touch target. */
.search-clear { width: 44px; height: 44px; right: 3.5rem; }

/* Single short examples still get a 44x44 target. */
.chat-examples a { min-width: 44px; }
.recent-chip { min-width: 44px; }

/* Footer links: 44 px minimum hit area (Phase 1 responsive gate). */
.foot-links a { display: inline-flex; align-items: center; min-width: 2.75rem; min-height: 2.75rem; justify-content: center; }

/* ==========================================================================
   v2 (2026-11-16): header surface, motion tokens, writers, typographic roles.
   Tokens: --bg page, --surface cards/inputs, --header sticky bar, --ink,
   --ink-soft / --ink-faint muted ink, --accent, --line hairline.
   Motion tokens match /workspace/MOTION-SPEC.md (site, chat, game).
   ========================================================================== */

:root {
  --dur-1: 100ms;
  --dur-2: 200ms;
  --dur-3: 300ms;
  --dur-4: 450ms;
  --ease-emph: cubic-bezier(0.2, 0, 0, 1);
  --ease-std: cubic-bezier(0.3, 0, 0, 1);
  --header-h: 4.25rem;
}

@media (max-width: 640px) {
  :root { --header-h: 56px; }
}

html { scroll-padding-top: calc(var(--header-h) + 1rem); }

@media (prefers-reduced-motion: reduce) {
  :root { --dur-1: 0.01ms; --dur-2: 0.01ms; --dur-3: 0.01ms; --dur-4: 0.01ms; }
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-delay: 0s !important;
    transition-duration: 0.01ms !important;
    transition-delay: 0s !important;
  }
}

/* Header: its own surface, hairline, and a shadow once the page has scrolled. */
.top {
  background-color: var(--header-solid);
  border-bottom-color: var(--header-line);
  transition: box-shadow var(--dur-2) var(--ease-std);
}

@supports ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  .top {
    background-color: var(--header);
    -webkit-backdrop-filter: saturate(1.4) blur(14px);
    backdrop-filter: saturate(1.4) blur(14px);
  }
}

body.is-scrolled .top { box-shadow: var(--header-shadow); }

/* Hover / press feedback. */
.langs a,
.nav a,
.theme-toggle,
.locale-menu-btn,
.locale-menu-link,
.back-to-top,
.search-mini button,
.key {
  transition:
    background-color var(--dur-1) var(--ease-std),
    color var(--dur-1) var(--ease-std),
    border-color var(--dur-1) var(--ease-std),
    transform var(--dur-1) var(--ease-std),
    opacity var(--dur-2) var(--ease-std);
}

.langs a:active,
.theme-toggle:active,
.locale-menu-btn:active,
.back-to-top:active,
.search-mini button:active { transform: scale(0.97); }

/* Language menu popover. */
.locale-menu[open] .locale-menu-panel {
  transform-origin: top right;
  animation: pop-in var(--dur-2) var(--ease-emph);
  box-shadow: var(--shadow);
}

@keyframes pop-in {
  from { opacity: 0; transform: translateY(-4px) scale(0.98); }
  to { opacity: 1; transform: none; }
}

/* Back to top: fades and rises instead of popping. */
.back-to-top,
.back-to-top[hidden] {
  display: inline-flex;
  opacity: 0;
  transform: translateY(8px);
  visibility: hidden;
  pointer-events: none;
  transition:
    opacity var(--dur-2) var(--ease-std),
    transform var(--dur-2) var(--ease-std),
    visibility 0s linear var(--dur-2),
    background-color var(--dur-1) var(--ease-std),
    color var(--dur-1) var(--ease-std);
}

.back-to-top.is-visible {
  opacity: 1;
  transform: none;
  visibility: visible;
  pointer-events: auto;
  transition-delay: 0s;
  box-shadow: var(--shadow);
}

.back-to-top.is-visible:active { transform: scale(0.97); }

/* Search pill: slot keeps the page layout while the pill lives in the header. */
.search-slot { position: relative; }

.search-mini { transform-origin: 0 0; }

.top .header-tools > .search-mini {
  flex: 0 1 auto;
  width: clamp(11rem, 22vw, 17rem);
  max-width: none;
  margin: 0;
  padding: 3px;
}

.top .search-mini input { height: 36px; padding-left: 2.2rem; font-size: 0.9rem; }
.top .search-mini .search-icon { left: 0.8rem; width: 18px; height: 18px; }
.top .search-mini button { width: 36px; height: 36px; }

body.search-compact .header-tools > .langs { display: none; }
body.search-compact .locale-menu { display: block; }

@media (min-width: 641px) {
  body.search-compact .locale-menu-panel > a:nth-child(-n + 2),
  body.search-compact .locale-menu-panel > hr { display: none; }
}

@media (min-width: 641px) and (max-width: 940px) {
  body.search-compact .nav-purpose,
  body.search-compact .nav-dict,
  body.search-compact .brand-sub { display: none; }
}

@media (max-width: 640px) {
  body.search-compact .brand-text { display: none; }
  body.search-compact .nav { flex: 1 1 auto; min-width: 0; }
  body.search-compact .header-tools { flex: 1 1 auto; min-width: 0; justify-content: flex-end; }
  .top .header-tools > .search-mini { flex: 1 1 0; width: auto; min-width: 0; }
  body.search-compact .locale-menu-btn { min-width: 64px; padding: 0 0.5rem; }
}

/* Word page: anchors clear the sticky header; the TOC rail sticks below it. */
body[data-page="word"] .sense[id^="sense-"],
body[data-page="word"] .hom-banner[id^="hom-"],
body[data-page="word"] #purpose { scroll-margin-top: calc(var(--header-h) + 1.25rem); }

@media (min-width: 1100px) {
  body[data-page="word"] .entry-toc-m { display: none; }

  body[data-page="word"] .entry-toc {
    top: calc(var(--header-h) + 1.25rem);
    align-self: start;
  }

  body[data-page="word"] .entry-toc ol {
    max-height: calc(100dvh - var(--header-h) - 3rem);
  }

  /* Current sense: wash + ink, no coloured edge stripe. */
  body[data-page="word"] .entry-toc a {
    margin-left: 0;
    border-left: 0;
    border-radius: 0 8px 8px 0;
    padding-left: 0.75rem;
    transition: background-color var(--dur-1) var(--ease-std), color var(--dur-1) var(--ease-std);
  }

  body[data-page="word"] .entry-toc a[aria-current="location"] {
    border-left: 0;
    background: var(--wash);
    color: var(--ink);
    font-weight: 600;
  }

  body[data-page="word"] .entry-toc a[aria-current="location"] .toc-n { color: var(--accent); }
}

@media (max-width: 1099.98px) {
  body[data-page="word"] .entry-toc-d { display: none; }
}

/* Typographic roles: the headword inside an example is bold, grammar labels
   are italic (real italic face), glosses stay regular, authors are small and muted. */
@font-face {
  font-family: "Noto Sans Sakha";
  font-style: italic;
  font-weight: 400 700;
  font-display: swap;
  src: url("fonts/noto-sans-italic-yakut.woff2") format("woff2");
}

body[data-page="word"] .ex-sah .hw { font-weight: 700; color: var(--ink); }

body[data-page="word"] .sense-pos,
body[data-page="word"] .entry-pos,
body[data-page="word"] .phrase-see {
  font-family: "Noto Sans Sakha", var(--sans);
  font-style: italic;
  font-synthesis: none;
}

body[data-page="word"] .def-ru > span[lang],
body[data-page="word"] .def-en > span[lang] { font-style: normal; font-weight: 400; }

body[data-page="word"] .ex-src {
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.005em;
  color: var(--ink-faint);
}

body[data-page="word"] .ex-src, body[data-page="word"] .ex-name { white-space: nowrap; }

/* Writers: round photo next to the attribution; opens the slide-over. */
a.writer-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0 0 0 0.1rem;
  padding: 1px 9px 1px 2px;
  border-radius: 999px;
  color: inherit;
  text-decoration: none;
  vertical-align: middle;
  transition: background-color var(--dur-1) var(--ease-std), color var(--dur-1) var(--ease-std);
}

a.writer-chip:hover,
a.writer-chip:focus-visible { background: var(--wash); color: var(--ink); }

.writer-av {
  position: relative;
  flex: none;
  display: inline-block;
  width: 22px;
  height: 22px;
  overflow: hidden;
  border-radius: 50%;
  background: var(--sunken);
  box-shadow: 0 0 0 1px var(--line);
}

.writer-av img { display: block; width: 100%; height: 100%; object-fit: cover; }

.writer-av-orn::after,
.writer-photo.writer-av-orn::after {
  content: "";
  position: absolute;
  inset: 22%;
  background-color: var(--ink-faint);
  -webkit-mask: url("/assets/brand-symbol.svg") center / contain no-repeat;
  mask: url("/assets/brand-symbol.svg") center / contain no-repeat;
  opacity: 0.7;
}

.writer-scrim {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(14, 11, 8, 0.4);
  opacity: 0;
  transition: opacity var(--dur-3) var(--ease-std);
}

.writer-scrim[hidden] { display: none; }
.writer-scrim.is-open { opacity: 1; }

.writer-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 310;
  width: min(92vw, 25rem);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 1.25rem 1.5rem 2rem;
  background: var(--surface);
  color: var(--ink);
  box-shadow: -1px 0 0 var(--line), var(--shadow);
  transform: translateX(100%);
  visibility: hidden;
  transition: transform var(--dur-3) var(--ease-emph), visibility 0s linear var(--dur-3);
}

.writer-panel.is-open {
  transform: none;
  visibility: visible;
  transition-delay: 0s;
}

.writer-close {
  position: absolute;
  top: 0.6rem;
  right: 0.6rem;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--ink-soft);
  cursor: pointer;
  transition: background-color var(--dur-1) var(--ease-std), transform var(--dur-1) var(--ease-std);
}

.writer-close:hover { background: var(--wash); color: var(--ink); }
.writer-close:active { transform: scale(0.97); }

.writer-photo {
  position: relative;
  width: 160px;
  height: 160px;
  margin: 2rem 0 1rem;
  overflow: hidden;
  border-radius: 16px;
  background: var(--sunken);
}

.writer-photo img { display: block; width: 100%; height: 100%; object-fit: cover; }

.writer-name {
  margin: 0;
  font-family: var(--serif);
  font-size: 1.4rem;
  font-weight: 650;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

.writer-years { margin: 0.25rem 0 0; color: var(--ink-faint); font-size: 0.9rem; font-variant-numeric: tabular-nums; }
.writer-bio { margin: 1rem 0 0; font-size: 1rem; line-height: 1.6; color: var(--ink); }
.writer-links { display: flex; flex-wrap: wrap; gap: 0.4rem 1.25rem; margin: 1.25rem 0 0; font-size: 0.95rem; font-weight: 600; }
.writer-links a { color: var(--accent); text-decoration: none; }
.writer-links a:hover { text-decoration: underline; }
.writer-credit { margin: 1.5rem 0 0; color: var(--ink-faint); font-size: 0.75rem; line-height: 1.5; }
.writer-credit a { color: inherit; }

html.writer-open { overflow: hidden; }

/* Writers list page. */
.writers-list { display: grid; gap: 0; margin: 1.5rem 0 0; padding: 0; list-style: none; }
.writers-list li { border-top: 1px solid var(--line); }
.writers-list li:last-child { border-bottom: 1px solid var(--line); }
.writers-list a.writer-chip {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.2rem 0.9rem;
  width: 100%;
  padding: 0.7rem 0.4rem;
  border-radius: 10px;
}
.writers-list .writer-av { width: 44px; height: 44px; grid-row: span 2; }
.writers-list .w-name { font-weight: 650; font-size: 1.02rem; }
.writers-list .w-years { color: var(--ink-faint); font-size: 0.85rem; font-variant-numeric: tabular-nums; }
.writers-list .w-count { grid-row: span 2; color: var(--ink-faint); font-size: 0.8rem; white-space: nowrap; }
.writers-list .w-bio { grid-column: 2; color: var(--ink-soft); font-size: 0.9rem; line-height: 1.45; }

/* Expanders and chat-like reveals: fade + 4px rise, transform/opacity only. */
body[data-page="word"] .more-examples[open] > .examples {
  animation: reveal var(--dur-2) var(--ease-emph);
}

@keyframes reveal {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: none; }
}

body[data-page="word"] .more-examples summary::after { transition: transform var(--dur-2) var(--ease-emph); }
body[data-page="word"] .entry-toc-m[open] > .entry-toc { animation: reveal var(--dur-2) var(--ease-emph); }

/* Sense anchors: a quiet "#" that appears on hover / keyboard focus. */
.sense-anchor {
  margin-left: 0.15rem;
  color: var(--ink-faint);
  font-size: 0.9em;
  text-decoration: none;
  opacity: 0;
  transition: opacity var(--dur-1) var(--ease-std), color var(--dur-1) var(--ease-std);
}
.sense:hover .sense-anchor,
.sense-anchor:focus-visible { opacity: 1; }
.sense-anchor:hover { color: var(--accent); }
@media (hover: none) { .sense-anchor { display: none; } }

/* Visible keyboard focus on the reading controls. */
body[data-page="word"] .more-examples summary:focus-visible,
body[data-page="word"] .entry-toc a:focus-visible,
body[data-page="word"] .entry-toc-m > summary:focus-visible,
a.writer-chip:focus-visible,
.writer-close:focus-visible,
.back-to-top:focus-visible,
.locale-menu-btn:focus-visible,
.langs a:focus-visible,
.nav a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 8px;
}

/* Print: the entry only, every example open. */
@media print {
  .top, .skip, .back-to-top, .search-slot, .search-mini, .game-promo, .entry-toc, .entry-toc-m,
  .writer-panel, .writer-scrim, .foot, .crumb, .sense-anchor, #word-translate { display: none !important; }
  html, body { background: #fff !important; color: #000 !important; }
  body[data-page="word"] main.wrap { width: 100% !important; }
  body[data-page="word"] .more-examples::details-content { content-visibility: visible; }
  body[data-page="word"] .more-examples summary { display: none; }
  a.writer-chip { padding: 0; }
  .writer-av { display: none; }
  body[data-page="word"] .sense { break-inside: avoid-page; }
}

/* ==========================================================================
   Home search card (2026-11-16): ChatGPT items 1–12.
   Search is the hero. Palette, Onest, Noto Serif Yakut, and Sakha copy stay.
   ========================================================================== */

body[data-page="home"] .home-chat {
  padding: 0.75rem 0 0;
}

body[data-page="home"] .chat-card {
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
}

body[data-page="home"] .chat-card-head {
  padding: 28px 32px 0;
}

body[data-page="home"] .chat-card-head .section-label { display: none; }

body[data-page="home"] .chat-card-head h2,
body[data-page="home"] #chat-title {
  margin: 0;
  font-family: var(--serif);
  font-size: 40px;
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.03em;
}

body[data-page="home"] .chat-card-lede {
  margin: 12px 0 0;
  max-width: 36rem;
}

body[data-page="home"] .chat-composer {
  margin: 0;
  padding: 24px 32px 0;
  border-top: 0;
  border-radius: 0;
  background: transparent;
}

body[data-page="home"] .chat-composer .search-row {
  height: 60px;
  border: 1px solid #C9BBA6;
  border-radius: 14px;
  background: #FFFDF8;
  transition: border-color 140ms ease-out, box-shadow 140ms ease-out;
}

body[data-page="home"] .chat-composer .search-row:focus-within {
  border-color: #9E2019;
  box-shadow: 0 0 0 2px rgba(158, 32, 25, 0.28);
}

body[data-page="home"] .chat-composer .search-row input {
  height: 60px;
  font-size: 17px;
  padding-left: 1.1rem;
}

body[data-page="home"] .search-go {
  width: 48px;
  height: 48px;
}

body[data-page="home"] .search-go svg {
  width: 20px;
  height: 20px;
}

body[data-page="home"] .chat-composer[data-submitting="1"] .search-go {
  pointer-events: none;
  opacity: 0.85;
}

body[data-page="home"] .chat-composer .search-keys {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
  padding: 0;
  border-top: 0;
}

body[data-page="home"] .chat-composer .keys-label {
  flex: 0 0 auto;
  padding: 0;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  line-height: 1.3;
  color: var(--ink-soft);
}

body[data-page="home"] .chat-composer .keys {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  width: auto;
  flex: 0 0 auto;
}

body[data-page="home"] .chat-composer .key {
  box-sizing: border-box;
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  border-radius: 10px;
  font-size: 20px;
  background: #EAE2D3;
  transition: background 140ms ease-out, border-color 140ms ease-out, color 140ms ease-out, transform 80ms ease-out;
}

body[data-page="home"] .chat-composer .key:active {
  transform: scale(0.96);
}

body[data-page="home"] .chat-card-stage {
  padding: 24px 32px 0;
}

body[data-page="home"] .chat-examples-label {
  margin: 0 0 8px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: #756D62;
}

body[data-page="home"] .chat-examples {
  gap: 8px;
}

body[data-page="home"] .chat-examples a {
  min-height: 0;
  min-width: 0;
  padding: 7px 12px;
  font-size: 14px;
  font-family: var(--serif);
  background: transparent;
  border: 1px solid #DDD2BF;
  border-radius: 999px;
  transition: background 140ms ease-out, border-color 140ms ease-out, color 140ms ease-out;
}

body[data-page="home"] .chat-examples a:hover {
  background: #F0E9DC;
  color: var(--ink);
  border-color: #DDD2BF;
}

body[data-page="home"] .recent {
  margin-top: 24px;
  padding: 16px 32px 28px;
  border-top: 1px solid var(--line);
}

body[data-page="home"] .recent-head {
  min-height: 0;
  margin-bottom: 8px;
}

body[data-page="home"] .recent-head .section-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

body[data-page="home"] .recent-clear {
  width: 32px;
  height: 32px;
  color: var(--ink-faint);
}

body[data-page="home"] .recent-chip {
  min-height: 0;
  min-width: 0;
  padding: 5px 10px;
  font-size: 13px;
  background: transparent;
  border: 1px solid var(--line);
}

body[data-page="home"] .hero {
  margin-top: 112px;
  padding: 0 0 4rem;
}

body[data-page="home"] .hero h1 {
  margin-top: 1.25rem;
  font-size: clamp(48px, 5vw, 72px);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.03em;
}

/* Cobalt and dark palettes: keep contrast, drop paper-only hex fills. */
html[data-theme="dark"] body[data-page="home"] .chat-composer .search-row,
html[data-palette="cobalt"] body[data-page="home"] .chat-composer .search-row {
  border-color: var(--line-strong);
  background: var(--bg);
}

html[data-theme="dark"] body[data-page="home"] .chat-composer .search-row:focus-within,
html[data-palette="cobalt"] body[data-page="home"] .chat-composer .search-row:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 35%, transparent);
}

html[data-theme="dark"] body[data-page="home"] .chat-composer .key,
html[data-palette="cobalt"] body[data-page="home"] .chat-composer .key {
  background: var(--sunken);
}

html[data-theme="dark"] body[data-page="home"] .chat-examples a,
html[data-palette="cobalt"] body[data-page="home"] .chat-examples a {
  border-color: var(--line-strong);
}

html[data-theme="dark"] body[data-page="home"] .chat-examples a:hover,
html[data-palette="cobalt"] body[data-page="home"] .chat-examples a:hover {
  background: var(--wash);
}

html[data-theme="dark"] body[data-page="home"] .chat-examples-label,
html[data-palette="cobalt"] body[data-page="home"] .chat-examples-label {
  color: var(--ink-soft);
}

@media (max-width: 640px) {
  body[data-page="home"] .wrap {
    width: calc(100% - 32px);
  }

  body[data-page="home"] .home-chat {
    padding-top: 0.35rem;
  }

  body[data-page="home"] .chat-card {
    width: 100%;
    max-width: none;
  }

  body[data-page="home"] .chat-card-head {
    padding: 20px 20px 0;
  }

  body[data-page="home"] .chat-card-head h2,
  body[data-page="home"] #chat-title {
    font-size: 32px;
  }

  body[data-page="home"] .chat-card-lede {
    margin-top: 8px;
    font-size: 15px;
    line-height: 1.5;
  }

  body[data-page="home"] .chat-composer {
    padding: 20px 20px 0;
  }

  body[data-page="home"] .chat-composer .search-row,
  body[data-page="home"] .chat-composer .search-row input {
    height: 56px;
  }

  body[data-page="home"] .chat-composer .search-keys {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  body[data-page="home"] .chat-composer .keys {
    width: 100%;
    justify-content: space-between;
  }

  body[data-page="home"] .chat-composer .key {
    flex: 0 0 44px;
  }

  body[data-page="home"] .chat-card-stage {
    padding: 20px 20px 0;
  }

  body[data-page="home"] .chat-examples {
    flex-wrap: nowrap;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scrollbar-width: thin;
    padding-bottom: 2px;
    -webkit-overflow-scrolling: touch;
  }

  body[data-page="home"] .chat-examples a {
    flex: 0 0 auto;
    min-height: 44px;
  }

  body[data-page="home"] .recent {
    margin-top: 20px;
    padding: 16px 20px 20px;
  }

  body[data-page="home"] .hero {
    margin-top: 72px;
    padding-bottom: 3rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  body[data-page="home"] .chat-composer .search-row,
  body[data-page="home"] .chat-composer .key,
  body[data-page="home"] .chat-examples a,
  body[data-page="home"] .search-go {
    transition: none !important;
  }
  body[data-page="home"] .chat-composer .key:active,
  body[data-page="home"] .search-go:active {
    transform: none;
  }
}

/* Home: one search-led hero, a language index, then the tools. */
body[data-page="home"] main.wrap { width: min(calc(100% - 48px), 1080px); }
body[data-page="home"] .home-chat {
  padding: 64px 0 0 !important;
  scroll-margin-top: 96px;
}
body[data-page="home"] .chat-card {
  margin: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
body[data-page="home"] .chat-card-head { padding: 0; }
body[data-page="home"] #chat-title {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(44px, 5.2vw, 76px);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.025em;
}
body[data-page="home"] #chat-title em { color: var(--accent); font-style: normal; }
body[data-page="home"] .chat-card-lede { margin-top: 16px; }
body[data-page="home"] .chat-composer { padding: 24px 0 0; }
body[data-page="home"] .chat-card-stage { padding: 24px 0 0; }
body[data-page="home"] .recent { padding: 16px 0 0; }
body[data-page="home"] .home-languages,
body[data-page="home"] .purpose { margin-top: 80px; padding-top: 32px !important; border-top: 1px solid var(--line); scroll-margin-top: 96px; }
body[data-page="home"] .home-languages h2,
body[data-page="home"] .purpose h2 { margin: 0; font: 600 clamp(32px, 3vw, 44px)/1.15 var(--serif); letter-spacing: -0.025em; }
body[data-page="home"] .language-index {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 32px;
  list-style: none; margin: 32px 0 0; padding: 0;
  font-family: "Noto Sans Sakha", "Noto Sans Yakut", "Noto Sans", sans-serif;
}
body[data-page="home"] .language-index a {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  min-height: 56px; border-bottom: 1px solid var(--line); text-decoration: none;
  font-size: clamp(17px, 1.6vw, 21px); transition: color 140ms ease-out;
}
body[data-page="home"] .language-index a:hover { color: var(--accent); }
body[data-page="home"] .language-index a span { color: var(--ink-faint); font-size: 14px; }
body[data-page="home"] .language-links { display: flex; flex-wrap: wrap; gap: 12px 24px; margin-top: 24px; }
body[data-page="home"] .language-links a { color: var(--ink-soft); font-size: 14px; }
body[data-page="home"] .purpose { display: block; }
body[data-page="home"] .purpose-copy > p { margin-top: 16px; }
body[data-page="home"] .explore {
  width: 100%; grid-template-columns: 220px minmax(0, 1fr); gap: 32px;
  padding-block: 32px 0 !important; margin-top: 32px; border-top: 0;
}
body[data-page="home"] .explore:last-of-type { padding-bottom: 80px !important; }
body[data-page="home"] .explore > .section-label { font-size: 11px; letter-spacing: 0.04em; color: var(--ink-soft); }
body[data-page="home"] .word-cards { display: block; }
body[data-page="home"] .word-card {
  display: grid; grid-template-columns: minmax(100px, 1fr) 1fr 1fr; align-items: baseline;
  gap: 16px; min-height: 0; padding: 12px 0; border: 0; border-bottom: 1px solid var(--line);
  border-radius: 0; background: transparent;
}
body[data-page="home"] .word-card:hover { background: transparent; }
body[data-page="home"] .word-card-term { margin: 0; }
@media (max-width: 640px) {
  body[data-page="home"] main.wrap { width: calc(100% - 32px); }
  body[data-page="home"] .home-chat { padding-top: 32px !important; }
  body[data-page="home"] #chat-title { font-size: 42px; }
  body[data-page="home"] .chat-card-head { padding: 0; }
  body[data-page="home"] .chat-composer { padding: 24px 0 0; }
  body[data-page="home"] .chat-card-stage { padding: 24px 0 0; }
  body[data-page="home"] .chat-examples { flex-wrap: wrap; overflow: visible; }
  body[data-page="home"] .recent { padding: 16px 0 0; }
  body[data-page="home"] .home-languages, body[data-page="home"] .purpose { margin-top: 72px; }
  body[data-page="home"] .language-index { grid-template-columns: 1fr; margin-top: 24px; }
  body[data-page="home"] .explore { display: block; }
  body[data-page="home"] .explore-body { margin-top: 16px; }
  body[data-page="home"] .word-card { grid-template-columns: minmax(70px, 1fr) 1fr 1fr; gap: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  body[data-page="home"] .language-index a { transition: none; }
}
body[data-page="home"] .recent:not([hidden]) { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
body[data-page="home"] .recent-head { margin: 0; gap: 8px; }
body[data-page="home"] .recent-list { align-items: center; padding: 0; }
body[data-page="home"] .explore:last-of-type { padding-bottom: 0 !important; }

/* Home editorial specimens and attached search. */
body[data-page="home"] #chat-title {
  font-size: clamp(64px, 7.5vw, 108px);
  line-height: .9;
  letter-spacing: -.045em;
}
body[data-page="home"] #chat-title em { display: block; }
body[data-page="home"] .search-field { position: relative; z-index: 4; }
body[data-page="home"] .home-suggestions {
  position: absolute; z-index: 10; top: 100%; left: 0; right: 0;
  margin: 0; padding: 6px 0; list-style: none; background: var(--surface);
  border: 1px solid var(--line); border-radius: 0 0 12px 12px;
  box-shadow: 0 12px 22px rgb(0 0 0 / .1);
}
body[data-page="home"] .home-suggestions[hidden] { display: none; }
body[data-page="home"] .home-suggestions a,
body[data-page="home"] .suggest-empty {
  display: block; padding: 9px 18px; font: 500 17px/1.3 var(--serif);
  text-decoration: none; color: var(--ink);
}
body[data-page="home"] .suggest-empty { color: var(--ink-soft); }
body[data-page="home"] .home-suggestions li[aria-selected="true"],
body[data-page="home"] .home-suggestions li:focus-within,
body[data-page="home"] .home-suggestions li:hover { background: var(--bg); }
body[data-page="home"] .home-suggestions li[aria-selected="true"] a { color: var(--accent); }
body[data-page="home"] .chat-composer .key {
  transition: color var(--dur-1) var(--ease-std), background-color var(--dur-1) var(--ease-std), transform var(--dur-1) var(--ease-std);
}
body[data-page="home"] .chat-composer .key:hover { color: var(--accent); }
body[data-page="home"] .chat-composer .key:active { color: var(--surface); background: var(--accent); transform: scale(.95); }
body[data-page="home"] .home-daily {
  margin-top: 72px; padding: 24px 0 16px; border-top: 1px solid var(--line);
  display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 32px; min-height: 174px;
}
body[data-page="home"] .home-daily h2 { margin: 6px 0 0; font: 500 12px/1.4 var(--sans); color: var(--ink-soft); }
body[data-page="home"] .daily-specimen a { font: 600 clamp(42px, 5.5vw, 76px)/1 var(--serif); letter-spacing: -.035em; color: var(--accent); text-decoration: none; overflow-wrap: anywhere; }
body[data-page="home"] .daily-specimen a:hover { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .12em; }
body[data-page="home"] .daily-specimen p { margin: 10px 0 0; color: var(--ink-soft); }
body[data-page="home"] .home-section-mark {
  display: inline-block; width: 22px; height: 22px; margin: 0;
  background: var(--band-daily-mark);
  -webkit-mask: url('/assets/brand-symbol.svg') center / contain no-repeat;
  mask: url('/assets/brand-symbol.svg') center / contain no-repeat;
}
body[data-page="home"] .language-index a { padding: 12px 0; align-items: center; }
body[data-page="home"] .language-index a .language-name { color: inherit; font-size: inherit; }
body[data-page="home"] .language-name small { display: block; margin-top: 4px; font: 400 12px/1.35 var(--sans); color: var(--ink-soft); }
body[data-page="home"] .language-index a:hover, body[data-page="home"] .language-index a:focus-visible { color: var(--accent); }
body[data-page="home"] .purpose { padding-top: 48px !important; }
body[data-page="home"] .purpose h2 { font-size: clamp(45px, 6vw, 76px); }
body[data-page="home"] .home-languages h2, body[data-page="home"] .purpose h2, body[data-page="home"] .explore > h2 { transition: color var(--dur-3) var(--ease-std), transform var(--dur-3) var(--ease-std); }
body[data-page="home"] .is-current > h2, body[data-page="home"] .purpose.is-current h2 { color: var(--accent); transform: translateX(8px); }
@media (max-width: 640px) {
  body[data-page="home"] #chat-title { font-size: clamp(62px, 18vw, 82px); }
  body[data-page="home"] .home-daily { display: block; margin-top: 56px; min-height: 166px; }
  body[data-page="home"] .home-daily h2 { margin-bottom: 16px; }
  body[data-page="home"] .home-languages { margin-top: 24px; }
}
@media (prefers-reduced-motion: reduce) {
  body[data-page="home"] .chat-composer .key:active { transform: none; }
  body[data-page="home"] .home-languages h2, body[data-page="home"] .purpose h2, body[data-page="home"] .explore > h2 { transition: none; }
}
/* Keep the letter keys reachable while the attached suggestion panel is open. */
body[data-page="home"] .chat-composer { display: flex; flex-direction: column; }
body[data-page="home"] .chat-composer .search-keys { margin: 0 0 12px; }

/* Birch, night and ochre: home specimens and shared closing navigation. */
body[data-page="home"] .home-chat { position: relative; }
body[data-page="home"] .home-daily { border-color: var(--line-strong); }
body[data-page="home"] .home-daily h2,
body[data-page="home"] .language-code { color: var(--ochre); }
body[data-page="home"] .home-languages { border-top: 0; }
body[data-page="home"] .home-languages h2 { font-size: clamp(46px, 6vw, 76px); }
body[data-page="home"] .language-index {
  grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 36px;
  border-top: 1px solid var(--line-strong); margin-top: 36px;
}
body[data-page="home"] .language-index li { min-width: 0; }
body[data-page="home"] .language-index a {
  min-height: 128px; padding: 18px 0; gap: 20px;
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: center; border-bottom: 1px solid var(--line-strong);
}
body[data-page="home"] .language-meta { display: flex; gap: 16px; align-items: start; min-width: 0; }
body[data-page="home"] .language-code { font: 600 10px/1.5 var(--sans); letter-spacing: .08em; padding-top: 5px; }
body[data-page="home"] .language-index a .language-name { font: 500 clamp(16px, 1.3vw, 20px)/1.25 var(--sans); }
body[data-page="home"] .language-name small { color: var(--ink-soft); }
body[data-page="home"] .language-index a .language-specimen {
  justify-self: end; max-width: 100%; text-align: right; overflow-wrap: anywhere;
  font: 500 clamp(25px, 3vw, 40px)/1.12 var(--serif);
  letter-spacing: -.04em; color: var(--ochre);
  transition: color var(--dur-2) var(--ease-std);
}
body[data-page="home"] .language-index a:hover .language-specimen,
body[data-page="home"] .language-index a:focus-visible .language-specimen { color: var(--accent); }
body[data-page="home"] .language-links { margin-top: 28px; }
body[data-page="home"] .language-links a { color: var(--accent); font-weight: 600; }
body[data-page="home"] .purpose {
  margin-top: 100px; padding: clamp(30px, 5vw, 64px) !important;
  border: 0; border-left: 5px solid var(--ochre); background: var(--sunken);
}
body[data-page="home"] .purpose h2 { font-size: clamp(54px, 7vw, 96px); }
body[data-page="home"] .purpose-copy > p { max-width: 34rem; font-size: clamp(18px, 2vw, 23px); }
body[data-page="home"] .word-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 3px; }
body[data-page="home"] .word-cards li { min-width: 0; }
body[data-page="home"] .word-card {
  display: flex; flex-direction: column; align-items: flex-start; justify-content: flex-end;
  gap: 8px; min-height: 210px; padding: clamp(20px, 2vw, 30px); border: 0;
  background: var(--sunken); color: var(--ink); text-decoration: none;
}
body[data-page="home"] .word-cards li:nth-child(2) .word-card { background: var(--surface); }
body[data-page="home"] .word-card:hover { background: var(--wash); }
body[data-page="home"] .word-card-term { margin: 0 0 auto; color: var(--accent); font: 600 clamp(44px, 5vw, 68px)/1 var(--serif); letter-spacing: -.04em; }
body[data-page="home"] .word-card-gloss { font-size: 14px; line-height: 1.3; }
body[data-page="home"] .explore[aria-labelledby="explore-intents"] .intent-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; }
body[data-page="home"] .intent-cards li:first-child { grid-column: 1 / -1; }
body[data-page="home"] .intent-card {
  min-height: 150px; padding: 24px; border: 0; border-top: 3px solid var(--ochre);
  border-radius: 0; background: var(--surface);
}
body[data-page="home"] .intent-cards li:first-child .intent-card { background: var(--sunken); min-height: 170px; }
body[data-page="home"] .intent-title { font-size: clamp(24px, 2.5vw, 36px); }
body[data-page="home"] .intent-dir { margin-top: 14px; color: var(--ochre); font-size: 12px; font-weight: 600; letter-spacing: .05em; }
body[data-page="home"] .game-promo { display: block; width: 100%; margin: 80px 0 0 !important; }
body[data-page="home"] .game-promo-link {
  max-width: none; min-height: 220px; padding: clamp(24px, 4vw, 48px);
  border: 1px solid var(--line-strong); border-left: 6px solid var(--ochre); border-radius: 0;
  background: var(--surface); color: var(--ink);
  grid-template-columns: auto minmax(0, 1fr) auto; gap: 24px;
}
body[data-page="home"] .game-promo-link:hover { color: var(--ink); border-color: var(--ochre); }
body[data-page="home"] .game-promo-logo img { width: 88px; height: 88px; border-radius: 50%; }
body[data-page="home"] .game-promo-name { color: var(--ochre); font-weight: 600; }
body[data-page="home"] .game-promo-invite { font-size: clamp(22px, 3vw, 35px); }
body[data-page="home"] .game-promo-cta { border-color: var(--accent); color: var(--accent); }
body[data-page="home"] .game-promo-link:hover .game-promo-cta { background: var(--accent); color: var(--on-accent); }
.foot { margin-top: clamp(64px, 8vw, 120px); background: var(--footer-bg); color: var(--footer-ink); }
.foot .foot-panel { border: 0; padding: clamp(40px, 6vw, 80px) 0 28px; color: var(--footer-ink); }
.foot .foot-brand { align-items: center; gap: 20px; padding-bottom: clamp(36px, 5vw, 64px); border-bottom: 1px solid var(--footer-soft); }
.foot .foot-brand .brand-mark { width: 42px; height: 42px; margin: 0; background-color: var(--footer-accent); }
.foot .foot-wordmark { color: var(--footer-ink); font: 500 clamp(48px, 8vw, 112px)/1 var(--serif); letter-spacing: -.05em; text-decoration: none; overflow-wrap: anywhere; }
.foot .foot-navigation { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 32px 20px; padding: 40px 0 48px; }
.foot .foot-group { min-width: 0; display: flex; flex-direction: column; align-items: flex-start; }
.foot .foot-group h2 { margin: 0 0 14px; color: var(--footer-accent); font: 600 12px/1.4 var(--sans); }
.foot .foot-group a, .foot .foot-locales a { color: var(--footer-ink); text-decoration: none; font: 400 14px/1.35 var(--sans); min-height: 44px; display: inline-flex; align-items: center; padding: 8px 0; overflow-wrap: anywhere; }
.foot .foot-group a:hover, .foot .foot-locales a:hover { text-decoration: underline; text-underline-offset: 4px; }
.foot .foot-group a:focus-visible, .foot .foot-locales a:focus-visible, .foot .foot-wordmark:focus-visible { outline: 2px solid var(--footer-accent); outline-offset: 3px; }
.foot .foot-bottom { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; border-top: 1px solid var(--footer-soft); padding-top: 20px; color: var(--footer-soft); }
.foot .foot-copy { margin: 0; }
.foot .foot-locales { display: flex; flex-wrap: wrap; gap: 0 22px; }
.foot .foot-locales a[aria-current="page"] { color: var(--footer-accent); text-decoration: underline; text-underline-offset: 4px; }
@media (max-width: 640px) {
  body[data-page="home"] .language-index { grid-template-columns: 1fr; }
  body[data-page="home"] .language-index a { min-height: 106px; }
  body[data-page="home"] .purpose { margin-top: 72px; padding: 28px 24px !important; }
  body[data-page="home"] .word-cards { grid-template-columns: 1fr; }
  body[data-page="home"] .word-card { min-height: 145px; }
  body[data-page="home"] .explore[aria-labelledby="explore-intents"] .intent-cards { grid-template-columns: 1fr; }
  body[data-page="home"] .intent-cards li:first-child { grid-column: auto; }
  body[data-page="home"] .game-promo-link { grid-template-columns: auto minmax(0, 1fr); gap: 16px; }
  body[data-page="home"] .game-promo-logo img { width: 64px; height: 64px; }
  body[data-page="home"] .game-promo-cta { grid-column: 2; justify-self: start; }
  .foot .foot-navigation { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .foot .foot-brand .brand-mark { width: 32px; height: 32px; }
}
@media (prefers-reduced-motion: reduce) {
  body[data-page="home"] .language-specimen { transition: none !important; }
}

/* Word-page discovery: a separate, touch-friendly surface. */
.entry .related {
  margin-block: 3rem 0;
  padding: clamp(1.25rem, 4vw, 2.5rem);
  background: var(--sunken);
  border: 1px solid var(--line);
  border-radius: 1rem;
}
.entry .related .section-head { margin-bottom: 1.5rem; }
.related-group + .related-group { margin-top: 1.75rem; }
.related-group h3 { margin: 0 0 .75rem; color: var(--ink); font: 600 .875rem/1.4 var(--sans); }
.entry .related-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr)); gap: .75rem; max-width: none; margin: 0; padding: 0; list-style: none; }
.entry .related-list li { min-width: 0; }
.entry .related-list li a, .entry .related-list li:first-child a, .entry .related-list li:nth-child(2) a {
  display: flex; flex-direction: column; justify-content: center; min-height: 5rem; height: 100%; padding: 1rem;
  border: 1px solid var(--line); border-radius: .7rem; background: var(--surface); text-decoration: none; overflow-wrap: anywhere;
}
.entry .related-list a:hover { border-color: var(--accent); }
.entry .related-list a:focus-visible, .word-bottom-nav a:focus-visible, .word-panel-close:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.related-word mark { color: var(--accent); background: transparent; }
.word-bottom-nav { margin-block: 1.5rem 3rem; border-block: 1px solid var(--line); }
.word-neighbors { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; padding-block: 1rem; }
.word-neighbors a { min-height: 44px; display: flex; flex-direction: column; gap: .25rem; text-decoration: none; overflow-wrap: anywhere; }
.word-neighbors a:last-child:nth-child(2) { text-align: right; }
.word-neighbors span { font-size: .8rem; color: var(--ink); }
.word-neighbors strong { color: var(--accent); }
.word-bottom-nav .back { display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; margin: 0; padding: .5rem 0; border: 0; }
.word-bottom-nav .back a { display: inline-flex; align-items: center; min-height: 44px; }
.word-panel-layer[hidden] { display: none; }
.word-panel-layer { position: fixed; inset: 0; z-index: 1000; }
.word-panel-scrim { position: absolute; inset: 0; background: var(--ink); opacity: .5; }
.word-panel { position: absolute; inset: 0 auto 0 0; width: min(42rem, 90vw); display: flex; flex-direction: column; background: var(--surface); color: var(--ink); box-shadow: var(--shadow-popover); animation: word-panel-in .2s ease-out; }
.word-panel-bar { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .5rem 1rem; border-bottom: 1px solid var(--line); }
.word-panel-bar span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.word-panel-close { min-width: 44px; min-height: 44px; border: 1px solid var(--line); border-radius: .5rem; background: var(--surface); color: var(--ink); font-size: 1.5rem; cursor: pointer; }
.word-panel-content { overflow: auto; overscroll-behavior: contain; padding: clamp(1rem, 4vw, 2rem); }
.word-panel-content .entry { margin: 0; }
.word-panel-open { overflow: hidden; }
@keyframes word-panel-in { from { transform: translateX(-100%); } to { transform: translateX(0); } }
@media (max-width: 700px) {
  .word-panel { inset: auto 0 0; width: 100%; height: min(88dvh, 60rem); border-radius: 1rem 1rem 0 0; animation-name: word-sheet-in; }
  @keyframes word-sheet-in { from { transform: translateY(100%); } to { transform: translateY(0); } }
}
@media (prefers-reduced-motion: reduce) { .word-panel { animation: none; } }

/* Full-bleed colour bands between home sections (t312). */
body[data-page="home"] { overflow-x: clip; }
body[data-page="home"] .home-daily,
body[data-page="home"] .home-languages {
  box-sizing: border-box;
  width: 100vw;
  max-width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  padding-left: max(24px, calc(50vw - 50%));
  padding-right: max(24px, calc(50vw - 50%));
  padding-top: clamp(2rem, 5vw, 3.25rem);
  padding-bottom: clamp(2rem, 5vw, 3.25rem);
  border-top: 0;
}
body[data-page="home"] .home-daily {
  margin-top: 2.75rem;
  background: var(--band-daily);
  color: var(--band-daily-ink);
}
body[data-page="home"] .home-daily h2 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 6px 0 0;
  color: var(--band-daily-soft);
}
body[data-page="home"] .daily-specimen a { color: var(--band-daily-accent); }
body[data-page="home"] .daily-specimen p { color: var(--band-daily-soft); }
body[data-page="home"] .home-languages {
  margin-top: 0;
  background: var(--sunken);
}
@media (max-width: 640px) {
  body[data-page="home"] .home-daily { margin-top: 2rem; }
  body[data-page="home"] .home-languages { margin-top: 0; }
}
