/* Lefila website styles.
   Shared base and components first, then the home page, the Media Vault page
   and the Media Vault docs. Values follow the Claude Design source files. */

:root {
  --ink: oklch(0.2 0.01 270);
  --ink-2: oklch(0.27 0.01 270);
  --muted: oklch(0.42 0.01 270);
  --label: oklch(0.5 0.01 270);
  --line: oklch(0.92 0.005 270);
  --wash: oklch(0.97 0.005 270);

  /* Lefila Blue: the home page palette, also used for link hovers site-wide */
  --a1: oklch(0.58 0.19 258);
  --a2: oklch(0.84 0.13 182);
  --a1-tint: oklch(0.96 0.03 258);
  --a2-tint: oklch(0.96 0.03 182);

  /* Media Vault */
  --gold: #f5b937;
  --cream: oklch(0.96 0.04 85);

  --font: 'Bricolage Grotesque', system-ui, sans-serif;
  --mono: 'DM Mono', ui-monospace, monospace;
  --spring: cubic-bezier(.3, 1.6, .5, 1);
}

/* ── Fonts ────────────────────────────────────────────────────── */

/* Self-hosted copies of the Google Fonts files (Bricolage Grotesque v9, DM Mono v16),
   so pages make no requests to Google. Licences: assets/fonts/OFL-*.txt.
   Bricolage Grotesque is one variable file per subset. Its weights are declared as two
   ranges, 400–500 and 700–800, so text set at 600 still renders at 700, as it did when
   Google served the four weights separately. Later rules win where ranges overlap. */
@font-face {
  font-family: 'Bricolage Grotesque'; font-weight: 400 500; font-display: swap;
  src: url(../assets/fonts/bricolage-grotesque-vietnamese.woff2) format('woff2');
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
@font-face {
  font-family: 'Bricolage Grotesque'; font-weight: 400 500; font-display: swap;
  src: url(../assets/fonts/bricolage-grotesque-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Bricolage Grotesque'; font-weight: 400 500; font-display: swap;
  src: url(../assets/fonts/bricolage-grotesque-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: 'Bricolage Grotesque'; font-weight: 700 800; font-display: swap;
  src: url(../assets/fonts/bricolage-grotesque-vietnamese.woff2) format('woff2');
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
@font-face {
  font-family: 'Bricolage Grotesque'; font-weight: 700 800; font-display: swap;
  src: url(../assets/fonts/bricolage-grotesque-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Bricolage Grotesque'; font-weight: 700 800; font-display: swap;
  src: url(../assets/fonts/bricolage-grotesque-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: 'DM Mono'; font-weight: 400; font-display: swap;
  src: url(../assets/fonts/dm-mono-400-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'DM Mono'; font-weight: 400; font-display: swap;
  src: url(../assets/fonts/dm-mono-400-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'DM Mono'; font-weight: 500; font-display: swap;
  src: url(../assets/fonts/dm-mono-500-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'DM Mono'; font-weight: 500; font-display: swap;
  src: url(../assets/fonts/dm-mono-500-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;
}

/* ── Base ─────────────────────────────────────────────────────── */

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

body {
  margin: 0;
  background: #fff;
  color: var(--ink);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, p, ol, figure { margin: 0; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--a1); }
img { display: block; height: auto; }
button, input { font: inherit; color: inherit; }
[hidden] { display: none !important; }

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

/* ── Layout ───────────────────────────────────────────────────── */

.page { min-height: 100vh; overflow-x: hidden; overflow-x: clip; }
.wrap { max-width: 1200px; margin-inline: auto; padding-inline: 32px; }
.wrap-wide { max-width: 1280px; margin-inline: auto; padding-inline: 32px; }
.section { padding-block: 48px 96px; }
.section-flush { padding-block: 0 96px; }
.section-72 { padding-block: 0 72px; }
.shape { position: absolute; }
.balance { text-wrap: balance; }

.hero {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr));
  gap: 56px;
  align-items: center;
  padding-block: 56px 96px;
}

.section-head {
  display: flex; align-items: end; justify-content: space-between; flex-wrap: wrap; gap: 24px;
  margin-bottom: 48px;
}

.split {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr));
  gap: 48px;
  align-items: start;
}

/* ── Type ─────────────────────────────────────────────────────── */

.display {
  font-size: clamp(48px, 6.4vw, 88px); line-height: .95; letter-spacing: -0.045em;
  font-weight: 800; text-wrap: balance;
}
.h2 { font-size: clamp(36px, 5vw, 56px); line-height: 1; letter-spacing: -0.035em; font-weight: 800; }
.lede {
  max-width: 520px; margin: 32px 0 40px;
  font-size: 20px; line-height: 1.5; color: var(--muted); text-wrap: pretty;
}
.kicker { margin-bottom: 20px; font-family: var(--mono); font-size: 13px; color: var(--label); }
.kicker-hero { margin-bottom: 24px; letter-spacing: .04em; }
.kicker-flush { margin: 0; }
.text-link { padding-bottom: 2px; border-bottom: 1.5px solid currentColor; font-size: 16px; font-weight: 500; }
.text-link-sm { font-size: 15px; }

/* ── Buttons ──────────────────────────────────────────────────── */

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

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 16px 26px; border-radius: 999px; font-size: 16px; font-weight: 500;
}
.btn-sm { padding: 10px 18px; font-size: 14px; }
.btn-md { padding: 14px 22px; font-size: 15px; }
.btn-dark { background: var(--ink); color: #fff; }
.btn-dark:hover { background: var(--a1); color: #fff; }
.btn-outline { border: 1.5px solid var(--ink); }
.btn-outline:hover { background: var(--wash); }
.btn-light { background: #fff; color: var(--ink); }
.btn-light:hover { background: var(--a2); color: var(--ink); }
.btn-lift { transition: transform .3s var(--spring); }
.btn-lift:hover { transform: translateY(-3px); }

/* ── Nav & footer ─────────────────────────────────────────────── */

.nav {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 24px;
  padding-block: 24px;
}
.brand { display: flex; align-items: center; gap: 10px; font-size: 22px; font-weight: 800; letter-spacing: -0.02em; }
.brand img { width: 44px; height: 44px; }
.nav-links { display: flex; flex-wrap: wrap; align-items: center; gap: 28px; font-size: 15px; font-weight: 500; }
.nav-links > a { display: inline-flex; min-height: 38px; align-items: center; line-height: 1.2; }

.footer {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 24px;
  padding-block: 0 48px; font-size: 14px; color: oklch(0.45 0.01 270);
}
.footer-links { display: flex; flex-wrap: wrap; gap: 24px; }
.footer-brand { display: flex; align-items: center; gap: 10px; }
.footer-brand img { width: 28px; height: 28px; }

/* Keep the nav on one balanced row at desktop widths, then give its links their own
   centered row before the brand and action begin competing for horizontal space. */
@media (max-width: 1100px) {
  .nav { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px 24px; }
  .nav-links { grid-column: 1 / -1; grid-row: 2; justify-content: center; gap: 8px clamp(12px, 2.4vw, 28px); }
  .nav > .btn { grid-column: 2; grid-row: 1; }
}

/* ══ Home ═════════════════════════════════════════════════════ */

.accent { color: var(--a1); }

.home-hero-art { position: relative; display: flex; justify-content: center; padding: 24px 0; }
.home-hero-disc {
  left: 8%; top: 6%; width: min(380px, 80%); aspect-ratio: 1;
  border-radius: 50%; background: var(--a1-tint);
}
.home-hero-square {
  right: 10%; top: 4%; width: 64px; height: 64px;
  border-radius: 14px; background: var(--a2); transform: rotate(18deg);
}
.home-hero-ring { left: 6%; bottom: 10%; width: 80px; height: 80px; border: 3px solid var(--ink); border-radius: 50%; }
.home-hero-dot { right: 14%; bottom: 18%; width: 28px; height: 28px; border-radius: 50%; background: var(--a1); }
.home-hero-phone {
  position: relative; width: min(280px, 70%); border-radius: 36px;
  box-shadow: 0 30px 60px -24px oklch(0.25 0.08 255 / 0.55);
  transform: rotate(4deg); transition: transform .5s var(--spring);
}
.home-hero-phone:hover { transform: rotate(0deg) translateY(-10px) scale(1.03); }

/* Shipped apps */
.app-card {
  position: relative; overflow: hidden;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  gap: 48px;
  align-items: center;
  padding: clamp(28px, 5vw, 56px);
  border-radius: 40px;
  background: var(--a1-tint);
}
.app-card-blob {
  right: -50px; bottom: -50px; width: 200px; height: 200px;
  border-radius: 50%; background: var(--a2); opacity: .9;
}
.app-card-info { position: relative; display: flex; flex-direction: column; gap: 20px; }
.app-card-id { display: flex; align-items: center; gap: 16px; }
.app-icon {
  width: 64px; height: 64px; border-radius: 18px;
  display: flex; align-items: center; justify-content: center;
  background: var(--ink); color: var(--gold);
  transition: transform .4s var(--spring);
}
.app-icon:hover { transform: rotate(-10deg) scale(1.08); }
.app-card-platforms { font-family: var(--mono); font-size: 12px; color: oklch(0.35 0.01 270); }
.app-card-title { font-size: clamp(40px, 5vw, 64px); line-height: 1; letter-spacing: -0.04em; font-weight: 800; }
.app-card-desc { max-width: 380px; font-size: 20px; line-height: 1.45; color: oklch(0.3 0.01 270); }
.app-card .btn-outline:hover { background: #fff; }

.trailer-link { display: flex; align-items: center; gap: 8px; padding: 14px 4px; font-size: 15px; font-weight: 600; }
.trailer-link span {
  width: 28px; height: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--ink); color: #fff; font-size: 11px;
}

.screens { position: relative; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.screen { display: flex; flex-direction: column; gap: 10px; transition: transform .45s var(--spring); }
.screen:nth-child(2) { margin-top: 48px; }
.screen:nth-child(3) { margin-top: -48px; }
.screen:nth-child(odd):hover { transform: translateY(-12px) rotate(-2deg); }
.screen:nth-child(even):hover { transform: translateY(-12px) rotate(2deg); }
.screen img { width: 100%; border-radius: 28px; box-shadow: 0 18px 40px -16px oklch(0.2 0.01 270 / 0.45); }
.screen figcaption { font-family: var(--mono); font-size: 12px; color: oklch(0.3 0.01 270); }

/* Products */
.product-list { display: flex; flex-direction: column; gap: 12px; }
.product {
  display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; gap: 18px; align-items: center;
  padding: 16px 20px 16px 16px;
  border: 1.5px solid var(--line); border-radius: 20px; background: #fff;
  transition: transform .35s var(--spring), border-color .2s, box-shadow .2s;
}
.product:hover {
  transform: translateY(-3px); border-color: var(--ink);
  box-shadow: 0 10px 24px -14px oklch(0.2 0.01 270 / 0.4); color: inherit;
}
.product-mv { --icon-bg: var(--ink); --icon-fg: var(--gold); --pill: oklch(0.95 0.05 150); --dot: oklch(0.65 0.17 150); }
.product-ledgerly { --icon-bg: var(--a1-tint); --icon-fg: var(--ink); --pill: oklch(0.96 0.005 270); --dot: var(--a1); }
.product-icon {
  width: 52px; height: 52px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  background: var(--icon-bg); color: var(--icon-fg); font-size: 20px; font-weight: 800;
}
.product-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.product-name { font-size: 19px; font-weight: 700; letter-spacing: -0.01em; }
.product-desc { font-size: 15px; color: var(--muted); }
.status {
  display: flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 999px;
  background: var(--pill); color: oklch(0.25 0.01 270); font-family: var(--mono); font-size: 12px;
}
.status::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--dot); }

/* Story */
.story {
  width: min(1136px, calc(100% - 64px));
  margin: 0 auto 96px;
  padding: 80px clamp(24px, 6vw, 80px);
  border-radius: 40px;
  background: oklch(0.975 0.006 80);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
  gap: 48px;
  align-items: start;
}
.story-title {
  margin-bottom: 28px; font-size: clamp(32px, 4.4vw, 48px); line-height: 1.05;
  letter-spacing: -0.03em; font-weight: 800; text-wrap: balance;
}
.story-copy { display: grid; gap: 16px; max-width: 640px; font-size: 17px; line-height: 1.6; }
.story-copy p { margin: 0; }
.story-question { font-size: 20px; line-height: 1.45; font-weight: 600; text-wrap: pretty; }
.story-mission { padding: 18px 20px; border-left: 3px solid var(--a1); border-radius: 0 14px 14px 0; background: color-mix(in oklch, var(--a1) 8%, transparent); }

/* Blog */
#blog .section-head { margin-bottom: 40px; }
.posts { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 24px; }
.post { display: flex; flex-direction: column; gap: 14px; padding-top: 20px; border-top: 1.5px solid var(--ink); }
.post-meta { font-family: var(--mono); font-size: 12px; color: var(--label); }
.post-title { font-size: 24px; line-height: 1.2; letter-spacing: -0.02em; font-weight: 700; text-wrap: pretty; }

/* Contact & newsletter */
.contact {
  position: relative; overflow: hidden;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 360px), 1fr));
  gap: 56px;
  padding: 72px clamp(24px, 6vw, 80px);
  border-radius: 40px;
  background: var(--ink);
  color: #fff;
}
.contact-no-newsletter { grid-template-columns: 1fr; }
.contact-blob { right: -40px; top: -40px; width: 180px; height: 180px; border-radius: 50%; background: var(--a1); }
.contact-main { position: relative; display: flex; flex-direction: column; gap: 28px; }
.contact-title { font-size: clamp(36px, 5vw, 60px); line-height: 1; letter-spacing: -0.035em; font-weight: 800; }
.contact-email { align-self: flex-start; font-size: 17px; }
.label-on-dark { font-family: var(--mono); font-size: 12px; color: oklch(0.8 0.01 270); }
.socials { display: flex; flex-direction: column; gap: 12px; }
.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip {
  padding: 10px 16px; border: 1.5px solid oklch(1 0 0 / 0.3); border-radius: 999px;
  color: #fff; font-size: 15px; font-weight: 500;
  transition: transform .3s var(--spring);
}
.chip:hover { transform: translateY(-3px) rotate(-2deg); background: #fff; color: var(--ink); border-color: #fff; }

.newsletter {
  position: relative; align-self: end;
  display: flex; flex-direction: column; gap: 16px;
  padding: 32px; border-radius: 28px; background: var(--ink-2);
}
.newsletter[hidden] { display: none; }
.newsletter-title { font-size: 28px; line-height: 1.15; letter-spacing: -0.02em; font-weight: 700; }
.newsletter-row { display: flex; flex-wrap: wrap; gap: 8px; }
.newsletter input {
  flex: 1 1 200px; min-width: 0; padding: 14px 18px;
  border: 1.5px solid oklch(1 0 0 / 0.25); border-radius: 999px;
  background: transparent; color: #fff; font-size: 16px; outline: none;
}
.newsletter input:focus { border-color: var(--a1); }
.newsletter button {
  padding: 14px 22px; border: none; border-radius: 999px;
  background: var(--a1); color: var(--ink); font-size: 16px; font-weight: 700; cursor: pointer;
  transition: transform .3s var(--spring);
}
.newsletter button:hover { transform: scale(1.05); }
.newsletter-done {
  padding: 14px 18px; border-radius: 999px;
  background: var(--a2); color: var(--ink); font-size: 16px; font-weight: 600;
}
.newsletter-note { font-size: 13px; color: oklch(0.78 0.01 270); }

/* ══ Media Vault ══════════════════════════════════════════════ */

.mv .brand { gap: 12px; }
.mv-mark {
  flex: none; width: 40px; height: 40px; border-radius: 11px;
  display: flex; align-items: center; justify-content: center;
  background: var(--ink); color: var(--gold);
}
.mv .btn-light { font-weight: 600; }
.mv .btn-light:hover { background: var(--gold); }

.hero-mv { padding-block: 48px 96px; }
.lede-mv { max-width: 500px; }
.badge {
  display: inline-flex; align-items: center; gap: 8px; margin-bottom: 24px;
  padding: 6px 12px; border-radius: 999px; background: var(--cream);
  font-family: var(--mono); font-size: 12px;
}
.badge::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--gold); }
.highlight {
  display: inline-block; padding: 0 10px; border-radius: 14px;
  background: var(--gold); transform: rotate(-2deg);
}
/* Tags a feature that needs Pro (feature cards, security, docs). */
.pro {
  display: inline-block; margin-left: 6px; padding: 3px 8px; border-radius: 999px;
  background: var(--ink); color: var(--gold);
  font-family: var(--mono); font-size: 11px; font-weight: 500; line-height: 1.3;
  letter-spacing: .04em; text-transform: uppercase; vertical-align: middle;
}
.security .pro { background: var(--gold); color: var(--ink); }

.mv-hero-art { position: relative; height: 560px; display: flex; align-items: center; justify-content: center; }
.mv-hero-disc { width: min(420px, 90%); aspect-ratio: 1; border-radius: 50%; background: var(--cream); }
.mv-hero-square {
  right: 8%; top: 6%; width: 56px; height: 56px;
  border-radius: 14px; background: var(--a1); transform: rotate(18deg);
}
.mv-hero-ring { left: 6%; bottom: 8%; width: 72px; height: 72px; border: 3px solid var(--ink); border-radius: 50%; }
.mv-phone-light {
  position: absolute; left: calc(50% - 220px); top: 70px; width: 210px; border-radius: 30px;
  box-shadow: 0 24px 50px -22px oklch(0.2 0.01 270 / 0.5);
  transform: rotate(-8deg); transition: transform .5s var(--spring);
}
.mv-phone-light:hover { transform: rotate(-2deg) translateY(-12px); z-index: 3; }
.mv-phone-dark {
  position: absolute; left: calc(50% - 40px); top: 30px; z-index: 2; width: 230px; border-radius: 32px;
  box-shadow: 0 30px 60px -24px oklch(0.2 0.01 270 / 0.6);
  transform: rotate(6deg); transition: transform .5s var(--spring);
}
.mv-phone-dark:hover { transform: rotate(0deg) translateY(-12px); }

/* Trailer. The frame takes the shape of the cut that's playing (see
   js/media-vault.js) and is never taller than 80% of the screen. */
.trailer-frame {
  --ratio: 16 / 9;
  position: relative; overflow: hidden;
  width: min(100%, 80vh * var(--ratio)); aspect-ratio: var(--ratio); margin: 0 auto;
  border-radius: 40px;
  background: oklch(0.18 0.015 260);
  box-shadow: 0 40px 80px -40px oklch(0.2 0.01 270 / 0.6);
}
.trailer-frame.is-square { --ratio: 1; }
.trailer-frame.is-vertical { --ratio: 9 / 16; }
.trailer-frame img,
.trailer-frame video { width: 100%; height: 100%; display: block; }
.trailer-frame img { object-fit: cover; }
/* The frame matches the cut, so the video fills it either way; contain keeps
   the 16:9 poster whole rather than cropped while a square or vertical cut loads. */
.trailer-frame video { object-fit: contain; }
.trailer-play { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.trailer-play span {
  width: 96px; height: 96px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--gold); color: var(--ink);
  box-shadow: 0 16px 40px -10px oklch(0 0 0 / 0.6);
  transition: transform .35s var(--spring);
}
.trailer-play span:hover { transform: scale(1.1); }
.trailer-controls { position: absolute; right: 20px; bottom: 20px; display: flex; gap: 8px; }
.trailer-controls button {
  padding: 10px 16px; border: none; border-radius: 999px;
  background: oklch(1 0 0 / 0.9); color: var(--ink); font-size: 14px; font-weight: 600; cursor: pointer;
  transition: transform .3s var(--spring);
}
.trailer-controls button:hover { transform: scale(1.06); }

/* Security */
.security {
  position: relative; overflow: hidden;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  gap: 32px;
  padding: 56px clamp(24px, 5vw, 64px);
  border-radius: 40px;
  background: var(--ink);
  color: #fff;
}
.security-blob { left: -60px; bottom: -60px; width: 180px; height: 180px; border-radius: 50%; background: var(--gold); }
.security-item {
  position: relative; display: flex; flex-direction: column; gap: 14px;
  transition: transform .35s var(--spring);
}
.security-item:hover { transform: translateY(-6px); }
.security-n { font-family: var(--mono); font-size: 12px; color: var(--gold); }
.security-item h3 { font-size: 28px; line-height: 1.1; letter-spacing: -0.025em; font-weight: 800; }
.security-item p { font-size: 16px; line-height: 1.5; color: oklch(0.85 0.01 270); text-wrap: pretty; }

/* Media Vault backup and guide sections */
.backup-intro { max-width: 430px; color: var(--muted); font-size: 18px; line-height: 1.5; text-wrap: pretty; }
.backup-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr)); gap: 16px; }
.backup-card { display: flex; min-height: 265px; flex-direction: column; align-items: flex-start; gap: 15px; padding: 28px; border-radius: 26px; background: var(--cream); }
.backup-card-tint { background: var(--a1-tint); }
.backup-card-dark { background: var(--ink); color: #fff; }
.backup-card h3 { font-size: 25px; line-height: 1.1; letter-spacing: -.025em; font-weight: 750; }
.backup-card p { color: oklch(0.38 0.01 270); font-size: 16px; line-height: 1.55; text-wrap: pretty; }
.backup-card-dark p { color: oklch(0.85 0.01 270); }
.backup-footnote { max-width: 790px; margin-top: 20px; color: var(--muted); font-size: 14px; line-height: 1.55; }
.guide-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); gap: 14px; }
.guide-card { position: relative; display: flex; min-height: 225px; flex-direction: column; align-items: flex-start; gap: 12px; padding: 24px; border: 1px solid var(--line); border-radius: 24px; background: #fff; transition: transform .25s var(--spring), border-color .25s ease, box-shadow .25s ease; }
.guide-card:hover { transform: translateY(-4px); border-color: var(--ink); box-shadow: 0 14px 30px -25px var(--ink); color: inherit; }
.guide-number { color: var(--a1); font-family: var(--mono); font-size: 12px; }
.guide-card h3 { max-width: 210px; font-size: 21px; line-height: 1.15; letter-spacing: -.02em; font-weight: 700; }
.guide-card p { max-width: 260px; padding-right: 12px; color: var(--muted); font-size: 15px; line-height: 1.5; }
.guide-arrow { position: absolute; right: 21px; bottom: 19px; color: var(--a1); font-size: 20px; }

/* Features */
.features-title { max-width: 640px; text-wrap: balance; }
.features { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 20px; }
.feature {
  display: flex; flex-direction: column; overflow: hidden;
  border-radius: 28px; background: var(--cream);
  transition: transform .4s var(--spring);
}
.feature:nth-child(3n+2) { background: var(--a1-tint); }
.feature:nth-child(3n) { background: oklch(0.965 0.005 270); }
.feature:hover { color: inherit; }
.feature:nth-child(odd):hover { transform: translateY(-8px) rotate(-1deg); }
.feature:nth-child(even):hover { transform: translateY(-8px) rotate(1deg); }
.feature-text { display: flex; flex-direction: column; gap: 6px; padding: 24px 24px 0; }
.feature h3 { font-size: 22px; letter-spacing: -0.02em; font-weight: 700; }
.feature p { font-size: 15px; line-height: 1.45; color: oklch(0.35 0.01 270); text-wrap: pretty; }
/* The screenshot is cropped by the fixed-height frame on purpose. */
.feature-shot { height: 280px; margin-top: auto; padding: 24px 32px 0; overflow: hidden; }
.feature-shot img { width: 100%; border-radius: 22px 22px 0 0; box-shadow: 0 12px 30px -16px oklch(0.2 0.01 270 / 0.5); }

/* FAQ */
.faq-title { margin-bottom: 20px; }
.faq-lede { max-width: 360px; margin-bottom: 24px; font-size: 18px; line-height: 1.5; color: var(--muted); }
/* The side column stretches to the height of the question list, so the heading can stay in
   view while the list scrolls past. When the columns stack, the column is only as tall as the
   heading, so it scrolls normally there. Short screens skip this so it is never cut off. */
.faq-side { align-self: stretch; }
@media (min-height: 500px) {
  .faq-head { position: sticky; top: 48px; }
}
.faq-list { display: flex; flex-direction: column; gap: 10px; }
.faq-item {
  border: 1.5px solid var(--line); border-radius: 20px; background: #fff;
  transition: border-color .2s, background .2s;
}
.faq-item[open] { border-color: var(--ink); background: oklch(0.985 0.015 85); }
.faq-item summary { display: block; list-style: none; cursor: pointer; }
.faq-item summary::-webkit-details-marker { display: none; }
/* Flex lives on an inner span: older Safari can't make <summary> itself a flex container. */
.faq-q {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 20px 22px; font-size: 18px; font-weight: 600;
}
.faq-icon {
  flex: none; width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: oklch(0.96 0.005 270); font-size: 20px; line-height: 1;
  transition: transform .35s var(--spring);
}
.faq-item[open] .faq-icon { background: var(--gold); transform: rotate(45deg); }
.faq-item p { padding: 0 22px 22px; font-size: 16px; line-height: 1.55; color: oklch(0.35 0.01 270); text-wrap: pretty; }

/* Download */
.cta {
  position: relative; overflow: hidden;
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 32px;
  padding: 64px clamp(24px, 6vw, 80px);
  border-radius: 40px;
  background: var(--ink);
  color: #fff;
}
.cta-blob { right: -50px; top: -50px; width: 200px; height: 200px; border-radius: 50%; background: var(--gold); }
.cta-title {
  position: relative; max-width: 560px;
  font-size: clamp(36px, 5vw, 60px); line-height: 1; letter-spacing: -0.035em; font-weight: 800;
}
.cta .actions { position: relative; }

/* ══ Media Vault docs ═════════════════════════════════════════ */

.docs-nav { border-bottom: 1.5px solid oklch(0.93 0.005 270); }
.docs-pill {
  padding: 4px 10px; border-radius: 999px; background: var(--cream);
  font-family: var(--mono); font-size: 12px; font-weight: 400;
}

.docs-layout { display: flex; gap: 48px; align-items: flex-start; padding-block: 40px 96px; }

.toc { flex: 0 1 240px; min-width: 200px; }
.toc-panel { display: flex; flex-direction: column; gap: 20px; }
/* Opens the topic list on phones (see Small screens); hidden beside the topic. */
.toc-toggle {
  display: none; width: 100%; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px 14px 14px 20px; border: 0; background: none; text-align: left; cursor: pointer;
}
.toc-toggle-text { display: flex; flex-direction: column; gap: 2px; }
.toc-current { font-size: 17px; font-weight: 700; }
.toc-toggle-icon {
  flex: none; width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: oklch(0.96 0.005 270); transition: transform .35s var(--spring);
}
.toc.is-open .toc-toggle-icon { background: var(--gold); transform: rotate(180deg); }
.toc-search {
  width: 100%; padding: 12px 16px;
  border: 1.5px solid oklch(0.9 0.005 270); border-radius: 999px;
  background: #fff; font-size: 15px; outline: none;
  -webkit-appearance: none; appearance: none;
}
.toc-search:focus { border-color: var(--ink); }
.toc-group { display: flex; flex-direction: column; gap: 2px; }
.toc-label, .toc-toggle-label { font-family: var(--mono); font-size: 11px; letter-spacing: .04em; color: var(--label); }
.toc-label { padding: 0 12px 6px; }
.toc-link { padding: 9px 12px; border-radius: 12px; font-size: 15px; transition: transform .25s var(--spring); }
.toc-link:hover { color: inherit; transform: translateX(4px); }
.toc-link.is-active { background: var(--cream); font-weight: 700; }
.toc-empty { padding: 0 12px; font-size: 14px; color: var(--label); }

.docs-main { flex: 1 1 480px; min-width: 0; }

/* Every topic is in the page. Without JS they stack; with JS only the
   topic named by the URL hash shows (see js/docs.js). */
.doc {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
  gap: 48px;
  align-items: start;
}
.doc + .doc { margin-top: 96px; }
.js .doc + .doc { margin-top: 0; }
.js .doc:not(.is-active) { display: none; }

.doc-body { min-width: 0; max-width: 640px; }
.doc-group { margin-bottom: 16px; font-family: var(--mono); font-size: 12px; color: var(--label); }
.doc-title { margin-bottom: 20px; font-size: clamp(36px, 4.6vw, 56px); line-height: 1; letter-spacing: -0.035em; font-weight: 800; }
.doc-intro { margin-bottom: 32px; font-size: 19px; line-height: 1.55; color: oklch(0.38 0.01 270); text-wrap: pretty; }
.doc-intro a, .doc-tip a { border-bottom: 1.5px solid currentColor; }
.doc-steps {
  list-style: none; margin-bottom: 32px; padding: 0;
  display: flex; flex-direction: column; gap: 12px;
  counter-reset: step;
}
.doc-steps li {
  display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 16px; align-items: start;
  padding: 16px; border-radius: 18px; background: oklch(0.975 0.004 270);
  counter-increment: step;
}
.doc-steps li::before {
  content: counter(step);
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--gold); font-size: 15px; font-weight: 800;
}
.doc-steps span { padding-top: 5px; font-size: 17px; line-height: 1.45; }
.doc-tip { padding: 18px 20px; border-radius: 18px; background: var(--a1-tint); font-size: 16px; line-height: 1.5; }
.doc-subtitle { margin: 36px 0 12px; font-size: clamp(23px, 2.6vw, 30px); line-height: 1.15; letter-spacing: -0.025em; }
.doc-subtitle-small { margin: 24px 0 10px; font-size: 19px; line-height: 1.25; }
.doc-table-wrap { max-width: 100%; margin: 18px 0 24px; overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; }
.doc-table { width: 100%; min-width: 520px; border-collapse: collapse; background: var(--wash); font-size: 14px; line-height: 1.45; }
.doc-table th, .doc-table td { padding: 12px 14px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.doc-table thead th { background: var(--cream); font-size: 12px; letter-spacing: .035em; }
.doc-table tbody th { width: 28%; font-weight: 700; }
.doc-table tbody tr:last-child th, .doc-table tbody tr:last-child td { border-bottom: 0; }
.doc-figure { margin: 28px 0 36px; }
.doc-figure img { display: block; width: 100%; height: auto; border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 20px 48px -28px oklch(0.2 0.01 270 / 0.45); }
.doc-figure figcaption { margin-top: 10px; color: var(--label); font-size: 13px; line-height: 1.45; }
.doc-bullets { display: grid; gap: 10px; margin: 18px 0 24px; padding-left: 22px; font-size: 16px; line-height: 1.5; }
.doc-footnote { color: var(--label); font-size: 14px; line-height: 1.5; }
.doc-pager {
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 16px;
  margin-top: 48px; padding-top: 24px; border-top: 1.5px solid oklch(0.93 0.005 270);
  font-size: 15px; font-weight: 500;
}
.doc-next { margin-left: auto; }

.doc-shot { position: relative; display: flex; justify-content: center; padding: 24px; }
.doc-shot::before {
  content: ''; position: absolute; inset: 40px 10%;
  border-radius: 40px; background: var(--cream);
}
.doc-shot img {
  position: relative; width: min(260px, 100%); border-radius: 30px;
  box-shadow: 0 24px 50px -22px oklch(0.2 0.01 270 / 0.5);
  transform: rotate(3deg); transition: transform .45s var(--spring);
}
.doc-shot img:hover { transform: rotate(0deg) translateY(-8px); }

/* ══ Media Vault legal documents ══════════════════════════════ */

.legal-nav { border-bottom: 1.5px solid var(--line); }
.legal-nav .brand { font-size: 19px; }
.legal-nav-links { display: flex; flex-wrap: wrap; align-items: center; gap: 24px; font-size: 14px; font-weight: 500; }
.legal-main { max-width: 920px; padding-block: 64px 96px; }
.legal-header { max-width: 720px; margin-bottom: 48px; }
.legal-kicker { margin-bottom: 18px; font: 12px/1.4 var(--mono); letter-spacing: .06em; color: var(--label); }
.legal-title { margin-bottom: 24px; font-size: clamp(44px, 7vw, 72px); line-height: .98; letter-spacing: -.045em; font-weight: 800; }
.legal-meta { display: flex; flex-wrap: wrap; gap: 8px 24px; color: var(--muted); font-size: 14px; }
.legal-meta dt { font-weight: 700; }
.legal-meta dd { margin: 0; }
.legal-document { max-width: 720px; color: var(--ink-2); font-size: 16px; line-height: 1.75; }
.legal-document h2 { margin: 48px 0 14px; padding-top: 20px; border-top: 1px solid var(--line); color: var(--ink); font-size: 24px; line-height: 1.2; letter-spacing: -.025em; font-weight: 700; }
.legal-document h2:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.legal-document p { margin: 0 0 16px; color: inherit; }
.legal-document ul, .legal-document ol { margin: 0 0 20px; padding-left: 24px; }
.legal-document li { margin-bottom: 8px; padding-left: 4px; }
.legal-document a { color: var(--a1); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.legal-document a:hover { color: var(--ink); }
.legal-footer { max-width: 920px; padding-top: 24px; border-top: 1.5px solid var(--line); }
.legal-footer-copy { max-width: 460px; display: grid; gap: 6px; line-height: 1.5; }
.legal-footer-links { display: flex; flex-wrap: wrap; gap: 12px 20px; }
.legal-index-list { max-width: 720px; margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.legal-index-list li { border-bottom: 1px solid var(--line); }
.legal-index-list a { display: flex; justify-content: space-between; gap: 16px; padding: 20px 0; font-size: 19px; font-weight: 700; }
.legal-index-list a:hover { color: var(--a1); }
.legal-index-list .version { color: var(--label); font: 12px/1.4 var(--mono); font-weight: 400; }

/* Below 1100px .nav is a grid (see Nav & footer). Like .nav-links, the legal links
   take their own centred row there instead of squeezing the brand to nothing. */
@media (max-width: 1100px) {
  .legal-nav-links { grid-column: 1 / -1; grid-row: 2; justify-content: center; gap: 8px clamp(12px, 2.4vw, 28px); }
}

@media (max-width: 600px) {
  .legal-main { padding-block: 40px 64px; }
  .legal-header { margin-bottom: 36px; }
  .legal-document { font-size: 15px; line-height: 1.7; }
  .legal-document h2 { margin-top: 36px; font-size: 21px; }
  .legal-footer { align-items: flex-start; padding-bottom: 32px; }
}

/* ══ Media Vault dark companion theme ══════════════════════════ */

html[data-theme="dark"] { color-scheme: dark; }
html[data-theme="light"] { color-scheme: light; }

/* The Lefila home page shares the saved theme with Media Vault and Transfer. */
html[data-theme="dark"] body.home-page {
  --ink: #edf0f2;
  --ink-2: #d0d6da;
  --muted: #aeb7bd;
  --label: #929da4;
  --line: #30383d;
  --wash: #20272c;
  --a1: #91adff;
  --a2: #77dfd2;
  --a1-tint: #202936;
  --a2-tint: #1d2d2c;
  color: #edf0f2;
  color-scheme: dark;
  background: radial-gradient(ellipse at 55% 0, #1c2226 0, #101315 54rem) #101315;
}
html[data-theme="dark"] .home-page .btn-dark { background: #e9edf0; color: #15191c; }
html[data-theme="dark"] .home-page .btn-dark:hover { background: #91adff; color: #11151a; }
html[data-theme="dark"] .home-page .btn-outline { border-color: #56616a; color: #e4e9ed; }
html[data-theme="dark"] .home-page .btn-outline:hover { background: #20272c; }
html[data-theme="dark"] .home-page .trailer-link span { background: #e9edf0; color: #15191c; }
html[data-theme="dark"] .home-page .home-hero-ring { border-color: #91adff; }
html[data-theme="dark"] .home-page .brand img { border-radius: 12px; }
html[data-theme="dark"] .home-page .app-card { background: #1a2227; }
html[data-theme="dark"] .home-page .app-card-platforms,
html[data-theme="dark"] .home-page .app-card-desc,
html[data-theme="dark"] .home-page .screen figcaption { color: #aeb7bd; }
html[data-theme="dark"] .home-page .app-card .btn-outline:hover { background: #303a40; }
html[data-theme="dark"] .home-page .app-icon { background: #101315; }
html[data-theme="dark"] .home-page .product { border-color: #30383d; background: #181e22; }
html[data-theme="dark"] .home-page .product:hover { border-color: #91adff; }
html[data-theme="dark"] .home-page .product-mv { --icon-bg: #101315; --pill: #202c24; --dot: #70cf8c; }
html[data-theme="dark"] .home-page .product-ledgerly { --pill: #202936; }
html[data-theme="dark"] .home-page .status { color: #e8edf0; }
html[data-theme="dark"] .home-page .story { background: #191f23; }
html[data-theme="dark"] .home-page .post { border-color: #57636a; }
html[data-theme="dark"] .home-page .contact { background: #191f23; }
html[data-theme="dark"] .home-page .contact-email { background: #e9edf0; color: #15191c; }
html[data-theme="dark"] .home-page .contact-email:hover { background: #91adff; color: #11151a; }
html[data-theme="dark"] .home-page .footer { color: #929da4; }

html[data-theme="dark"] body.mv {
  --ink-2: #d4dad7;
  --muted: #aeb6b7;
  --label: #8a9495;
  --line: #303739;
  --wash: #191d20;
  --a1: #e4bd68;
  --a2: #dbb55f;
  --a1-tint: #202528;
  --a2-tint: #202528;
  --gold: #e4bd68;
  --cream: #191d20;
  color: #eef0ed;
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: radial-gradient(ellipse at 50% 0, #22272a 0, #101214 52rem) #101214;
}
html[data-theme="dark"] .mv h1,
html[data-theme="dark"] .mv h2,
html[data-theme="dark"] .mv h3,
html[data-theme="dark"] .mv strong { color: #eef0ed; }
html[data-theme="dark"] .mv .highlight { color: #17191a; }
html[data-theme="dark"] .mv .btn-outline { border-color: #424a4d; color: #e2e4e1; }
html[data-theme="dark"] .mv .btn-outline:hover { background: #202528; }
html[data-theme="dark"] .mv .security,
html[data-theme="dark"] .mv .backup-card-dark,
html[data-theme="dark"] .mv .cta { background: #191d20; border: 1px solid #2d3336; }
html[data-theme="dark"] .mv .security { color: #eef0ed; }
html[data-theme="dark"] .mv .security-item p,
html[data-theme="dark"] .mv .backup-card-dark p,
html[data-theme="dark"] .mv .backup-card p,
html[data-theme="dark"] .mv .feature p,
html[data-theme="dark"] .mv .guide-card p,
html[data-theme="dark"] .mv .faq-item p { color: #aeb6b7; }
html[data-theme="dark"] .mv .feature:nth-child(3n) { background: #202528; }
html[data-theme="dark"] .mv .guide-card,
html[data-theme="dark"] .mv .faq-item { border-color: #303739; background: #191d20; }
html[data-theme="dark"] .mv .guide-card:hover,
html[data-theme="dark"] .mv .faq-item[open] { border-color: #d5a545; }
html[data-theme="dark"] .mv .faq-item[open] { background: #22231f; }
html[data-theme="dark"] .mv .faq-icon { background: #2d3336; color: #e2e4e1; }
html[data-theme="dark"] .mv .toc-toggle-icon,
html[data-theme="dark"] .mv .toc-search { border-color: #424a4d; background: #191d20; color: #eef0ed; }
html[data-theme="dark"] .mv .toc-search::placeholder { color: #838e90; }
html[data-theme="dark"] .mv .toc-link.is-active { background: #202528; }
html[data-theme="dark"] .mv .docs-nav,
html[data-theme="dark"] .mv .doc-pager { border-color: #303739; }
html[data-theme="dark"] .mv .doc-intro { color: #aeb6b7; }
html[data-theme="dark"] .mv .doc-steps li { background: #191d20; }
html[data-theme="dark"] .mv .doc-steps li::before { color: #17191a; }
html[data-theme="dark"] .mv .doc-tip { background: #202528; }
html[data-theme="dark"] .mv .doc-table thead th { background: #202528; color: #eef0ed; }
html[data-theme="dark"] .mv .doc-table tbody th { color: #eef0ed; }
html[data-theme="dark"] .mv .doc-table th, html[data-theme="dark"] .mv .doc-table td { border-color: #343a3d; }
html[data-theme="dark"] .mv .doc-shot::before { background: #191d20; }
html[data-theme="dark"] .mv .legal-document { color: #d4dad7; }
html[data-theme="dark"] .mv .legal-document h2 { color: #eef0ed; }
html[data-theme="dark"] .mv .legal-footer,
html[data-theme="dark"] .mv .legal-index-list { border-color: #303739; }
html[data-theme="dark"] .mv .legal-index-list .version,
html[data-theme="dark"] .mv .footer { color: #8a9495; }
.mv .footer-brand img { border-radius: 8px; }

.theme-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 38px; padding: 0 13px; gap: 8px; flex: none;
  border: 1px solid var(--line); border-radius: 999px;
  background: var(--wash); color: var(--ink); font-size: 13px; font-weight: 600; line-height: 1;
  cursor: pointer; transition: transform .2s var(--spring), border-color .2s, background .2s;
}
.theme-toggle:hover { transform: translateY(-1px); border-color: var(--gold); }
.theme-toggle:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
.theme-icon { display: block; font-size: 20px; line-height: 1; }
nav .theme-toggle { width: 38px; height: 38px; min-height: 38px; padding: 0; border-radius: 50%; font-size: 20px; }
nav .theme-toggle .theme-label {
  position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden;
  clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
html[data-theme="dark"] .mv .theme-toggle { border-color: #424a4d; background: #191d20; color: #e4bd68; }

/* ── Small screens ────────────────────────────────────────────── */

/* The two overlapping phones span ~460px and sit left of centre, so on narrow
   screens the hero art is the desktop layout scaled down (--u is one desktop
   pixel) and shifted 17px right to centre the pair, keeping both on screen. */
@media (max-width: 540px) {
  .mv-hero-art { --u: min(1px, 100vw / 500); height: calc(560 * var(--u)); }
  .mv-hero-disc { width: calc(420 * var(--u)); transform: translateX(calc(17 * var(--u))); }
  .mv-hero-square {
    right: calc(50% - 244 * var(--u)); top: calc(34 * var(--u));
    width: calc(56 * var(--u)); height: calc(56 * var(--u)); border-radius: calc(14 * var(--u));
  }
  .mv-hero-ring {
    left: calc(50% - 220 * var(--u)); bottom: calc(45 * var(--u));
    width: calc(72 * var(--u)); height: calc(72 * var(--u));
  }
  .mv-phone-light { left: calc(50% - 203 * var(--u)); top: calc(70 * var(--u)); width: calc(210 * var(--u)); border-radius: calc(30 * var(--u)); }
  .mv-phone-dark { left: calc(50% - 23 * var(--u)); top: calc(30 * var(--u)); width: calc(230 * var(--u)); border-radius: calc(32 * var(--u)); }
}

/* Docs on phones: the topic list folds into a button above the topic, so the topic shows
   first; js/docs.js opens and closes it. Without JS the list stays open. */
@media (max-width: 760px) {
  .docs-layout { flex-direction: column; align-items: stretch; gap: 32px; padding-top: 24px; }
  .toc, .docs-main { flex: none; min-width: 0; }
  .js .toc { border: 1.5px solid var(--line); border-radius: 20px; transition: border-color .2s; }
  .js .toc.is-open { border-color: var(--ink); }
  .js .toc-toggle { display: flex; }
  .js .toc-panel { padding: 0 8px 16px; }
  .js .toc:not(.is-open) .toc-panel { display: none; }
  .toc-link { padding-block: 11px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0s !important; }
}
