/* ============================================================
   public.css — what every public page shares (GitHub issue 452): the
   brand's font and colours, the night header with its menu of guides,
   the buttons and the dark footer. The home page adds its horizon
   (home.css); the reading pages, their day and night (reading.css).
   The direction: DESIGN.md.
   ============================================================ */

/* The brand's font, the file the app serves (frontend/brand/, its licence there). */
@font-face {
  font-family: "Satoshi";
  font-weight: 300 900;
  font-display: swap;
  src: url("/app/brand/Satoshi-Variable.woff2") format("woff2");
}

:root {
  --nav-h: 64px;
  --night: #07080d; --navy: #10153a; --panel-n: #0d1030;
  --ink-n: #f1f2f8; --muted-n: #a6acc8; --soft-n: #c3c8e6;
  --lav: #b7bdff; --green-n: #7ee0a8;
  --day: #f8f6f1; --panel: #fff; --ink: #1c1b19; --muted: #6f6c66; --border: #e6e1da; --indigo: #4b4fc4;
  --rule-n: #ffffff2a;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scrollbar-color: var(--indigo) var(--night); scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { margin: 0; font-family: "Satoshi", sans-serif; color: var(--ink-n); background: var(--day); line-height: 1.5; -webkit-font-smoothing: antialiased; }
img { max-width: 100%; }
a { color: inherit; }
::selection { background: var(--lav); color: var(--night); }
:where(a, button, summary, [tabindex]):focus-visible { outline: 2px solid var(--lav); outline-offset: 3px; }
.day :where(a, button, summary):focus-visible { outline-color: var(--indigo); }
.site-footer a:focus-visible { outline-color: var(--lav); }
/* The fixed header's room, once, for the links within the page and the keyboard. */
html { scroll-padding-top: calc(var(--nav-h) + var(--promo-band-h, 0px)); }
h1, h2, h3, h4 { text-wrap: balance; } p, li { text-wrap: pretty; }

.wrap { width: min(1120px, calc(100% - 128px)); margin: 0 auto; }

/* Buttons: rounded, light on the night, ink in the day. */
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; font-weight: 800; font-size: 1rem; padding: 12px 26px; border-radius: 999px; text-decoration: none; border: 1px solid transparent; transition: background .2s, border-color .2s, transform .2s; }
.btn[hidden] { display: none; }
.btn.light { background: var(--ink-n); color: var(--night); }
.btn.light:hover { background: #fff; }
.btn.ghost-n { border-color: #ffffff3a; color: var(--ink-n); }
.btn.ghost-n:hover { border-color: #ffffff80; }
.btn.ghost { border-color: var(--border); background: var(--panel); color: var(--ink); }
.btn.ghost:hover { border-color: #c9c3ba; }

/* ---------- Header ---------- */
/* The header stays at the top as the page scrolls (the owner, 2026-12-03), under the special offer's
   band when there is one: an opaque night ground and a hairline under it. */
.site-header { position: sticky; top: var(--promo-band-h, 0px); z-index: 25; height: var(--nav-h); display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 0 64px; background: var(--night); border-bottom: 1px solid #ffffff14; }
.site-brand { display: flex; } .site-brand img { display: block; height: 28px; width: auto; }
.site-nav { display: flex; align-items: center; gap: 26px; font-size: 0.9375rem; }
.nav-link, .site-menu > summary { color: var(--muted-n); text-decoration: none; }
.nav-link:hover, .site-menu > summary:hover, .site-menu[open] > summary { color: var(--ink-n); }
.site-menu { position: relative; }
.site-menu > summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.site-menu > summary::-webkit-details-marker { display: none; }
.site-menu > summary::after { content: ''; width: 6px; height: 6px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: translateY(-2px) rotate(45deg); }
.site-menu[open] > summary::after { transform: translateY(1px) rotate(225deg); }
.site-menu-pop { position: absolute; top: calc(100% + 12px); right: -40px; z-index: 20; width: 300px; display: flex; flex-direction: column; padding: 6px; border-radius: 14px; background: var(--navy); border: 1px solid var(--rule-n); box-shadow: 0 24px 48px -24px #000; }
.site-menu-pop a { padding: 10px 12px; border-radius: 9px; text-decoration: none; color: var(--ink-n); font-size: 0.875rem; line-height: 1.35; }
.site-menu-pop a:hover { background: #ffffff12; }
.site-lang { background: none; border: 0; padding: 4px 2px; font: inherit; font-weight: 700; color: var(--muted-n); cursor: pointer; }
.site-lang:hover { color: var(--ink-n); }
a.site-lang { text-decoration: none; }
.pill { white-space: nowrap; color: var(--ink-n); text-decoration: none; border: 1px solid #ffffff2a; padding: 8px 16px; border-radius: 999px; font-weight: 600; }
.pill:hover { border-color: #ffffff70; }

/* The theme button of the reading pages, beside the language (js/theme.js). */
.site-theme { width: 32px; height: 32px; padding: 0; display: inline-grid; place-items: center; border-radius: 8px; }

/* ---------- Footer: the disclaimer and the legal links, on the night ---------- */
.site-footer { background: var(--night); color: var(--muted-n); border-top: 1px solid #ffffff1a; padding: 26px max(64px, calc((100% - 1120px) / 2)) 40px; font-size: 0.8125rem; display: flex; justify-content: space-between; gap: 24px; }
.site-footer p { margin: 0; max-width: 62ch; }
.site-footer b { color: var(--ink-n); }
.legal-links { display: flex; flex-wrap: wrap; gap: 6px 16px; align-content: flex-start; justify-content: flex-end; }
.legal-links a { color: var(--muted-n); text-decoration: none; }
.legal-links a:hover { color: var(--ink-n); }

/* English offered, never forced (GitHub issue 302). */
.lang-hint { position: fixed; left: 0; right: 0; bottom: 16px; margin: 0 auto; width: fit-content; max-width: calc(100% - 32px); z-index: 50; display: flex; align-items: center; gap: 14px; padding: 8px 8px 8px 16px; border-radius: 14px; background: var(--navy); color: var(--ink-n); border: 1px solid var(--rule-n); box-shadow: 0 20px 40px -20px #000; font-size: 0.875rem; }
.lang-hint[hidden] { display: none; }
.lang-hint a { color: var(--lav); font-weight: 700; white-space: nowrap; }
.lang-hint button { width: 32px; height: 32px; flex: none; border: 0; border-radius: 8px; background: transparent; color: var(--muted-n); font-size: 1.125rem; cursor: pointer; }
.lang-hint button:hover { background: #ffffff14; color: var(--ink-n); }

@media (prefers-reduced-motion: reduce) { .btn { transition: none; } }

/* Touch: every control at least 44px high. */
@media (pointer: coarse) {
  .site-lang, .site-menu > summary, .pill { min-height: 44px; display: inline-flex; align-items: center; }
  .site-theme { width: 36px; height: 44px; }
  .lang-hint button { width: 44px; height: 44px; }
}

@media (max-width: 700px) {
  .wrap { width: calc(100% - 32px); }
  :root { --nav-h: 56px; }
  .site-header { padding: 0 16px; }
  .site-nav { gap: 14px; } .nav-link { display: none; }
  .site-menu { position: static; }
  .site-menu-pop { left: 16px; right: 16px; width: auto; }
  .site-footer { flex-direction: column; padding: 22px 16px 34px; }
  .legal-links { justify-content: flex-start; }
}
/* A phone with the theme button as well: the logo's mark alone (the lockup's left end), so the
   header holds on one line. */
@media (max-width: 440px) {
  .site-header:has(.site-theme) .site-brand { width: 28px; overflow: hidden; flex: none; }
  .site-header:has(.site-theme) .site-brand img { max-width: none; }
}
@media (max-width: 360px) {
  .site-brand img { height: 24px; } .site-nav { gap: 10px; }
  .site-header:has(.site-theme) .site-brand { width: 24px; }
  .site-header:has(.site-theme) { padding: 0 12px; }
  .site-header:has(.site-theme) .site-nav { gap: 8px; }
  .site-header:has(.site-theme) .pill { padding: 7px 10px; font-size: 0.875rem; }
}
/* The narrowest touch screens: the controls' 44px boxes leave less room between them. */
@media (max-width: 360px) and (pointer: coarse) {
  .site-header:has(.site-theme) .site-nav { gap: 3px; }
}
