/* Promilleni pages. Dark only, one accent, hairlines instead of boxes, no motion. */
:root {
  color-scheme: dark;
  --bg: #0f0e0c;
  --bg-2: #15130f;
  --fg: #ebe9e5;
  --body: #cfcbc4;
  --muted: #9d9890;
  --faint: #6f6b64;
  --accent: #ffb52e;
  --accent-text: #ffc247;
  --on-accent: #2a1a02;
  --line: rgba(235, 233, 229, 0.09);
  --rounded: ui-rounded, "SF Pro Rounded", -apple-system, system-ui, sans-serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, system-ui, sans-serif;
  --wrap: 68rem;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scrollbar-gutter: stable; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 400 16px/1.7 var(--sans); }
/* Footer stays at the bottom on short pages. */
body { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
main { flex: 1 0 auto; }
a { color: var(--accent-text); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--fg); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding-left: 1.25rem; padding-right: 1.25rem; }

/* Header and footer */
.site-header { border-bottom: 1px solid var(--line); }
.bar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 4rem; }
.brand { display: inline-flex; align-items: center; gap: 0.6rem; color: var(--fg); text-decoration: none; font: 800 1.05rem var(--rounded); letter-spacing: -0.01em; }
.brand img { width: 1.75rem; height: 1.75rem; border-radius: 50%; }
.site-nav { display: flex; gap: 1.25rem; font-size: 0.92rem; }
.site-nav a { color: var(--muted); text-decoration: none; }
.site-nav a[aria-current="page"], .site-nav a:hover { color: var(--fg); }
.site-nav { align-items: center; }
/* Language menu: a native disclosure, so no script. Add a language by adding a list item. */
.lang-menu { position: relative; }
.lang-menu summary { list-style: none; display: inline-flex; align-items: center; gap: 0.35rem; cursor: pointer; border: 1px solid var(--line); border-radius: 999px; padding: 0.15rem 0.6rem; color: var(--muted); font-size: 0.8rem; font-weight: 600; letter-spacing: 0.04em; }
.lang-menu summary::-webkit-details-marker { display: none; }
.lang-menu summary:hover, .lang-menu[open] summary { color: var(--fg); border-color: var(--muted); }
.lang-menu ul { position: absolute; right: 0; top: calc(100% + 0.4rem); z-index: 10; list-style: none; margin: 0; padding: 0.35rem; min-width: 9rem; background: var(--bg-2); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5); }
.lang-menu li { margin: 0; }
.lang-menu a { display: flex; justify-content: space-between; padding: 0.4rem 0.6rem; border-radius: 9px; color: var(--muted); text-decoration: none; font-size: 0.9rem; }
.lang-menu a:hover { background: var(--bg); color: var(--fg); }
.lang-menu a[aria-current] { color: var(--fg); }
.lang-menu a[aria-current]::after { content: "✓"; color: var(--accent-text); }
.site-footer { border-top: 1px solid var(--line); }
.site-footer .bar { min-height: 5rem; }

/* Type */
.eyebrow { display: flex; width: fit-content; align-items: center; gap: 0.6rem; margin: 0 0 1rem; color: var(--accent-text); font: 600 0.72rem/1 var(--sans); letter-spacing: 0.14em; text-transform: uppercase; }
.eyebrow::before { content: ""; width: 1.5rem; height: 1px; background: var(--accent); }
h1, h2 { font-family: var(--rounded); letter-spacing: -0.02em; margin: 0; }
.display { font-weight: 800; font-size: clamp(2.6rem, 8vw, 4.5rem); line-height: 1.02; }
.title { font-weight: 800; font-size: clamp(2.25rem, 6vw, 3.25rem); line-height: 1.05; }
.lede { color: var(--muted); font-size: 1.15rem; line-height: 1.6; max-width: 32rem; margin: 1.25rem 0 0; }
.meta { color: var(--faint); font-size: 0.85rem; margin: 0.75rem 0 0; }
p, ul { margin: 0 0 1rem; }
ul { padding-left: 1.1rem; }
li { margin-bottom: 0.4rem; }
li::marker { color: var(--faint); }

/* Landing */
.hero { display: grid; grid-template-columns: 1.15fr 1fr; gap: 3rem; align-items: start; padding-top: 4rem; padding-bottom: 5rem; }
.features { list-style: none; padding: 0; margin: 1.75rem 0 0; display: grid; gap: 1rem; max-width: 30rem; }
.features li { display: flex; gap: 0.9rem; align-items: flex-start; margin: 0; }
.features .ic { flex: none; width: 2.25rem; height: 2.25rem; border-radius: 50%; background: #2a1f0c; color: var(--accent); display: grid; place-items: center; }
.features .ic svg { width: 1.1rem; height: 1.1rem; }
.features strong { display: block; font: 700 1.02rem/1.3 var(--rounded); }
.features span { color: var(--muted); font-size: 0.92rem; }
.caveat { margin: 1.75rem 0 0; display: flex; gap: 0.6rem; align-items: center; color: var(--muted); font-size: 0.85rem; }
.caveat svg { flex: none; color: var(--faint); width: 1rem; height: 1rem; }
.soon { color: var(--faint); font-size: 0.85rem; margin: 0.5rem 0 0; }
.shot { display: flex; justify-content: center; }
.shot > div { width: min(24rem, 100%); }

/* Two screenshots on a carousel: a click turns it half a revolution and the back screen comes forward. */
@property --a { syntax: '<angle>'; inherits: true; initial-value: 0deg; }
.deck { position: relative; display: block; width: 100%; aspect-ratio: 5 / 4; margin: 0 auto; padding: 0; border: 0; background: none; cursor: pointer; container-type: inline-size; transition: --a 450ms cubic-bezier(0.45, 0.05, 0.25, 1); }
.deck:focus-visible { outline: 2px solid var(--accent); outline-offset: 6px; border-radius: 50%; }
.card { --t: calc(var(--a) + var(--o)); --d: sin(var(--t)); position: absolute; left: 50%; top: 50%; width: 56%;
  transform: translate(-50%, -50%) translate(calc(cos(var(--t)) * 30cqw), calc(var(--d) * 5cqw)) scale(calc(0.82 + 0.18 * (var(--d) + 1) / 2));
  filter: brightness(calc(0.55 + 0.45 * (var(--d) + 1) / 2)); }
.card.c1 { --o: 120deg; }
.card.c2 { --o: 300deg; }
.card.front { z-index: 2; }
.card.back { z-index: 1; }
.card img { display: block; width: 100%; height: auto; border-radius: 22%; border: 9px solid #1d1b18; outline: 1px solid #3a3732; background: var(--bg); }
.card.front img { box-shadow: 0 24px 50px rgba(0, 0, 0, 0.6); }
.deck-label { text-align: center; color: var(--faint); font-size: 0.8rem; margin: 0.5rem 0 0; }
.deck-label b { color: var(--muted); font-weight: 600; }
@media (prefers-reduced-motion: reduce) { .deck { transition: none; } }
@media (max-width: 52rem) { .hero { grid-template-columns: 1fr; padding-top: 2.5rem; padding-bottom: 3.5rem; gap: 2.5rem; } }

/* How it works: the steps as a list and one screenshot. Choosing a step (a hidden radio button,
   so no script) opens its text and swaps the screenshot. On phones the screenshot sits inside the step. */
.how { border-top: 1px solid var(--line); padding-top: 3.5rem; padding-bottom: 4rem; }
.steps { display: grid; grid-template-columns: 1fr 16rem; gap: 3rem; align-items: start; max-width: 54rem; }
.steps input { position: absolute; opacity: 0; pointer-events: none; }
.step-list { grid-column: 1; grid-row: 1; display: grid; gap: 0.35rem; }
.step { display: flex; gap: 1rem; padding: 1rem; border-radius: 18px; border: 1px solid transparent; cursor: pointer; }
.step:hover { background: var(--bg-2); }
.step .dot { display: grid; place-items: center; flex: none; width: 2rem; height: 2rem; border-radius: 50%; border: 1px solid var(--accent); color: var(--accent-text); font: 700 0.85rem var(--rounded); }
.step strong { display: block; font: 700 1.1rem/1.3 var(--rounded); letter-spacing: -0.01em; padding-top: 0.25rem; }
.step-text { display: none; margin-top: 0.3rem; color: var(--muted); font-size: 0.95rem; line-height: 1.55; }
.step-inline, .step-shot { display: none; height: auto; border-radius: 22%; border: 6px solid #1d1b18; outline: 1px solid #3a3732; background: var(--bg); }
.step-inline { width: min(14rem, 100%); margin-top: 1rem; }
.step-shot { width: 16rem; }
.step-view { grid-column: 2; grid-row: 1; position: sticky; top: 1.5rem; }
#step-1:checked ~ .step-view .s1, #step-2:checked ~ .step-view .s2, #step-3:checked ~ .step-view .s3, #step-4:checked ~ .step-view .s4 { display: block; }
#step-1:checked ~ .step-list .s1, #step-2:checked ~ .step-list .s2, #step-3:checked ~ .step-list .s3, #step-4:checked ~ .step-list .s4 { background: var(--bg-2); border-color: var(--line); }
#step-1:checked ~ .step-list .s1 .step-text, #step-2:checked ~ .step-list .s2 .step-text, #step-3:checked ~ .step-list .s3 .step-text, #step-4:checked ~ .step-list .s4 .step-text { display: block; }
#step-1:focus-visible ~ .step-list .s1, #step-2:focus-visible ~ .step-list .s2, #step-3:focus-visible ~ .step-list .s3, #step-4:focus-visible ~ .step-list .s4 { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (max-width: 52rem) {
  .steps { grid-template-columns: 1fr; }
  .step-view { display: none; }
  #step-1:checked ~ .step-list .s1 .step-inline, #step-2:checked ~ .step-list .s2 .step-inline, #step-3:checked ~ .step-list .s3 .step-inline, #step-4:checked ~ .step-list .s4 .step-inline { display: block; }
  .how { padding-top: 2.5rem; padding-bottom: 3rem; }
}

/* Document pages: heading column + content column */
.doc { display: grid; grid-template-columns: 17rem 1fr; gap: 3rem; padding-top: 4rem; padding-bottom: 5rem; }
.doc-aside { font-size: 0.9rem; }
.toc { list-style: none; padding: 0; margin: 1.5rem 0 0; border-top: 1px solid var(--line); }
.toc li { margin: 0; border-bottom: 1px solid var(--line); }
.toc a { display: flex; gap: 0.75rem; align-items: baseline; padding: 0.55rem 0; color: var(--muted); text-decoration: none; }
.toc a:hover { color: var(--fg); }
.num { font: 600 0.75rem/1.9 ui-monospace, "SF Mono", Menlo, monospace; color: var(--accent-text); }
.doc-body { max-width: 40rem; }
.summary { font-family: var(--rounded); font-size: 1.35rem; line-height: 1.45; font-weight: 600; margin: 0 0 2rem; }
.doc-body section { border-top: 1px solid var(--line); padding-top: 1.5rem; margin-top: 1.5rem; scroll-margin-top: 1rem; }
.doc-body h2 { display: flex; gap: 0.75rem; align-items: baseline; font-size: 1.3rem; font-weight: 700; margin-bottom: 0.75rem; }
.doc-body p, .doc-body li { color: var(--body); }
@media (max-width: 52rem) {
  .doc { grid-template-columns: 1fr; gap: 2rem; padding-top: 2.5rem; padding-bottom: 3.5rem; }
  .toc { display: none; }
}

/* Support */
.faq { border-top: 1px solid var(--line); }
.faq .qa { border-bottom: 1px solid var(--line); padding: 1.1rem 0 0.4rem; }
.faq h2 { font: 700 1.05rem/1.4 var(--rounded); letter-spacing: -0.01em; margin: 0 0 0.4rem; }
.faq p, .faq li { color: var(--muted); }
.calc { padding-left: 1.2rem; margin: 0 0 1rem; }
.calc li { margin-bottom: 0.5rem; }
.calc li::marker { color: var(--muted); }
.calc strong { color: var(--fg); font-weight: 600; }
/* A Promilleni setting or value as it reads on the watch. */
.ui { display: inline-block; padding: 0 0.4em; border: 1px solid var(--line); border-radius: 6px; background: var(--bg-2); color: var(--fg); font-weight: 600; font-size: 0.92em; line-height: 1.5; white-space: nowrap; }
.formula { display: block; margin-top: 0.35rem; font: 0.82rem/1.6 ui-monospace, "SF Mono", Menlo, monospace; color: var(--body); overflow-wrap: anywhere; }

/* 404 */
.missing { padding-top: 5rem; padding-bottom: 5rem; }
.missing p { color: var(--muted); }
