/* Design tokens; the dark theme follows the OS setting (no theme cookie: the privacy policy names
   only the session and language cookies). Text contrast is 6.8:1 or more in both themes.
   ADR-002 patterns to avoid: cream backgrounds, 01/02/03 labels, pill buttons, italic emphasis,
   gradient headings, emoji icons, cards inside cards, purple-blue gradients. */
:root {
  color-scheme: light dark;
  --bg: #ffffff;
  --fg: #16181d;
  --muted: #50565f;
  --line: #d8dce2;
  --surface: #f4f6f8;
  --accent: #0b5d6b;
  --accent-fg: #ffffff;
  --error: #a1261b;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --radius: 4px;
  --gutter: 16px;
  --page: 68rem;
  --measure: 42rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121418;
    --fg: #e8eaee;
    --muted: #a4abb6;
    --line: #2d323a;
    --surface: #1a1e24;
    --accent: #6cc7d4;
    --accent-fg: #0c1a1d;
    --error: #ff9b8f;
  }
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 16px/1.55 var(--font);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

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

a:focus-visible,
input:focus-visible,
button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

h1,
h2,
h3 {
  line-height: 1.2;
  font-weight: 650;
  margin: 0 0 0.75rem;
}

h1 {
  font-size: clamp(1.9rem, 1.4rem + 2.2vw, 2.9rem);
  letter-spacing: -0.015em;
  max-width: 24ch;
}

h2 {
  font-size: clamp(1.4rem, 1.25rem + 0.8vw, 1.8rem);
  letter-spacing: -0.01em;
}

h3 {
  font-size: 1.075rem;
}

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

/* Layout: one centred column with a 16px gutter on small screens; text lines stay readable. */
.wrap {
  max-width: var(--page);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* Text blocks keep the page's left edge but not its full width. */
.measure > * {
  max-width: var(--measure);
}

section {
  padding: 3.5rem 0;
  border-top: 1px solid var(--line);
}

section.hero {
  border-top: 0;
  padding: 4rem 0 3rem;
}

.lead {
  font-size: 1.2rem;
  max-width: var(--measure);
}

.note,
.proof {
  color: var(--muted);
  font-size: 0.925rem;
}

.proof {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  max-width: var(--measure);
}

.actions {
  margin: 1.75rem 0 0.5rem;
}

.button {
  display: inline-block;
  padding: 0.7rem 1.1rem;
  border-radius: var(--radius);
  background: var(--accent);
  color: var(--accent-fg);
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
}

.button:hover {
  text-decoration: underline;
}

/* Header and footer */
.masthead {
  border-bottom: 1px solid var(--line);
}

.bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.5rem;
  padding-top: 0.875rem;
  padding-bottom: 0.875rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  margin-right: auto;
  color: var(--fg);
  font-weight: 700;
  font-size: 1.1rem;
  text-decoration: none;
}

.brand img {
  width: auto;
  height: 36px;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1.25rem;
}

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

.nav a:not(.button):hover {
  text-decoration: underline;
}

.nav .button {
  padding: 0.5rem 0.85rem;
}

/* Signed-in pages (C-056): the section this page is in, who is signed in in muted text, and
   signing out as a link rather than a filled button. */
.nav a[aria-current="page"] {
  font-weight: 650;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 0.35em;
}

.account {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.25rem 0.75rem;
  min-width: 0;
  color: var(--muted);
  font-size: 0.925rem;
  overflow-wrap: anywhere;
}

.account form {
  margin: 0;
}

.quiet {
  padding: 0;
  border: 0;
  background: none;
  color: var(--accent);
  font: inherit;
  text-decoration: underline;
  text-underline-offset: 0.15em;
  cursor: pointer;
}

/* The signed-in pages' breadcrumb (C-056), above their heading. */
.crumbs ol {
  display: flex;
  flex-wrap: wrap;
  margin: -1.5rem 0 1.25rem;
  padding: 0;
  list-style: none;
  color: var(--muted);
  font-size: 0.925rem;
}

.crumbs li {
  min-width: 0;
  overflow-wrap: anywhere;
}

.crumbs li + li::before {
  content: "›";
  content: "›" / "";
  margin: 0 0.5rem;
}

.crumbs a {
  color: var(--muted);
}

.crumbs [aria-current="page"] {
  color: var(--fg);
}

.languages,
.links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.languages a[aria-current] {
  color: var(--fg);
  font-weight: 650;
  text-decoration: none;
}

.colophon {
  border-top: 1px solid var(--line);
  padding: 2.5rem 0 3rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.colophon .tagline {
  color: var(--fg);
  font-weight: 600;
}

.colophon .links {
  margin-bottom: 1.25rem;
}

.colophon p {
  max-width: var(--measure);
  margin-bottom: 0.5rem;
}

/* Content blocks: flat panels, never nested. */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr));
  gap: 1.25rem;
  margin-top: 1.5rem;
}

.grid > * {
  min-width: 0;
}

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

.panel p:last-child,
.step p:last-child {
  margin-bottom: 0;
}

.step {
  padding-top: 1rem;
  border-top: 3px solid var(--accent);
}

.rules {
  padding-left: 1.25rem;
}

.rules li {
  margin-bottom: 0.6rem;
}

#faq h3 {
  margin-top: 1.75rem;
}

/* The plain-language panels are followed by paragraphs of the same section (C-100). */
#why .grid {
  margin-bottom: 1.5rem;
}

/* Waitlist form */
.signup {
  display: grid;
  gap: 0.4rem;
  max-width: 28rem;
  margin-top: 1.5rem;
}

.signup label {
  font-weight: 600;
}

.signup input[type="email"],
.signup input[type="text"],
.signup textarea {
  width: 100%;
  margin-bottom: 0.6rem;
  padding: 0.6rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--fg);
  font: inherit;
}

.signup .consent {
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
  margin: 0.4rem 0 0.8rem;
  color: var(--muted);
  font-size: 0.925rem;
  font-weight: 400;
}

.signup .consent input {
  margin-top: 0.2rem;
}

.signup .button {
  justify-self: start;
  border: 0;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

/* The trap field of the signup and waitlist forms (devkit.signup, devkit.waitlist): off screen
   for people, still in the page for a bot that fills in every field. */
.signup .trap {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* Evidence pack form (C-056): a period per line, its radio beside its words; the custom days on a
   line of their own, side by side where they fit, one above the other on a phone. The billing
   page's period (C-060) takes the same fieldset. */
.evidence fieldset,
.billing fieldset {
  display: grid;
  gap: 0.55rem;
  min-width: 0;
  margin: 0 0 0.9rem;
  padding: 0.9rem 1rem 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.evidence legend,
.billing legend {
  padding: 0 0.35rem;
  font-weight: 600;
}

.evidence .choice,
.billing .choice {
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
  font-weight: 400;
}

.evidence .choice input,
.billing .choice input {
  flex: none;
  margin: 0.35rem 0 0;
}

.evidence .days {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 10rem), 1fr));
  gap: 0.5rem 1rem;
  padding-left: 1.45rem;
}

.evidence .days p {
  margin: 0;
}

.evidence .days label {
  display: block;
  font-size: 0.925rem;
}

.evidence input[type="date"] {
  width: 100%;
  padding: 0.5rem 0.6rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--fg);
  font: inherit;
}

.error {
  color: var(--error);
  font-weight: 600;
}

/* Pricing */
.plan h2 {
  font-size: 1.25rem;
}

.price {
  font-size: 1.6rem;
  font-weight: 650;
}

.terms {
  margin: 2rem 0 0;
}

/* A card statement's descriptor stays on one line, as the statement prints it (T-098). */
.nowrap {
  white-space: nowrap;
}

/* Billing (C-060): the period above the pricing page's plans, each with its button at the foot of
   its panel; the subscription's facts as label and value, and its portal buttons side by side
   where they fit. */
.billing fieldset {
  max-width: var(--measure);
}

.billing .plan {
  display: flex;
  flex-direction: column;
}

.billing .button {
  border: 0;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.billing .plan .button {
  align-self: flex-start;
  margin-top: auto;
}

.billing .buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin: 1.75rem 0 0.5rem;
}

/* Above the signed-in pages while the org's subscription gives read-only access (C-061). */
.notice {
  margin: 1.25rem 0 0;
  padding: 0.8rem 1rem;
  border-left: 3px solid var(--accent);
  background: var(--surface);
}

.facts {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 0.5rem 1.25rem;
  margin: 0;
}

.facts dt {
  font-weight: 600;
}

/* Long addresses wrap instead of widening the page at 390 px (T-067). */
.facts dd {
  margin: 0;
  overflow-wrap: anywhere;
}

/* A section after the facts starts apart from them (the account page, T-077). */
.facts + h2 {
  margin-top: 2rem;
}

/* About and legal text: long URLs and e-mail addresses wrap instead of widening the page. */
.prose {
  overflow-wrap: anywhere;
}

.prose li {
  margin-bottom: 0.6rem;
}

/* In a table, only a word longer than its column breaks: "anywhere" above let the columns shrink
   below their words, "DigitalOc|ean" at 1280 px (T-075). */
.prose table {
  overflow-wrap: break-word;
}

/* A guide's quotes: the law's own words, set apart from ours (C-081). */
.prose blockquote {
  margin: 1.25rem 0;
  padding: 0.1rem 0 0.1rem 1rem;
  border-left: 3px solid var(--accent);
}

/* A command to copy (a new API key's curl): it scrolls sideways instead of widening the page. */
pre {
  overflow-x: auto;
  padding: 0.75rem 1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

/* A support message's text (the admin pages): its own lines kept, the long ones wrapped. */
pre.message {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* The reply to a support message (the admin pages): as wide as the message it answers. */
.signup.reply {
  max-width: none;
}

/* Closing the ticket, the first action after the message, with room above it (C-090); the whole
   reply stands between its button and the reply's, so a slip of the finger on a phone does not
   close the ticket and lose the reply being written (T-069). */
.close-ticket {
  margin-top: 2rem;
}

/* The way back to the list, with room above the reply's button (T-089): a slip of the finger
   there left the page and the reply being written. */
.all-tickets {
  margin-top: 2rem;
}

.legal {
  padding-top: 3rem;
  padding-bottom: 3rem;
}

.legal ol,
.legal ul {
  padding-left: 1.5rem;
}

.legal li > ul,
.legal li > p {
  margin-top: 0.6rem;
}

/* Legal tables: a grid on wide screens, one block per row on phones (no sideways scrolling). */
.stack {
  width: 100%;
  margin: 0.25rem 0 1rem;
  border-collapse: collapse;
  font-size: 0.925rem;
}

.stack th,
.stack td {
  padding: 0.5rem 0.6rem;
  border: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.stack th {
  background: var(--surface);
  font-weight: 600;
}

@media (max-width: 48rem) {
  .stack thead {
    display: none;
  }

  .stack,
  .stack tbody,
  .stack tr,
  .stack td {
    display: block;
  }

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

  .stack td {
    border: 0;
    border-top: 1px solid var(--line);
  }

  .stack td:first-child {
    border-top: 0;
    font-weight: 600;
  }

  .stack td::before {
    content: attr(data-label);
    display: block;
    color: var(--muted);
    font-size: 0.8rem;
    font-weight: 600;
  }
}
