/* Sidecar Tools — one stylesheet for every page.
   To change a colour, edit it in :root (light) and again in the dark block below. */

:root {
  --bg: #fbfbf9;
  --text: #1d1d1b;
  --muted: #62625d;
  --rule: #e2e1db;
  --accent: #2456a6;      /* the one accent colour: links, the form button */
  --field: #ffffff;
  --frame: #ecebe5;       /* background behind screenshots */

  /* Type scale: each step is 1.25x the one below it. */
  --step--1: 0.85rem;
  --step-0: 1.0625rem;    /* body text, 17px */
  --step-1: 1.33rem;
  --step-2: 1.66rem;
  --step-3: 2.07rem;

  --measure: 68ch;        /* max line length for running text */
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #171716;
    --text: #e6e5e0;
    --muted: #a09f98;
    --rule: #33332f;
    --accent: #8db4f5;
    --field: #22221f;
    --frame: #262623;
  }
}

/* ---------- Base ---------- */

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  font-size: var(--step-0);
  line-height: 1.65;
  -webkit-text-size-adjust: 100%;
}

.wrap {
  max-width: 48rem;
  margin: 0 auto;
  padding: 2rem 1.25rem 4rem;
}

p, li, dd { max-width: var(--measure); }

a { color: var(--accent); text-underline-offset: 0.15em; }

h1, h2, h3 { line-height: 1.25; font-weight: 650; letter-spacing: -0.01em; }
h1 { font-size: var(--step-3); margin: 0 0 0.75rem; }
h2 { font-size: var(--step-2); margin: 3rem 0 0.75rem; }
h3 { font-size: var(--step-1); margin: 2rem 0 0.5rem; }

.muted { color: var(--muted); }
.lede { font-size: var(--step-1); line-height: 1.5; color: var(--muted); margin: 0 0 1rem; }

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

/* ---------- Header and footer ---------- */

header.site {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  padding-bottom: 1.25rem;
  margin-bottom: 3rem;
  border-bottom: 1px solid var(--rule);
}
header.site .name { font-weight: 650; color: var(--text); text-decoration: none; }
header.site nav a { margin-left: 1.25rem; }
header.site nav a:first-child { margin-left: 0; }

footer.site {
  margin-top: 5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--rule);
  font-size: var(--step--1);
  color: var(--muted);
}
footer.site a { margin-right: 1.25rem; }

/* ---------- Home: the extension list ---------- */

ul.extensions { list-style: none; padding: 0; margin: 2.5rem 0 0; }

ul.extensions > li {
  max-width: none;
  padding: 2.25rem 0;
  border-top: 1px solid var(--rule);
}
ul.extensions > li:last-child { border-bottom: 1px solid var(--rule); }

ul.extensions h2 { font-size: var(--step-1); margin: 0 0 0.5rem; }
ul.extensions p { margin: 0 0 0.75rem; }
ul.extensions .links { font-size: var(--step--1); margin: 0; }
ul.extensions .links a { margin-right: 1.25rem; }

/* Screenshot: a plain frame, no shadow. On phones it sits under the text. */
ul.extensions .shot { display: block; margin-top: 1.25rem; line-height: 0; }
ul.extensions .shot img {
  width: 100%;
  background: var(--frame);
  border: 1px solid var(--rule);
  border-radius: 3px;
}

/* Wider screens: screenshot on the left, text on the right. */
@media (min-width: 44rem) {
  ul.extensions > li {
    display: grid;
    grid-template-columns: 17rem 1fr;
    grid-template-areas: "shot text";
    gap: 2rem;
    align-items: start;
  }
  ul.extensions .text { grid-area: text; }
  ul.extensions .shot { grid-area: shot; margin-top: 0.3rem; }
}

/* ---------- Support form ---------- */

form { max-width: 34rem; margin-top: 2rem; }
form label { display: block; font-weight: 600; margin: 1.5rem 0 0.4rem; }
form .hint { font-weight: 400; color: var(--muted); }
form input, form select, form textarea {
  display: block;
  width: 100%;
  font: inherit;
  color: inherit;
  background: var(--field);
  border: 1px solid var(--rule);
  border-radius: 3px;
  padding: 0.6rem 0.7rem;
}
form textarea { min-height: 11rem; resize: vertical; }
form input:focus, form select:focus, form textarea:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}
form button {
  margin-top: 2rem;
  font: inherit;
  font-weight: 600;
  padding: 0.65rem 1.4rem;
  border: 0;
  border-radius: 3px;
  background: var(--accent);
  color: var(--bg);
  cursor: pointer;
}

/* Spam trap: hidden from sighted users. With CSS off, its label says to leave it empty. */
.trap { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- Writeup and policy pages: text and one table, nothing else ---------- */

table { border-collapse: collapse; width: 100%; font-size: var(--step--1); margin: 1.5rem 0; }
th, td { text-align: left; padding: 0.5rem 0.6rem; border-bottom: 1px solid var(--rule); vertical-align: top; }
.table-scroll { overflow-x: auto; }

/* The only non-accent colour on the site: the DRAFT warning on unpublished pages. */
.draft-banner {
  border: 2px solid #c98f00;
  padding: 0.75rem 1rem;
  margin: 0 0 2rem;
}
