/*!
 * Teryaq (ترياق) — website styles. No framework, no build step.
 *
 * Everything the site draws is here: the type, the two colour themes, the
 * page furniture (header, menu, footer), the landing sections, the long-form
 * documents (privacy, account deletion) and the motion. Direction-neutral by
 * construction — margins and paddings are logical (inline-start/-end), so the
 * same rules lay out the Arabic pages right to left and the English pages
 * left to right.
 *
 * Contents
 *   1. Fonts            5. Header & menu      9.  Documents
 *   2. Tokens & themes  6. Buttons & badges   10. Footer, 404
 *   3. Base             7. Landing sections   11. Motion
 *   4. Layout helpers   8. FAQ, CTA, contact  12. Print
 */

/* 1. Fonts ================================================================
 * IBM Plex Sans Arabic, the app's own face, served from this site
 * (tools/make_fonts.py). Split by script: an English page never downloads
 * the Arabic glyphs. */

@font-face {
  font-family: 'IBM Plex Sans Arabic';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/assets/fonts/plex-arabic-400.woff2?v=20260930') format('woff2');
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0898-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC;
}
@font-face {
  font-family: 'IBM Plex Sans Arabic';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/assets/fonts/plex-arabic-600.woff2?v=20260930') format('woff2');
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0898-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC;
}
@font-face {
  font-family: 'IBM Plex Sans Arabic';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/assets/fonts/plex-arabic-700.woff2?v=20260930') format('woff2');
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0898-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC;
}
@font-face {
  font-family: 'IBM Plex Sans Arabic';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/assets/fonts/plex-latin-400.woff2?v=20260930') 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-200B, U+2012-206F, U+2074, U+20AC, U+2122, U+2190-2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'IBM Plex Sans Arabic';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/assets/fonts/plex-latin-600.woff2?v=20260930') 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-200B, U+2012-206F, U+2074, U+20AC, U+2122, U+2190-2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'IBM Plex Sans Arabic';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/assets/fonts/plex-latin-700.woff2?v=20260930') 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-200B, U+2012-206F, U+2074, U+20AC, U+2122, U+2190-2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* 2. Tokens & themes ======================================================
 * The app's own palette (AppPalette): the deep clinical teal, used as an
 * accent rather than a wash. Text and buttons take the darker `--brand-ink`
 * so they clear WCAG AA on white; the lighter `--brand` is decoration only.
 * Contrast checked for every text/background pair in both themes (WCAG AA):
 * body text ≥ 10:1, muted text ≥ 5.7:1, links and buttons ≥ 5.5:1 on the
 * page and ≥ 4.8:1 on the tinted pills, white on the teal panels ≥ 4.9:1. */

:root {
  --font: 'IBM Plex Sans Arabic', system-ui, -apple-system, 'Segoe UI', Roboto,
    'Noto Sans Arabic', Tahoma, sans-serif;

  --brand: #00867d;
  --brand-ink: #00766e;
  --brand-strong: #005f58;
  --brand-2: #12ae9f;
  --brand-soft: #e3f4f1;
  --brand-wash: rgba(0, 134, 125, 0.07);
  --on-brand: #ffffff;

  --bg: #ffffff;
  --bg-soft: #f4f8f7;
  --surface: #ffffff;
  --surface-2: #f1f6f5;
  --ink: #0b1b1a;
  --ink-2: #2a3a38;
  --muted: #52615e;
  --line: rgba(11, 27, 26, 0.09);
  --line-strong: rgba(11, 27, 26, 0.16);

  --warm: #a55b00;
  --violet: #5b48d4;
  --danger: #c2302a;
  --danger-soft: #fdecea;
  --ph-bg: #fff8d6;
  --ph-line: #b58900;
  --ph-ink: #5c4400;

  --shadow-sm: 0 1px 2px rgba(11, 27, 26, 0.06), 0 1px 1px rgba(11, 27, 26, 0.03);
  --shadow-md: 0 1px 2px rgba(11, 27, 26, 0.05), 0 10px 28px -12px rgba(11, 27, 26, 0.16);
  --shadow-lg: 0 2px 6px rgba(11, 27, 26, 0.05), 0 28px 60px -24px rgba(11, 27, 26, 0.28);
  --ring: 0 0 0 3px var(--bg), 0 0 0 6px var(--brand-ink);

  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 24px;
  --radius-xl: 32px;

  --container: 1180px;
  --reading: 46rem;
  --gutter: clamp(16px, 4vw, 32px);
  --header-h: 68px;
  --section-y: clamp(64px, 9vw, 120px);

  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);

  color-scheme: light;
}

:root[data-theme='dark'] {
  --brand: #4fd1c1;
  --brand-ink: #5fd8c9;
  --brand-strong: #8be6da;
  --brand-2: #2fd4c4;
  --brand-soft: rgba(79, 209, 193, 0.13);
  --brand-wash: rgba(79, 209, 193, 0.07);
  --on-brand: #04201d;

  --bg: #07100f;
  --bg-soft: #0b1716;
  --surface: #0f1d1b;
  --surface-2: #132422;
  --ink: #eaf4f2;
  --ink-2: #c9d9d6;
  --muted: #98aeaa;
  --line: rgba(234, 244, 242, 0.09);
  --line-strong: rgba(234, 244, 242, 0.17);

  --warm: #f0a54a;
  --violet: #a597ff;
  --danger: #ff7b73;
  --danger-soft: rgba(255, 123, 115, 0.12);
  --ph-bg: rgba(255, 214, 10, 0.12);
  --ph-line: #d6b000;
  --ph-ink: #ffe28a;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 1px 2px rgba(0, 0, 0, 0.35), 0 12px 32px -14px rgba(0, 0, 0, 0.7);
  --shadow-lg: 0 2px 8px rgba(0, 0, 0, 0.35), 0 30px 70px -24px rgba(0, 0, 0, 0.8);

  color-scheme: dark;
}

/* 3. Base ================================================================= */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + 16px);
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.7;
  color: var(--ink-2);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;
}

:lang(en) body,
body:lang(en) {
  line-height: 1.6;
}

h1,
h2,
h3,
h4 {
  color: var(--ink);
  font-weight: 700;
  line-height: 1.25;
  margin: 0 0 0.6em;
  text-wrap: balance;
}

:lang(en) :is(h1, h2, h3) {
  letter-spacing: -0.02em;
  line-height: 1.15;
}

h1 {
  font-size: clamp(2.1rem, 1.35rem + 3.4vw, 3.9rem);
}

h2 {
  font-size: clamp(1.7rem, 1.25rem + 1.9vw, 2.6rem);
}

h3 {
  font-size: 1.2rem;
  line-height: 1.4;
}

p {
  margin: 0 0 1em;
  text-wrap: pretty;
}

a {
  color: var(--brand-ink);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.25em;
}

a:hover {
  color: var(--brand-strong);
}

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

img {
  height: auto;
}

ul,
ol {
  padding-inline-start: 1.3em;
  margin: 0 0 1em;
}

strong {
  color: var(--ink);
  font-weight: 700;
}

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

::selection {
  background: var(--brand-soft);
  color: var(--ink);
}

.icon {
  width: 1.25em;
  height: 1.25em;
  flex: none;
}

/* Arrows and chevrons point the reading way. */
[dir='rtl'] .flip {
  transform: scaleX(-1);
}

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

.skip-link {
  position: absolute;
  inset-inline-start: 12px;
  top: -60px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  background: var(--ink);
  color: var(--bg);
  font-weight: 600;
  text-decoration: none;
  transition: top 0.2s var(--ease);
}

.skip-link:focus {
  top: 12px;
  color: var(--bg);
}

/* Values the operator has still to fill in: loud on purpose, so none is
 * missed before publishing (tools/check_site.py lists them). */
.ph {
  display: inline;
  padding: 0.05em 0.35em;
  border: 1.5px dashed var(--ph-line);
  border-radius: 6px;
  background: var(--ph-bg);
  color: var(--ph-ink);
  font-size: 0.92em;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

/* 4. Layout helpers ======================================================= */

.container {
  width: 100%;
  max-width: calc(var(--container) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section {
  padding-block: var(--section-y);
  position: relative;
}

.section.is-soft {
  background: var(--bg-soft);
  border-block: 1px solid var(--line);
}

.section-head {
  max-width: 44rem;
  margin: 0 auto clamp(36px, 5vw, 56px);
  text-align: center;
}

.section-head.is-start {
  margin-inline: 0;
  text-align: start;
}

.section-head p {
  color: var(--muted);
  font-size: 1.125rem;
  margin: 0;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 16px;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand-ink);
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.4;
}

.eyebrow .icon {
  width: 1.05em;
  height: 1.05em;
}

.lead {
  font-size: clamp(1.1rem, 1rem + 0.4vw, 1.3rem);
  color: var(--muted);
}

.grid {
  display: grid;
  gap: clamp(14px, 2vw, 22px);
}

@media (min-width: 640px) {
  .grid.cols-2,
  .grid.cols-3,
  .grid.cols-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 960px) {
  .grid.cols-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .grid.cols-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.card {
  position: relative;
  padding: clamp(20px, 2.4vw, 28px);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transition: transform 0.35s var(--ease-out), box-shadow 0.35s var(--ease-out),
    border-color 0.35s var(--ease-out);
}

.card h3 {
  margin-bottom: 0.4em;
}

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

.card p {
  color: var(--muted);
}

@media (hover: hover) {
  .card.is-lift:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: var(--line-strong);
  }
}

.icon-tile {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin-bottom: 18px;
  border-radius: 14px;
  background: var(--brand-soft);
  color: var(--brand-ink);
}

.icon-tile .icon {
  width: 24px;
  height: 24px;
}

.icon-tile.is-warm {
  background: color-mix(in srgb, var(--warm) 13%, transparent);
  color: var(--warm);
}

.icon-tile.is-violet {
  background: color-mix(in srgb, var(--violet) 13%, transparent);
  color: var(--violet);
}

/* 5. Header & menu ======================================================== */

.lang-suggest {
  background: var(--ink);
  color: var(--bg);
  font-size: 0.9375rem;
}

.lang-suggest[hidden] {
  display: none;
}

.lang-suggest .container {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px 16px;
  padding-block: 10px;
}

.lang-suggest p {
  margin: 0;
}

.lang-suggest a,
.lang-suggest button {
  color: inherit;
  font: inherit;
  font-weight: 600;
}

.lang-suggest button {
  padding: 4px 10px;
  border: 1px solid color-mix(in srgb, var(--bg) 35%, transparent);
  border-radius: 999px;
  background: transparent;
  cursor: pointer;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  -webkit-backdrop-filter: saturate(1.6) blur(16px);
  backdrop-filter: saturate(1.6) blur(16px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s var(--ease), box-shadow 0.3s var(--ease),
    background-color 0.3s var(--ease);
  view-transition-name: site-header;
}

.site-header.is-scrolled {
  border-bottom-color: var(--line);
  box-shadow: 0 8px 24px -18px rgba(0, 0, 0, 0.35);
}

.nav {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: var(--header-h);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 700;
  font-size: 1.2rem;
  line-height: 1.1;
  margin-inline-end: auto;
}

.brand:hover {
  color: var(--ink);
}

.brand img {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  box-shadow: 0 4px 12px -4px rgba(0, 98, 91, 0.45);
}

.brand small {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.nav-links {
  display: none;
  align-items: center;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav-links a {
  display: block;
  padding: 8px 12px;
  border-radius: 999px;
  color: var(--ink-2);
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  transition: background-color 0.2s var(--ease), color 0.2s var(--ease);
}

.nav-links a:hover,
.nav-links a.is-active,
.nav-links a[aria-current='page'] {
  background: var(--brand-wash);
  color: var(--brand-ink);
}

.nav-tools {
  display: flex;
  align-items: center;
  gap: 6px;
}

.tool-btn {
  display: inline-grid;
  place-items: center;
  min-width: 42px;
  height: 42px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font: 600 0.9rem/1 var(--font);
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.2s var(--ease), border-color 0.2s var(--ease);
}

.tool-btn:hover {
  background: var(--surface-2);
  border-color: var(--line-strong);
  color: var(--ink);
}

.tool-btn .icon {
  width: 20px;
  height: 20px;
}

/* The theme button shows the theme it switches *to*. */
.theme-toggle .when-dark,
:root[data-theme='dark'] .theme-toggle .when-light {
  display: none;
}

:root[data-theme='dark'] .theme-toggle .when-dark {
  display: block;
}

.nav-tools .nav-cta {
  display: none;
}

.menu-toggle .when-open,
.menu-toggle[aria-expanded='true'] .when-closed {
  display: none;
}

.menu-toggle[aria-expanded='true'] .when-open {
  display: block;
}

@media (min-width: 640px) {
  .nav-tools .nav-cta {
    display: inline-flex;
    min-height: 42px;
    padding-block: 8px;
  }
}

@media (min-width: 1120px) {
  .nav-links {
    display: flex;
  }
  .menu-toggle {
    display: none;
  }
}

.mobile-menu {
  position: fixed;
  inset: var(--header-h) 0 0 0; /* top follows the header; see site.js */
  z-index: 49;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 12px var(--gutter) calc(24px + env(safe-area-inset-bottom));
  background: var(--bg);
  border-top: 1px solid var(--line);
}

.mobile-menu[hidden] {
  display: none;
}

.mobile-menu ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.mobile-menu li + li {
  border-top: 1px solid var(--line);
}

.mobile-menu a:not(.btn) {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 4px;
  color: var(--ink);
  font-size: 1.125rem;
  font-weight: 600;
  text-decoration: none;
}

.mobile-menu a:not(.btn) .icon {
  color: var(--muted);
  width: 18px;
  height: 18px;
}

.mobile-menu .menu-foot {
  display: grid;
  gap: 12px;
  margin-top: 20px;
}

body.menu-open {
  overflow: hidden;
}

/* 6. Buttons & badges ===================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 12px 22px;
  border: 1px solid transparent;
  border-radius: 999px;
  font: 600 1rem/1.2 var(--font);
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.25s var(--ease-out), box-shadow 0.25s var(--ease-out),
    background-color 0.25s var(--ease), color 0.25s var(--ease),
    border-color 0.25s var(--ease);
}

.btn .icon {
  width: 20px;
  height: 20px;
}

.btn-primary {
  background: var(--brand-ink);
  color: var(--on-brand);
  box-shadow: 0 10px 24px -12px color-mix(in srgb, var(--brand-ink) 80%, transparent);
}

.btn-primary:hover {
  background: var(--brand-strong);
  color: var(--on-brand);
}

.btn-ghost {
  background: var(--surface);
  border-color: var(--line-strong);
  color: var(--ink);
}

.btn-ghost:hover {
  background: var(--surface-2);
  color: var(--ink);
}

.btn-soft {
  background: var(--brand-soft);
  color: var(--brand-ink);
}

.btn-soft:hover {
  color: var(--brand-strong);
  background: color-mix(in srgb, var(--brand-soft) 70%, var(--brand) 12%);
}

.btn-block {
  width: 100%;
}

@media (hover: hover) {
  .btn:hover {
    transform: translateY(-2px);
  }
  .btn:hover .flip,
  .btn:hover .nudge {
    transform: translateX(3px);
  }
  [dir='rtl'] .btn:hover .flip {
    transform: scaleX(-1) translateX(3px);
  }
}

.btn .nudge,
.btn .flip {
  transition: transform 0.25s var(--ease-out);
}

.store-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

/* A store badge: a plain <span> ("coming soon") until assets/js/site.js
 * turns it into a link once the listing is live. */
.store-badge {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  padding: 8px 20px 8px 16px;
  border-radius: 14px;
  background: var(--ink);
  color: var(--bg);
  text-decoration: none;
  transition: transform 0.25s var(--ease-out), box-shadow 0.25s var(--ease-out);
}

[dir='rtl'] .store-badge {
  padding: 8px 16px 8px 20px;
}

.store-badge .icon {
  width: 26px;
  height: 26px;
}

.store-badge span {
  display: grid;
  line-height: 1.15;
  text-align: start;
}

.store-badge small {
  font-size: 0.75rem;
  opacity: 0.8;
}

.store-badge b {
  font-size: 1.05rem;
  font-weight: 700;
}

span.store-badge {
  cursor: default;
  opacity: 0.94;
}

a.store-badge:hover {
  color: var(--bg);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* 7. Landing sections ===================================================== */

/* Hero */
.hero {
  position: relative;
  padding-block: clamp(40px, 7vw, 96px) clamp(56px, 8vw, 110px);
  overflow: hidden;
  isolation: isolate;
}

.hero::before {
  content: '';
  position: absolute;
  inset: -20% -10% auto;
  height: 120%;
  z-index: -2;
  background:
    radial-gradient(40rem 26rem at 78% 18%, color-mix(in srgb, var(--brand-2) 22%, transparent), transparent 70%),
    radial-gradient(34rem 24rem at 12% 8%, color-mix(in srgb, var(--violet) 10%, transparent), transparent 70%),
    radial-gradient(30rem 22rem at 30% 90%, color-mix(in srgb, var(--brand) 12%, transparent), transparent 70%);
}

[dir='rtl'] .hero::before {
  transform: scaleX(-1);
}

/* A faint dot grid, fading out towards the edges. */
.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image: radial-gradient(color-mix(in srgb, var(--ink) 16%, transparent) 1px, transparent 1.2px);
  background-size: 22px 22px;
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 35%, #000 20%, transparent 75%);
  mask-image: radial-gradient(ellipse 70% 60% at 50% 35%, #000 20%, transparent 75%);
  opacity: 0.55;
}

.hero-grid {
  display: grid;
  gap: clamp(40px, 6vw, 72px);
  align-items: center;
}

@media (min-width: 960px) {
  .hero-grid {
    grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
  }
}

.hero h1 {
  margin-bottom: 20px;
}

.hero h1 .accent {
  color: var(--brand-ink);
}

.hero .lead {
  max-width: 36rem;
  margin-bottom: 28px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 18px;
}

.hero-note {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.9375rem;
  margin: 18px 0 0;
}

.hero-note .icon {
  color: var(--brand-ink);
}

/* A phone, drawn in CSS around a real screenshot of the app. */
.hero-visual {
  position: relative;
  justify-self: center;
  width: min(320px, 78vw);
}

.device {
  position: relative;
  padding: 10px;
  border-radius: 46px;
  background: linear-gradient(145deg, #1d2b29, #0b1413);
  box-shadow: var(--shadow-lg), inset 0 0 0 1.5px rgba(255, 255, 255, 0.08);
}

.device img {
  width: 100%;
  aspect-ratio: 1170 / 2532;
  border-radius: 37px;
  object-fit: cover;
  background: var(--surface-2);
}

.device::after {
  content: '';
  position: absolute;
  top: 18px;
  left: 50%;
  width: 30%;
  height: 22px;
  transform: translateX(-50%);
  border-radius: 999px;
  background: #050908;
}

.device.is-small {
  border-radius: 34px;
  padding: 7px;
}

.device.is-small img {
  border-radius: 28px;
}

.device.is-small::after {
  top: 13px;
  height: 15px;
}

.float-card {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 12px;
  width: max-content;
  max-width: 250px;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow-md);
  color: var(--ink);
  font-size: 0.875rem;
  line-height: 1.35;
}

.float-card b {
  display: block;
  font-size: 0.9375rem;
}

.float-card span span {
  color: var(--muted);
}

.float-card .icon-tile {
  width: 38px;
  height: 38px;
  margin: 0;
  border-radius: 12px;
}

.float-card .icon-tile .icon {
  width: 20px;
  height: 20px;
}

.float-card.is-a {
  top: 16%;
  inset-inline-start: -34%;
}

.float-card.is-b {
  bottom: 14%;
  inset-inline-end: -30%;
}

@media (max-width: 520px) {
  .float-card.is-a {
    inset-inline-start: -12%;
  }
  .float-card.is-b {
    inset-inline-end: -10%;
  }
}

/* Trust strip */
.trust {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: clamp(40px, 6vw, 72px);
}

@media (min-width: 900px) {
  .trust {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.trust li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface) 80%, transparent);
  color: var(--ink);
  font-weight: 600;
  font-size: 0.95rem;
  line-height: 1.35;
}

.trust .icon {
  color: var(--brand-ink);
  width: 22px;
  height: 22px;
}

.plain-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

/* Feature cards: the first two span wider on large screens. */
.features .card.is-wide {
  background:
    radial-gradient(28rem 16rem at 100% 0%, var(--brand-wash), transparent 70%),
    var(--surface);
}

@media (min-width: 960px) {
  .features .card.is-wide {
    grid-column: span 2;
  }
}

/* Split: text beside an image */
.split {
  display: grid;
  gap: clamp(40px, 6vw, 80px);
  align-items: center;
}

@media (min-width: 960px) {
  .split {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
  .split.is-reverse > :first-child {
    order: 2;
  }
  /* The phones stay beside the text as it scrolls, rather than leaving a
   * column of empty page under them. */
  .split > .visual-stack {
    position: sticky;
    top: calc(var(--header-h) + 40px);
    align-self: start;
  }
}

.check-list {
  margin: 0 0 1.5em;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 12px;
}

.check-list li {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.check-list .icon {
  flex: none;
  width: 22px;
  height: 22px;
  margin-top: 0.2em;
  padding: 3px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand-ink);
}

.check-list.is-danger .icon {
  background: var(--danger-soft);
  color: var(--danger);
}

.steps {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.steps > li {
  position: relative;
  padding: 18px 20px;
  padding-inline-start: 64px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  counter-increment: step;
}

.steps > li::before {
  content: counter(step);
  position: absolute;
  top: 18px;
  inset-inline-start: 18px;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  background: var(--brand-ink);
  color: var(--on-brand);
  font-weight: 700;
  font-size: 0.95rem;
}

.steps b {
  display: block;
  color: var(--ink);
}

.steps span {
  color: var(--muted);
}

.note {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 16px 18px;
  border-radius: var(--radius);
  background: var(--brand-wash);
  border: 1px solid color-mix(in srgb, var(--brand) 22%, transparent);
  color: var(--ink-2);
  margin: 20px 0 0;
}

.note .icon {
  color: var(--brand-ink);
  margin-top: 0.2em;
}

.visual-stack {
  position: relative;
  display: flex;
  justify-content: center;
  gap: 18px;
}

.visual-stack .device {
  width: min(250px, 42vw);
}

.visual-stack .device + .device {
  margin-top: 64px;
}

/* Departments */
.dept-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr));
  gap: 12px;
}

.dept {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  transition: border-color 0.25s var(--ease), transform 0.35s var(--ease-out);
}

@media (hover: hover) {
  .dept:hover {
    border-color: color-mix(in srgb, var(--brand) 40%, transparent);
    transform: translateY(-2px);
  }
}

.dept .icon {
  flex: none;
  width: 22px;
  height: 22px;
  margin-top: 2px;
  color: var(--brand-ink);
}

.dept b {
  display: block;
  color: var(--ink);
  line-height: 1.4;
}

.dept span {
  color: var(--muted);
  font-size: 0.9375rem;
  line-height: 1.5;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 20px 0 0;
  padding: 0;
  list-style: none;
}

.chips li {
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-2);
  font-size: 0.9375rem;
}

.chips .chips-label {
  border: 0;
  background: none;
  padding-inline: 0;
  color: var(--muted);
  font-weight: 600;
}

.security-card {
  margin-top: 28px;
  display: grid;
  gap: 20px;
  align-items: center;
  background:
    radial-gradient(30rem 18rem at 0% 100%, var(--brand-wash), transparent 70%),
    var(--surface);
}

@media (min-width: 860px) {
  .security-card {
    grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  }
}

.security-card .check-list {
  margin: 0;
}

/* Screenshots: a row that scrolls sideways on a phone and settles into a
 * grid on anything wider. */
.gallery {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: min(62vw, 250px);
  gap: 20px;
  margin: 0;
  padding: 4px var(--gutter) 24px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: var(--gutter);
  list-style: none;
  scrollbar-width: thin;
}

@media (min-width: 900px) {
  .gallery {
    grid-auto-flow: row;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    grid-auto-columns: auto;
    overflow: visible;
    padding-inline: 0;
  }
}

.gallery li {
  scroll-snap-align: start;
}

.gallery figure {
  margin: 0;
}

.gallery figcaption {
  margin-top: 16px;
  text-align: center;
}

.gallery figcaption b {
  display: block;
  color: var(--ink);
}

.gallery figcaption span {
  color: var(--muted);
  font-size: 0.9375rem;
}

.gallery-wrap {
  margin-inline: calc(var(--gutter) * -1);
}

@media (min-width: 900px) {
  .gallery-wrap {
    margin-inline: 0;
  }
}

/* About */
.about-grid {
  display: grid;
  gap: clamp(32px, 5vw, 64px);
}

@media (min-width: 960px) {
  .about-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: start;
  }
}

.about-name {
  font-size: clamp(3.2rem, 2rem + 5vw, 5.5rem);
  line-height: 1;
  font-weight: 700;
  color: var(--brand-ink);
  margin: 0 0 12px;
}

.privacy-card {
  display: grid;
  gap: 16px;
  padding: clamp(24px, 3vw, 36px);
  border-radius: var(--radius-xl);
  background: linear-gradient(150deg, var(--brand-strong), var(--brand-ink) 55%, #006f68);
  color: #ffffff;
  box-shadow: var(--shadow-lg);
}

:root[data-theme='dark'] .privacy-card {
  background: linear-gradient(150deg, #0f3a36, #0d2f2c 60%, #0b2624);
  border: 1px solid var(--line-strong);
}

.privacy-card h3 {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #ffffff;
  font-size: 1.4rem;
  margin: 0;
}

.privacy-card p {
  color: rgba(255, 255, 255, 0.92);
  margin: 0;
}

.privacy-card .check-list {
  margin: 0;
  gap: 10px;
}

.privacy-card .check-list li {
  color: #ffffff;
}

.privacy-card .check-list .icon {
  background: rgba(255, 255, 255, 0.16);
  color: #ffffff;
}

.privacy-card .btn {
  justify-self: start;
  background: #ffffff;
  color: #00524c;
}

.privacy-card .btn:hover {
  background: #eafaf7;
  color: #00524c;
}

/* 8. FAQ, CTA, contact ==================================================== */

.faq {
  max-width: 50rem;
  margin-inline: auto;
  display: grid;
  gap: 12px;
}

.faq details {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  transition: border-color 0.25s var(--ease), box-shadow 0.25s var(--ease);
}

.faq details[open] {
  border-color: var(--line-strong);
  box-shadow: var(--shadow-sm);
}

.faq summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 22px;
  cursor: pointer;
  list-style: none;
  color: var(--ink);
  font-weight: 600;
  font-size: 1.0625rem;
  line-height: 1.45;
  border-radius: var(--radius);
}

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

.faq summary .icon {
  flex: none;
  width: 22px;
  height: 22px;
  color: var(--muted);
  transform: rotate(90deg);
  transition: transform 0.3s var(--ease-out);
}

.faq details[open] summary .icon {
  transform: rotate(-90deg);
}

.faq .answer {
  padding: 0 22px 20px;
  color: var(--muted);
}

.faq .answer p:last-child {
  margin: 0;
}

.cta-band {
  position: relative;
  display: grid;
  gap: 28px;
  align-items: center;
  padding: clamp(32px, 5vw, 64px);
  border-radius: var(--radius-xl);
  background:
    radial-gradient(36rem 20rem at 100% 0%, rgba(47, 212, 196, 0.3), transparent 70%),
    linear-gradient(140deg, #00524c, #00766e 60%, #006f68);
  color: #ffffff;
  overflow: hidden;
  isolation: isolate;
}

/* The highlight sits behind the store badges, on the side the text ends —
 * never behind the heading, where it would thin the contrast. */
[dir='rtl'] .cta-band {
  background:
    radial-gradient(36rem 20rem at 0% 0%, rgba(47, 212, 196, 0.3), transparent 70%),
    linear-gradient(220deg, #00524c, #00766e 60%, #006f68);
}

:root[data-theme='dark'] .cta-band {
  background:
    radial-gradient(36rem 20rem at 90% 10%, rgba(47, 212, 196, 0.2), transparent 70%),
    linear-gradient(140deg, #0d302d, #0f3b37 60%, #104440);
  border: 1px solid var(--line-strong);
}

.cta-band::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image: radial-gradient(rgba(255, 255, 255, 0.14) 1px, transparent 1.2px);
  background-size: 20px 20px;
  -webkit-mask-image: linear-gradient(to bottom, #000, transparent);
  mask-image: linear-gradient(to bottom, #000, transparent);
}

@media (min-width: 900px) {
  .cta-band {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }
}

.cta-band img {
  width: 88px;
  height: 88px;
  border-radius: 22px;
  box-shadow: 0 16px 32px -12px rgba(0, 0, 0, 0.5);
}

.cta-band h2 {
  color: #ffffff;
  margin-bottom: 8px;
}

.cta-band p {
  color: rgba(255, 255, 255, 0.92);
  margin: 0;
}

.cta-band .store-badge {
  background: #ffffff;
  color: #062522;
}

.cta-band a.store-badge:hover {
  color: #062522;
}

.contact-grid {
  display: grid;
  gap: 16px;
}

@media (min-width: 900px) {
  .contact-grid {
    grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) minmax(0, 1fr);
  }
}

.contact-card.is-primary {
  background:
    radial-gradient(26rem 14rem at 100% 0%, var(--brand-wash), transparent 70%),
    var(--surface);
  border-color: color-mix(in srgb, var(--brand) 26%, transparent);
}

.email-line {
  display: block;
  margin: 4px 0 16px;
  color: var(--ink);
  font-size: clamp(1.05rem, 0.95rem + 0.5vw, 1.25rem);
  font-weight: 700;
  word-break: break-all;
  text-decoration: none;
}

.email-line:hover {
  color: var(--brand-ink);
  text-decoration: underline;
}

.contact-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.copy-status {
  display: block;
  min-height: 1.6em;
  margin-top: 8px;
  color: var(--brand-ink);
  font-size: 0.9rem;
  font-weight: 600;
}

/* 9. Documents (privacy, account deletion) ================================ */

.doc-hero {
  position: relative;
  padding-block: clamp(40px, 6vw, 80px) clamp(32px, 4vw, 48px);
  background:
    radial-gradient(40rem 20rem at 85% 0%, color-mix(in srgb, var(--brand-2) 14%, transparent), transparent 70%),
    var(--bg-soft);
  border-bottom: 1px solid var(--line);
}

[dir='rtl'] .doc-hero {
  background:
    radial-gradient(40rem 20rem at 15% 0%, color-mix(in srgb, var(--brand-2) 14%, transparent), transparent 70%),
    var(--bg-soft);
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin: 0 0 18px;
  padding: 0;
  list-style: none;
  font-size: 0.9rem;
  color: var(--muted);
}

.breadcrumb a {
  color: var(--muted);
  text-decoration: none;
}

.breadcrumb a:hover {
  color: var(--brand-ink);
  text-decoration: underline;
}

.breadcrumb .icon {
  width: 14px;
  height: 14px;
}

.doc-hero h1 {
  font-size: clamp(2rem, 1.4rem + 2.6vw, 3.25rem);
}

.doc-hero .lead {
  max-width: 44rem;
  margin-bottom: 20px;
}

.doc-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin: 0;
}

.doc-meta > div {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 6px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  font-size: 0.9375rem;
}

.doc-meta dt {
  color: var(--muted);
  font-weight: 400;
}

.doc-meta dd {
  margin: 0;
  color: var(--ink);
  font-weight: 600;
}

.glance {
  display: grid;
  gap: 12px;
  margin: 28px 0 0;
  padding: 0;
  list-style: none;
}

@media (min-width: 720px) {
  .glance {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1100px) {
  .glance {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.glance li {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink-2);
  font-size: 0.95rem;
  line-height: 1.55;
}

.glance .icon {
  flex: none;
  width: 22px;
  height: 22px;
  color: var(--brand-ink);
  margin-top: 1px;
}

.doc-layout {
  display: grid;
  gap: 32px;
  padding-block: clamp(32px, 5vw, 64px) var(--section-y);
}

@media (min-width: 1024px) {
  .doc-layout {
    grid-template-columns: 270px minmax(0, 1fr);
    gap: clamp(40px, 5vw, 72px);
  }
}

/* Contents: a disclosure on a phone, a sticky sidebar on a desk. */
.toc {
  font-size: 0.95rem;
}

.toc details {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.toc summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  cursor: pointer;
  list-style: none;
  color: var(--ink);
  font-weight: 700;
}

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

.toc summary .icon {
  width: 20px;
  height: 20px;
  color: var(--muted);
  transform: rotate(90deg);
  transition: transform 0.3s var(--ease-out);
}

.toc details[open] summary .icon {
  transform: rotate(-90deg);
}

.toc ol {
  margin: 0;
  padding: 4px 10px 14px;
  list-style: none;
  counter-reset: toc;
}

.toc li {
  counter-increment: toc;
}

.toc a {
  display: flex;
  gap: 10px;
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  color: var(--ink-2);
  text-decoration: none;
  line-height: 1.45;
  transition: background-color 0.2s var(--ease), color 0.2s var(--ease);
}

.toc a::before {
  content: counter(toc) '.';
  flex: none;
  min-width: 1.6em;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.toc a:hover {
  background: var(--surface-2);
  color: var(--ink);
}

.toc a.is-active {
  background: var(--brand-wash);
  color: var(--brand-ink);
  font-weight: 600;
}

.toc a.is-active::before {
  color: var(--brand-ink);
}

@media (min-width: 1024px) {
  .toc {
    position: sticky;
    top: calc(var(--header-h) + 24px);
    align-self: start;
    max-height: calc(100vh - var(--header-h) - 48px);
    overflow-y: auto;
  }
  .toc details {
    border: 0;
    background: none;
  }
  .toc summary {
    padding: 0 10px 12px;
    cursor: default;
    pointer-events: none;
    color: var(--muted);
    font-size: 0.8rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }
  .toc summary .icon {
    display: none;
  }
  .toc ol {
    padding: 0;
  }
}

.prose {
  max-width: var(--reading);
  min-width: 0;
}

.prose section {
  padding-block: 8px 28px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 28px;
}

.prose section:last-of-type {
  border-bottom: 0;
}

.prose h2 {
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-size: clamp(1.4rem, 1.2rem + 0.8vw, 1.75rem);
  margin-bottom: 16px;
}

.prose h3 {
  font-size: 1.125rem;
  margin: 28px 0 10px;
}

.prose p,
.prose li {
  color: var(--ink-2);
}

.prose ul,
.prose ol {
  display: grid;
  gap: 8px;
}

.prose ul li::marker {
  color: var(--brand);
}

.heading-anchor {
  opacity: 0;
  color: var(--muted);
  font-weight: 400;
  text-decoration: none;
  transition: opacity 0.2s var(--ease);
}

.prose h2:hover .heading-anchor,
.heading-anchor:focus-visible {
  opacity: 1;
}

.table-wrap {
  overflow-x: auto;
  margin: 12px 0 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.data-table {
  width: 100%;
  min-width: 640px;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.data-table caption {
  padding: 14px 16px 0;
  color: var(--muted);
  font-weight: 600;
  text-align: start;
}

.data-table th,
.data-table td {
  padding: 14px 16px;
  text-align: start;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
}

.data-table tr:last-child > * {
  border-bottom: 0;
}

.data-table thead th {
  color: var(--ink);
  background: var(--surface-2);
  font-size: 0.875rem;
}

.data-table tbody th {
  color: var(--ink);
}

.data-table small {
  display: block;
  color: var(--muted);
  font-weight: 400;
}

.contact-panel {
  display: grid;
  gap: 16px;
  margin-top: 8px;
  padding: 24px;
  border-radius: var(--radius-lg);
  border: 1px solid color-mix(in srgb, var(--brand) 26%, transparent);
  background:
    radial-gradient(26rem 14rem at 100% 0%, var(--brand-wash), transparent 70%),
    var(--surface);
}

.contact-panel p {
  margin: 0;
}

/* Account deletion: panels in a grid */
.panel-grid {
  display: grid;
  gap: 16px;
  padding-block: clamp(32px, 5vw, 64px) 24px;
}

@media (min-width: 900px) {
  .panel-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
  .panel-grid > .span-3 {
    grid-column: span 3;
  }
  .panel-grid > .span-2 {
    grid-column: span 2;
  }
}

.panel {
  padding: clamp(20px, 2.6vw, 30px);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.panel h2 {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 1.25rem;
  margin-bottom: 16px;
}

.panel p {
  color: var(--ink-2);
}

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

.icon-bubble {
  display: grid;
  place-items: center;
  flex: none;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--brand-soft);
  color: var(--brand-ink);
}

.panel.is-danger {
  border-color: color-mix(in srgb, var(--danger) 30%, transparent);
}

.panel.is-danger .icon-bubble {
  background: var(--danger-soft);
  color: var(--danger);
}

.callout {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  background: var(--brand-wash);
}

.callout.is-danger {
  background: var(--danger-soft);
  color: var(--ink);
}

.panel .steps > li {
  padding-block: 12px;
  padding-inline-start: 56px;
  /* Inside a panel a second border would box the steps in twice. */
  border-color: transparent;
  background: var(--surface-2);
}

.panel .steps > li::before {
  top: 12px;
  inset-inline-start: 14px;
  width: 28px;
  height: 28px;
}

.doc-foot-panel {
  margin-top: 8px;
}

.doc-foot {
  padding-bottom: var(--section-y);
}

.back-to-top {
  position: fixed;
  inset-inline-end: 20px;
  bottom: calc(20px + env(safe-area-inset-bottom));
  z-index: 40;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-md);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease-out), visibility 0.3s;
}

.back-to-top.is-shown {
  opacity: 1;
  visibility: visible;
  transform: none;
}

.back-to-top .icon {
  width: 22px;
  height: 22px;
}

/* Bootstrap-era spacing helpers still present in the carried-over text. */
.mb-0 {
  margin-bottom: 0 !important;
}

.mt-0 {
  margin-top: 0 !important;
}

.mt-3 {
  margin-top: 1rem !important;
}

/* 10. Footer, 404 ========================================================= */

.site-footer {
  padding-block: clamp(48px, 7vw, 80px) 32px;
  background: var(--bg-soft);
  border-top: 1px solid var(--line);
  font-size: 0.975rem;
}

.footer-grid {
  display: grid;
  gap: 36px;
}

@media (min-width: 720px) {
  .footer-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1000px) {
  .footer-grid {
    grid-template-columns: minmax(0, 1.5fr) repeat(3, minmax(0, 1fr));
  }
}

.footer-about p {
  color: var(--muted);
  max-width: 24rem;
  margin: 16px 0 0;
}

.site-footer h2 {
  font-size: 0.8125rem;
  color: var(--muted);
  letter-spacing: 0.06em;
  margin: 0 0 14px;
}

:lang(en) .site-footer h2 {
  text-transform: uppercase;
}

.footer-links {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 10px;
}

.footer-links a {
  color: var(--ink-2);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
}

/* The email address has no spaces to break at; between 1000 and ~1100 px its
   column is narrower than it, and it pushed the page sideways. */
.footer-links a > bdi {
  min-width: 0;
  overflow-wrap: anywhere;
}

.footer-links a:hover {
  color: var(--brand-ink);
  text-decoration: underline;
}

.footer-links .icon {
  width: 18px;
  height: 18px;
  color: var(--muted);
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.9rem;
}

.footer-bottom p {
  margin: 0;
}

.footer-tools {
  display: flex;
  gap: 8px;
}

.notfound {
  min-height: calc(100vh - var(--header-h) - 200px);
  display: grid;
  place-items: center;
  padding-block: var(--section-y);
  text-align: center;
}

.notfound-code {
  font-size: clamp(5rem, 3rem + 10vw, 9rem);
  font-weight: 700;
  line-height: 1;
  margin: 0 0 8px;
  background: linear-gradient(120deg, var(--brand-ink), var(--brand-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.notfound-langs {
  display: grid;
  gap: 32px;
  max-width: 56rem;
}

@media (min-width: 800px) {
  .notfound-langs {
    grid-template-columns: 1fr 1fr;
  }
}

.notfound-langs > div {
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.notfound-langs .hero-actions {
  justify-content: center;
  margin: 20px 0 0;
}

/* Under /en/… the English half comes first. */
.notfound-langs.en-first > [lang='en'] {
  order: -1;
}

/* 11. Motion ==============================================================
 * Everything that moves is opt-in: only for visitors who have not asked
 * their system for reduced motion, and — for the scroll reveal — only once
 * the script is running, so nothing stays hidden if it never does. */

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }

  /* Cross-page transitions, where the browser supports them: the header
   * stays put while the page beneath it cross-fades. */
  @view-transition {
    navigation: auto;
  }

  ::view-transition-old(root) {
    animation: 180ms var(--ease) both vt-out;
  }

  ::view-transition-new(root) {
    animation: 320ms var(--ease-out) both vt-in;
  }

  @keyframes vt-out {
    to {
      opacity: 0;
    }
  }

  @keyframes vt-in {
    from {
      opacity: 0;
      transform: translateY(10px);
    }
  }

  html.reveal-ready .reveal {
    opacity: 0;
    transform: translateY(22px);
    transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
    transition-delay: calc(var(--d, 0) * 80ms);
  }

  /* A stagger for neighbours that arrive together (a class, not an inline
   * style: the CSP allows no inline styles). */
  .d-1 {
    --d: 1;
  }

  .d-2 {
    --d: 2;
  }

  .d-3 {
    --d: 3;
  }

  html.reveal-ready .reveal.is-visible {
    opacity: 1;
    transform: none;
  }

  .float-card {
    animation: float 7s ease-in-out infinite;
  }

  .float-card.is-b {
    animation-delay: -3.5s;
  }

  @keyframes float {
    50% {
      transform: translateY(-10px);
    }
  }

  .mobile-menu:not([hidden]) {
    animation: menu-in 0.28s var(--ease-out);
  }

  @keyframes menu-in {
    from {
      opacity: 0;
      transform: translateY(-8px);
    }
  }
}

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

/* 12. Print =============================================================== */

@media print {
  :root {
    --bg: #ffffff;
    --bg-soft: #ffffff;
    --surface: #ffffff;
    --ink: #000000;
    --ink-2: #111111;
    --muted: #333333;
  }

  .site-header,
  .site-footer,
  .lang-suggest,
  .mobile-menu,
  .back-to-top,
  .toc,
  .skip-link,
  .heading-anchor {
    display: none !important;
  }

  body {
    font-size: 11pt;
  }

  .doc-hero,
  .panel,
  .table-wrap,
  .glance li {
    background: none !important;
    box-shadow: none !important;
  }

  .doc-layout {
    display: block;
    padding: 0;
  }

  .prose {
    max-width: none;
  }

  .prose section {
    break-inside: avoid-page;
  }

  .prose a[href^='http']::after {
    content: ' (' attr(href) ')';
    font-size: 0.85em;
  }
}
