/* Motored — motored.products.ripeseed.io
 *
 * One stylesheet, no build step. Tokens below are lifted from the app's own
 * src/theme.ts so the site and the product read as one thing. Dark is a
 * recolour, not a redesign — the same four tokens carry it there and here.
 */

/* ── tokens ─────────────────────────────────────────────────────── */

:root {
  --paper: #fbf9f6;
  --panel: #f3efe9;
  --ink: #1a1714;
  --ink72: rgba(26, 23, 20, 0.72);
  --ink62: rgba(26, 23, 20, 0.62);
  --ink40: rgba(26, 23, 20, 0.4);
  --accent: #c3401f;
  --on-accent: #fbf9f6;
  --line: rgba(26, 23, 20, 0.1);
  --line-strong: rgba(26, 23, 20, 0.18);
  --due-bg: #fdf1ec;
  --due-border: rgba(195, 64, 31, 0.22);
  --well: rgba(26, 23, 20, 0.06);

  --r-card: 20px;
  --r-btn: 14px;
  --measure: 34rem; /* prose column — about 72 characters */
  --gutter: clamp(1.25rem, 5vw, 3rem);
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #15120e;
    --panel: #29241e;
    --ink: #f3efe9;
    --ink72: rgba(243, 239, 233, 0.72);
    --ink62: rgba(243, 239, 233, 0.62);
    --ink40: rgba(243, 239, 233, 0.4);
    --accent: #e86a45;
    --on-accent: #15120e;
    --line: rgba(255, 255, 255, 0.1);
    --line-strong: rgba(255, 255, 255, 0.18);
    --due-bg: #2d241f;
    --due-border: rgba(232, 106, 69, 0.3);
    --well: rgba(255, 255, 255, 0.07);
  }
}

/* ── fonts ──────────────────────────────────────────────────────── */

/* Self-hosted, not fetched from Google. The store listing says Motored works
 * with no signal and asks for no account; a site that hands every visitor to a
 * third party before the first paint undercuts the tone of that. These are the
 * same files the app renders, subsetted to Latin-1 plus the punctuation these
 * pages use. */
@font-face {
  font-family: 'Instrument Sans';
  src: url('../fonts/instrument-sans-400.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Instrument Sans';
  src: url('../fonts/instrument-sans-600.woff2') format('woff2');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Instrument Sans';
  src: url('../fonts/instrument-sans-700.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* ── base ───────────────────────────────────────────────────────── */

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

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

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: 'Instrument Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI',
    Roboto, sans-serif;
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img,
picture {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--accent);
  text-underline-offset: 0.18em;
  text-decoration-thickness: 0.08em;
}

a:hover {
  text-decoration-thickness: 0.14em;
}

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

h1,
h2,
h3 {
  line-height: 1.12;
  letter-spacing: -0.02em;
  margin: 0 0 0.5em;
  font-weight: 700;
  text-wrap: balance;
}

h1 {
  font-size: clamp(2.3rem, 6.2vw, 3.9rem);
}
h2 {
  font-size: clamp(1.6rem, 3.6vw, 2.25rem);
}
h3 {
  font-size: 1.16rem;
  letter-spacing: -0.01em;
}

p {
  margin: 0 0 1.1em;
}

/* Screen-reader-only, used for the skip link and a few headings that exist
 * for structure rather than for looks. */
.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--accent);
  color: var(--on-accent);
  padding: 0.7rem 1.1rem;
  border-radius: 0 0 var(--r-btn) 0;
  z-index: 20;
  text-decoration: none;
  font-weight: 600;
}
.skip:focus {
  left: 0;
}

/* ── layout ─────────────────────────────────────────────────────── */

.wrap {
  width: min(68rem, 100%);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.prose {
  max-width: var(--measure);
}

section {
  padding-block: clamp(3rem, 8vw, 5.5rem);
}

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

/* ── header ─────────────────────────────────────────────────────── */

.site-head {
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: saturate(1.6) blur(12px);
  z-index: 10;
}

/* On a narrow screen the nav wraps to its own row, and a sticky header two
 * rows tall eats a third of the viewport. Let it scroll away there. */
@media (max-width: 34rem) {
  .site-head {
    position: static;
  }
}

.site-head .wrap {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  min-height: 60px;
  flex-wrap: wrap;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  font-size: 0.8rem;
  text-transform: uppercase;
  color: var(--ink);
  text-decoration: none;
  margin-right: auto;
}

.brand img {
  width: 26px;
  height: 26px;
  border-radius: 7px;
}

.site-head nav {
  display: flex;
  gap: 1.1rem;
  font-size: 0.92rem;
}

.site-head nav a {
  color: var(--ink72);
  text-decoration: none;
  font-weight: 600;
}

.site-head nav a:hover,
.site-head nav a[aria-current='page'] {
  color: var(--accent);
}

/* ── hero ───────────────────────────────────────────────────────── */

.hero {
  padding-block: clamp(2.75rem, 8vw, 5rem) clamp(2rem, 5vw, 3rem);
}

.hero p.lede {
  font-size: clamp(1.1rem, 2.4vw, 1.32rem);
  color: var(--ink72);
  max-width: 32rem;
}

.hero .lede strong {
  color: var(--ink);
  font-weight: 600;
}

/* ── buttons and store chips ────────────────────────────────────── */

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-top: 1.6rem;
  align-items: center;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 46px;
  padding: 0.65rem 1.15rem;
  border-radius: var(--r-btn);
  font-weight: 600;
  font-size: 0.98rem;
  text-decoration: none;
  border: 1px solid transparent;
  background: var(--accent);
  color: var(--on-accent);
}

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

.btn:hover {
  filter: brightness(1.06);
}

/* The stores do not have the app yet. This is deliberately not a link: an
 * install button that goes nowhere is the first thing a visitor tries and the
 * first thing a store reviewer notices. Swap both for real links on the day the
 * listings go live — see README, "When the app ships". */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 46px;
  padding: 0.65rem 1.1rem;
  border-radius: var(--r-btn);
  border: 1px dashed var(--line-strong);
  color: var(--ink62);
  font-weight: 600;
  font-size: 0.95rem;
  background: var(--well);
}

.chip svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
  flex: none;
}

.note {
  font-size: 0.88rem;
  color: var(--ink62);
  margin-top: 0.9rem;
}

/* ── screenshots ────────────────────────────────────────────────── */

.shots {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(200px, 236px);
  gap: 1.1rem;
  overflow-x: auto;
  padding-block: 0.5rem 1.5rem;
  scroll-snap-type: x mandatory;
  scrollbar-width: thin;
  /* Bleed to the viewport edge so the strip reads as scrollable on a phone. */
  margin-inline: calc(var(--gutter) * -1);
  padding-inline: var(--gutter);
}

.shots figure {
  margin: 0;
  scroll-snap-align: start;
}

.shots img {
  width: 100%;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--panel);
}

.shots figcaption {
  font-size: 0.87rem;
  color: var(--ink62);
  margin-top: 0.6rem;
  line-height: 1.4;
}

/* ── feature grid ───────────────────────────────────────────────── */

.grid {
  display: grid;
  gap: 1.1rem;
  grid-template-columns: repeat(auto-fit, minmax(15.5rem, 1fr));
  margin-top: 2rem;
}

/* Four cards in a three-up grid leaves one stranded on its own row. The
 * feature grids all hold exactly four, so they get two columns once there is
 * room for two; the three-card grid on the support page keeps auto-fit. */
@media (min-width: 46rem) {
  .grid.two {
    grid-template-columns: repeat(2, 1fr);
  }
}

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  padding: 1.35rem 1.4rem;
}

.card h3 {
  margin-bottom: 0.4rem;
}

.card p {
  margin: 0;
  color: var(--ink72);
  font-size: 0.97rem;
}

.card.due {
  background: var(--due-bg);
  border-color: var(--due-border);
}

.kicker {
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 0.7rem;
}

/* ── small utilities ────────────────────────────────────────────── */

/* These exist because the response headers policy sets a strict CSP, and
 * style-src 'self' blocks inline style="" attributes outright — hashes do not
 * apply to style attributes. Every one-off rule lives here instead. */

.lead-in {
  font-size: 1.15rem;
  color: var(--ink72);
}

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

/* A block of prose or <details> wider than the reading measure but still
 * short of the full wrap — the FAQ lists on the home and support pages. */
.readable {
  max-width: 46rem;
}

.steps {
  color: var(--ink72);
  padding-left: 1.15rem;
}

/* The summary card at the head of each legal page. */
.summary {
  margin-bottom: 2rem;
}

/* Two classes rather than one, so this outranks `.legal h3`'s top margin
 * wherever the two land in source order. */
.card.summary h3 {
  margin-top: 0;
}

/* The screenshot strip carries its own vertical rhythm. */
.flush {
  padding-block: 0;
}

/* ── pricing ────────────────────────────────────────────────────── */

.prices {
  display: grid;
  gap: 1.1rem;
  grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
  margin-top: 2rem;
}

.price {
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  padding: 1.35rem 1.4rem;
  background: var(--panel);
}

.price.pick {
  border-color: var(--due-border);
  background: var(--due-bg);
}

.price .amount {
  font-size: 1.9rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  display: block;
  line-height: 1.1;
}

.price .per {
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--ink62);
  display: block;
  margin-top: 0.35rem;
}

.price p {
  margin: 0.7rem 0 0;
  font-size: 0.93rem;
  color: var(--ink72);
}

/* ── FAQ ────────────────────────────────────────────────────────── */

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

details summary {
  cursor: pointer;
  font-weight: 600;
  padding: 0.95rem 2rem 0.95rem 0;
  list-style: none;
  position: relative;
  min-height: 44px;
  display: flex;
  align-items: center;
}

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

details summary::after {
  content: '';
  position: absolute;
  right: 0.35rem;
  top: 50%;
  width: 9px;
  height: 9px;
  border-right: 2px solid var(--ink40);
  border-bottom: 2px solid var(--ink40);
  transform: translateY(-70%) rotate(45deg);
  transition: transform 0.15s ease;
}

details[open] summary::after {
  transform: translateY(-25%) rotate(-135deg);
}

details .answer {
  padding: 0 0 1.1rem;
  color: var(--ink72);
  max-width: var(--measure);
}

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

/* ── legal pages ────────────────────────────────────────────────── */

/* On the legal pages the wrap and the reading column are the same element
 * (<div class="wrap legal">), so capping the wrap would squeeze the tables
 * down with the prose. Cap the prose instead, and let the wide things —
 * tables, the contents box, the summary card — have more room. */
.legal > h1,
.legal > h2,
.legal > h3,
.legal > p,
.legal > ul,
.legal > ol,
.legal > .dates {
  max-width: var(--measure);
}

.legal > .table-scroll,
.legal > .toc,
.legal > .card {
  max-width: 46rem;
}

.legal h2 {
  font-size: 1.4rem;
  margin-top: 2.6rem;
  scroll-margin-top: 5rem;
}

.legal h3 {
  font-size: 1.03rem;
  margin-top: 1.7rem;
}

.legal p,
.legal li {
  color: var(--ink72);
}

.legal ul,
.legal ol {
  padding-left: 1.15rem;
  margin: 0 0 1.1em;
}

.legal li {
  margin-bottom: 0.45em;
}

.legal strong {
  color: var(--ink);
  font-weight: 600;
}

.dates {
  font-size: 0.88rem;
  color: var(--ink62);
  margin-bottom: 2rem;
}

.toc {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  padding: 1.2rem 1.35rem;
  margin-bottom: 1rem;
}

.toc h2 {
  font-size: 0.76rem;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--ink62);
  margin: 0 0 0.7rem;
}

.toc ol {
  margin: 0;
  padding-left: 1.15rem;
  columns: 2;
  column-gap: 1.6rem;
  font-size: 0.93rem;
}

@media (max-width: 34rem) {
  .toc ol {
    columns: 1;
  }
}

.toc li {
  margin-bottom: 0.3em;
  break-inside: avoid;
}

.toc a {
  color: var(--ink72);
  text-decoration: none;
}

.toc a:hover {
  color: var(--accent);
  text-decoration: underline;
}

/* A short factual table — the third-party list in the privacy policy, and the
 * store-URL table in support. Scrolls rather than squeezing on a phone. */
.table-scroll {
  overflow-x: auto;
  margin: 0 0 1.4em;
  border: 1px solid var(--line);
  border-radius: var(--r-card);
}

table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.93rem;
  min-width: 30rem;
}

th,
td {
  text-align: left;
  padding: 0.7rem 0.9rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  color: var(--ink72);
}

th {
  font-weight: 600;
  color: var(--ink);
  background: var(--panel);
  white-space: nowrap;
}

tbody tr:last-child td {
  border-bottom: 0;
}

/* ── footer ─────────────────────────────────────────────────────── */

.site-foot {
  border-top: 1px solid var(--line);
  padding-block: 2.5rem 3rem;
  font-size: 0.92rem;
  color: var(--ink62);
}

.site-foot .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem 1.4rem;
  align-items: baseline;
}

.site-foot nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1.1rem;
  margin-right: auto;
}

.site-foot a {
  color: var(--ink72);
  text-decoration: none;
  font-weight: 600;
}

.site-foot a:hover {
  color: var(--accent);
  text-decoration: underline;
}

.site-foot .fine {
  flex-basis: 100%;
  color: var(--ink40);
  font-size: 0.85rem;
}

/* ── 404 ────────────────────────────────────────────────────────── */

.lost {
  padding-block: clamp(4rem, 14vw, 8rem);
}
