:root {
  --paper: #f7f8fa;
  --ink: #1f2a6b;
  --yellow: #ffd93d;
  --red: #d6342c;
  --green: #17724a;
  --line: #d9dce3;
  --white: #fff;
  --tint: rgba(31, 42, 107, 0.06);
  --field: rgba(31, 42, 107, 0.55);
  --on-ink-line: rgba(247, 248, 250, 0.3);
  --sans: "Noto Sans", "Noto Sans Arabic", "Noto Sans Ethiopic", sans-serif;
  --serif: "Noto Serif", "Noto Naskh Arabic", "Noto Serif Ethiopic", Georgia, serif;
  --header: 4.25rem;
  --pad: 1.25rem;
}

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

[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.6;
}

body.menu-open { overflow: hidden; }

img { max-width: 100%; height: auto; }
svg { display: inline-block; }

p, li, dd { max-width: 68ch; }

h1, h2, h3, h4 {
  font-family: var(--sans);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.12;
  margin: 0 0 0.6rem;
}

h1 { font-size: clamp(2.05rem, 4.6vw, 3.6rem); max-width: 18ch; letter-spacing: -0.04em; }
h2 { font-size: clamp(1.6rem, 3vw, 2.3rem); max-width: 24ch; }
h3 { font-size: 1.3rem; }
h4 { font-size: 1.15rem; }

a { color: inherit; text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }

:focus { outline: none; }

:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 3px;
}

.site-header :focus-visible,
.band :focus-visible,
.ink-section :focus-visible,
.choice-ink :focus-visible,
.site-footer :focus-visible,
.whatsapp-float:focus-visible {
  outline-color: var(--paper);
}

/* Keep anything that receives focus or is jumped to clear of the sticky header. */
[id], input, select, textarea, button, a, summary, .error-summary {
  scroll-margin-top: calc(var(--header) + 1rem);
}

form[data-form] [id],
form[data-form] input,
form[data-form] select,
form[data-form] textarea,
form[data-form] button,
form[data-form] .field,
form[data-form] fieldset,
form[data-form] .lang-row {
  scroll-margin-top: calc(var(--header) + 5rem);
}

.skip {
  position: absolute;
  left: 0.75rem;
  top: -4rem;
  z-index: 40;
  background: var(--paper);
  color: var(--ink);
  padding: 0.5rem 0.8rem;
  text-decoration: underline;
}

.skip:focus { top: 0.5rem; }

/* Header */

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--ink);
  color: #fff;
  border-bottom: 1px solid transparent;
}

.site-header.is-scrolled { border-bottom-color: rgba(247, 248, 250, 0.45); }

.header-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: var(--header);
  padding: 0.4rem var(--pad);
  max-width: 78rem;
  margin: 0 auto;
}

.brand {
  display: flex;
  align-items: center;
  margin-inline-end: auto;
}

.brand img { height: 44px; width: auto; max-width: 46vw; display: block; }

.menu-button,
.close-button,
.button,
button,
summary {
  font-family: var(--sans);
  font-size: 1rem;
  letter-spacing: -0.02em;
}

.menu-button,
.close-button {
  flex-shrink: 0;
  min-height: 44px;
  min-width: 44px;
  padding: 0.4rem 0.7rem;
  background: transparent;
  color: #fff;
  border: 1px solid rgba(247, 248, 250, 0.5);
  cursor: pointer;
}

.menu-button:hover,
.close-button:hover { background: rgba(247, 248, 250, 0.14); }

.nav-wrap { display: none; }

.nav-wrap.is-open {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  position: fixed;
  inset: 0;
  z-index: 35;
  background: var(--ink);
  color: #fff;
  padding: 1rem var(--pad) 2rem;
  overflow: auto;
}

.nav-links {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin: 0;
  padding: 0;
  list-style: none;
  font-family: var(--sans);
}

.nav-links li { max-width: none; }

.nav-links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  text-decoration: none;
  border-bottom: 2px solid transparent;
}

.nav-links a:hover { border-bottom-color: rgba(247, 248, 250, 0.55); }
.nav-links a[aria-current="page"] { border-bottom-color: #fff; }

.lang-switch {
  display: flex;
  gap: 0.35rem;
  align-items: center;
  min-height: 44px;
  font-family: var(--sans);
}

.lang-switch a,
.lang-switch [aria-current="true"] {
  color: inherit;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 0.4rem;
}

.lang-switch [aria-current="true"] { font-weight: 700; text-decoration: underline; }

.lang-switch ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.lang-list ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.15rem 0.75rem;
  align-items: center;
}

.lang-menu {
  position: relative;
}

.lang-menu > summary {
  list-style: none;
  cursor: pointer;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.35rem 0.75rem;
  border: 1px solid rgba(247, 248, 250, 0.55);
  background: transparent;
  color: #fff;
  font-family: var(--sans);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.lang-menu > summary::-webkit-details-marker,
.lang-menu > summary::marker { display: none; content: ""; }

.lang-menu > summary .lang-globe {
  width: 1.05rem;
  height: 1.05rem;
  flex-shrink: 0;
  opacity: 0.9;
}

.lang-menu > summary .lang-name { line-height: 1; }

.lang-menu > summary .lang-chevron {
  width: 0.55rem;
  height: 0.55rem;
  flex-shrink: 0;
  border-inline-end: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translateY(-0.12rem);
  opacity: 0.85;
}

.lang-menu[open] > summary .lang-chevron {
  transform: rotate(225deg) translateY(-0.12rem);
}

.lang-menu > summary:hover,
.lang-menu[open] > summary {
  background: rgba(247, 248, 250, 0.14);
}

.lang-menu > ul {
  position: absolute;
  inset-inline-end: 0;
  top: calc(100% + 0.4rem);
  z-index: 40;
  min-width: 12rem;
  margin: 0;
  padding: 0.4rem;
  background: var(--ink);
  border: 1px solid rgba(247, 248, 250, 0.45);
}

.lang-menu > ul a,
.lang-menu > ul [aria-current="true"] {
  display: flex;
  width: 100%;
  min-height: 44px;
  padding: 0.4rem 0.75rem;
  text-decoration: none;
  border: 0;
  font-weight: 400;
}

.lang-menu > ul [aria-current="true"] {
  font-weight: 700;
  background: rgba(247, 248, 250, 0.12);
}

.lang-menu > ul a:hover { background: rgba(247, 248, 250, 0.14); }

.nav-wrap.is-open .lang-menu {
  align-self: stretch;
}

.nav-wrap.is-open .lang-menu > summary {
  width: 100%;
  justify-content: space-between;
}

.nav-wrap.is-open .lang-menu > ul {
  position: static;
  inset: auto;
  margin-top: 0.4rem;
  width: 100%;
}

/* Buttons and links */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0.6rem 1.15rem;
  border: 2px solid var(--ink);
  background: var(--ink);
  color: #fff;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  line-height: 1.2;
}

.button:hover { background: var(--white); color: var(--ink); }

.button-secondary {
  background: transparent;
  color: var(--ink);
}

.button-secondary:hover,
.button[aria-pressed="true"] { background: var(--ink); color: #fff; }

.site-header .button,
.band .button {
  background: var(--paper);
  color: var(--ink);
  border-color: var(--paper);
}

.site-header .button { min-height: 44px; padding: 0.5rem 1rem; }

.site-header .button:hover,
.band .button:hover {
  background: transparent;
  color: #fff;
}

.button:disabled,
.button[aria-disabled="true"] {
  cursor: wait;
  opacity: 0.7;
}

.text-link { color: inherit; }

.go::after { content: "\2192"; display: inline-block; margin-inline-start: 0.35em; }
[dir="rtl"] .go::after { content: "\2190"; }

/* A link that makes its whole block clickable. */
.stretched::before {
  content: "";
  position: absolute;
  inset: 0;
}

.lang-banner {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  align-items: center;
  padding: 0.7rem var(--pad);
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.lang-banner p { margin: 0; }

.lang-banner button {
  min-height: 44px;
  background: transparent;
  border: 0;
  color: var(--ink);
  text-decoration: underline;
  cursor: pointer;
  font-family: var(--serif);
  font-size: 1rem;
}

/* Page frame */

main { padding: 0; }

.wrap {
  max-width: 78rem;
  margin: 0 auto;
  padding-inline: var(--pad);
}

.lede {
  font-size: 1.2rem;
  line-height: 1.55;
  margin: 0 0 1.25rem;
  max-width: 58ch;
}

.hero-actions { display: flex; flex-wrap: wrap; gap: 0.6rem; margin: 1.25rem 0 0; }

.split > *,
.choices > *,
.footer-grid > *,
.header-bar > *,
.hero-grid > *,
.section > *,
.doc > * { min-width: 0; }

.hero,
.page-head {
  background-color: var(--paper);
  border-bottom: 1px solid var(--line);
}

.hero { padding: 2rem 0 2.75rem; }

.hero-grid { display: grid; gap: 2rem; }

.hero h1 { margin-bottom: 1.1rem; line-height: 1.22; }

/* Hand-drawn underline beneath a phrase or a page title. */
.scribble { position: relative; white-space: nowrap; }

.scribble svg {
  position: absolute;
  left: -2%;
  bottom: -0.16em;
  width: 104%;
  height: 0.24em;
  overflow: visible;
}

.page-head { padding: 2.25rem 0 2rem; }
.page-head h1 { margin-bottom: 0.5rem; }
.page-head .lede { margin-bottom: 0; }
.page-head .lede + * { margin-top: 1.25rem; }

.title-rule {
  display: block;
  width: 6.5rem;
  height: 0.7rem;
  margin: 0 0 1.1rem;
  overflow: visible;
}

/* Sections on the home page: a text column and a margin for notes. */

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

.sheet > .section:first-child { border-top: 0; }

.section-main > :last-child,
.mnote > :last-child { margin-bottom: 0; }

.section h2 { margin-bottom: 1.25rem; }

.mnote {
  margin-top: 1.5rem;
  padding-block: 0.1rem;
  padding-inline: 1rem 0;
  border-inline-start: 3px solid var(--ink);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.5;
}

.mnote:empty { display: none; }
.mnote p { margin: 0 0 0.6rem; }
.mnote ul { margin: 0 0 0.75rem; padding: 0; list-style: none; }
.mnote li { padding: 0.3rem 0; border-top: 1px solid var(--line); }
.mnote li:last-child { border-bottom: 1px solid var(--line); }
.mnote-title { font-weight: 700; }
.mnote-arrow { display: none; }
.mnote a { display: inline-flex; align-items: center; min-height: 44px; }

.status-line { margin: 0; }

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

.stack > * + * { border-top: 1px solid var(--line); }
.stack > * { padding: 1rem 0; margin: 0; }
.stack h3 { margin-bottom: 0.35rem; }

/* Two blocks side by side that are links as a whole. */

.choices { display: grid; gap: 1rem; }

.choice {
  position: relative;
  padding: 1.4rem 1.4rem 1.2rem;
  border: 1px solid var(--line);
  background: var(--white);
}

.choice h3 { font-size: 1.5rem; margin-bottom: 0.5rem; }
.choice p { margin: 0 0 0.9rem; }
.choice p:last-child { margin-bottom: 0; }
.choice .go { font-family: var(--sans); font-weight: 600; }
.choice:hover { border-color: var(--ink); }
.choice:hover .go { text-decoration-thickness: 2px; }

.choice-ink {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}

.choice-ink:hover { border-color: var(--ink); background: #18225a; }

/* Rows: one service per row, with a hand-drawn mark. */

.rows { margin: 0 0 1.5rem; padding: 0; list-style: none; border-bottom: 1px solid var(--line); }

.row {
  position: relative;
  display: grid;
  grid-template-columns: 2.6rem minmax(0, 1fr);
  gap: 0.25rem 1rem;
  max-width: none;
  padding: 1.25rem 0.75rem 1.25rem 0.5rem;
  border-top: 1px solid var(--line);
}

.row:hover { background: var(--white); }
.row-mark { grid-row: 1 / span 3; padding-top: 0.15rem; }
.row-mark svg { width: 2.3rem; height: 2.3rem; }
.row h3, .row p { grid-column: 2; margin: 0; }
.row p + p { margin-top: 0.35rem; }
.row .go { font-family: var(--sans); font-weight: 600; }

.tag {
  font-family: var(--sans);
  font-size: 0.95rem;
  font-weight: 600;
  white-space: nowrap;
}

.tag-flag { color: var(--ink); background: var(--yellow); padding: 0 0.3em 0 0.2em; }
.tag-err { color: var(--red); }
.tag-ok { color: var(--green); }

.on-request {
  font-family: var(--sans);
  font-size: 0.95rem;
  font-weight: 400;
  letter-spacing: 0;
  border: 1px solid var(--field);
  padding: 0.1rem 0.45rem;
  white-space: nowrap;
}

/* Ticks and crosses lists. */

.checks { margin: 0 0 1.25rem; padding: 0; list-style: none; display: grid; }

.checks li {
  position: relative;
  max-width: none;
  padding: 0.9rem 0.5rem;
  padding-inline-start: 2.4rem;
  border-top: 1px solid var(--line);
}

.checks li svg {
  position: absolute;
  inset-inline-start: 0.2rem;
  top: 1rem;
  width: 1.5rem;
  height: 1.5rem;
}

.checks { border-bottom: 1px solid var(--line); }

/* Numbered steps, used only for real sequences. */

ol.steps { margin: 0 0 1.5rem; padding: 0; list-style: none; counter-reset: step; }

ol.steps li {
  counter-increment: step;
  position: relative;
  max-width: 44rem;
  padding: 0 0 1.5rem;
  padding-inline-start: 3.6rem;
}

ol.steps li::before {
  content: counter(step);
  position: absolute;
  inset-inline-start: 0;
  top: 0;
  width: 2.4rem;
  height: 2.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--ink);
  background: var(--paper);
  font-family: var(--sans);
  font-weight: 700;
  line-height: 1;
}

ol.steps li::after {
  content: "";
  position: absolute;
  inset-inline-start: calc(1.2rem - 1px);
  top: 2.4rem;
  bottom: 0;
  border-inline-start: 2px solid var(--line);
}

ol.steps li:last-child { padding-bottom: 0; }
ol.steps li:last-child::after { display: none; }

ol.steps li strong {
  display: block;
  font-family: var(--sans);
  font-size: 1.15rem;
  letter-spacing: -0.02em;
  line-height: 1.3;
  padding-top: 0.35rem;
  margin-bottom: 0.15rem;
}

/* The same steps across a dark section. */

.ink-section {
  background: var(--ink);
  color: #fff;
  padding: 3rem 0;
}

.ink-section h2 { margin-bottom: 1.75rem; }

.ink-section ol.steps { margin-bottom: 0; }
.ink-section ol.steps li { padding-inline-start: 0; padding-top: 0; padding-bottom: 1.75rem; }
.ink-section ol.steps li::after { display: none; }

.ink-section ol.steps li::before {
  position: static;
  width: auto;
  height: auto;
  display: block;
  border: 0;
  border-top: 1px solid var(--on-ink-line);
  background: transparent;
  padding-top: 0.8rem;
  font-size: 3rem;
  letter-spacing: -0.04em;
}

.note-box {
  border-inline-start: 3px solid var(--ink);
  padding-block: 0.2rem;
  padding-inline: 1rem 0;
  margin: 1.5rem 0;
  font-family: var(--sans);
}

.note-box p { margin: 0; }

/* Example card */

.sheet-stack { position: relative; }

.eval {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  padding: 1rem 1rem 0.9rem;
}

.eval-kicker {
  font-family: var(--sans);
  font-size: 0.95rem;
  margin: 0 0 0.7rem;
}

.tabs { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-bottom: 1rem; }

.tabs button {
  min-height: 44px;
  padding: 0.35rem 0.8rem;
  border: 1px solid var(--field);
  background: var(--white);
  color: var(--ink);
  cursor: pointer;
  font-family: var(--sans);
}

.tabs button:hover { background: var(--tint); }

.tabs button[aria-selected="true"] {
  border-color: var(--ink);
  background: var(--ink);
  color: #fff;
  font-weight: 600;
}

/* Every language panel sits in the same cell, so the card keeps the height of the tallest one. */
.panel-stack { display: grid; }
.panel-stack > .panel { grid-area: 1 / 1; min-width: 0; }
.panel-stack > .panel[hidden] { display: block !important; visibility: hidden; }

.sheet-grid { display: grid; gap: 1rem; }

.passage { margin: 0; }

.pl {
  font-family: var(--sans);
  font-size: 0.95rem;
  font-weight: 600;
  margin: 0 0 0.15rem;
}

.passage .q,
.passage .a { font-family: var(--sans); margin: 0; }

.passage .q { margin-bottom: 0.9rem; line-height: 1.5; }

.passage .a {
  font-size: 1.3rem;
  line-height: 1.85;
  letter-spacing: -0.01em;
}

.flag {
  color: var(--ink);
  padding: 0.1em 0.2em;
  margin: 0 -0.05em;
  border-radius: 0.2em 0.5em 0.25em 0.45em;
  background: linear-gradient(var(--yellow), var(--yellow)) no-repeat 0 55% / 100% 100%;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

.err { position: relative; color: var(--red); white-space: nowrap; }

.ring {
  position: absolute;
  left: -0.32em;
  top: -0.1em;
  width: calc(100% + 0.54em);
  height: calc(100% + 0.26em);
  overflow: visible;
  pointer-events: none;
}

.ring path { stroke-dasharray: 1; stroke-dashoffset: 0; }

.notes { margin: 0; padding: 0.4rem 0 0; border-top: 1px solid var(--line); position: relative; }
.notes .note { margin: 0.2rem -0.4rem; padding: 0.35rem 0.4rem; }

.mark-svg { width: 1.1rem; height: 1.1rem; vertical-align: -0.15rem; margin-inline-end: 0.2rem; }

/* Pointing at a mark shows which note belongs to it, and the other way round. */
.note.is-hot { background: var(--tint); }
.flag.is-hot { outline: 2px solid var(--ink); outline-offset: 1px; }
.err.is-hot .ring path { stroke-width: 3.5; }

.eval-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  margin-top: 0.9rem;
  padding-top: 0.8rem;
  border-top: 1px solid var(--line);
  min-height: 4.1rem;
}

.eval-status {
  flex: 1 1 12rem;
  min-height: 2.8em;
  display: flex;
  align-items: center;
  margin: 0;
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.4;
}

.eval-foot .button { min-height: 44px; }

/* "Try it yourself": the answer without marks, each word a button. */
.is-quiz .flag { background-size: 0 100%; outline: 0; }
.is-quiz .err { color: inherit; }
.is-quiz .ring { display: none; }
.is-quiz .notes .note { visibility: hidden; }

.quiz-note {
  position: absolute;
  inset-inline: 0;
  top: 0.75rem;
  margin: 0;
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.45;
}

.word {
  font: inherit;
  line-height: 1.2;
  letter-spacing: inherit;
  color: inherit;
  background: transparent;
  border: 0;
  border-bottom: 2px dotted var(--field);
  padding: 0.05em 0.1em;
  margin: 0;
  cursor: pointer;
}

.word:hover { background: var(--tint); border-bottom-color: var(--ink); }
.word.is-miss { border-bottom-style: solid; border-bottom-color: var(--line); text-decoration: line-through; text-decoration-thickness: 1px; }

@media (prefers-reduced-motion: no-preference) {
  .eval:not(.settled) .panel:not([hidden]) .notes .step { animation: appear 0.45s ease both; }
  .eval:not(.settled) .panel:not([hidden]) .flag.step { animation: sweep 0.5s ease-out both; }
  .eval:not(.settled) .panel:not([hidden]) .err.step { animation: redden 0.3s ease both; }
  .eval:not(.settled) .panel:not([hidden]) .err.step .ring path { animation: draw 0.55s ease-out both; }
  .eval:not(.settled) .panel:not([hidden]) .tag-ok path { stroke-dasharray: 1; animation: draw 0.4s ease-out both; }
  .eval:not(.settled) .panel:not([hidden]) .step-2,
  .eval:not(.settled) .panel:not([hidden]) .err.step-2 .ring path { animation-delay: 0.8s; }
  .eval:not(.settled) .panel:not([hidden]) .step-3 { animation-delay: 1.55s; }
  .eval:not(.settled) .panel:not([hidden]) .step-3 .tag-ok path { animation-delay: 1.75s; }

  a, button, .button, .choice, .row, summary, input, select, textarea {
    transition: background-color 0.12s ease, color 0.12s ease, border-color 0.12s ease;
  }
}

@keyframes appear {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes sweep {
  from { background-size: 0 100%; }
  to { background-size: 100% 100%; }
}

@keyframes redden {
  from { color: var(--ink); }
  to { color: var(--red); }
}

@keyframes draw {
  from { stroke-dashoffset: 1; }
  to { stroke-dashoffset: 0; }
}

/* Closing call to action */

.band {
  background: var(--ink);
  color: #fff;
  padding: 3.25rem 0;
}

.band h2 { color: #fff; font-size: clamp(1.9rem, 4.4vw, 3.2rem); max-width: 18ch; margin-bottom: 1.25rem; }
.band p { margin: 0; }
.band a:not(.button) { color: #fff; }
.band-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem 1.25rem; }
.band-actions .text-link { min-height: 44px; display: inline-flex; align-items: center; font-family: var(--sans); }

/* Inner pages: text column plus a margin index that follows the reader. */

.doc { padding-top: 0.5rem; padding-bottom: 4rem; }

.doc-main > h2 {
  max-width: none;
  margin-top: 2.75rem;
  padding-top: 2rem;
  border-top: 1px solid var(--line);
}

.doc-main > :first-child { margin-top: 1.75rem; }
.doc-main > h2:first-child { margin-top: 0; border-top: 0; }
.doc-main > h3 { margin-top: 1.5rem; }
.doc-main > .eval { margin: 2.5rem 0 0; }

.toc { display: none; }

.facts { display: grid; gap: 0; margin: 1.25rem 0 1.5rem; border-bottom: 1px solid var(--line); }
.facts > div { padding: 1rem 0; border-top: 1px solid var(--line); }
.facts h3 { font-size: 1.05rem; margin-bottom: 0.3rem; }
.facts p { margin: 0; }

.plain { padding-top: 2.25rem; padding-bottom: 4rem; }

/* Footer */

.site-footer {
  background: var(--ink);
  color: #fff;
  border-top: 1px solid var(--on-ink-line);
  padding: 2.75rem 0 5rem;
}

.footer-grid { display: grid; gap: 1.5rem; }
.footer-brand img { height: 40px; width: auto; display: block; margin-bottom: 0.9rem; }
.footer-grid p { margin: 0 0 0.6rem; }
.footer-grid ul { list-style: none; margin: 0; padding: 0; }
.footer-grid li { max-width: none; }
.footer-grid a { display: inline-flex; min-height: 44px; align-items: center; }

.footer-grid h2 {
  font-size: 1rem;
  letter-spacing: -0.01em;
  margin-bottom: 0.2rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--on-ink-line);
}

.footer-base {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--on-ink-line);
}

.fine { font-size: 1rem; margin: 0; }

.whatsapp-float {
  position: fixed;
  inset-inline-end: 0.9rem;
  bottom: 0.9rem;
  z-index: 25;
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.9rem;
  background: var(--ink);
  color: #fff;
  text-decoration: none;
  border: 2px solid var(--paper);
  font-family: var(--sans);
  font-weight: 600;
}

.whatsapp-float:hover { background: var(--white); color: var(--ink); border-color: var(--ink); }
.whatsapp-float svg { width: 1.3rem; height: 1.3rem; }
.wa-long { display: none; }

/* Forms */

.split { display: grid; gap: 2rem; padding-top: 2.25rem; padding-bottom: 4rem; }

form { margin: 0; }

form[data-form] {
  background: var(--white);
  border: 1px solid var(--line);
  padding: 0 1.1rem 1.25rem;
}

form[data-form] > .progress[hidden] + * { margin-top: 1.25rem; }

fieldset {
  border: 0;
  margin: 0 0 1.25rem;
  padding: 0;
  min-width: 0;
}

legend { font-family: var(--sans); font-weight: 700; padding: 0; margin-bottom: 0.4rem; }

.field { margin: 0 0 1.25rem; }
label, legend { display: block; }
.field > label, .lang-row label { font-family: var(--sans); font-weight: 600; }
.req { font-family: var(--sans); font-size: 0.95rem; font-weight: 400; }

input, select, textarea {
  width: 100%;
  max-width: 40rem;
  margin-top: 0.35rem;
  padding: 0.6rem 0.7rem;
  border: 1px solid var(--field);
  border-radius: 0;
  background: #fff;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1rem;
  line-height: 1.4;
}

input:hover, select:hover, textarea:hover { border-color: var(--ink); }
input:focus-visible, select:focus-visible, textarea:focus-visible { border-color: var(--ink); outline-offset: 0; }

textarea { min-height: 8rem; resize: vertical; }

.check { display: flex; gap: 0.6rem; align-items: flex-start; min-height: 44px; padding: 0.35rem 0; }
.check input { width: 1.35rem; height: 1.35rem; margin-top: 0.25rem; flex-shrink: 0; accent-color: var(--ink); }
.check label { font-weight: 400; }
label.check { cursor: pointer; }
label.check:hover { background: var(--tint); }

.hint, .field-error, .counter { margin: 0.3rem 0 0; font-size: 1rem; }
.counter { font-family: var(--sans); }
.field-error { color: var(--red); font-family: var(--sans); }
input[aria-invalid="true"],
select[aria-invalid="true"],
textarea[aria-invalid="true"] { border-color: var(--red); border-width: 2px; }

.error-summary {
  border: 2px solid var(--red);
  padding: 0.9rem 1rem;
  margin: 1.25rem 0;
  font-family: var(--sans);
}

.error-summary p { margin: 0; font-weight: 700; }
.error-summary ul { margin: 0.4rem 0 0; padding-inline-start: 1.2rem; }

.form-error { color: var(--red); font-family: var(--sans); }

/* How much of the form is filled; stays in view under the header. */
.progress {
  position: sticky;
  top: var(--header);
  z-index: 5;
  margin: 0 -1.1rem 1.25rem;
  padding: 0.7rem 1.1rem 0.75rem;
  background: var(--white);
  border-bottom: 1px solid var(--line);
  font-family: var(--sans);
}

.progress p { margin: 0 0 0.4rem; font-size: 1rem; }
.progress-bar { display: flex; gap: 3px; }
.progress-bar span { flex: 1; height: 6px; background: var(--line); }
.progress-bar span.is-on { background: var(--ink); }

.lang-row {
  display: grid;
  gap: 0.6rem;
  padding-bottom: 0.8rem;
  margin-bottom: 0.8rem;
  border-bottom: 1px solid var(--line);
}

.lang-row [data-remove] {
  min-height: 44px;
  padding: 0.4rem 0.8rem;
  background: transparent;
  border: 1px solid var(--field);
  color: var(--ink);
  cursor: pointer;
}

.lang-row [data-remove]:hover { background: var(--tint); border-color: var(--ink); }

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

.copied { font-family: var(--sans); min-height: 1.2em; }

.contact-lines { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem 1rem; margin: 0 0 1rem; }
.contact-lines a:not(.button) { display: inline-flex; align-items: center; min-height: 44px; }

/* Questions (FAQ only — do not style the header language menu) */

main details { border-top: 1px solid var(--line); }
main details:last-of-type { border-bottom: 1px solid var(--line); margin-bottom: 1.5rem; }

main details > summary {
  cursor: pointer;
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.5rem 0.6rem 0.5rem 0.5rem;
  font-weight: 700;
  font-size: 1.1rem;
  list-style: none;
}

main details > summary::-webkit-details-marker { display: none; }

main details > summary::after {
  content: "+";
  flex-shrink: 0;
  width: 1.9rem;
  height: 1.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--field);
  font-weight: 400;
  font-size: 1.3rem;
  line-height: 1;
}

main details[open] > summary::after { content: "\2212"; background: var(--ink); border-color: var(--ink); color: #fff; }
main details > summary:hover { background: var(--white); }
main details > p { margin: 0.1rem 0.5rem 1.1rem; }

.aside {
  border-top: 1px solid var(--line);
  padding-top: 1.25rem;
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.5;
}

.aside p { margin: 0 0 0.9rem; }
.aside a { display: inline-flex; align-items: center; min-height: 44px; }

.anchor-links { display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; margin: 0 0 1rem; font-family: var(--sans); }
.anchor-links a { display: inline-flex; align-items: center; min-height: 44px; }

@media (min-width: 700px) {
  :root { --pad: 2rem; }
  .wa-long { display: inline; }
  .choices { grid-template-columns: 1fr 1fr; }
  .checks.checks-2 { grid-template-columns: 1fr 1fr; column-gap: 2rem; }
  .facts { grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: 2rem; }
  .eval { padding: 1.25rem 1.4rem 1rem; }
  .eval-wide .sheet-grid { grid-template-columns: minmax(0, 1fr) minmax(13rem, 0.6fr); gap: 1.5rem; align-items: start; }
  .eval-wide .notes { border-top: 0; border-inline-start: 1px solid var(--line); padding: 0; padding-inline-start: 1.4rem; }
  .eval-wide .quiz-note { inset-inline-start: 1.4rem; top: 0.35rem; }
  .lang-row { grid-template-columns: 1fr 1fr auto; align-items: end; }
  [data-languages] label.check { display: inline-flex; width: 32%; vertical-align: top; }
  .footer-grid { grid-template-columns: 1.5fr repeat(4, 1fr); gap: 2rem; }
  form[data-form] { padding: 0 1.75rem 1.75rem; }
  .progress { margin-inline: -1.75rem; padding-inline: 1.75rem; }
  .ink-section ol.steps { display: grid; grid-template-columns: 1fr 1fr; column-gap: 2rem; }
}

@media (min-width: 900px) {
  .menu-button, .close-button { display: none; }
  .nav-wrap, .nav-wrap.is-open {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 1rem;
    position: static;
    padding: 0;
    overflow: visible;
    background: transparent;
  }
  .nav-links { flex-direction: row; gap: 0.15rem 1.1rem; }
  .header-bar .button { margin-inline-start: 0.4rem; }
  /* Ruled proof paper on the side of the page top that carries no running text. */
  .hero,
  .page-head {
    background-image:
      linear-gradient(to right, var(--paper) 0, var(--paper) 50%, rgba(247, 248, 250, 0) 68%),
      linear-gradient(to bottom, transparent calc(100% - 1px), var(--line) calc(100% - 1px));
    background-size: 100% 100%, 100% 2.4rem;
  }
  [dir="rtl"] .hero,
  [dir="rtl"] .page-head {
    background-image:
      linear-gradient(to left, var(--paper) 0, var(--paper) 50%, rgba(247, 248, 250, 0) 68%),
      linear-gradient(to bottom, transparent calc(100% - 1px), var(--line) calc(100% - 1px));
  }
  .hero { padding: 3.5rem 0 4.25rem; }
  .hero-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1.02fr); gap: 3.5rem; align-items: center; }
  .page-head { padding: 3.25rem 0 2.75rem; }
  .ink-section { padding: 4.25rem 0; }
  .ink-section ol.steps { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .ink-section ol.steps li { padding-bottom: 0; }
  .band { padding: 4.5rem 0; }
  .split { grid-template-columns: minmax(0, 1fr) 17rem; gap: 3rem; align-items: start; }
  .aside {
    position: sticky;
    top: calc(var(--header) + 1.5rem);
    border-top: 0;
    padding: 0;
    padding-inline-start: 1.5rem;
    border-inline-start: 1px solid var(--line);
  }

  /* A second sheet shows behind the example, like a stack of proofs. */
  .sheet-stack { isolation: isolate; }
  .sheet-stack::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--white);
    transform: rotate(-1.8deg) translate(-0.5rem, 0.6rem);
  }
  [dir="rtl"] .sheet-stack::before { transform: rotate(1.8deg) translate(0.5rem, 0.6rem); }
}

@media (min-width: 1000px) {
  .section {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 17rem;
    padding: 0;
  }
  .section > * { padding-top: 3.5rem; padding-bottom: 3.5rem; }
  .section-main { padding-inline-end: 3.5rem; }
  .section-wide .section-main { grid-column: 1 / -1; padding-inline-end: 0; }
  .mnote,
  .mnote:empty {
    display: block;
    margin: 0;
    padding-inline-start: 1.5rem;
    border-inline-start: 1px solid var(--line);
  }
  .section.section-wide .mnote { display: none; }
  .mnote-arrow { display: block; width: 2.6rem; height: 1.3rem; margin: 0.6rem 0 0.5rem -0.2rem; overflow: visible; }
  [dir="rtl"] .mnote-arrow { margin-inline: -0.2rem 0; transform: scaleX(-1); }

  .doc { display: grid; grid-template-columns: minmax(0, 1fr) 15rem; column-gap: 4rem; }
  .toc {
    display: block;
    position: sticky;
    top: calc(var(--header) + 1.5rem);
    align-self: start;
    margin-top: 2rem;
    padding-inline-start: 1.5rem;
    border-inline-start: 1px solid var(--line);
    font-family: var(--sans);
    font-size: 1rem;
    line-height: 1.35;
  }
  .toc p { margin: 0 0 0.4rem; font-weight: 700; }
  .toc ol { margin: 0; padding: 0; list-style: none; }
  .toc a {
    display: flex;
    align-items: center;
    min-height: 44px;
    margin-inline-start: calc(-1.5rem - 2px);
    padding-block: 0.3rem;
    padding-inline: 1.5rem 0;
    border-inline-start: 3px solid transparent;
    text-decoration: none;
  }
  .toc a:hover { text-decoration: underline; }
  .toc a[aria-current] { border-inline-start-color: var(--ink); font-weight: 700; }
}

/* Arabic and other right-to-left pages. */
[dir="rtl"] .skip { left: auto; right: 0.75rem; }
[dir="rtl"] .ring { left: auto; right: -0.32em; }
[dir="rtl"] .quiz-note { left: auto; right: 0; }
[dir="rtl"] .row-mark svg,
[dir="rtl"] .mnote-arrow { transform: scaleX(-1); }
[dir="rtl"] .passage .q,
[dir="rtl"] .passage .a { unicode-bidi: isolate; }

@media (max-width: 599px) {
  .hero-actions { flex-direction: column; align-items: stretch; }
  .hero-actions .button { width: 100%; }
}

@media (max-width: 899px) {
  h1 { max-width: 100%; }
  .brand img { height: 36px; }
  .nav-wrap.is-open .button { align-self: stretch; }
  .nav-links { font-size: 1.25rem; }
}
