/* ACom — commuter.drawla.app
 *
 * One stylesheet for every page. No web fonts, no CDN, no tracker: the site
 * explains a privacy policy, so it has to be the kind of site that policy
 * describes. Nothing here loads from a third party, which is also why the
 * pages need no cookie banner — there are no cookies.
 *
 * Colours are the app's own (AcomTheme in lib/app.dart), so the site and the
 * screen the reader has in their other hand are the same product.
 */

:root {
  --primary: #1e88e5;
  --primary-ink: #ffffff;
  --primary-soft: rgba(30, 136, 229, 0.1);
  --bg: #f0f1f3;
  --surface: #ffffff;
  --surface-2: #f7f8fa;
  --ink: #14181d;
  --ink-muted: #5a636e;
  --line: #dfe3e8;
  --error: #c62828;
  --ok: #2e7d32;
  --warn: #ef6c00;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.06), 0 8px 24px rgba(16, 24, 40, 0.06);
  --radius: 14px;
  --measure: 68ch;
}

@media (prefers-color-scheme: dark) {
  :root {
    --primary: #5aa6f2;
    --primary-ink: #0b1220;
    --primary-soft: rgba(90, 166, 242, 0.14);
    --bg: #12161b;
    --surface: #1b2028;
    --surface-2: #232830;
    --ink: #e6eaf0;
    --ink-muted: #98a2b0;
    --line: #2c333d;
    --error: #ef5350;
    --ok: #81c784;
    --warn: #ffb74d;
    --shadow: none;
  }
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 5.5rem;
  -webkit-text-size-adjust: 100%;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

/* ---------------------------------------------------------------- header */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(150%) blur(12px);
  border-bottom: 1px solid var(--line);
}

.site-header__inner {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0.7rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: inherit;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-right: auto;
}

.brand__mark {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--primary);
  display: grid;
  place-items: center;
  flex: none;
}

.brand__mark svg {
  width: 22px;
  height: 22px;
  fill: var(--primary-ink);
}

.brand__text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.brand__name {
  font-size: 1.05rem;
}

.brand__sub {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex-wrap: wrap;
}

.site-nav a {
  color: var(--ink-muted);
  text-decoration: none;
  font-size: 0.94rem;
  font-weight: 600;
  padding: 0.4rem 0.7rem;
  border-radius: 9px;
}

.site-nav a:hover {
  color: var(--ink);
  background: var(--surface);
}

.site-nav a[aria-current="page"] {
  color: var(--primary);
  background: var(--primary-soft);
}

.lang-switch {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 9px;
  overflow: hidden;
  background: var(--surface);
}

.lang-switch a {
  padding: 0.3rem 0.6rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-decoration: none;
  color: var(--ink-muted);
}

.lang-switch a[aria-current="true"] {
  background: var(--primary);
  color: var(--primary-ink);
}

/* ------------------------------------------------------------------ page */

.wrap {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

main {
  padding-block: 2.5rem 4rem;
}

.prose {
  max-width: var(--measure);
}

h1,
h2,
h3,
h4 {
  line-height: 1.25;
  letter-spacing: -0.015em;
  margin: 0 0 0.6rem;
}

h1 {
  font-size: clamp(1.9rem, 1.3rem + 2.4vw, 2.6rem);
}

h2 {
  font-size: 1.45rem;
  margin-top: 2.8rem;
  padding-top: 0.4rem;
}

h3 {
  font-size: 1.12rem;
  margin-top: 1.9rem;
}

h4 {
  font-size: 1rem;
  margin-top: 1.4rem;
  color: var(--ink-muted);
}

p,
ul,
ol,
dl {
  margin: 0 0 1.1rem;
}

ul,
ol {
  padding-left: 1.3rem;
}

li {
  margin-bottom: 0.4rem;
}

li > ul,
li > ol {
  margin-top: 0.4rem;
}

a {
  color: var(--primary);
  text-underline-offset: 0.18em;
  text-decoration-thickness: from-font;
}

strong {
  font-weight: 660;
  color: var(--ink);
}

code {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
    monospace;
  font-size: 0.88em;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.08em 0.36em;
}

hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 2.5rem 0;
}

.lede {
  font-size: 1.16rem;
  color: var(--ink-muted);
  max-width: var(--measure);
}

.updated {
  font-size: 0.85rem;
  color: var(--ink-muted);
  margin-bottom: 2rem;
}

.eyebrow {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 0.5rem;
}

/* ------------------------------------------------------- docs two-column */

.docs {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: 3rem;
  align-items: start;
}

@media (max-width: 900px) {
  .docs {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
}

.toc {
  position: sticky;
  top: 5.5rem;
  max-height: calc(100vh - 7rem);
  overflow-y: auto;
  font-size: 0.92rem;
  border-left: 2px solid var(--line);
  padding-left: 1rem;
}

@media (max-width: 900px) {
  .toc {
    position: static;
    max-height: none;
    border-left: 0;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    padding: 1rem 1.25rem;
  }

  .toc summary {
    cursor: pointer;
    font-weight: 700;
  }
}

.toc__title {
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-bottom: 0.6rem;
}

.toc ol {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: toc;
}

.toc li {
  margin: 0;
}

.toc a {
  display: block;
  padding: 0.28rem 0;
  color: var(--ink-muted);
  text-decoration: none;
  font-weight: 550;
}

.toc a:hover {
  color: var(--ink);
}

.toc a.is-active {
  color: var(--primary);
}

/* ----------------------------------------------------------------- cards */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.4rem 1.5rem;
  box-shadow: var(--shadow);
}

.grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  margin-bottom: 1.5rem;
}

.grid .card p:last-child,
.card > :last-child {
  margin-bottom: 0;
}

.card h3 {
  margin-top: 0;
  font-size: 1.05rem;
}

.card__icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--primary-soft);
  color: var(--primary);
  display: grid;
  place-items: center;
  margin-bottom: 0.8rem;
}

.card__icon svg {
  width: 21px;
  height: 21px;
  fill: currentColor;
}

/* ----------------------------------------------------------- screenshots */

/* Real captures from the running app, not mock-ups — so they are shown at
   their own aspect ratio with nothing drawn over them. The frame is a border
   and a radius, no fake device chrome: the status bar is already in the shot. */
.shots {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  margin: 2rem 0;
}

.shot {
  margin: 0;
}

.shot img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  box-shadow: var(--shadow);
}

.shot figcaption {
  margin-top: 0.6rem;
  font-size: 0.88rem;
  line-height: 1.45;
  color: var(--ink-muted);
}

.shot figcaption b {
  color: var(--ink);
  font-weight: 640;
}

/* A single screenshot beside its explanation, inside the docs column. */
.shot-inline {
  float: right;
  width: min(220px, 40%);
  margin: 0.4rem 0 1.2rem 1.6rem;
}

@media (max-width: 640px) {
  .shot-inline {
    float: none;
    width: 100%;
    max-width: 300px;
    margin: 1.2rem 0;
  }
}

/* --------------------------------------------------------------- callout */

.note {
  border: 1px solid var(--line);
  border-left: 3px solid var(--primary);
  background: var(--surface);
  border-radius: 10px;
  padding: 1rem 1.2rem;
  margin: 1.5rem 0;
}

.note > :last-child {
  margin-bottom: 0;
}

.note--warn {
  border-left-color: var(--warn);
}

.note--stop {
  border-left-color: var(--error);
}

.note__title {
  font-weight: 700;
  margin-bottom: 0.3rem;
  display: block;
}

/* ---------------------------------------------------------------- tables */

.table-scroll {
  overflow-x: auto;
  margin: 1.4rem 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.95rem;
  min-width: 480px;
}

th,
td {
  text-align: left;
  vertical-align: top;
  padding: 0.7rem 1rem;
  border-bottom: 1px solid var(--line);
}

thead th {
  font-size: 0.76rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-muted);
  background: var(--surface-2);
}

tbody tr:last-child td {
  border-bottom: 0;
}

/* -------------------------------------------------------------- UI parts */

/* A control as it is named in the app, so the sentence and the screen match. */
.ui {
  display: inline-flex;
  align-items: center;
  gap: 0.3em;
  background: var(--primary-soft);
  color: var(--primary);
  border-radius: 6px;
  padding: 0.06em 0.42em;
  font-size: 0.92em;
  font-weight: 640;
  white-space: nowrap;
}

.steps {
  list-style: none;
  counter-reset: step;
  padding: 0;
  margin: 1.2rem 0;
}

.steps li {
  counter-increment: step;
  position: relative;
  padding-left: 2.6rem;
  margin-bottom: 0.9rem;
}

.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0.05em;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
  background: var(--primary);
  color: var(--primary-ink);
  display: grid;
  place-items: center;
  font-size: 0.85rem;
  font-weight: 700;
}

dl.defs dt {
  font-weight: 660;
  margin-top: 1rem;
}

dl.defs dd {
  margin: 0.15rem 0 0;
  color: var(--ink-muted);
}

/* ----------------------------------------------------------------- links */

.linkrow {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin: 1.6rem 0;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: var(--primary);
  color: var(--primary-ink);
  text-decoration: none;
  font-weight: 650;
  padding: 0.62rem 1.15rem;
  border-radius: 10px;
}

.btn--ghost {
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line);
}

.btn svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

/* ---------------------------------------------------------------- footer */

.site-footer {
  border-top: 1px solid var(--line);
  background: var(--surface);
  padding: 2.5rem 0;
  font-size: 0.92rem;
  color: var(--ink-muted);
}

.site-footer__inner {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 1.25rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem 2.5rem;
  justify-content: space-between;
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.3rem;
}

.site-footer a {
  color: var(--ink-muted);
  text-decoration: none;
  font-weight: 600;
}

.site-footer a:hover {
  color: var(--primary);
}

/* Added by site.js to every h2/h3 that has an id. Hidden until the heading is
   hovered or the anchor itself is focused, so it never competes with the text. */
.heading-anchor {
  margin-left: 0.4em;
  color: var(--ink-muted);
  text-decoration: none;
  font-weight: 400;
  opacity: 0;
  transition: opacity 0.12s;
}

h2:hover > .heading-anchor,
h3:hover > .heading-anchor,
.heading-anchor:focus {
  opacity: 1;
}

.skip-link {
  position: absolute;
  left: -9999px;
}

.skip-link:focus {
  left: 1rem;
  top: 0.6rem;
  z-index: 50;
  background: var(--primary);
  color: var(--primary-ink);
  padding: 0.5rem 0.9rem;
  border-radius: 8px;
}

:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}
