:root {
  color-scheme: light dark;

  /* docs/product/BRAND_SYSTEM.md §1 (Color) — light values */
  --color-background: #F3F5F9;
  --color-surface: #FFFFFF;
  --color-surface-alt: #F7F9FC;
  --color-border: #E3E7EE;
  --color-text-primary: #14213D;
  --color-text-secondary: #5A6478;
  --color-text-tertiary: #8A93A6;
  --color-primary-action: #2F6FEA;
}

@media (prefers-color-scheme: dark) {
  :root {
    /* docs/product/BRAND_SYSTEM.md §1 (Color) — dark values */
    --color-background: #0B1220;
    --color-surface: #16203A;
    --color-surface-alt: #1B2740;
    --color-border: #26314D;
    --color-text-primary: #EDF0F7;
    --color-text-secondary: #A6AEC2;
    --color-text-tertiary: #747E96;
    --color-primary-action: #6E9CF5;
  }
}

/* Onest (docs/product/BRAND_SYSTEM.md §2), self-hosted — only the weights this page actually
   uses (400 body, 600 sub-headings, 700 section headings, 800 hero headline). */
@font-face {
  font-family: "Onest";
  src: url("assets/fonts/onest-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Onest";
  src: url("assets/fonts/onest-600.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Onest";
  src: url("assets/fonts/onest-700.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Onest";
  src: url("assets/fonts/onest-800.woff2") format("woff2");
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--color-background);
  color: var(--color-text-primary);
  font-family: 'Onest', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-weight: 400;
  line-height: 1.5;
}

.wrap {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.hero {
  padding: 4rem 0 3rem;
  border-bottom: 1px solid var(--color-border);
}

.lockup {
  margin: 0 0 1.5rem;
}

.lockup img {
  height: 64px;
  width: auto;
}

.lockup-light {
  display: block;
}

.lockup-dark {
  display: none;
}

@media (prefers-color-scheme: dark) {
  .lockup-light {
    display: none;
  }

  .lockup-dark {
    display: block;
  }
}

h1 {
  font-size: 2rem;
  font-weight: 800;
  margin: 0 0 0.5rem;
}

h2 {
  font-weight: 700;
}

.tagline {
  color: var(--color-text-secondary);
  font-size: 1.1rem;
}

main {
  padding: 3rem 0;
}

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

.grid article h3 {
  color: var(--color-primary-action);
  font-weight: 600;
  margin-bottom: 0.25rem;
  /* Reserve room for two lines so a heading that wraps (e.g. "Go where it's
     happening.") doesn't push its paragraph out of alignment with the other
     columns' single-line headings. */
  min-height: 3em;
}

footer {
  padding: 2rem 0 3rem;
  color: var(--color-text-secondary);
  font-size: 0.9rem;
}

/* Effective-date line at the top of a legal/policy page (website/terms.html,
   website/privacy.html, website/data-policy.html) -- same secondary-text treatment as
   .tagline, since both are supporting text directly under an <h1>. */
.policy-meta {
  color: var(--color-text-secondary);
  font-size: 0.95rem;
}

a {
  color: var(--color-primary-action);
}

/* Tier cards on website/pricing.html (SPEC-WEBSITE-004 Behavior item 9, issue #715). A row on a
   wide screen, one column on a phone; existing tokens only, so light and dark both follow. */
.tiers {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin: 2rem 0 1.5rem;
}

/* The tier cards and the comparison disclosure are wider than the 720px text column on a wide
   screen, so four cards fit in one row and the table lines up with them. */
.wide {
  width: max(100%, min(72rem, 100vw - 4rem));
  position: relative;
  left: 50%;
  transform: translateX(-50%);
}

.compare-details {
  margin: 0 0 1.5rem;
}

.compare-details summary {
  cursor: pointer;
  padding: 0.9rem 1.25rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 1rem;
  font-weight: 700;
}

.compare-details[open] summary {
  margin-bottom: 1rem;
}

.compare-details .table-scroll {
  margin: 0;
}

/* One column on a phone, two on a tablet, all four in a row on a wide screen (never three and one). */
@media (min-width: 34rem) {
  .tiers {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 62rem) {
  .tiers {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.tier-card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 1.25rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 1rem;
}

.tier-card-featured {
  border: 2px solid var(--color-primary-action);
}

.tier-card h2 {
  margin: 0 0 0.5rem;
}

.tier-badge {
  position: absolute;
  top: 0;
  left: 1.25rem;
  transform: translateY(-50%);
  margin: 0;
  padding: 0.15rem 0.7rem;
  border-radius: 999px;
  background: var(--color-primary-action);
  color: #FFFFFF;
  font-size: 0.8rem;
  font-weight: 700;
}

.tier-price {
  margin: 0;
  font-size: 1.75rem;
  font-weight: 700;
}

.tier-note {
  margin: 0.25rem 0 1rem;
  min-height: 3em;
  font-size: 0.9rem;
  color: var(--color-text-secondary);
}

.tier-highlights {
  flex: 1;
  margin: 0 0 1.25rem;
  padding: 0;
  list-style: none;
}

.tier-highlights li {
  margin: 0 0 0.5rem;
  padding-left: 1.5rem;
  position: relative;
}

.tier-highlights li::before {
  content: "✓" / "";
  position: absolute;
  left: 0;
  color: var(--color-primary-action);
}

.tier-label {
  display: block;
  margin: 0;
  padding: 0.5rem 1rem;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  color: var(--color-text-secondary);
  font-weight: 600;
  text-align: center;
  text-decoration: none;
}

.tier-card-featured .tier-label {
  background: var(--color-primary-action);
  border-color: var(--color-primary-action);
  color: #FFFFFF;
}

@media (prefers-color-scheme: dark) {
  .tier-badge,
  .tier-card-featured .tier-label {
    color: #0B1220;
  }
}

/* Tier comparison table on website/pricing.html (SPEC-WEBSITE-004 Behavior item 7). The wrapper
   scrolls horizontally at phone widths so the page itself never scrolls sideways. */
.table-scroll {
  overflow-x: auto;
  margin: 1.5rem 0;
}

.compare {
  width: 100%;
  border-collapse: collapse;
  background: var(--color-surface);
  font-size: 0.95rem;
}

.compare caption {
  text-align: left;
  font-weight: 700;
  font-size: 1.25rem;
  padding: 0 0 0.75rem;
}

.compare th,
.compare td {
  padding: 0.6rem 0.75rem;
  text-align: center;
  vertical-align: top;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
}

.compare thead th {
  font-weight: 600;
  white-space: nowrap;
}

.compare th[scope="row"] {
  text-align: left;
  font-weight: 600;
  min-width: 12rem;
}

.compare td {
  min-width: 7rem;
}

.compare [aria-hidden="true"] {
  color: var(--color-text-secondary);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Primary call-to-action button on the billing return pages (SPEC-BILLING-004 Behavior item 2):
   full width on a phone, a comfortable fixed minimum width beside it. */
.button-primary {
  display: block;
  box-sizing: border-box;
  padding: 0.9rem 1.25rem;
  border-radius: 0.75rem;
  background: var(--color-primary-action);
  color: #FFFFFF;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
}

@media (prefers-color-scheme: dark) {
  .button-primary {
    color: #0B1220;
  }
}

@media (min-width: 40rem) {
  .button-primary {
    display: inline-block;
    min-width: 16rem;
  }
}

.small {
  font-size: 0.9rem;
  color: var(--color-text-secondary);
}
