/* Rowclerk site: one stylesheet for every page except the Trello® relay (site/connect/trello/).
   System fonts only, no external assets, no inline styles (the pages' CSP is style-src 'self').
   Colours: the brand palette in brand/README.md (Brick accent on light, Vermilion on dark; Ink and
   Paper focus rings), plus neutral greys for text, lines and backgrounds. */

:root {
  color-scheme: light dark;
  --bg: #ffffff;
  --bg-soft: #f4f6f8;
  --fg: #1c2430;
  --muted: #4f5b69;
  --line: #d9dee4;
  --accent: #c2410c; /* Brick: 5.2:1 on white, 4.7:1 on --accent-soft */
  --accent-fg: #ffffff;
  --accent-soft: #fdf1eb;
  --focus: #1f1b24; /* Ink */
  --warn-bg: #fff4d6;
  --warn-fg: #5c4300;
  --radius: 10px;
  --wrap: 68rem;
  --text: 44rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #12171d;
    --bg-soft: #1a2129;
    --fg: #e6eaef;
    --muted: #a9b3bf;
    --line: #2d3742;
    --accent: #f0582b; /* Vermilion: 5.3:1 on --bg, 4.8:1 on --accent-soft */
    --accent-fg: #1f1b24; /* Ink on Vermilion: 4.95:1 */
    --accent-soft: #2d1b16;
    --focus: #fff6e9; /* Paper */
    --warn-bg: #3a3112;
    --warn-fg: #f3df9c;
  }
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  font: 1rem/1.6 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  color: var(--fg);
  background: var(--bg);
}

img {
  max-width: 100%;
}

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

a:hover {
  text-decoration-thickness: 2px;
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-radius: 2px;
}

h1,
h2,
h3 {
  line-height: 1.25;
  margin: 2rem 0 0.75rem;
}

h1 {
  font-size: clamp(1.75rem, 1.2rem + 2.4vw, 2.6rem);
  margin-top: 0;
}

h2 {
  font-size: 1.45rem;
}

h3 {
  font-size: 1.1rem;
}

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

li + li {
  margin-top: 0.3rem;
}

code {
  font: 0.9em/1.4 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0 0.25em;
  overflow-wrap: anywhere;
}

.skip {
  position: absolute;
  left: 0.5rem;
  top: -3rem;
  padding: 0.5rem 0.75rem;
  background: var(--accent);
  color: var(--accent-fg);
  border-radius: 0 0 6px 6px;
  z-index: 10;
}

.skip:focus {
  top: 0;
}

.wrap {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 1.25rem;
}

.text {
  max-width: var(--text);
}

/* Header */

.site-header {
  border-bottom: 1px solid var(--line);
}

.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 {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.brand picture,
.brand img {
  display: block;
}

.brand img {
  height: 2rem;
  width: auto;
}

.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.25rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-nav li + li {
  margin-top: 0;
}

.site-nav a {
  color: var(--fg);
  text-decoration: none;
}

.site-nav a:hover {
  text-decoration: underline;
}

/* Main */

main {
  display: block;
  padding: 2.5rem 0 3rem;
}

section {
  scroll-margin-top: 1rem;
}

.lead {
  font-size: 1.15rem;
  color: var(--muted);
  max-width: 40rem;
}

.hero {
  padding-bottom: 1rem;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
  margin: 1.5rem 0 0;
}

.button {
  display: inline-block;
  padding: 0.6rem 1.1rem;
  border-radius: 999px;
  border: 2px solid var(--accent);
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}

.button:hover {
  background: var(--accent-soft);
}

/* A status notice, not a control: square corners and a dashed border so it doesn't look clickable. */
.badge {
  display: inline-block;
  padding: 0.5rem 0.9rem;
  border-radius: 6px;
  border: 1px dashed var(--accent);
  background: var(--accent-soft);
  color: var(--fg);
  font-weight: 600;
}

.band {
  background: var(--bg-soft);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 0.5rem 0 1.5rem;
  margin: 2rem 0;
}

.grid {
  display: grid;
  /* 3 columns at full width (6 features = 2 rows of 3), 2 on tablets, 1 on phones. */
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 19rem), 1fr));
  gap: 1rem;
  margin: 0 0 1rem;
  padding: 0;
  list-style: none;
}

.grid > li + li {
  margin-top: 0;
}

.card {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem 1.15rem;
}

.card h3 {
  margin-top: 0;
}

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

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

.steps > li {
  counter-increment: step;
  position: relative;
  padding-left: 3rem;
  min-height: 2.25rem;
}

.steps > li + li {
  margin-top: 1rem;
}

.steps > li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-fg);
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tag {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0 0.5rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--fg);
  vertical-align: middle;
}

/* Pricing */

.plans {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}

.plan {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.25rem;
  background: var(--bg);
}

.plan.featured {
  border: 2px solid var(--accent);
}

.plan h3 {
  margin: 0 0 0.25rem;
  font-size: 1.25rem;
}

.price {
  font-size: 1.1rem;
  margin: 0 0 1rem;
}

.price strong {
  font-size: 2rem;
  line-height: 1.2;
}

.plan ul {
  padding-left: 1.2rem;
  margin: 0;
}

.note {
  color: var(--muted);
  font-size: 0.95rem;
}

/* FAQ */

.faq details {
  border-bottom: 1px solid var(--line);
  padding: 0.75rem 0;
}

.faq details:first-of-type {
  border-top: 1px solid var(--line);
}

.faq summary {
  cursor: pointer;
  font-weight: 600;
}

.faq details > :not(summary) {
  margin-top: 0.6rem;
}

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

/* Legal pages and tables */

.meta {
  color: var(--muted);
}

.table-wrap {
  overflow-x: auto;
  margin: 0 0 1.25rem;
}

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

.table-wrap table {
  margin: 0;
}

th,
td {
  text-align: left;
  vertical-align: top;
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--line);
  overflow-wrap: anywhere;
}

thead th {
  background: var(--bg-soft);
}

tbody th {
  font-weight: 600;
}

.callout {
  border-left: 4px solid var(--accent);
  background: var(--accent-soft);
  padding: 0.75rem 1rem;
  border-radius: 0 var(--radius) var(--radius) 0;
  margin: 0 0 1.25rem;
}

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

.pending {
  background: var(--warn-bg);
  color: var(--warn-fg);
  border-radius: 4px;
  padding: 0 0.3em;
  font-weight: 600;
}

.toc {
  columns: 2 16rem;
  padding-left: 1.2rem;
}

.toc li {
  break-inside: avoid;
}

/* Footer */

.site-footer {
  border-top: 1px solid var(--line);
  background: var(--bg-soft);
  color: var(--muted);
  font-size: 0.9rem;
  padding: 1.5rem 0 2rem;
}

.site-footer ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.25rem;
  list-style: none;
  margin: 0 0 1rem;
  padding: 0;
}

.site-footer li + li {
  margin-top: 0;
}

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

.site-footer p {
  margin: 0 0 0.6rem;
  max-width: var(--text);
}

/* Narrow screens: tables marked .stack become one card per row, so no column is cut off.
   Cells name their column with data-label; the first cell is the row header. */
@media (max-width: 40rem) {
  .stack table,
  .stack caption,
  .stack tbody,
  .stack tr,
  .stack th,
  .stack td {
    display: block;
    width: 100%;
  }

  .stack thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }

  .stack tr {
    border: 1px solid var(--line);
    border-radius: 6px;
    margin-bottom: 0.75rem;
  }

  .stack th,
  .stack td {
    border: 0;
  }

  .stack td[data-label]::before {
    content: attr(data-label) ": ";
    font-weight: 600;
  }
}

@media (max-width: 30rem) {
  main {
    padding-top: 1.5rem;
  }

  th,
  td {
    padding: 0.4rem 0.5rem;
  }
}

@media print {
  .site-header nav,
  .skip {
    display: none;
  }

  a {
    color: inherit;
  }
}
