/* ==========================================================================
   RevBook secondary pages: /support, /privacy, /terms, /open, 404.
   Same tokens, type and primitives as index.html (see the comment block at
   the top of its <style>), so leaving the home page never feels like leaving
   the site. If a token changes there, change it here too.
   ========================================================================== */

/* ---------- Tokens ---------- */
:root {
  --paper:      #F4F7FB;
  --surface:    #FFFFFF;
  --surface-2:  #E9EFF7;
  --ink:        #0B1220;
  --muted:      #56657C;
  --soft:       #8593A8;
  --line:       #DFE6F0;
  --line-soft:  #EBF0F7;
  --blue:       #0069FB;
  --blue-strong:#0058D6;
  --blue-soft:  #E6F0FF;
  --blue-tint:  #7AB1FD;
  --green:      #12B76A;

  --night:        #0B1220;
  --night-2:      #111C30;
  --on-night:     #F4F7FB;
  --on-night-dim: #A7B5C9;
  --on-night-line: rgba(255,255,255,.12);

  --display: "Archivo", "Helvetica Neue", system-ui, sans-serif;
  --body:    "Hanken Grotesk", "Helvetica Neue", system-ui, -apple-system, sans-serif;
  --mono:    "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --wide: 122%;
  --semi: 112%;

  --t-xs: .78rem;
  --t-sm: .92rem;
  --t-md: 1.0625rem;
  --t-lg: clamp(1.08rem, 1.5vw, 1.22rem);

  --s1: 6px;  --s2: 10px; --s3: 16px; --s4: 24px;
  --s5: 32px; --s6: 48px; --s7: 72px;
  --gutter: clamp(16px, 4vw, 44px);
  --wrap: 1160px;
  --r-lg: 24px;
  --r-md: 16px;
  --r-sm: 10px;
  --nav-h: 68px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper:     #070D16;
    --surface:   #0F1A2B;
    --surface-2: #16243A;
    --ink:       #F2F6FA;
    --muted:     #A3B1C4;
    --soft:      #7A8AA1;
    --line:      #22304A;
    --line-soft: #1A2740;
    --blue:      #3D8BFF;
    --blue-strong:#1376FF;
    --blue-soft: #12315B;
    --green:     #2EE59D;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper:     #070D16;
  --surface:   #0F1A2B;
  --surface-2: #16243A;
  --ink:       #F2F6FA;
  --muted:     #A3B1C4;
  --soft:      #7A8AA1;
  --line:      #22304A;
  --line-soft: #1A2740;
  --blue:      #3D8BFF;
  --blue-strong:#1376FF;
  --blue-soft: #12315B;
  --green:     #2EE59D;
  color-scheme: dark;
}

/* ---------- 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; } }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: var(--t-md);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  /* Short pages (/open, 404) keep the footer on the bottom edge. */
  min-height: 100vh;
  display: flex; flex-direction: column;
}
body > main { flex: 1 0 auto; }
img { max-width: 100%; height: auto; display: block; }
p { margin: 0; }
h1, h2, h3, h4 { margin: 0; font-family: var(--display); text-wrap: balance; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
:focus-visible { outline: 3px solid var(--blue-tint); outline-offset: 3px; border-radius: 8px; }
::selection { background: var(--blue); color: #fff; }

.skip {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--blue); color: #fff; padding: 12px 18px; border-radius: 0 0 10px 0;
  font-weight: 600;
}
.skip:focus { left: 0; }

.wrap { max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }

/* ---------- Primitives (copied from index.html) ---------- */
.eyebrow {
  display: inline-flex; align-items: baseline; gap: 10px;
  font-family: var(--mono); font-size: var(--t-xs); font-weight: 500;
  letter-spacing: .14em; text-transform: uppercase; color: var(--blue);
}
.lede { font-size: var(--t-lg); color: var(--muted); max-width: 46ch; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  font: 600 var(--t-md)/1 var(--body);
  padding: 15px 24px;
  border-radius: 999px;
  text-decoration: none;
  border: 1px solid transparent;
  white-space: nowrap;
  transition: background-color .16s ease, border-color .16s ease, transform .16s ease;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn--primary { background: #0069FB; color: #fff; }
.btn--primary:hover { background: #0058D6; }
.btn--ghost { color: var(--on-night); border-color: rgba(255,255,255,.3); }
.btn--ghost:hover { background: rgba(255,255,255,.09); border-color: rgba(255,255,255,.5); }
.btn--sm { padding: 11px 18px; font-size: var(--t-sm); }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: clamp(20px, 2.4vw, 28px);
}

.ico {
  width: 40px; height: 40px; border-radius: 11px;
  display: grid; place-items: center;
  background: var(--blue-soft); color: var(--blue);
  flex: none;
}
.ico svg { width: 20px; height: 20px; }

/* ---------- Header band: nav + page title, dark in both themes ---------- */
.page-top {
  position: relative;
  background: var(--night);
  color: var(--on-night);
  isolation: isolate;
  overflow: hidden;
}
/* A faint road-blue glow so the band has depth without a photo to load. */
.page-top::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    radial-gradient(60% 120% at 88% 0%, rgba(0,105,251,.28) 0%, rgba(0,105,251,0) 60%),
    radial-gradient(40% 80% at 0% 100%, rgba(122,177,253,.10) 0%, rgba(122,177,253,0) 70%);
}

.nav { height: var(--nav-h); display: flex; align-items: center; border-bottom: 1px solid var(--on-night-line); }
.nav-inner { display: flex; align-items: center; justify-content: space-between; gap: var(--s4); width: 100%; }
.brand { display: flex; align-items: center; gap: 11px; color: var(--on-night); }
.brand:hover { text-decoration: none; }
.brand img { width: 34px; height: 34px; border-radius: 9px; }
.brand span { font-family: var(--display); font-stretch: var(--wide); font-weight: 800; font-size: 1.22rem; letter-spacing: -.02em; }
.nav-links { display: flex; align-items: center; gap: var(--s4); }
.nav-links a:not(.btn) {
  color: var(--on-night-dim);
  font-size: var(--t-sm); font-weight: 500;
  padding-block: 6px;
  border-bottom: 2px solid transparent;
  transition: color .16s ease;
}
.nav-links a:not(.btn):hover { color: var(--on-night); text-decoration: none; }
.nav-links a[aria-current="page"] { color: var(--on-night); border-bottom-color: var(--blue-tint); }

.page-hero { padding-block: clamp(48px, 7vw, 96px) clamp(44px, 6vw, 80px); display: grid; gap: var(--s3); justify-items: start; }
.page-hero .eyebrow { color: var(--blue-tint); }
.page-hero h1 {
  font-stretch: var(--wide); font-weight: 900;
  font-size: clamp(2.3rem, 5.6vw, 4rem);
  letter-spacing: -.035em; line-height: .95;
}
.page-hero h1 i { font-style: normal; color: var(--blue-tint); }
.page-hero .lede { color: var(--on-night-dim); }
.page-hero .btn-row { display: flex; flex-wrap: wrap; gap: var(--s2); margin-top: var(--s3); }

/* Small facts under the title: last updated, reply time, and so on. */
.chips { display: flex; flex-wrap: wrap; gap: var(--s2); margin-top: var(--s2); }
.chip {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--mono); font-size: .76rem; color: var(--on-night-dim);
  background: rgba(255,255,255,.05); border: 1px solid var(--on-night-line);
  border-radius: 999px; padding: 6px 12px;
}
.chip svg { width: 14px; height: 14px; color: var(--blue-tint); flex: none; }

/* ---------- Page body ---------- */
.page-body { padding-block: clamp(40px, 6vw, 80px) clamp(64px, 8vw, 112px); }

/* Long-form documents: a sticky index beside a readable measure. */
.doc {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: clamp(32px, 5vw, 72px);
  align-items: start;
}
.toc {
  position: sticky; top: var(--s4);
  font-size: var(--t-sm);
}
.toc h2 {
  font-family: var(--mono); font-stretch: normal; font-size: var(--t-xs); font-weight: 500;
  letter-spacing: .13em; text-transform: uppercase; color: var(--soft);
  margin-bottom: var(--s3);
}
.toc ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; counter-reset: toc; }
.toc li { counter-increment: toc; }
.toc a {
  display: grid; grid-template-columns: 28px 1fr; gap: 4px;
  padding: 7px 10px; margin-left: -10px; border-radius: 8px;
  color: var(--muted); line-height: 1.35;
}
.toc a::before { content: counter(toc, decimal-leading-zero); font-family: var(--mono); font-size: .72rem; color: var(--soft); padding-top: 2px; }
.toc a:hover { background: var(--surface-2); color: var(--ink); text-decoration: none; }

.prose { max-width: 70ch; }
.prose > .intro {
  font-size: var(--t-lg); color: var(--ink);
  padding-bottom: var(--s5); margin-bottom: var(--s2);
  border-bottom: 1px solid var(--line);
}
.prose section { scroll-margin-top: var(--s4); padding-top: var(--s5); }
.prose h2 {
  display: flex; align-items: baseline; gap: var(--s3);
  font-stretch: var(--semi); font-weight: 800;
  font-size: clamp(1.35rem, 2.4vw, 1.65rem);
  letter-spacing: -.02em; line-height: 1.15;
  margin-bottom: var(--s3);
}
.prose h2 .n { font-family: var(--mono); font-stretch: normal; font-weight: 500; font-size: var(--t-xs); letter-spacing: .1em; color: var(--blue); flex: none; transform: translateY(-.2em); }
.prose h3 {
  font-stretch: var(--semi); font-weight: 700; font-size: 1.04rem; letter-spacing: -.01em;
  margin: var(--s4) 0 var(--s1);
}
.prose p, .prose li { color: var(--muted); }
.prose p + p { margin-top: var(--s3); }
.prose strong { color: var(--ink); font-weight: 600; }
.prose ul { margin: var(--s3) 0; padding: 0; list-style: none; display: grid; gap: var(--s2); }
.prose ul li { position: relative; padding-left: 26px; }
.prose ul li::before {
  content: ""; position: absolute; left: 4px; top: .62em;
  width: 8px; height: 8px; border-radius: 3px; background: var(--blue);
  opacity: .8;
}
.prose ul + p { margin-top: var(--s3); }

/* Highlighted promise inside a document ("we do not sell your data"). */
.promise {
  display: grid; grid-template-columns: 22px 1fr; gap: var(--s2);
  margin-top: var(--s4);
  background: var(--blue-soft); border-radius: var(--r-sm);
  padding: var(--s3) var(--s4);
  color: var(--ink); font-weight: 500;
}
.promise svg { width: 21px; height: 21px; color: var(--blue); margin-top: 2px; }

.table-wrap {
  overflow-x: auto; margin: var(--s4) 0;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md);
}
table { width: 100%; border-collapse: collapse; font-size: var(--t-sm); min-width: 440px; }
th {
  text-align: left; padding: 12px 18px;
  font-family: var(--mono); font-size: var(--t-xs); font-weight: 500;
  letter-spacing: .1em; text-transform: uppercase; color: var(--soft);
  border-bottom: 1px solid var(--line);
}
td { padding: 13px 18px; border-bottom: 1px solid var(--line-soft); vertical-align: top; color: var(--muted); }
td:first-child { color: var(--ink); font-weight: 600; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }

/* ---------- Support ---------- */
.topics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s3); margin-bottom: clamp(48px, 6vw, 72px); }
.topic {
  display: grid; grid-template-columns: 40px 1fr auto; gap: var(--s3); align-items: center;
  color: var(--ink);
  transition: border-color .16s ease, transform .16s ease;
}
.topic:hover { text-decoration: none; border-color: var(--blue); transform: translateY(-2px); }
.topic b { display: block; font-family: var(--display); font-stretch: var(--semi); font-weight: 700; font-size: 1.05rem; letter-spacing: -.01em; }
.topic b + span { display: block; font-size: var(--t-sm); color: var(--muted); }
.topic .arrow { width: 18px; height: 18px; color: var(--soft); }

.faq-group { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 2fr); gap: clamp(24px, 4vw, 64px); scroll-margin-top: var(--s4); }
.faq-group + .faq-group { margin-top: clamp(48px, 6vw, 72px); }
.faq-group header { display: grid; gap: var(--s2); align-content: start; }
.faq-group header h2 { font-stretch: var(--wide); font-weight: 900; font-size: clamp(1.6rem, 3vw, 2.2rem); letter-spacing: -.03em; line-height: 1; }
.faq-group header p { color: var(--muted); font-size: var(--t-sm); max-width: 30ch; }

.faq { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; }
.faq details { border-top: 1px solid var(--line-soft); }
.faq details:first-child { border-top: 0; }
.faq summary {
  list-style: none; cursor: pointer;
  display: grid; grid-template-columns: 1fr 28px; gap: var(--s3); align-items: center;
  padding: 20px clamp(18px, 2.4vw, 26px);
  font-weight: 600; font-size: var(--t-md); line-height: 1.4;
  transition: background-color .16s ease;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary:hover { background: var(--paper); }
.faq summary:focus-visible { outline-offset: -3px; border-radius: 0; }
.faq summary .plus {
  width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--surface-2); color: var(--blue);
  transition: transform .2s ease, background-color .2s ease, color .2s ease;
}
.faq summary .plus svg { width: 14px; height: 14px; }
.faq details[open] summary .plus { transform: rotate(45deg); background: var(--blue); color: #fff; }
.faq .a { padding: 0 clamp(18px, 2.4vw, 26px) 22px; color: var(--muted); max-width: 64ch; }
.faq .a p + p { margin-top: var(--s2); }
.path {
  font-family: var(--mono); font-size: .84em; color: var(--ink);
  background: var(--surface-2); border-radius: 6px; padding: 1px 7px;
  white-space: nowrap;
}

/* Contact band at the foot of support and the document pages. */
.contact {
  margin-top: clamp(56px, 7vw, 96px);
  display: grid; grid-template-columns: minmax(0, 1.2fr) auto; gap: var(--s4); align-items: center;
  background: var(--night); color: var(--on-night);
  border-radius: var(--r-lg);
  padding: clamp(28px, 4vw, 48px);
  position: relative; overflow: hidden; isolation: isolate;
}
.contact::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: radial-gradient(70% 140% at 100% 0%, rgba(0,105,251,.32) 0%, rgba(0,105,251,0) 62%);
}
.contact h2 { font-stretch: var(--wide); font-weight: 900; font-size: clamp(1.6rem, 3.4vw, 2.4rem); letter-spacing: -.03em; line-height: 1; }
.contact p { color: var(--on-night-dim); margin-top: var(--s2); max-width: 48ch; }
.contact .eyebrow { color: var(--blue-tint); margin-bottom: var(--s2); }

/* ---------- Open-in-app + 404 ---------- */
.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s3); }
.steps .card { display: grid; gap: var(--s2); align-content: start; }
.steps .ico { margin-bottom: var(--s1); }
.steps h2 { font-stretch: var(--semi); font-weight: 700; font-size: 1.1rem; letter-spacing: -.012em; }
.steps p { color: var(--muted); font-size: var(--t-sm); }

.big-code {
  font-family: var(--display); font-stretch: var(--wide); font-weight: 900;
  font-size: clamp(5rem, 16vw, 10rem); line-height: .8; letter-spacing: -.05em;
  color: transparent; -webkit-text-stroke: 2px rgba(122,177,253,.55);
}

/* ---------- Footer ---------- */
/* The 404 has no body, so its dark header grows to meet the footer. */
.page-top:has(+ .site-foot) { flex: 1 0 auto; }
.site-foot { margin-top: auto; background: var(--night); color: var(--on-night-dim); padding-block: var(--s6) var(--s5); }
.foot-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) repeat(3, minmax(0, 1fr)); gap: var(--s5); }
.foot-grid h4 { font-family: var(--mono); font-size: var(--t-xs); font-weight: 500; letter-spacing: .13em; text-transform: uppercase; color: rgba(255,255,255,.5); margin-bottom: var(--s3); }
.foot-grid ul { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s2); }
.foot-grid a { color: var(--on-night-dim); font-size: var(--t-sm); overflow-wrap: anywhere; }
.foot-grid a:hover { color: var(--on-night); text-decoration: none; }
.foot-blurb { font-size: var(--t-sm); margin-top: var(--s3); max-width: 30ch; }
.foot-legal {
  display: flex; justify-content: space-between; gap: var(--s3); flex-wrap: wrap;
  margin-top: var(--s6); padding-top: var(--s4);
  border-top: 1px solid var(--on-night-line);
  font-size: var(--t-xs); color: rgba(255,255,255,.5);
}

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .doc { grid-template-columns: minmax(0, 1fr); }
  .toc { position: static; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: var(--s4); }
  .toc ol { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: var(--s3); }
  .topics, .steps { grid-template-columns: minmax(0, 1fr); }
  .faq-group { grid-template-columns: minmax(0, 1fr); gap: var(--s4); }
  .faq-group header p { max-width: 56ch; }
  .foot-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s5) var(--s4); }
  .foot-grid > :first-child { grid-column: 1 / -1; }
}
@media (max-width: 760px) {
  .nav-links .btn { display: none; }
  .contact { grid-template-columns: minmax(0, 1fr); }
  .contact .btn { justify-self: start; }
}
@media (max-width: 560px) {
  .toc ol { grid-template-columns: minmax(0, 1fr); }
  .nav-links { gap: var(--s3); }
  .contact .btn { justify-self: stretch; }
  .page-hero .btn-row .btn { flex: 1 1 100%; }
}
@media (max-width: 420px) {
  .brand span { display: none; }
}
