/* Counter website: one shared stylesheet, no external resources.
   Light by default, follows the system setting for dark mode. */

:root {
  --bg: #ffffff;
  --text: #111111;
  --muted: #6b7280;          /* 4.8:1 on white */
  --line: #e5e7eb;
  --surface: #f6f7f9;
  --scroll-thumb: #cbd0d8;
  --accent: #2563eb;         /* 5.2:1 on white */
  --accent-solid: #2563eb;   /* button background, white text 5.2:1 */
  --accent-solid-hover: #1d4ed8;
  --accent-tint: rgba(37, 99, 235, 0.12);
  --amber: #b45309;
  --amber-tint: rgba(217, 119, 6, 0.14);
  --todo-bg: #fde047;
  --todo-text: #111111;
  --todo-line: #ca8a04;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0a0a0a;
    --text: #f5f5f5;
    --muted: #a3a3a3;        /* 8.3:1 on #0a0a0a */
    --line: #262626;
    --surface: #141414;
    --scroll-thumb: #3a3a3a;
    --accent: #3b82f6;       /* 5.6:1 on #0a0a0a */
    --accent-solid: #2563eb; /* the lighter accent would put white text below 4.5:1 */
    --accent-solid-hover: #3b82f6;
    --accent-tint: rgba(59, 130, 246, 0.22);
    --amber: #fbbf24;
    --amber-tint: rgba(251, 191, 36, 0.16);
    --todo-bg: #713f12;
    --todo-text: #fef9c3;
    --todo-line: #facc15;
  }
}

[hidden] { display: none !important; }

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

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 17px;
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
}

img { max-width: 100%; height: auto; }

.wrap {
  width: 100%;
  max-width: 680px;
  margin: 0 auto;
  padding: 0 20px;
}

main.wrap { flex: 1; padding-top: 40px; padding-bottom: 64px; }

/* Links: underlined inside page content, underlined on hover in header and footer. */
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 2px; }
main a { text-decoration: underline; text-underline-offset: 2px; }

/* Header and footer */
.site-header { border-bottom: 1px solid var(--line); }
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 14px;
  padding-bottom: 14px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 600;
}
.brand img { width: 28px; height: 28px; border-radius: 7px; }

.site-footer { border-top: 1px solid var(--line); color: var(--muted); font-size: 0.875rem; }
.site-footer .wrap { padding-top: 24px; padding-bottom: 32px; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 6px 20px; }
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--accent); }
.site-footer p { margin: 14px 0 0; }

/* Text */
h1 { margin: 0 0 0.6em; font-size: 2.5rem; line-height: 1.15; font-weight: 700; }
h2 { margin: 2.4em 0 0.6em; font-size: 1.25rem; line-height: 1.3; font-weight: 600; }
h3 { margin: 1.8em 0 0.4em; font-size: 1rem; line-height: 1.4; font-weight: 600; }
p, ul { margin: 0 0 1em; }
ul { padding-left: 1.25em; }
li { margin: 0.4em 0; }
strong { font-weight: 600; }

.doc .meta { margin: -0.2em 0 1.5em; color: var(--muted); font-size: 0.9rem; }

.contact {
  margin: 0 0 1.5em;
  padding: 14px 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.contact p { margin: 0.2em 0; }

/* Marker for unconfirmed facts. Must be removed before the site goes live. */
.todo {
  padding: 1px 6px;
  background: var(--todo-bg);
  color: var(--todo-text);
  border: 1px solid var(--todo-line);
  border-radius: 4px;
  font-size: 0.9em;
  font-weight: 600;
}

a.button {
  display: inline-block;
  padding: 11px 22px;
  background: var(--accent-solid);
  color: #ffffff;
  border-radius: 10px;
  font-weight: 600;
  text-decoration: none;
}
a.button:hover { background: var(--accent-solid-hover); text-decoration: none; }

.status-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  margin: 0 0 20px;
  border-radius: 50%;
}
.status-icon svg { width: 28px; height: 28px; }
.status-icon.is-success { background: var(--accent-tint); color: var(--accent); }
.status-icon.is-error { background: var(--amber-tint); color: var(--amber); }

p.detail { color: var(--muted); font-size: 0.875rem; word-break: break-word; overflow-wrap: anywhere; }

/* Landing page: term and description rows, used for the Details box */
.facts { margin: 0 0 1em; border-top: 1px solid var(--line); }
.facts > div {
  display: grid;
  grid-template-columns: minmax(96px, 9rem) minmax(0, 1fr);
  gap: 4px 20px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.facts dt { font-weight: 600; }
.facts dd { margin: 0; overflow-wrap: anywhere; }

/* Landing page: stacked full-width bands. Everything below is scoped to body.home
   or to classes only index.html uses, so the document pages are not affected. */
.home main { flex: 1; }

.home .band { padding: 64px 0; background: var(--bg); }
.home .band-alt {
  background: var(--surface);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.home .band-last { border-bottom: 0; }   /* the footer draws the line */
.home .wrap { max-width: 960px; }   /* one left edge for header, bands and footer */
.home .band .wrap > p, .home .note, .home .checks, .home .facts.boxed { max-width: 680px; }
.home .band .wrap > :last-child { margin-bottom: 0; }

.home h2 { margin: 0 0 0.5em; font-size: 1.6rem; line-height: 1.25; font-weight: 700; }
.home h3 { margin: 0 0 0.4em; }

/* Intro */
.home .app-icon { display: block; width: 72px; height: 72px; margin: 0 0 20px; border-radius: 16px; }
.home h1 { margin-bottom: 0.4em; }
.home .lead { margin-bottom: 24px; font-size: 1.2rem; line-height: 1.5; color: var(--text); }
.home .note {
  margin-bottom: 0;
  padding: 14px 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
}

/* Screenshots: one horizontal row, edge to edge. It is centred when every item fits and
   scrolls sideways when it does not. Any number of figures works. */
.home .band-shots { padding: 40px 0; }
.shots {
  display: flex;
  gap: 20px;
  padding-block: 8px;   /* room for the focus outline */
  padding-inline: 20px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: 20px;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: var(--scroll-thumb) transparent;
}
.shots::-webkit-scrollbar { height: 8px; }
.shots::-webkit-scrollbar-track { background: transparent; }
.shots::-webkit-scrollbar-thumb { background: var(--scroll-thumb); border-radius: 4px; }
.shots:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
/* Fixed width per screenshot. The auto margins on the first and last one centre the row
   when everything fits and collapse to 0 when it scrolls, so nothing is ever cut off
   (unlike justify-content: center). */
.shots figure { flex: 0 0 auto; width: 232px; margin: 0; scroll-snap-align: start; }
.shots figure:first-child { margin-left: auto; }
.shots figure:last-child { margin-right: auto; }
.shots img {
  display: block;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 18px;
}
.shots figcaption { margin-top: 10px; color: var(--muted); font-size: 0.875rem; text-align: center; }

/* How it works */
.home .steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px; margin-top: 24px; }
.home .step p { margin: 0; }
.home .step .step-num { margin: 0 0 4px; color: var(--accent); font-size: 0.9rem; font-weight: 600; line-height: 1.4; }

/* Rules */
.home .intro { max-width: 680px; }
.home .cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin: 24px 0 0; }
.home .card {
  padding: 20px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.home .card dt { font-weight: 600; }
.home .card dd { margin: 4px 0 0; color: var(--muted); overflow-wrap: anywhere; }

/* Privacy */
.home .checks { margin: 24px 0; padding: 0; list-style: none; }
.home .checks li { position: relative; margin: 0 0 14px; padding-left: 30px; }
.home .checks li:last-child { margin-bottom: 0; }
.home .checks .check { position: absolute; left: 0; top: 0.4em; color: var(--accent); }

/* Details: the rows sit in a box */
.home .facts.boxed {
  margin: 24px 0 0;
  padding: 0 20px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.home .facts.boxed > div:last-child { border-bottom: 0; }

@media (max-width: 640px) {
  h1 { font-size: 2rem; }
  main.wrap { padding-top: 28px; padding-bottom: 48px; }
  .facts > div { grid-template-columns: minmax(0, 1fr); gap: 0; }

  .home .band { padding: 48px 0; }
  .home .band-shots { padding: 32px 0; }
  .shots figure { width: min(68vw, 280px); scroll-snap-align: start; }
  .home .steps { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .home .cards { grid-template-columns: minmax(0, 1fr); }
}

/* Touch screens: the next screenshot peeks in, so the scrollbar is not needed. */
@media (hover: none) {
  .shots { scrollbar-width: none; }
  .shots::-webkit-scrollbar { display: none; }
}

/* Invite page: long counter names must not run off the screen */
.doc h1 { overflow-wrap: anywhere; }
