/* PawnTeller — marketing site.
   Identity: ledger paper and brass. The product sits between a pawn counter and
   a database, so the palette borrows from both — warm paper stock, a brass
   accent for the thing being weighed, and a clear red/teal split for the one
   idea the product turns on: what the model proposes versus what our code
   permits. Deliberately not the blue-purple gradient every AI product wears. */

:root {
  --paper: #faf9f5;
  --paper-2: #f2f0e9;
  --surface: #ffffff;
  --ink: #12161c;
  --ink-2: #3f4750;
  --muted: #656e78;
  --rule: #ddd9cd;
  --rule-2: #c6c0b0;

  --brass: #8f5c0e;
  --brass-2: #7d5009;
  --brass-soft: #f6ecd6;
  /* Text that sits *on* brass. A token rather than a literal on the button:
     brass is dark in light mode and light in dark mode, so the pairing has to
     travel with the palette. Declared as a literal it was overridden by source
     order and shipped white-on-light-brass at 2.3:1. */
  --on-brass: #ffffff;
  /* The call-to-action band is a deliberately inverted panel. It needs its own
     ground and text tokens: built from `--ink` it flipped to a light ground in
     dark mode while its text stayed pale, landing at 1.6:1. A token whose role
     reverses between themes cannot be reused for a fixed role. */
  --band-bg: #12161c;
  --band-ink: #faf9f5;
  --band-ink-2: #b9c0c8;
  --band-rule: #4a535e;

  --allow: #145c52;
  --allow-soft: #dceae6;
  --deny: #9c3527;
  --deny-soft: #f6e2dd;

  --display: "Newsreader", ui-serif, Georgia, "Times New Roman", serif;
  --body: "Public Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --shadow: 0 1px 2px rgba(18, 22, 28, 0.05), 0 12px 32px -20px rgba(18, 22, 28, 0.35);
  --wrap: 68rem;
}

/* Three states, not two. An explicit choice stamps `data-theme` on the root;
   the default "follow my system" setting stamps nothing, and only the media
   query separates light from dark there. So the dark palette is declared twice:
   once behind the media query, guarded so an explicit light choice still wins
   over a dark OS, and once behind the stamp so the toggle wins in the other
   direction. Components read tokens only — a colour declared solely inside one
   of these blocks never applies in the unstamped state. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #101317;
    --paper-2: #171b21;
    --surface: #1a1f26;
    --ink: #eceef0;
    --ink-2: #b3bac1;
    --muted: #868f99;
    --rule: #2a3039;
    --rule-2: #3c444f;

    /* Brass has to lift off a dark ground without going neon; the soft variant
       becomes a tint of the ground rather than a wash of the accent. */
    --brass: #d5a04a;
    --brass-2: #e8b869;
    --brass-soft: #2a2214;
    --on-brass: #12161c;
    --band-bg: #1e242c;
    --band-ink: #eceef0;
    --band-ink-2: #aab2ba;
    --band-rule: #4a535e;

    --allow: #5fbfa8;
    --allow-soft: #14261f;
    --deny: #e0897a;
    --deny-soft: #2b1a16;

    --shadow: 0 1px 2px rgba(0, 0, 0, 0.5), 0 12px 32px -20px rgba(0, 0, 0, 0.8);
  }
}

:root[data-theme="dark"] {
  --paper: #101317;
  --paper-2: #171b21;
  --surface: #1a1f26;
  --ink: #eceef0;
  --ink-2: #b3bac1;
  --muted: #868f99;
  --rule: #2a3039;
  --rule-2: #3c444f;

  /* Brass has to lift off a dark ground without going neon; the soft variant
       becomes a tint of the ground rather than a wash of the accent. */
  --brass: #d5a04a;
  --brass-2: #e8b869;
  --brass-soft: #2a2214;
  --on-brass: #12161c;
  --band-bg: #1e242c;
  --band-ink: #eceef0;
  --band-ink-2: #aab2ba;
  --band-rule: #4a535e;

  --allow: #5fbfa8;
  --allow-soft: #14261f;
  --deny: #e0897a;
  --deny-soft: #2b1a16;

  --shadow: 0 1px 2px rgba(0, 0, 0, 0.5), 0 12px 32px -20px rgba(0, 0, 0, 0.8);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: var(--brass-2);
  text-underline-offset: 3px;
}

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

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

header.site {
  border-bottom: 1px solid var(--rule);
  background: var(--paper);
  position: sticky;
  top: 0;
  z-index: 20;
}

header.site .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  min-height: 4.25rem;
  flex-wrap: wrap;
}

.brand {
  font-family: var(--display);
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.brand .mark {
  width: 1.35rem;
  height: 1.35rem;
  flex: none;
}

nav.site ul {
  display: flex;
  gap: 1.4rem;
  list-style: none;
  margin: 0;
  padding: 0;
  align-items: center;
  flex-wrap: wrap;
}

/* `:not(.btn)` is load-bearing. `nav.site a` outranks `.btn-primary` on
   specificity, so without it the nav's link colour repaints the call-to-action
   button and lands grey text on brass — legible enough in a screenshot to miss,
   and a contrast failure in fact. */
nav.site a:not(.btn) {
  color: var(--ink-2);
  text-decoration: none;
  font-size: 0.94rem;
  font-weight: 500;
}

nav.site a:not(.btn):hover,
nav.site a:not(.btn)[aria-current="page"] {
  color: var(--brass-2);
}

/* --- buttons ------------------------------------------------------------ */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border-radius: 3px;
  padding: 0.62rem 1.15rem;
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid transparent;
  white-space: nowrap;
}

.btn-primary {
  background: var(--brass);
  color: var(--on-brass);
  border-color: var(--brass);
}

.btn-primary:hover {
  background: var(--brass-2);
}

.btn-ghost {
  border-color: var(--rule-2);
  color: var(--ink);
  background: var(--surface);
}

.btn-ghost:hover {
  border-color: var(--brass);
  color: var(--brass-2);
}

/* --- sections ----------------------------------------------------------- */

section {
  padding: 4.5rem 0;
  border-bottom: 1px solid var(--rule);
}

section:last-of-type {
  border-bottom: none;
}

.eyebrow {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--brass);
  margin: 0 0 0.8rem;
  font-weight: 500;
}

h1 {
  font-family: var(--display);
  font-size: clamp(2.4rem, 6vw, 4rem);
  line-height: 1.04;
  font-weight: 600;
  letter-spacing: -0.022em;
  margin: 0;
  text-wrap: balance;
}

h2 {
  font-family: var(--display);
  font-size: clamp(1.75rem, 3.4vw, 2.4rem);
  line-height: 1.14;
  font-weight: 600;
  letter-spacing: -0.015em;
  margin: 0 0 1rem;
  text-wrap: balance;
}

h3 {
  font-family: var(--body);
  font-size: 1.06rem;
  font-weight: 700;
  margin: 0 0 0.35rem;
  letter-spacing: -0.005em;
}

p {
  margin: 0 0 1rem;
  max-width: 64ch;
}

p:last-child {
  margin-bottom: 0;
}

.lede {
  font-size: 1.2rem;
  color: var(--ink-2);
  max-width: 56ch;
  line-height: 1.55;
}

.section-intro {
  max-width: 60ch;
  margin-bottom: 2.5rem;
}

/* --- hero --------------------------------------------------------------- */

.hero {
  padding: 5rem 0 4rem;
  border-bottom: 1px solid var(--rule);
  background: linear-gradient(180deg, var(--paper-2) 0%, var(--paper) 62%);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(0, 1fr);
  gap: 3.5rem;
  align-items: center;
}

@media (max-width: 60rem) {
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }
}

.hero-cta {
  display: flex;
  gap: 0.8rem;
  margin-top: 2rem;
  flex-wrap: wrap;
}

.hero-note {
  margin-top: 1.1rem;
  font-size: 0.88rem;
  color: var(--muted);
}

/* --- the mechanism panel ------------------------------------------------ */

.panel {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 4px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.panel-head {
  padding: 0.7rem 1.1rem;
  border-bottom: 1px solid var(--rule);
  background: var(--paper-2);
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
}

.panel-body {
  padding: 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.turn {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.turn .who {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
}

.turn .said {
  font-size: 1rem;
}

.sql {
  font-family: var(--mono);
  font-size: 0.76rem;
  line-height: 1.65;
  background: var(--paper-2);
  border: 1px solid var(--rule);
  border-left: 3px solid var(--brass);
  border-radius: 0 3px 3px 0;
  padding: 0.7rem 0.85rem;
  overflow-x: auto;
  white-space: pre;
  margin: 0;
}

.sql .added {
  color: var(--deny);
  font-weight: 600;
}

.sql .kw {
  color: var(--brass-2);
}

.stamp {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.18rem 0.55rem;
  border-radius: 2px;
  align-self: flex-start;
}

.stamp.allow {
  background: var(--allow-soft);
  color: var(--allow);
}

.stamp.deny {
  background: var(--deny-soft);
  color: var(--deny);
}

.result-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.result-table th {
  text-align: left;
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 500;
  padding: 0 0.7rem 0.35rem 0;
  border-bottom: 1px solid var(--rule);
}

.result-table td {
  padding: 0.42rem 0.7rem 0.42rem 0;
  border-bottom: 1px solid var(--rule);
  font-variant-numeric: tabular-nums;
}

.result-table tr:last-child td {
  border-bottom: none;
}

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

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15.5rem, 1fr));
  gap: 1.4rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.card p {
  color: var(--ink-2);
  font-size: 0.95rem;
  margin: 0;
}

.card .icon {
  width: 1.6rem;
  height: 1.6rem;
  color: var(--brass);
  margin-bottom: 0.35rem;
}

/* --- steps -------------------------------------------------------------- */

.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0;
  counter-reset: step;
}

.steps li {
  display: grid;
  grid-template-columns: 3.2rem 1fr;
  gap: 1.2rem;
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--rule);
  align-items: start;
}

.steps li:last-child {
  border-bottom: none;
}

.steps li::before {
  counter-increment: step;
  content: counter(step, decimal-leading-zero);
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--brass);
  padding-top: 0.2rem;
}

.steps .who {
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  margin-bottom: 0.3rem;
}

.steps .who.model {
  color: var(--allow);
}

.steps .who.ours {
  color: var(--deny);
}

/* --- pricing ------------------------------------------------------------ */

.plans {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 1.3rem;
  align-items: stretch;
}

.plan {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: 1.6rem 1.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.plan.featured {
  border-color: var(--brass);
  border-width: 1.5px;
  box-shadow: var(--shadow);
}

.plan-name {
  font-family: var(--display);
  font-size: 1.4rem;
  font-weight: 600;
  margin: 0;
}

.plan-price {
  font-family: var(--mono);
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brass);
  font-weight: 500;
  padding: 0.25rem 0.6rem;
  background: var(--brass-soft);
  border-radius: 2px;
  align-self: flex-start;
}

.plan-questions {
  font-family: var(--display);
  font-size: 2rem;
  font-weight: 600;
  line-height: 1;
  margin: 0;
}

.plan-questions small {
  display: block;
  font-family: var(--body);
  font-size: 0.82rem;
  font-weight: 400;
  color: var(--muted);
  margin-top: 0.3rem;
}

.plan ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  font-size: 0.92rem;
  color: var(--ink-2);
  flex: 1;
}

.plan li {
  display: grid;
  grid-template-columns: 1.1rem 1fr;
  gap: 0.5rem;
  align-items: baseline;
}

.plan li .tick {
  color: var(--allow);
  font-weight: 700;
}

.plan li .dash {
  color: var(--muted);
}

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

.table-scroll {
  overflow-x: auto;
  border: 1px solid var(--rule);
  border-radius: 4px;
  background: var(--surface);
}

table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
  min-width: 34rem;
}

table.data th {
  text-align: left;
  font-size: 0.68rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
  padding: 1rem 1rem 0.5rem;
  border-bottom: 1px solid var(--rule-2);
}

table.data td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--rule);
  vertical-align: top;
}

table.data tr:last-child td {
  border-bottom: none;
}

table.data td.k {
  font-weight: 600;
  white-space: nowrap;
}

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

.callout {
  border-left: 3px solid var(--brass);
  background: var(--brass-soft);
  border-radius: 0 4px 4px 0;
  padding: 1.2rem 1.4rem;
  margin: 2rem 0 0;
}

.callout h3 {
  font-family: var(--display);
  font-size: 1.15rem;
  margin-bottom: 0.4rem;
}

.callout p {
  color: var(--ink-2);
  font-size: 0.96rem;
}

/* --- faq ---------------------------------------------------------------- */

.faq {
  display: flex;
  flex-direction: column;
  gap: 0;
}

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

.faq summary {
  font-weight: 600;
  cursor: pointer;
  font-size: 1.02rem;
  list-style: none;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: baseline;
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary::after {
  content: "+";
  font-family: var(--mono);
  color: var(--brass);
  font-weight: 400;
  flex: none;
}

.faq details[open] summary::after {
  content: "\2212";
}

.faq details p {
  margin-top: 0.75rem;
  color: var(--ink-2);
  font-size: 0.97rem;
}

/* --- cta band ----------------------------------------------------------- */

.band {
  background: var(--band-bg);
  color: var(--band-ink);
  padding: 4rem 0;
  border-bottom: none;
}

.band h2 {
  color: var(--band-ink);
}

.band p {
  color: var(--band-ink-2);
}

.band .btn-ghost {
  background: transparent;
  color: var(--band-ink);
  border-color: var(--band-rule);
}

.band .btn-ghost:hover {
  border-color: var(--band-ink);
  color: var(--band-ink);
}

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

footer.site {
  background: var(--paper-2);
  border-top: 1px solid var(--rule);
  padding: 3rem 0 2.5rem;
  font-size: 0.9rem;
}

footer.site .cols {
  display: grid;
  grid-template-columns: 1.4fr repeat(2, 1fr);
  gap: 2.5rem;
  margin-bottom: 2.5rem;
}

@media (max-width: 45rem) {
  footer.site .cols {
    grid-template-columns: 1fr;
    gap: 1.8rem;
  }
}

footer.site h4 {
  font-size: 0.7rem;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 0.7rem;
}

footer.site ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

footer.site a {
  color: var(--ink-2);
  text-decoration: none;
}

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

footer.site .legal {
  border-top: 1px solid var(--rule);
  padding-top: 1.5rem;
  color: var(--muted);
  font-size: 0.84rem;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

/* --- utilities ---------------------------------------------------------- */

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

.skip:focus {
  left: 1rem;
  top: 1rem;
  z-index: 100;
  background: var(--surface);
  padding: 0.6rem 1rem;
  border: 1px solid var(--brass);
  border-radius: 3px;
}

.stack-lg {
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}

.two-col {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(19rem, 1fr));
  gap: 2.5rem;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  * {
    animation: none !important;
    transition: none !important;
  }
}

/* --- theme toggle ------------------------------------------------------- */

.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--surface);
  border: 1px solid var(--rule-2);
  border-radius: 999px;
  padding: 0.2rem;
  line-height: 0;
}

.theme-toggle button {
  appearance: none;
  background: none;
  border: none;
  border-radius: 999px;
  padding: 0.32rem 0.42rem;
  cursor: pointer;
  color: var(--muted);
  display: inline-flex;
  line-height: 0;
}

.theme-toggle button svg {
  width: 1rem;
  height: 1rem;
}

.theme-toggle button:hover {
  color: var(--ink);
}

/* The pressed state is what tells someone which of the three is active, so it
   has to be visible rather than implied by a hover colour they cannot see. */
.theme-toggle button[aria-pressed="true"] {
  background: var(--brass-soft);
  color: var(--brass);
}
