/* The website's only stylesheet. System fonts; nothing loaded from elsewhere. */

:root {
  --ink: #1d2733;
  --muted: #4a5564;
  --paper: #ffffff;
  --tint: #f2f5f8;
  --line: #d5dce4;
  --accent: #0b4f8a;
  --accent-dark: #083a66;
  --focus: #b45309;
  /* The one content width (work item EP): the headline, paragraphs, lists, video, pictures and notices
     all stop at the same right edge. */
  --column: 42rem;
}

* { box-sizing: border-box; }

html {
  font-size: 100%;
  /* A link to a heading (#leaves) stops below the pinned header, not under it (work item ES). */
  scroll-padding-top: 4.5rem;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.6;
}

.wrap {
  max-width: 60rem;
  margin: 0 auto;
  padding: 0 1rem;
}

a { color: var(--accent); }
a:hover { color: var(--accent-dark); }

a:focus-visible, .button:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.skip {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--paper);
  padding: 0.5rem 1rem;
  z-index: 20;  /* above the pinned header */
}
.skip:focus { left: 1rem; }

/* Header and navigation */

/* The header stays at the top while the page scrolls (work item ES): one slim line, white, with its line
   underneath, so the text passing under it is hidden cleanly. */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid var(--line);
  background: var(--paper);
}
.site-header .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
}
.brand {
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--ink);
  text-decoration: none;
}
nav ul, .site-footer ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.25rem;
}
nav a { text-decoration: none; }
nav a:hover, nav a[aria-current="page"] { text-decoration: underline; }
nav a[aria-current="page"] { color: var(--ink); font-weight: 600; }

/* Content */

main.wrap { padding: 2rem 1rem 3rem; }

h1 { font-size: 2rem; line-height: 1.2; margin: 0 0 1rem; }
h2 { font-size: 1.375rem; margin: 2.25rem 0 0.5rem; }
h3 { font-size: 1.125rem; margin: 1.5rem 0 0.25rem; }
main.wrap > *, p, li { max-width: var(--column); }

.lead { font-size: 1.25rem; color: var(--muted); }
.lead-action { color: var(--ink); }

.hero { padding: 1rem 0 0.5rem; }
.hero h1 { font-size: 2.25rem; }

.example {
  border-left: 4px solid var(--line);
  padding-left: 1rem;
  margin: 1.5rem 0;
}
.example p { margin: 0.25rem 0; }
.example-label { color: var(--muted); font-size: 0.9375rem; }

/* Under *Join the waiting list*: what's kept, what for, how to be removed (decision 052). */
.privacy-line { color: var(--muted); font-size: 0.9375rem; margin-top: -0.75rem; max-width: 40rem; }

.lines { list-style: none; margin: 1.5rem 0; padding: 0; }
.lines li { margin-bottom: 1rem; }

ol.steps { padding-left: 1.5rem; }
ol.steps li { margin-bottom: 0.75rem; }

.notice {
  border-left: 4px solid var(--accent);
  background: var(--tint);
  padding: 0.75rem 1rem;
  margin: 1.5rem 0;
}

/* Buttons */

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.25rem;
  margin: 1.5rem 0;
}
.button {
  display: inline-block;
  padding: 0.6rem 1.1rem;
  border-radius: 6px;
  border: 2px solid var(--accent);
  background: var(--accent);
  color: #ffffff;
  font-weight: 600;
  text-decoration: none;
}
.button:hover { background: var(--accent-dark); color: #ffffff; }

/* Footer */

.site-footer {
  border-top: 1px solid var(--line);
  background: var(--tint);
  color: var(--muted);
  font-size: 0.9375rem;
  padding: 1.5rem 0;
}
.site-footer p { margin: 0.5rem 0; }

@media (max-width: 30rem) {
  h1, .hero h1 { font-size: 1.75rem; }
  .lead { font-size: 1.125rem; }
  .site-header .wrap { flex-wrap: nowrap; }
  nav ul { flex-wrap: nowrap; gap: 0.75rem; }
  nav a { white-space: nowrap; font-size: 1rem; }
}

/* The narrowest phones: the header still fits on one line. */
@media (max-width: 22.5rem) {
  .site-header .wrap { gap: 0.75rem; }
  nav ul { gap: 0.5rem; }
  nav a { font-size: 0.9375rem; }
}

/* Under the hero: which computers it runs on (work item EN). */
.platform { color: var(--ink); }

/* The three pictures on Home (work items EN, EP), each beside the sentence it shows: to the side on a
   wide screen, under it on a phone. Each links to its full-size file. */
.lines li.has-picture {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 42%);
  gap: 1.25rem;
  align-items: start;
  margin-bottom: 1.5rem;
}
.lines li.has-picture > p { margin: 0; }
figure.beside { margin: 0.25rem 0 0; }
figure.beside a { display: block; }
figure.beside img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
}
figure.beside figcaption { color: var(--muted); font-size: 0.9375rem; margin-top: 0.5rem; }
/* A second Join button above the video, shown on phones only, so it is in the first screen (work item ER). */
.phone-only { display: none; }
@media (max-width: 40rem) {
  .lines li.has-picture { grid-template-columns: 1fr; gap: 0.75rem; }
  .phone-only { display: block; }
}

/* The picture viewer on Home (work item EP): a picture opened large over the page, with Close.
   The dialog's own edge has no padding, so a click anywhere outside the box closes it. */
dialog.viewer {  /* "dialog." so the page's one column (`main.wrap > *`) doesn't narrow it */
  padding: 0;
  border: 0;
  background: transparent;
  width: 96vw;
  max-width: 96vw;
  max-height: 96vh;
}
.viewer::backdrop { background: rgba(20, 28, 38, 0.75); }
.viewer-box {
  background: var(--paper);
  border-radius: 8px;
  padding: 0.75rem;
}
.viewer-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.5rem;
}
.viewer-bar p { margin: 0; color: var(--muted); font-size: 0.9375rem; max-width: none; }
.viewer-close {
  flex: none;
  font: inherit;
  font-weight: 600;
  padding: 0.4rem 0.9rem;
  border: 2px solid var(--accent);
  border-radius: 6px;
  background: var(--paper);
  color: var(--accent);
  cursor: pointer;
}
.viewer-close:hover { background: var(--accent); color: #ffffff; }
.viewer-close:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.viewer img {
  display: block;
  width: 100%;
  height: auto;
  max-height: calc(96vh - 5rem);
  object-fit: contain;  /* the whole picture, never cut off */
}

/* The five-line summary at the top of How it works (work item EN). */
.summary {
  background: var(--tint);
  border-radius: 6px;
  padding: 0.75rem 1rem;
  margin: 1.5rem 0;
}
.summary p { margin: 0.25rem 0; }
.summary ol { margin: 0.5rem 0; padding-left: 1.5rem; }
.summary li { margin-bottom: 0.25rem; }

/* The demo video on Home (work item EP), in the first screen under the lead. As wide as the text
   column (`--column`) and lined up with it, never wider than its container. Served from the site;
   nothing loads until it's played. */
.demo { margin: 1.5rem 0; max-width: var(--column); }
.demo video {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  background: var(--tint);
  border: 1px solid var(--line);
  border-radius: 6px;
}
.demo-note { color: var(--muted); font-size: 0.9375rem; margin-top: 0.5rem; }

/* The folded reference sections on How it works (work item EP). Closed at first; printing opens them. */
details.fold {
  border-top: 1px solid var(--line);
  margin: 0;
  padding: 0.25rem 0;
}
details.fold:last-of-type { border-bottom: 1px solid var(--line); }
details.fold > summary {
  cursor: pointer;
  padding: 0.5rem 0;
  font-size: 1.375rem;  /* like an h2 */
  font-weight: 700;
  line-height: 1.3;
}
details.fold > summary:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
details.fold[open] { padding-bottom: 1rem; }

@media print {
  .site-header { position: static; }
  details.fold > summary { list-style: none; }
  details.fold > summary::-webkit-details-marker { display: none; }
  details.fold::details-content { content-visibility: visible; }
}
