/* ═══════════════════════════════════════════════════════════════════════════
   allrev.app — shared styles (M3.6)

   The tokens below are the desktop app's palette (apps/desktop/src/styles.css)
   reused verbatim: same teal accent, same warm light / cool dark neutrals, same
   radii, focus ring and system font stack (the product ships no webfont). A
   marketing page next to the app should read as its sibling, not a template.

   Differences from the desktop file are deliberate:
     - type scale is web-sized (16px base — this is a page, not a dense tool);
     - theme follows the OS only (no user theme switch on a static page);
     - nothing here is Tailwind — this is plain CSS for a static host.
   ═══════════════════════════════════════════════════════════════════════════ */

:root {
  color-scheme: light;

  /* Surfaces */
  --bg: #f6f6f2;
  --surface: #ffffff;
  --surface-sunken: #eff1ec;
  --surface-hover: #eaece5;
  --surface-active: #e1e4db;
  --overlay: rgb(27 32 36 / 40%);

  /* Text */
  --ink: #1b2024;
  --ink-muted: #4c565f;
  --ink-subtle: #5f6971;
  --ink-disabled: #9aa2a8;
  --ink-on-accent: #ffffff;

  /* Lines */
  --line: #d9dbd3;
  --line-strong: #b9bdb2;
  --field-border: #858a7e;
  --focus: #145c6e;

  /* Accent (teal) */
  --accent: #145c6e;
  --accent-hover: #0f4b5b;
  --accent-active: #0b3b47;
  --accent-soft: #dcebef;
  --accent-ink: #0f4b5b;

  /* Semantic */
  --positive: #1f6b41;
  --negative: #a53232;
  --negative-soft: #f5dddd;
  --warning: #8a5410;
  --warning-soft: #f6e9d2;
  --neutral: #4c565f;
  --neutral-soft: #e6e8e2;

  /* Typography — system stack only, no webfont, no external request */
  --font-ui:
    ui-sans-serif, system-ui, -apple-system, "Segoe UI Variable Text", "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  --font-mono:
    ui-monospace, "Cascadia Mono", "Segoe UI Mono", "SF Mono", "JetBrains Mono", Menlo, Consolas,
    monospace;

  --text-sm: 14px;
  --text-base: 16px;
  --text-md: 17px;
  --text-lg: 20px;
  --text-xl: 26px;
  /* One step beyond the app's ladder, for the landing hero alone (M8.3). */
  --text-2xl: 34px;

  --leading-snug: 1.35;
  --leading-normal: 1.55;

  /* Radii — same ladder as the app */
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 9px;
  --radius-xl: 13px;
  --radius-full: 999px;

  --shadow-md: 0 2px 6px rgb(27 32 36 / 10%), 0 6px 16px rgb(27 32 36 / 8%);

  --space-2: 4px;
  --space-4: 8px;
  --space-5: 12px;
  --space-6: 16px;
  --space-7: 20px;
  --space-8: 24px;
  --space-9: 32px;
  /* Room between landing sections — the app's ladder stops at 32. */
  --space-10: 44px;
  --space-11: 60px;
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;

    --bg: #15181b;
    --surface: #1c2024;
    --surface-sunken: #22272c;
    --surface-hover: #262c31;
    --surface-active: #2e353b;
    --overlay: rgb(8 10 12 / 62%);

    --ink: #e8e9e4;
    --ink-muted: #a7b0b7;
    --ink-subtle: #8d969d;
    --ink-disabled: #626b72;
    --ink-on-accent: #08181d;

    --line: #2e343a;
    --line-strong: #454c54;
    --field-border: #737c83;
    --focus: #5fb0c4;

    --accent: #5fb0c4;
    --accent-hover: #79c1d3;
    --accent-active: #91cfdd;
    --accent-soft: #183038;
    --accent-ink: #7cc2d4;

    --positive: #6cc08c;
    --negative: #e07a7a;
    --negative-soft: #3a1e1e;
    --warning: #dba24c;
    --warning-soft: #362a15;
    --neutral: #a7b0b7;
    --neutral-soft: #262c31;

    --shadow-md: 0 2px 6px rgb(0 0 0 / 45%), 0 6px 16px rgb(0 0 0 / 35%);
  }
}

/* ── Base ─────────────────────────────────────────────────────────────────── */

* {
  box-sizing: border-box;
}

html {
  font-family: var(--font-ui);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  letter-spacing: -0.011em;
  -webkit-font-smoothing: antialiased;
}

body {
  margin: 0;
  min-height: 100svh;
  background: var(--bg);
  color: var(--ink);
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* The app's one focus treatment: visible for keyboard, off mouse clicks. */
:where(a, button, input, select, textarea):focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

a {
  color: var(--accent-ink);
}

/* ── Page shell ───────────────────────────────────────────────────────────── */

.page {
  width: 100%;
  max-width: 34rem;
  padding: var(--space-9) var(--space-6) var(--space-8);
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: var(--space-4);
  font-size: var(--text-sm);
  font-weight: 650;
  letter-spacing: 0.06em;
  color: var(--ink-muted);
  margin: 0 0 var(--space-8);
}

.wordmark svg {
  display: block;
}

h1,
h2 {
  font-size: var(--text-xl);
  line-height: 1.15;
  letter-spacing: -0.018em;
  margin: 0 0 var(--space-5);
}

.lede {
  color: var(--ink-muted);
  margin: 0 0 var(--space-8);
  max-width: 32rem;
}

.subtle {
  color: var(--ink-subtle);
  font-size: var(--text-sm);
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
  padding: var(--space-8);
}

/* ── Form ─────────────────────────────────────────────────────────────────── */

.field {
  display: block;
  margin-bottom: var(--space-5);
}

.field-label {
  display: block;
  font-size: var(--text-sm);
  font-weight: 600;
  margin-bottom: var(--space-4);
}

.input {
  width: 100%;
  font: inherit;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--field-border); /* >= 3:1 on --surface and --bg (WCAG 1.4.11) */
  border-radius: var(--radius-md);
  padding: 10px 12px;
}

.input::placeholder {
  color: var(--ink-subtle);
}

.input[aria-invalid="true"] {
  border-color: var(--negative);
}

.field-error {
  color: var(--negative);
  font-size: var(--text-sm);
  margin: var(--space-4) 0 0;
}

/* ── Buttons ──────────────────────────────────────────────────────────────── */

.btn {
  font: inherit;
  font-weight: 600;
  border-radius: var(--radius-md);
  padding: 10px 16px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background-color 120ms cubic-bezier(0.16, 1, 0.3, 1);
}

.btn:disabled {
  cursor: default;
  opacity: 0.55;
}

.btn-primary {
  background: var(--accent);
  color: var(--ink-on-accent);
}

.btn-primary:hover:enabled {
  background: var(--accent-hover);
}

.btn-primary:active:enabled {
  background: var(--accent-active);
}

/* Secondary action inside a card: a bordered quiet button, like the app's. */
.btn-quiet {
  background: transparent;
  color: var(--ink);
  border-color: var(--field-border);
}

.btn-quiet:hover:enabled {
  background: var(--surface-hover);
}

/* Destructive row action. */
.btn-danger {
  background: transparent;
  color: var(--negative);
  border-color: var(--field-border);
}

.btn-danger:hover:enabled {
  background: var(--negative-soft);
}

/* ── Notices ──────────────────────────────────────────────────────────────── */

.notice {
  border-radius: var(--radius-md);
  padding: var(--space-4) var(--space-5);
  font-size: var(--text-sm);
  margin: 0 0 var(--space-5);
}

.notice-warning {
  background: var(--warning-soft);
  color: var(--warning);
}

.notice-error {
  background: var(--negative-soft);
  color: var(--negative);
}

/* ── Device list ──────────────────────────────────────────────────────────── */

.slots {
  color: var(--ink-muted);
  font-size: var(--text-sm);
  margin: 0 0 var(--space-6);
}

.devices {
  list-style: none;
  margin: 0;
  padding: 0;
}

.device {
  display: flex;
  align-items: center;
  gap: var(--space-5);
  padding: var(--space-5) 0;
  border-top: 1px solid var(--line);
}

.device:first-child {
  border-top: 0;
  padding-top: 0;
}

.device-ident {
  flex: 1;
  min-width: 0;
}

.device-name {
  font-weight: 600;
  overflow-wrap: anywhere;
}

.device-meta {
  color: var(--ink-subtle);
  font-size: var(--text-sm);
  margin-top: 2px;
}

.device-platform {
  display: inline-block;
  font-size: var(--text-sm);
  background: var(--neutral-soft);
  color: var(--neutral);
  border-radius: var(--radius-full);
  padding: 2px 10px;
  margin-right: var(--space-4);
}

/* ── Loading / empty ──────────────────────────────────────────────────────── */

.loading {
  color: var(--ink-muted);
}

.loading-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  background: var(--accent);
  margin-right: var(--space-4);
  animation: allrev-pulse 1.8s cubic-bezier(0.65, 0, 0.35, 1) infinite;
}

@keyframes allrev-pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.45;
  }
}

/* ── Dialog ───────────────────────────────────────────────────────────────── */

dialog {
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-md);
  padding: var(--space-8);
  max-width: 26rem;
  width: calc(100% - 2 * var(--space-8));
}

dialog::backdrop {
  background: var(--overlay);
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-4);
  margin-top: var(--space-7);
}

/* ── Reduced motion ───────────────────────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
  }
}

/* ═══════════════════════════════════════════════════════════════════════════
   Marketing shell (M8.3) — the shared header/footer and the landing/docs pages.

   The /devices page keeps its narrow single column (.page); the pages added in
   M8.3 use .page-wide. Everything below is composed from the tokens above — no
   new colours, no webfonts, no external requests of any kind.
   ═══════════════════════════════════════════════════════════════════════════ */

/* With a footer in the document, main takes the slack so the footer sits at the
   bottom of short pages instead of floating mid-air. */
body > main {
  flex: 1;
}

.page-wide {
  max-width: 56rem;
}

.page-wide > section + section,
.page-wide > h2 + section,
.page-wide > section + h2 {
  margin-top: var(--space-11);
}

/* ── Shared header / footer ────────────────────────────────────────────────── */

.site-nav,
.site-footer {
  width: 100%;
}

.site-nav {
  border-bottom: 1px solid var(--line);
}

.site-footer {
  border-top: 1px solid var(--line);
  margin-top: var(--space-11);
}

.site-nav-inner,
.site-footer-inner {
  max-width: 56rem;
  margin: 0 auto;
  padding: var(--space-6);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-6);
  flex-wrap: wrap;
}

.site-footer-inner {
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-5);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--space-4);
  font-size: var(--text-sm);
  font-weight: 650;
  letter-spacing: 0.06em;
  color: var(--ink);
  text-decoration: none;
}

.site-nav nav,
.site-footer nav {
  display: flex;
  gap: var(--space-6);
  flex-wrap: wrap;
}

.site-nav nav a,
.site-footer nav a {
  font-size: var(--text-sm);
  color: var(--ink-muted);
  text-decoration: none;
}

.site-nav nav a:hover,
.site-footer nav a:hover {
  color: var(--accent-ink);
  text-decoration: underline;
}

/* ── Hero ──────────────────────────────────────────────────────────────────── */

.hero-title {
  font-size: var(--text-2xl);
  line-height: 1.12;
  letter-spacing: -0.022em;
  margin: 0 0 var(--space-5);
}

.hero-actions {
  display: flex;
  gap: var(--space-4);
  flex-wrap: wrap;
  margin: var(--space-7) 0 var(--space-5);
}

/* `a` needs the button paddings spelled out; .btn is written for <button>. */
a.btn {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

/* ── Provider badges ───────────────────────────────────────────────────────── */

.provider-badges {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr));
  gap: var(--space-4);
}

.provider-badges a {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: var(--space-5) var(--space-6);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  text-decoration: none;
}

.provider-badges a:hover {
  border-color: var(--line-strong);
  background: var(--surface-hover);
}

.badge-name {
  font-weight: 600;
  color: var(--ink);
}

.badge-tagline {
  font-size: var(--text-sm);
  color: var(--ink-subtle);
}

/* ── How it works ──────────────────────────────────────────────────────────── */

.steps {
  list-style: none;
  counter-reset: allrev-step;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: var(--space-6);
}

.steps > li {
  counter-increment: allrev-step;
  border-top: 2px solid var(--accent-soft);
  padding-top: var(--space-5);
}

.steps > li::before {
  content: counter(allrev-step, decimal-leading-zero);
  display: block;
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--accent-ink);
  margin-bottom: var(--space-4);
}

.steps h3 {
  font-size: var(--text-md);
  margin: 0 0 var(--space-4);
}

.steps p {
  margin: 0;
  color: var(--ink-muted);
}

/* ── Feature list / honest caveats ─────────────────────────────────────────── */

.feature-list {
  margin: 0;
  padding-left: 1.3rem;
  display: grid;
  gap: var(--space-5);
  color: var(--ink-muted);
}

.feature-list li::marker {
  color: var(--accent-ink);
}

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

/* ── Demo-video placeholder ───────────────────────────────────────────────── */

.video-frame {
  border: 1px dashed var(--line-strong); /* dashed = provisional, as in the app */
  border-radius: var(--radius-xl);
  background: var(--surface-sunken);
  aspect-ratio: 16 / 9;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-4);
  text-align: center;
  padding: var(--space-8);
}

.video-frame-title {
  font-weight: 600;
  margin: 0;
}

/* ── Pricing ───────────────────────────────────────────────────────────────── */

.price-figure {
  display: flex;
  align-items: baseline;
  gap: var(--space-5);
  margin: 0 0 var(--space-6);
}

.price-amount {
  font-size: var(--text-2xl);
  font-weight: 650;
  letter-spacing: -0.02em;
}

.price-cadence {
  color: var(--ink-muted);
}

.price-facts {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--space-4);
}

.price-facts li {
  position: relative;
  padding-left: var(--space-7);
}

.price-facts li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.5em;
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  background: var(--accent);
}

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

.faq {
  border-top: 1px solid var(--line);
}

.faq details {
  border-bottom: 1px solid var(--line);
}

.faq summary {
  cursor: pointer;
  padding: var(--space-5) 0;
  font-weight: 600;
}

.faq summary::marker {
  color: var(--accent-ink);
}

.faq details > div {
  padding: 0 0 var(--space-6);
}

.faq p {
  margin: 0 0 var(--space-4);
  color: var(--ink-muted);
  max-width: 40rem;
}

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

/* ── Claims (privacy page) ─────────────────────────────────────────────────── */

.claims {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--space-5);
}

.claims li {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
}

.claims h3 {
  font-size: var(--text-md);
  margin: 0 0 var(--space-4);
}

.claims p {
  margin: 0;
  color: var(--ink-muted);
}

/* ── Tables (privacy hosts) ────────────────────────────────────────────────── */

.tablewrap {
  overflow-x: auto;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
}

.table th {
  text-align: left;
  font-weight: 600;
  color: var(--ink-subtle);
  border-bottom: 1px solid var(--line-strong);
  padding: var(--space-4) var(--space-5) var(--space-4) 0;
}

.table td {
  border-bottom: 1px solid var(--line);
  padding: var(--space-5) var(--space-5) var(--space-5) 0;
  vertical-align: top;
  color: var(--ink-muted);
}

.table td:first-child code {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--ink);
  white-space: nowrap;
}

/* ── Per-provider guides ───────────────────────────────────────────────────── */

.provider-guide {
  border-top: 1px solid var(--line);
  padding-top: var(--space-8);
}

.guide-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
  gap: var(--space-5) var(--space-6);
  margin: 0 0 var(--space-6);
}

.guide-meta div {
  min-width: 0;
}

.guide-meta dt {
  font-size: var(--text-sm);
  color: var(--ink-subtle);
  margin-bottom: 2px;
}

.guide-meta dd {
  margin: 0;
  font-weight: 500;
  overflow-wrap: anywhere;
}

.guide-meta code {
  font-family: var(--font-mono);
  font-size: 13px;
}

.guide-steps {
  margin: 0 0 var(--space-6);
  padding-left: 1.4rem;
  display: grid;
  gap: var(--space-4);
  color: var(--ink-muted);
}

.guide-steps li::marker {
  color: var(--accent-ink);
  font-weight: 600;
}

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

.scopes {
  background: var(--surface-sunken);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
}

.scopes h3 {
  font-size: var(--text-md);
  margin: 0 0 var(--space-5);
}

.scopes ul {
  list-style: none;
  margin: 0 0 var(--space-5);
  padding: 0;
  display: grid;
  gap: var(--space-4);
}

.scopes li {
  display: flex;
  align-items: baseline;
  gap: var(--space-4);
}

.scopes code {
  font-family: var(--font-mono);
  font-size: 13px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 2px 7px;
  white-space: nowrap;
}

.scopes p {
  margin: 0;
  font-size: var(--text-sm);
  color: var(--ink-muted);
}

/* ── On this page (providers TOC) ──────────────────────────────────────────── */

.toc {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4) var(--space-6);
  margin: 0 0 var(--space-8);
  padding: 0;
}

.toc a {
  font-size: var(--text-sm);
}

/* ── Docs body copy ────────────────────────────────────────────────────────── */

.doc-body p,
.doc-body li {
  color: var(--ink-muted);
}

.doc-body p {
  max-width: 46rem;
}

.doc-body p + p {
  margin-top: var(--space-5);
}

/* Offset in-page anchors past the fixed-height header-less flow (none yet, but
   breathing room under a skip target costs nothing and reads better). */
:target {
  scroll-margin-top: var(--space-8);
}
