/* Ephemeria public site — L'Arc, Marine theme (docs/ephemeria-spec.md §3).
   One stylesheet, no scripts, no third-party requests: fonts are self-hosted
   (SIL Open Font License, see assets/fonts/OFL-*.txt). The generated pages
   come from site/src/ (node site/src/build.mjs). */

@font-face {
  font-family: "Bricolage Grotesque";
  src: url("fonts/BricolageGrotesque_600SemiBold.ttf") format("truetype");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Sans";
  src: url("fonts/IBMPlexSans_400Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Sans";
  src: url("fonts/IBMPlexSans_600SemiBold.ttf") format("truetype");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("fonts/IBMPlexMono_400Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

/* Marine tokens. Dark theme: the accent is a fill only, never text. */
:root {
  --bg: #162236;
  --bg-image: radial-gradient(118% 92% at 62% 16%, #2A3851 0%, #18243A 46%, #0D1626 100%);
  --ink: #F1F2F4;
  --mist: #97A4BA;
  --rule: rgba(241, 243, 242, 0.17);
  --accent: #236AE7;
  --on-accent: #FFFFFF;
  --field: rgba(255, 255, 255, 0.07);
  --stage: #0C121D;
  --cut: 18px;
  /* Illustration only: the tones of a night photo, in the theme's own hue. */
  --ph-0: #2F4670;
  --ph-1: #3A4F7A;
  --ph-2: #24395C;
  --ph-hi: #B8C7E3;
  --ph-lo: #111A2B;
  --display: "Bricolage Grotesque", "IBM Plex Sans", system-ui, sans-serif;
  --body: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;
  color-scheme: dark;
}

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

html {
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  background-image: var(--bg-image);
  background-attachment: fixed;
  color: var(--ink);
  font-family: var(--body);
  font-size: 1.0625rem;
  line-height: 1.6;
  overflow-wrap: break-word;
}

a { color: var(--ink); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }
a:focus-visible, .button:focus-visible, summary:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
  border-radius: 2px;
}

.skip {
  position: absolute;
  left: 16px;
  top: -200px;
  padding: 8px 12px;
  background: var(--stage);
  color: var(--ink);
  z-index: 10;
}
.skip:focus { top: 8px; }

.wrap {
  width: 100%;
  max-width: 48rem;
  margin: 0 auto;
  padding: 0 16px;
}
.wrap.wide { max-width: 72rem; }
@media (min-width: 640px) { .wrap { padding: 0 24px; } }

/* Header */
.site-header {
  border-bottom: 1px solid var(--rule);
}
.site-header .wrap {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 6px 16px;
  padding-top: 16px;
  padding-bottom: 10px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.25rem;
  letter-spacing: 0.01em;
  color: var(--ink);
}
.brand svg { width: 40px; height: 16px; flex: none; }
.primary {
  grid-column: 1 / -1;
  grid-row: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 0 2px;
  margin: 0 -8px;
}
.primary a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 4px 8px;
  color: var(--mist);
  text-decoration: none;
  font-size: 0.95rem;
}
.primary a:hover { color: var(--ink); }
.primary a[aria-current="page"] { color: var(--ink); text-decoration: underline; text-underline-offset: 0.4em; }
@media (min-width: 860px) {
  .site-header .wrap { grid-template-columns: auto 1fr auto; padding-bottom: 14px; }
  .primary { grid-column: 2; grid-row: 1; justify-content: flex-end; margin: 0; gap: 4px; }
}
.lang { display: flex; gap: 4px; font-family: var(--mono); font-size: 0.875rem; }
.lang a, .lang span {
  display: inline-block;
  min-width: 44px;
  min-height: 32px;
  padding: 4px 8px;
  text-align: center;
  text-decoration: none;
  color: var(--mist);
  border-radius: 999px;
}
.lang span[aria-current] { color: var(--ink); border: 1px solid var(--rule); }
.lang a:hover { color: var(--ink); }

/* Content */
main { padding: 40px 0 56px; }
h1, h2, h3 {
  font-family: var(--display);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.005em;
}
h1 { font-size: clamp(2rem, 6vw, 2.75rem); margin: 0 0 12px; }
h2 { font-size: 1.5rem; margin: 2.4em 0 0.6em; padding-top: 0.8em; border-top: 1px solid var(--rule); }
h3 { font-size: 1.15rem; margin: 1.8em 0 0.4em; }
p, ul, ol { margin: 0 0 1em; }
li { margin-bottom: 0.35em; }
strong { font-weight: 600; }

.lede { font-size: 1.2rem; color: var(--ink); max-width: 40rem; }
.muted, .meta { color: var(--mist); }
.small { font-size: 0.9rem; }
.meta {
  font-family: var(--mono);
  font-size: 0.875rem;
  font-variant-numeric: tabular-nums;
  margin-bottom: 24px;
}
.data { font-family: var(--mono); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* The notched card — one notch size everywhere (spec §3, --cut). */
.card, .plate, .cta, .ticket {
  clip-path: polygon(var(--cut) 0, 100% 0, 100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, 0 100%, 0 var(--cut));
}
.card {
  background: var(--field);
  padding: 20px 20px 18px;
  margin: 0 0 16px;
}
.card h2, .card h3 { margin-top: 0; padding-top: 0; border-top: 0; }
.card p:last-child, .card ul:last-child { margin-bottom: 0; }
.grid { display: grid; gap: 16px; grid-template-columns: 1fr; }
.grid .card { margin: 0; }
@media (min-width: 640px) { .grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 960px) { .grid.three { grid-template-columns: repeat(3, 1fr); } }

.button {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 10px 18px;
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 600;
  text-decoration: none;
  clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
}
.button.ghost {
  background: transparent;
  color: inherit;
  box-shadow: inset 0 0 0 1px currentColor;
  clip-path: none;
}
.button:hover { text-decoration: underline; text-underline-offset: 0.2em; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }

.stores { display: flex; flex-wrap: wrap; gap: 12px; margin: 8px 0 16px; }
.store {
  display: inline-block;
  padding: 10px 16px;
  border: 1px solid var(--rule);
  color: var(--ink);
  font-size: 0.95rem;
}

.note {
  border-left: 3px solid var(--accent);
  padding: 10px 14px;
  background: var(--field);
  margin: 0 0 1.2em;
}

/* Tables scroll inside their own box on narrow screens; the page never does. */
.table {
  width: 100%;
  overflow-x: auto;
  margin: 0 0 1.4em;
  border: 1px solid var(--rule);
}
table { width: 100%; border-collapse: collapse; font-size: 0.95rem; min-width: 34rem; }
th, td { text-align: left; vertical-align: top; padding: 10px 12px; border-bottom: 1px solid var(--rule); }
th { font-weight: 600; background: var(--field); }
tr:last-child td { border-bottom: 0; }

/* Phones: each row becomes a small labelled block instead of a wide grid. */
@media (max-width: 639px) {
  .table { border: 0; overflow: visible; }
  table { min-width: 0; }
  thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  tr { display: block; border: 1px solid var(--rule); margin: 0 0 12px; }
  td { display: block; border-bottom: 0; padding: 8px 12px; }
  td + td { border-top: 1px solid var(--rule); }
  td::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 2px;
    color: var(--mist);
    font-family: var(--mono);
    font-size: 0.8rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
  }
}

.toc { font-size: 0.95rem; }
.toc ol { padding-left: 1.2em; columns: 1; }
@media (min-width: 640px) { .toc ol { columns: 2; column-gap: 32px; } }

address { font-style: normal; }

/* ——— Marketing pages ——— */
.marketing main { padding: 0 0 24px; }
.marketing h2 {
  border-top: 0;
  padding-top: 0;
  margin: 0 0 18px;
  font-size: clamp(1.75rem, 4.4vw, 2.75rem);
  line-height: 1.08;
  letter-spacing: -0.015em;
  max-width: 20ch;
}
.marketing .card h3, .step h3, .principle h3 { margin: 0 0 8px; }
.eyebrow, .kicker {
  font-family: var(--mono);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--mist);
  margin: 0 0 14px;
}
.card .kicker { color: var(--ink); }
.band { padding: 56px 0; border-top: 1px solid var(--rule); }
@media (min-width: 860px) { .band { padding: 96px 0; } }

.hero { padding: 28px 0 56px; }
.hero h1 {
  font-size: clamp(2.6rem, 8.2vw, 5.25rem);
  line-height: 1;
  letter-spacing: -0.025em;
  margin: 0 0 22px;
  max-width: 14ch;
}
.hero .lede { font-size: clamp(1.15rem, 2.2vw, 1.35rem); max-width: 38rem; }
.hero-text { margin-top: 36px; }
.page-hero { padding: 56px 0 64px; }
.page-hero h1 { font-size: clamp(2.4rem, 6.5vw, 4.4rem); max-width: 16ch; }

.sky-figure { margin: 0; }
.sky-rail {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 10px;
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--mist);
  font-variant-numeric: tabular-nums;
}
.sky-rail span { max-width: 34%; }
.sky-rail span:nth-child(2) { text-align: center; }
.sky-rail span:last-child { text-align: right; }

/* Illustrations: inline SVG, coloured by class (the CSP forbids inline styles). */
.art { display: block; width: 100%; height: auto; overflow: visible; }
.art .ink { fill: var(--ink); }
.art .stroke-ink { stroke: var(--ink); }
.art .si { stop-color: var(--ink); }
.art .ss { stop-color: var(--stage); }
.art .hz { stroke: var(--rule); stroke-width: 1; }
.art .tick { stroke: var(--rule); stroke-width: 1; }
.art .dash { stroke: var(--ink); stroke-opacity: 0.4; stroke-width: 1; stroke-dasharray: 3 4; }
.art .mark { stroke: var(--ink); stroke-width: 1.2; }
.art .accent { fill: var(--accent); }
.art .ring { fill: none; stroke: var(--ink); stroke-opacity: 0.5; stroke-width: 1; }
.art .figure { stroke: var(--ink); stroke-opacity: 0.55; stroke-width: 1.2; stroke-linejoin: round; }
.art .rule-h { stroke: var(--rule); stroke-width: 1; }
.art .rule-q { stroke: var(--rule); stroke-width: 1; stroke-opacity: 0.45; }
.art text { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.art .lbl { fill: var(--mist); font-size: 14px; }
.art .lbl-ink { fill: var(--ink); font-size: 16px; }
.art .sm { font-size: 10.5px; }
.art .ph-0 { stop-color: var(--ph-0); }
.art .ph-1 { stop-color: var(--ph-1); }
.art .ph-2 { stop-color: var(--ph-2); }
.art .ph-hi { stop-color: var(--ph-hi); }
.art .ph-lo { stop-color: var(--ph-lo); }
.art .tick-done { stroke: var(--ink); stroke-opacity: 0.18; stroke-width: 2; stroke-linecap: round; }
.art .tick-live { stroke: var(--ink); stroke-width: 2.4; stroke-linecap: round; }
.art .dial-num { fill: var(--ink); font-size: 104px; }
.art .code-bg { fill: var(--ink); }
.art .code-ink { fill: var(--stage); }

/* The one orchestrated animation: the arc drawing itself. */
@media (prefers-reduced-motion: no-preference) {
  .art .draw { stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 2.4s cubic-bezier(0.3, 0.1, 0.2, 1) 0.2s forwards; }
}
@keyframes draw { to { stroke-dashoffset: 0; } }

.rail-figure { display: none; margin: 40px 0 16px; }
@media (min-width: 900px) { .rail-figure { display: block; } }

.steps { list-style: none; padding: 0; margin: 32px 0 0; display: grid; gap: 16px; }
.steps .card { margin: 0; padding: 22px 22px 20px; }
@media (min-width: 860px) { .steps { grid-template-columns: repeat(3, 1fr); } }
.step h3 { font-size: 1.4rem; }

.split { display: grid; gap: 40px; align-items: start; }
@media (min-width: 900px) {
  .split { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 72px; align-items: center; }
  .split.sticky, .split.top { align-items: start; }
  .split.sticky > .split-text { position: sticky; top: 32px; }
  .split.reverse > :first-child { order: 2; }
}
.split-text { max-width: 36rem; }
.split-text.narrow { max-width: 46rem; }
.points { padding-left: 1.1em; margin-top: 20px; }
.points li { margin-bottom: 0.7em; }
.numbered { padding-left: 1.4em; margin-top: 8px; }
.numbered li { margin-bottom: 18px; }
.numbered li::marker { font-family: var(--mono); color: var(--mist); }
.numbered h3 { margin: 0 0 4px; font-size: 1.15rem; }
.numbered p { margin: 0; }

.plate { background: var(--stage); padding: 20px; margin: 0; }
.plate figcaption { color: var(--mist); font-size: 0.9rem; margin-top: 14px; }
.plate figcaption strong { color: var(--ink); display: block; font-family: var(--display); font-size: 1.15rem; margin-bottom: 2px; }
.plate .kicker { color: var(--mist); margin-bottom: 8px; }

.phone { width: 100%; max-width: 380px; justify-self: center; padding: 22px 20px 20px; }
.phone-title { font-family: var(--display); font-weight: 600; font-size: 1.6rem; line-height: 1.1; margin: 0 0 6px; }
.phone-head .data { white-space: normal; font-size: 0.85rem; margin: 0; }
.neb-arc { margin: 18px 0 2px; }
.neb-line { margin-top: 6px; }

.dial-figure { width: 100%; max-width: 420px; justify-self: center; padding: 32px 24px 24px; text-align: center; }
.dial { max-width: 300px; margin: 0 auto; }
.dial-figure figcaption { font-family: var(--display); font-size: 1.25rem; color: var(--ink); }

.skies { display: grid; gap: 16px; margin: 36px 0 14px; }
@media (min-width: 860px) { .skies { grid-template-columns: 1fr 1fr; } }

.ticket {
  width: 100%;
  max-width: 340px;
  justify-self: center;
  margin: 0;
  padding: 24px 22px 20px;
  background: var(--ink);
  color: var(--stage);
}
.ticket .kicker { color: var(--stage); opacity: 0.72; margin-bottom: 6px; }
.ticket .phone-title { margin-bottom: 4px; }
.ticket .data { white-space: normal; font-size: 0.9rem; margin: 0; }
.ticket-code { max-width: 190px; margin: 22px auto; }
.ticket-foot {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-top: 14px;
  border-top: 1px dashed currentColor;
  font-family: var(--mono);
  font-size: 0.8rem;
  letter-spacing: 0.02em;
}

.cta {
  display: grid;
  gap: 18px;
  align-items: center;
  padding: 32px 28px;
  background: var(--accent);
  color: var(--on-accent);
}
.cta h2 { color: var(--on-accent); margin-bottom: 10px; }
.cta .kicker { color: var(--on-accent); }
.cta p { margin: 0; max-width: 40rem; }
.cta a { color: var(--on-accent); }
@media (min-width: 860px) { .cta { grid-template-columns: 1fr auto; padding: 48px 52px; gap: 40px; } }

.split-faq { display: grid; gap: 24px; }
@media (min-width: 900px) { .split-faq { grid-template-columns: 1fr 1.6fr; gap: 72px; } }

/* Questions: native disclosure, no script. */
.faq details { border-top: 1px solid var(--rule); }
.faq details:last-child { border-bottom: 1px solid var(--rule); }
.faq summary {
  position: relative;
  cursor: pointer;
  list-style: none;
  padding: 16px 36px 16px 0;
  font-weight: 600;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  position: absolute;
  right: 6px;
  top: 13px;
  font-family: var(--mono);
  font-size: 1.25rem;
  color: var(--mist);
}
.faq details[open] summary::after { content: "−"; }
.faq details p { margin: 0 0 18px; max-width: 42rem; }
.faq-group h2 { margin-bottom: 0.4em; }
.doc .more { margin-top: 48px; }

.months-figure { margin: 28px 0 8px; }
.months-figure > figcaption { color: var(--mist); font-size: 0.9rem; margin-top: 14px; }
.months { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px 8px; }
@media (min-width: 560px) { .months { grid-template-columns: repeat(6, 1fr); } }
.month { margin: 0; }
.month figcaption {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 6px;
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--mist);
}
.month figcaption .data { color: var(--ink); text-transform: none; }

/* Footer */
.site-footer { border-top: 1px solid var(--rule); padding: 40px 0 48px; font-size: 0.95rem; }
.foot-grid { display: grid; gap: 28px; }
@media (min-width: 860px) { .foot-grid { grid-template-columns: 1fr 2fr; gap: 48px; } }
.foot-brand p { color: var(--mist); max-width: 22rem; margin: 12px 0 0; }
.foot-nav { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 20px; }
.foot-title {
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--mist);
  margin: 0 0 10px;
}
.foot-nav ul { list-style: none; padding: 0; margin: 0; }
.foot-nav li { margin: 0 0 6px; }
.site-footer a { color: var(--ink); text-decoration: none; }
.site-footer a:hover, .site-footer a[aria-current="page"] { text-decoration: underline; }
.fine { color: var(--mist); margin: 32px 0 0; font-size: 0.85rem; }

@media print {
  body { background: #fff; color: #000; }
  a { color: #000; }
  .site-header .lang, .site-header .primary, .skip, .art { display: none; }
  .card, .note, th, .plate, .cta, .ticket { background: none; color: #000; }
}
