/* Launcher and info pages (index, about, route, help).
 * Design A palette and type, matching the hub (coastal-legacies.html): ink background,
 * sand text, Domine for display, Open Sans for reading. Fonts are self-hosted.
 */

@font-face {
  font-family: 'Domine'; font-style: normal; font-weight: 400; font-display: swap;
  src: url('../fonts/domine-v25-latin/domine-v25-latin-regular.woff2') format('woff2');
}
@font-face {
  font-family: 'Domine'; font-style: normal; font-weight: 700; font-display: swap;
  src: url('../fonts/domine-v25-latin/domine-v25-latin-700.woff2') format('woff2');
}
@font-face {
  font-family: 'Open Sans'; font-style: normal; font-weight: 400; font-display: swap;
  src: url('../fonts/open-sans-v44-latin/open-sans-v44-latin-regular.woff2') format('woff2');
}
@font-face {
  font-family: 'Open Sans'; font-style: normal; font-weight: 600; font-display: swap;
  src: url('../fonts/open-sans-v44-latin/open-sans-v44-latin-600.woff2') format('woff2');
}

:root {
  --ink: #0B1A20;
  --ink-raised: #11262E;
  --ink-deep: #071219;
  --sand: #E4E7E2;
  --sand-dim: #B9C4C4;
  --tide: #7FA8AE;
  --current: #1F9188;
  --ochre: #C08A3E;
  --flare: #DA8518;
  --rule: rgba(127, 168, 174, 0.26);
  --rule-soft: rgba(127, 168, 174, 0.13);
  --gutter: 22px;
  --display: 'Domine', Georgia, serif;
  --text: 'Open Sans', system-ui, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; background: var(--ink-deep); }

body {
  min-height: 100vh;
  min-height: 100dvh;
  font-family: var(--text);
  font-size: 16px;
  line-height: 1.55;
  color: var(--sand);
  background: linear-gradient(180deg, #143038 0%, var(--ink) 40%, var(--ink-deep) 100%);
}

a { color: inherit; }
::selection { background: var(--current); color: #fff; }
:focus-visible { outline: 2px solid var(--current); outline-offset: 2px; }

[data-lang="en"] .lang-fr,
[data-lang="fr"] .lang-en { display: none !important; }

/* MIA Cube awareness (js/site.js) */
html:not(.on-cube) .cube-only,
html:not(.cube-portal) .portal-only,
.cube-portal .not-portal { display: none !important; }

.page {
  max-width: 720px;
  margin: 0 auto;
  padding: max(env(safe-area-inset-top), 16px) var(--gutter) max(env(safe-area-inset-bottom), 32px);
}

/* ── Top bar: back / brand, language toggle ── */
.topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--sand-dim);
  padding: 10px 0;
}

.brand {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.85);
}

.lang-toggle {
  margin-left: auto;
  display: flex;
  border: 1px solid var(--rule);
  border-radius: 3px;
  overflow: hidden;
}

.lang-toggle button {
  appearance: none;
  border: 0;
  background: none;
  cursor: pointer;
  font: 600 11px/1 var(--text);
  letter-spacing: 0.16em;
  color: var(--sand-dim);
  padding: 10px 14px;
  min-width: 44px;
}

.lang-toggle button[aria-pressed="true"] { background: var(--current); color: #fff; }

/* ── Status chip: "Connected to MIA Cube" ── */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--sand);
  background: rgba(31, 145, 136, 0.22);
  border: 1px solid rgba(31, 145, 136, 0.55);
  border-radius: 999px;
  padding: 5px 12px 5px 10px;
}

.chip::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #3fd1b4;
  box-shadow: 0 0 0 3px rgba(63, 209, 180, 0.2);
}

/* ── Notice: the welcome-window "open the full app" banner, placeholders ── */
.notice {
  border: 1px solid var(--rule);
  background: rgba(17, 38, 46, 0.86);
  border-radius: 10px;
  padding: 14px 16px;
  font-size: 14px;
  line-height: 1.5;
}

.notice strong { color: #fff; }

.notice .url {
  display: inline-block;
  margin-top: 6px;
  font-weight: 600;
  color: #fff;
  word-break: break-all;
  -webkit-user-select: all;
  user-select: all;
}

/* Hand-off from the welcome window to Safari/Chrome (js/site.js). Tested 2026-10-18:
   copying is the only route out of the iOS welcome window; intent:// is Android-only. */
.handoff { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.btn-handoff {
  appearance: none;
  border: 0;
  border-radius: 2px;
  background: var(--current);
  color: #fff;
  font: 600 12px/1 var(--text);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 14px 20px;
  cursor: pointer;
}
.btn-handoff--ghost { background: transparent; box-shadow: inset 0 0 0 1px currentColor; color: inherit; }
.btn-handoff[hidden], .handoff-done[hidden] { display: none; }
.handoff-done { flex-basis: 100%; margin: 4px 0 0; font-weight: 600; }

.todo {
  border: 1px dashed rgba(218, 133, 24, 0.7);
  background: rgba(218, 133, 24, 0.08);
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 14px;
  color: var(--sand-dim);
}

.todo::before {
  content: 'À confirmer · To confirm';
  display: block;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--flare);
  margin-bottom: 4px;
}

/* ── Info pages: article type ── */
.page-head { padding: 28px 0 8px; }

.eyebrow {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--tide);
  margin-bottom: 10px;
}

.page-head h1 {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(30px, 8vw, 44px);
  line-height: 1.12;
  color: #fff;
}

.lede {
  margin-top: 14px;
  font-size: 17px;
  color: var(--sand-dim);
}

.section {
  padding: 26px 0 4px;
  border-top: 1px solid var(--rule-soft);
  margin-top: 26px;
}

.section h2 {
  font-family: var(--display);
  font-weight: 700;
  font-size: 21px;
  line-height: 1.25;
  color: #fff;
  margin-bottom: 10px;
}

.section p + p,
.section p + ol,
.section p + ul,
.section ol + p,
.section ul + p,
.section .notice,
.section .todo { margin-top: 12px; }

.section ol,
.section ul { padding-left: 22px; }
.section li + li { margin-top: 6px; }
.section strong { color: #fff; font-weight: 600; }

.platform {
  margin-top: 14px;
  padding: 14px 16px;
  border-radius: 10px;
  background: var(--ink-raised);
  border: 1px solid var(--rule-soft);
}

.platform h3 {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--tide);
  margin-bottom: 8px;
}

/* ── Route list ── */
.ports { list-style: none; padding: 0 !important; margin-top: 16px; counter-reset: port; }

.ports li {
  counter-increment: port;
  position: relative;
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 12px 0 12px 44px;
  border-bottom: 1px solid var(--rule-soft);
  margin: 0 !important;
}

.ports li::before {
  content: counter(port);
  position: absolute;
  left: 0;
  top: 10px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid var(--rule);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--tide);
}

.ports .port-name { font-family: var(--display); font-size: 18px; color: #fff; }

.ports a.story {
  margin-left: auto;
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--sand);
  border: 1px solid var(--rule);
  border-radius: 999px;
  padding: 7px 12px;
}

/* ── Keep everything offline (help.html, js/offline.js) ── */
.offline[hidden] { display: none; }
.offline-lang {
  border: 0;
  margin-top: 14px;
  display: grid;
  gap: 6px;
}
.offline-lang legend {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--tide);
  margin-bottom: 6px;
}
.offline-lang label {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 14px;
  border-radius: 10px;
  background: var(--ink-raised);
  border: 1px solid var(--rule-soft);
  cursor: pointer;
}
.offline-lang input { accent-color: var(--current); width: 18px; height: 18px; }
.offline-lang small { margin-left: auto; color: var(--sand-dim); font-size: 13px; }
.offline-status { margin-top: 14px; }
.offline-progress {
  display: block;
  width: 100%;
  height: 6px;
  margin-top: 10px;
  accent-color: var(--current);
}
.offline-progress[hidden] { display: none; }
.btn-handoff:disabled { opacity: 0.55; cursor: default; }

.foot {
  margin-top: 40px;
  font-size: 12px;
  color: var(--tide);
  text-align: center;
}

@media (min-width: 700px) {
  :root { --gutter: 40px; }
}
