/* Pingtail design system: one stylesheet, light + dark (system preference, overridable with data-theme). Mobile-first:
   every layout stacks to one column on small screens, tap targets are at least 44px, photos keep their box (no layout shift). */
:root {
  --bg: #f7f6f2; --surface: #ffffff; --surface-2: #efede6; --ink: #16202e; --ink-2: #4a5566; --line: #dcd8cc;
  --accent: #b54708; --accent-ink: #ffffff; --accent-soft: #fbe9dc; --ok: #1f7a4d; --warn: #9a6700; --bad: #b42318;
  --focus: #1d4ed8; --radius: 10px; --shadow: 0 1px 2px rgba(22, 32, 46, .06), 0 4px 16px rgba(22, 32, 46, .05);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  --img-dim: 1; --photo-shade: rgba(10, 16, 26, .66); --tap: 44px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #11151c; --surface: #181e27; --surface-2: #1f2632; --ink: #e8ebf0; --ink-2: #aab3c0; --line: #2d3644;
    --accent: #f79a5b; --accent-ink: #1a1106; --accent-soft: #3a2616; --ok: #5ccf96; --warn: #e5b84a; --bad: #ff8a80;
    --focus: #8ab4ff; --shadow: none; --img-dim: .86; --photo-shade: rgba(8, 11, 16, .74); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #11151c; --surface: #181e27; --surface-2: #1f2632; --ink: #e8ebf0; --ink-2: #aab3c0; --line: #2d3644;
  --accent: #f79a5b; --accent-ink: #1a1106; --accent-soft: #3a2616; --ok: #5ccf96; --warn: #e5b84a; --bad: #ff8a80;
  --focus: #8ab4ff; --shadow: none; --img-dim: .86; --photo-shade: rgba(8, 11, 16, .74); color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.6 var(--font); overflow-wrap: break-word; }
img { max-width: 100%; height: auto; }
a { color: var(--accent); text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
h1, h2, h3, .h3 { line-height: 1.2; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: clamp(1.85rem, 1.3rem + 2.6vw, 2.9rem); }
h2 { font-size: clamp(1.35rem, 1.1rem + 1.2vw, 1.8rem); }
h3, .h3 { font-size: 1.12rem; }
p { margin: 0 0 1em; }
code, pre { font-family: var(--mono); font-size: .92em; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: 8px 12px; z-index: 10; }
.skip:focus { left: 8px; }

.wrap { width: 100%; max-width: 1140px; margin: 0 auto; padding-inline: clamp(16px, 4vw, 24px); }
.narrow { max-width: 760px; }
.center { text-align: center; }
.muted { color: var(--ink-2); }
.small { font-size: .9rem; }
section { padding-block: clamp(28px, 5vw, 56px); }
.band { background: var(--surface-2); }
.page-head { padding-bottom: 12px; }
.section-h { margin-top: .4em; }
.eyebrow { text-transform: uppercase; letter-spacing: .08em; font-size: .8rem; font-weight: 600; color: var(--accent); margin-bottom: .6em; }
.lead { font-size: clamp(1.05rem, 1rem + .3vw, 1.15rem); color: var(--ink-2); max-width: 62ch; }

/* breadcrumbs */
.crumbs { font-size: .9rem; color: var(--ink-2); margin-bottom: .4em; }
.crumbs ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; align-items: center; }
.crumbs li { display: inline-flex; align-items: center; }
.crumbs li + li::before { content: "/"; margin-inline: 8px; color: var(--line); }
.crumbs a { display: inline-flex; align-items: center; min-height: var(--tap); }

/* header / nav */
.site-header { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.bar { display: flex; align-items: center; gap: 16px; min-height: 60px; flex-wrap: wrap; }
.brand { font-weight: 700; color: var(--ink); text-decoration: none; display: inline-flex; align-items: center; gap: 8px; margin: 0; min-height: var(--tap); }
.brand-mark { width: 14px; height: 14px; border-radius: 3px; background: var(--accent); display: inline-block; }
.nav { display: flex; align-items: center; gap: 4px 18px; margin-left: auto; flex-wrap: wrap; }
.nav a { color: var(--ink); text-decoration: none; font-weight: 500; display: inline-flex; align-items: center; min-height: var(--tap); }
.nav a[aria-current="page"] { color: var(--accent); }
.nav .btn { color: var(--accent-ink); }
.nav-toggle { display: none; margin-left: auto; background: none; border: 1px solid var(--line); color: var(--ink); border-radius: 8px;
              padding: 6px 16px; font: inherit; min-height: var(--tap); cursor: pointer; }
@media (max-width: 860px) {
  .nav-toggle { display: inline-flex; align-items: center; }
  .nav { display: none; width: 100%; flex-direction: column; align-items: stretch; gap: 0; padding-bottom: 14px; }
  .nav a { padding-block: 4px; border-top: 1px solid var(--line); }
  .nav .btn { justify-content: center; margin-top: 10px; border-top: 0; }
  .nav.is-open { display: flex; }
}
.subnav { display: flex; gap: 16px; flex-wrap: wrap; align-items: center; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: var(--tap); background: var(--accent);
       color: var(--accent-ink); border: 1px solid var(--accent); border-radius: 8px; padding: 10px 18px; font: 600 1rem/1.2 var(--font);
       text-decoration: none; cursor: pointer; text-align: center; }
.btn:hover { filter: brightness(1.06); }
.btn-ghost { background: transparent; color: var(--accent); }
.btn-small { padding: 6px 14px; font-size: .92rem; }
.btn-danger { background: var(--bad); border-color: var(--bad); color: #fff; }
.cta-row { display: flex; gap: 12px; flex-wrap: wrap; }
.link-arrow { font-weight: 600; display: inline-flex; align-items: center; min-height: var(--tap); }
.link-arrow::after { content: " →"; white-space: pre; }
@media (max-width: 560px) {
  .cta-row .btn, .cta-band .btn, .form .btn[type=submit], .auth-main .btn[type=submit] { width: 100%; }
}

/* layout grids */
.hero-grid, .two-col, .split { display: grid; grid-template-columns: minmax(0, 1fr); gap: clamp(20px, 4vw, 40px); align-items: start; }
.grid-2, .grid-3 { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; }
@media (min-width: 700px) { .grid-2, .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 900px) {
  .hero-grid, .two-col { grid-template-columns: 1.2fr 1fr; }
  .split { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: center; }
  .split-flip > :first-child { order: 2; }
}
@media (min-width: 1000px) { .grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); margin-bottom: 18px; }
.card > :last-child { margin-bottom: 0; }
.card-link { color: inherit; text-decoration: none; display: block; }
.card-link:hover { border-color: var(--accent); }
.card h3 a, .card h2 a { display: inline-block; padding-block: 12px; margin-block: -12px; }
.hero-grid > *, .two-col > *, .split > *, .grid-2 > *, .grid-3 > * { min-width: 0; }   /* wide code/tables never stretch a column */
.grid-2 > .card, .grid-3 > .card { margin-bottom: 0; }
.hero { padding-block: clamp(36px, 7vw, 80px); }
.hero-card { margin: 0; }

/* photos */
.photo { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; filter: brightness(var(--img-dim)); }
.card-media { overflow: hidden; padding-top: 0; }
.card-media > .photo { width: calc(100% + 40px); max-width: none; margin: 0 -20px 16px; border-radius: 0; }
.photo-frame { position: relative; margin: 0; border-radius: var(--radius); overflow: hidden; background: var(--surface-2); box-shadow: var(--shadow); }
.photo-frame .photo { aspect-ratio: 4 / 3; }
@media (min-width: 900px) { .photo-frame .photo { aspect-ratio: 16 / 11; } }
@media (prefers-reduced-motion: no-preference) {
  .card-media > .photo { transition: transform .35s ease; }
  .card-link:hover .photo, .card-media:hover > .photo { transform: scale(1.03); }
}

/* home hero over a photo: dark shade keeps text legible in light and dark themes */
.hero-photo { position: relative; isolation: isolate; overflow: hidden; background: #0f1720; color: #fff; padding-block: clamp(44px, 9vw, 120px); }
.hero-photo .hero-img { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; aspect-ratio: auto; object-fit: cover;
                        object-position: 65% 60%; z-index: -2; filter: none; }
.hero-photo::before { content: ""; position: absolute; inset: 0; z-index: -1;
                      background: linear-gradient(180deg, rgba(10, 16, 26, .84) 0%, rgba(10, 16, 26, .74) 100%); }
@media (min-width: 900px) {
  .hero-photo::before { background: linear-gradient(90deg, rgba(10, 16, 26, .9) 0%, rgba(10, 16, 26, .74) 50%, rgba(10, 16, 26, .3) 100%); }
  .hero-photo .hero-grid { align-items: center; }
}
.hero-photo h1 { color: #fff; }
.hero-photo .lead, .hero-photo .muted { color: rgba(255, 255, 255, .88); }
.hero-photo .eyebrow { color: #ffc49d; }
.hero-photo .btn { background: #d9651c; border-color: #d9651c; color: #fff; }
.hero-photo .btn-ghost { background: rgba(255, 255, 255, .06); border-color: rgba(255, 255, 255, .75); color: #fff; }
.hero-photo .pill { background: rgba(255, 255, 255, .14); color: #fff; }
.hero-photo .hero-card { background: rgba(12, 18, 27, .74); border-color: rgba(255, 255, 255, .18); color: #fff; box-shadow: none; }
.hero-photo .hero-card ul.checks li::before { border-color: #6fe0a6; }
.hero-chips { display: flex; flex-wrap: wrap; gap: 8px; }

/* page banner photo (feed, use case, guide, about, process, pricing, api, contact) */
.banner { position: relative; margin: 0; background: var(--surface-2); }
.banner .photo { aspect-ratio: auto; height: clamp(160px, 30vw, 360px); }
.banner::after { content: ""; position: absolute; inset: auto 0 0 0; height: 45%; background: linear-gradient(to bottom, transparent, var(--bg)); pointer-events: none; }
.banner-slim .photo { height: clamp(110px, 18vw, 220px); }

/* call to action band over a photo (decorative background, no content image) */
.cta-photo { position: relative; isolation: isolate; color: #fff; background: #10161f url("/static/img/truck-desert-highway-800.webp") center / cover no-repeat; }
@media (min-width: 900px) { .cta-photo { background-image: url("/static/img/truck-desert-highway-1600.webp"); } }
.cta-photo::before { content: ""; position: absolute; inset: 0; z-index: -1; background: var(--photo-shade); }
.cta-photo h2, .cta-photo p { color: #fff; }
.cta-photo .btn { background: #d9651c; border-color: #d9651c; color: #fff; }

/* sign-up / log-in: side photo on wide screens only (display:none keeps the lazy image from loading on phones) */
.auth-split { display: grid; grid-template-columns: minmax(0, 1fr); gap: 32px; align-items: stretch; }
.auth-main { max-width: 560px; width: 100%; }
.auth-aside { display: none; }
@media (min-width: 960px) {
  .auth-split { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .auth-aside { display: block; position: relative; border-radius: var(--radius); overflow: hidden; min-height: 460px; background: #10161f; color: #fff; }
  .auth-aside .photo { position: absolute; inset: 0; width: 100%; height: 100%; aspect-ratio: auto; }
  .auth-aside::before { content: ""; position: absolute; inset: 0; z-index: 1; background: linear-gradient(to top, rgba(10, 16, 26, .86), rgba(10, 16, 26, .1) 60%); }
  .auth-caption { position: absolute; z-index: 2; inset: auto 24px 24px 24px; margin: 0; }
  .auth-caption strong { display: block; font-size: 1.3rem; }
}

ul.plain { list-style: none; padding: 0; margin: 0 0 1em; }
ul.plain li { margin: 0; }
ul.plain a { display: inline-flex; align-items: center; min-height: var(--tap); }
ul.checks { list-style: none; padding: 0; margin: 0 0 1em; }
ul.checks li { padding-left: 1.6em; position: relative; margin: 8px 0; }
ul.checks li::before { content: ""; position: absolute; left: .2em; top: .55em; width: .7em; height: .38em; border-left: 2px solid var(--ok); border-bottom: 2px solid var(--ok); transform: rotate(-45deg); }
ul.tags { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
ul.tags li, .pill { display: inline-block; background: var(--accent-soft); color: var(--ink); border-radius: 999px; padding: 2px 10px; font-size: .88rem; }
a.pill { display: inline-flex; align-items: center; min-height: var(--tap); padding: 0 14px; text-decoration: none; }
ol.steps { padding-left: 1.2em; display: grid; gap: 12px; }

/* facts + stats */
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(140px, 100%), 1fr)); gap: 10px; margin: 12px 0; }
.facts div { background: var(--surface-2); border-radius: 8px; padding: 8px 12px; }
.facts dt { font-size: .78rem; color: var(--ink-2); text-transform: uppercase; letter-spacing: .05em; }
.facts dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr)); gap: 14px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.stat-v { font-size: 2rem; font-weight: 700; margin: 0; font-variant-numeric: tabular-nums; }
.stat-l { margin: 0; font-weight: 600; }
.stat-s { margin: 0; color: var(--ink-2); font-size: .88rem; }

/* tables: always inside a horizontal scroll container */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); margin-bottom: 1em; max-width: 100%; }
.table-wrap:focus-visible { outline: 2px solid var(--accent, #1f6feb); outline-offset: 2px; }
table { border-collapse: collapse; width: 100%; font-size: .94rem; }
th { text-align: left; font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-2); padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
table.data td { white-space: nowrap; font-variant-numeric: tabular-nums; }
pre.code { background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: 14px; overflow-x: auto; white-space: pre; max-width: 100%; }

/* forms */
.form .field { margin-bottom: 14px; }
.field label { display: block; font-weight: 600; margin-bottom: 4px; }
.field.check { display: flex; gap: 10px; align-items: flex-start; }
.field.check label { font-weight: 400; }
.field.check input { width: 22px; height: 22px; margin-top: 2px; flex: none; }
input[type=text], input[type=email], input[type=password], input[type=tel], input[type=number], input:not([type]), select, textarea {
  width: 100%; min-height: var(--tap); padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--ink); font: inherit; font-size: 1rem; }
.inline-form { display: inline-flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 0; }
.inline-form input, .inline-form select { width: auto; }
.hint { font-size: .88rem; color: var(--ink-2); margin: 4px 0 0; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.errors { border: 1px solid var(--bad); background: color-mix(in srgb, var(--bad) 8%, var(--surface)); border-radius: var(--radius); padding: 12px 16px; margin-bottom: 16px; }
.errors ul { margin: 0; padding-left: 1.2em; }
.notice, .flash { border-left: 4px solid var(--warn); background: var(--surface); padding: 10px 14px; border-radius: 6px; margin: 12px 0; }
.flash { border-left-color: var(--ok); }
.key-once { border-color: var(--ok); }

/* pricing */
.switches { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 12px; }
.segmented { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; background: var(--surface); }
.seg { display: inline-flex; align-items: center; min-height: var(--tap); padding: 0 16px; text-decoration: none; color: var(--ink); font-weight: 600; font-size: .95rem; }
.seg.is-on { background: var(--accent); color: var(--accent-ink); }
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(230px, 100%), 1fr)); gap: 18px; }
.plan-featured { border: 2px solid var(--accent); }
.price { min-height: 3.4em; }
.amount { font-size: 1.9rem; font-weight: 700; display: inline-block; }
.amount .per { font-size: .95rem; font-weight: 500; color: var(--ink-2); }
.amount .tax { display: block; font-size: .8rem; font-weight: 400; color: var(--ink-2); }
.faq details { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 0 14px; margin-bottom: 10px; }
.faq summary { font-weight: 600; cursor: pointer; min-height: var(--tap); display: flex; align-items: center; padding-block: 8px; }
.faq details p { margin: 0 0 12px; }

/* landing funnel (home) + two-plan pricing */
.btn-large { padding: 12px 26px; font-size: 1.08rem; }
.hero-copy { max-width: 760px; }
ul.hero-trust { margin-top: 18px; }
ul.hero-trust li { margin: 6px 0; font-weight: 600; }
.hero-photo ul.hero-trust li::before { border-color: #6fe0a6; }
table.preview td { font-size: .92rem; }
.steps-3 { list-style: none; padding: 0; margin: 0 0 1em; display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; }
.steps-3 > .card { margin-bottom: 0; }
.step-n { display: inline-flex; align-items: center; justify-content: center; width: 2.1em; height: 2.1em; border-radius: 999px;
  background: var(--accent); color: var(--accent-ink); font-weight: 700; margin-bottom: 10px; }
.grid-4 { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; }
.grid-4 > * { min-width: 0; }
.grid-4 > .card { margin-bottom: 0; }
@media (min-width: 700px) { .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 820px) { .steps-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1000px) { .grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.plans-2 { grid-template-columns: repeat(auto-fit, minmax(min(290px, 100%), 1fr)); max-width: 860px; margin-bottom: 12px; }
.plan .pill { margin-bottom: 8px; }
.annual { display: block; font-size: .9rem; color: var(--ink-2); }
table.compare th[scope=row] { text-transform: none; letter-spacing: 0; font-size: .94rem; color: var(--ink); white-space: normal; font-weight: 500; }
table.compare td { text-align: center; white-space: nowrap; }
.free-leads { border: 2px solid var(--accent); }

/* prose (markdown) */
.prose h2 { margin-top: 1.6em; }
.prose h3 { margin-top: 1.3em; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose table { margin: 1em 0; border: 1px solid var(--line); display: block; overflow-x: auto; max-width: 100%; }
.prose code { overflow-wrap: anywhere; }
.prose blockquote { border-left: 4px solid var(--line); margin: 1em 0; padding: .2em 1em; color: var(--ink-2); }

/* blog (index, categories, posts, weekly data chart: inline SVG coloured by these classes, no inline styles) */
.blog-cat-list { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 6px; }
.blog-cat-list a.pill[aria-current="true"] { background: var(--accent); color: var(--accent-ink); }
.blog-meta { margin-bottom: .4em; }
.blog-meta a { color: var(--ink-2); }
.pager { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: center; margin-top: 28px; }
.blog-body { padding-bottom: 8px; }
.blog-foot { padding-bottom: clamp(28px, 5vw, 56px); }
.blog-next { margin-top: 18px; }
.chart { margin: 1.4em 0; }
.chart-svg { display: block; width: 100%; max-width: 640px; height: auto; }
.chart-bar { fill: var(--accent); }
.chart-label, .chart-value { fill: var(--ink); font: 14px var(--font); }
.chart figcaption { font-size: .88rem; color: var(--ink-2); margin-top: 6px; }

/* footer */
.site-footer { background: var(--surface); border-top: 1px solid var(--line); padding-top: 32px; margin-top: 24px; }
.footer-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.footer-grid > :first-child { grid-column: 1 / -1; }
@media (min-width: 760px) { .footer-grid { grid-template-columns: 1.4fr repeat(3, minmax(0, 1fr)); } .footer-grid > :first-child { grid-column: auto; } }
.footer-h { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-2); }
.footer-bottom { border-top: 1px solid var(--line); margin-top: 24px; padding-block: 18px; display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: center; }
.footer-bottom p { margin: 0; }
/* cookie consent banner (logic in /static/tags.js; rendered only when a tag is enabled) */
.cookie-banner { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; background: var(--surface); border-top: 2px solid var(--accent);
                 box-shadow: 0 -6px 24px rgba(0, 0, 0, .12); padding-block: 14px; max-height: 80vh; overflow-y: auto; }
.cookie-title { font-size: 1.05rem; margin: 0 0 4px; }
.cookie-banner p { margin: 0 0 10px; }
.cookie-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.cookie-prefs fieldset { border: 1px solid var(--line); border-radius: 8px; padding: 10px 14px; margin: 0 0 10px; }
.cookie-prefs .field { margin-bottom: 8px; }
.cookie-prefs .hint { display: block; }
@media (max-width: 560px) { .cookie-actions .btn { flex: 1 1 100%; } }
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; transition: none !important; animation: none !important; } }
@media print { .site-header, .site-footer, .cta-row, .btn, .banner, .auth-aside { display: none !important; } body { background: #fff; color: #000; } }
