/* Reco site: shared tokens, type, header, footer, buttons and the prose layout used by support and legal pages.
   Colours are the app's own (Reco/Theme/Palette.swift): warm graphite, one amber signal, paper-white actions. */

:root {
  color-scheme: dark light;

  --ground: #121210;
  --surface: #191916;
  --sunken: #141412;
  --control: #1c1b18;
  --control-on: #34322c;
  --tile: #23221e;
  --line: #2a2924;
  --line-soft: #22211d;
  --line-strong: #3a3833;

  --ink: #ece8df;
  --muted: #a29d90;
  --dim: #8c877b;

  --action: #f1ece1;
  --action-ink: #15140f;
  --signal: #f2b84b;
  --signal-text: #f2b84b;
  --signal-ink: #1c1506;
  --warn-fill: #261b12;
  --warn-line: #6b4a1e;

  --photos: #f2b84b;
  --videos: #ee7d5c;
  --documents: #8fa6ff;
  --audio: #8ccfa8;

  --cell-unread: #1f1e1b;
  --cell-read: #302e29;
  --cell-head: #f6f2e8;
  --lens-read: #4a4740;
  --lens-idle: #26241f;

  --radius-card: 14px;
  --radius-control: 10px;
  --gutter: clamp(16px, 4vw, 40px);
  --measure: 1180px;
  --font: "Plus Jakarta Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}

/* Warm paper: same amber, darker ink, text amber deepened for contrast. */
@media (prefers-color-scheme: light) {
  :root {
    --ground: #f3efe6;
    --surface: #fbf9f4;
    --sunken: #ede8dd;
    --control: #e9e3d7;
    --control-on: #d8d0c0;
    --tile: #e6e0d3;
    --line: #ddd6c8;
    --line-soft: #e6e0d4;
    --line-strong: #c9c0ae;

    --ink: #1c1a15;
    --muted: #57524a;
    --dim: #6b6558;

    --action: #1c1a15;
    --action-ink: #f7f3ea;
    --signal: #f2b84b;
    --signal-text: #8a5a00;
    --signal-ink: #1c1506;
    --warn-fill: #fbecd0;
    --warn-line: #e0b86a;

    --photos: #eaa827;
    --videos: #e2663f;
    --documents: #5f7cf0;
    --audio: #4fa676;

    --cell-unread: #e5dfd2;
    --cell-read: #cdc5b3;
    --cell-head: #1c1a15;
    --lens-read: #a39b89;
    --lens-idle: #ddd6c7;
  }
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

img, svg, canvas { display: block; max-width: 100%; }

a { color: inherit; text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--signal-text); }

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

::selection { background: var(--signal); color: var(--signal-ink); }

.skip-link {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 100;
  padding: 10px 14px;
  border-radius: var(--radius-control);
  background: var(--action);
  color: var(--action-ink);
  font-weight: 600;
  text-decoration: none;
}
.skip-link:focus { top: 12px; color: var(--action-ink); }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

.wrap {
  width: 100%;
  max-width: calc(var(--measure) + var(--gutter) * 2);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* ---------- Type ---------- */

.eyebrow {
  margin: 0 0 14px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--dim);
}
.eyebrow--signal { color: var(--signal-text); }

.display {
  margin: 0;
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.05;
  text-wrap: balance;
}

.lede {
  color: var(--muted);
  font-size: clamp(1.02rem, 1.3vw, 1.15rem);
  line-height: 1.65;
  text-wrap: pretty;
}

/* ---------- Brand + header ---------- */

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-weight: 700;
  font-size: 19px;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.brand:hover { color: var(--ink); }
.brand img {
  width: 36px;
  height: 36px;
  /* The macOS icon PNG carries transparent padding; pull it in so the mark sits on the baseline. */
  margin: -4px -2px -4px -6px;
}

.site-header {
  position: relative;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 20px;
  padding-bottom: 20px;
}

.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 22px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 14.5px;
  font-weight: 500;
}
@media (max-width: 480px) {
  .site-nav ul { flex-wrap: nowrap; gap: 14px; font-size: 14px; }
}
.site-nav a {
  color: var(--muted);
  text-decoration: none;
}
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--ink); }

/* ---------- Buttons ---------- */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 22px;
  border-radius: 12px;
  border: 1px solid transparent;
  font: inherit;
  font-weight: 600;
  font-size: 16px;
  letter-spacing: -0.01em;
  text-decoration: none;
  cursor: pointer;
  transition: transform 160ms ease, background-color 160ms ease, box-shadow 160ms ease;
}
.button:active { transform: translateY(1px); }

/* Primary actions are paper white, as in the app. */
.button--primary {
  background: var(--action);
  color: var(--action-ink);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.25) inset, 0 10px 30px -12px rgba(242, 184, 75, 0.45);
}
.button--primary:hover { color: var(--action-ink); background: color-mix(in srgb, var(--action) 90%, var(--signal)); }

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

.button svg { width: 18px; height: 18px; flex: none; }

/* ---------- Footer ---------- */

.site-footer {
  border-top: 1px solid var(--line);
  background: var(--sunken);
  padding: 48px 0 40px;
  font-size: 14px;
  color: var(--dim);
}
.site-footer__grid {
  display: grid;
  grid-template-columns: 1.4fr repeat(2, 1fr);
  gap: 32px;
}
.site-footer h2 {
  margin: 0 0 12px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--dim);
}
.site-footer ul { margin: 0; padding: 0; list-style: none; }
.site-footer li { margin: 0 0 8px; }
.site-footer a { color: var(--muted); text-decoration: none; }
.site-footer a:hover { color: var(--ink); }
.site-footer__about p { margin: 14px 0 0; max-width: 34ch; }
.site-footer__legal {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 24px;
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid var(--line-soft);
  font-size: 13px;
}
@media (max-width: 720px) {
  .site-footer__grid { grid-template-columns: 1fr 1fr; }
  .site-footer__about { grid-column: 1 / -1; }
}

/* ---------- Prose pages (support, legal) ---------- */

.page-head {
  padding: 48px 0 36px;
  border-bottom: 1px solid var(--line);
  position: relative;
  overflow: hidden;
}
.page-head .display { font-size: clamp(2.1rem, 5vw, 3.4rem); }
.page-head .lede { max-width: 60ch; margin: 16px 0 0; }
.page-head__meta { margin: 18px 0 0; font-size: 13.5px; color: var(--dim); }

/* A strip of sector cells under the page title: the app's signature, quiet. */
.cell-strip {
  display: grid;
  grid-template-columns: repeat(auto-fill, 12px);
  gap: 4px;
  height: 12px;
  overflow: hidden;
  margin-top: 28px;
}
.cell-strip i {
  display: block;
  width: 12px; height: 12px;
  border-radius: 3px;
  background: var(--cell-read);
}
.cell-strip i.u { background: var(--cell-unread); box-shadow: inset 0 0 0 1px var(--line); }
.cell-strip i.p { background: var(--photos); }
.cell-strip i.v { background: var(--videos); }
.cell-strip i.d { background: var(--documents); }
.cell-strip i.a { background: var(--audio); }
.cell-strip i.h { background: var(--cell-head); box-shadow: 0 0 8px color-mix(in srgb, var(--cell-head) 55%, transparent); }

.doc-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 56px;
  padding-top: 48px;
  padding-bottom: 88px;
}
.doc-nav { position: sticky; top: 24px; align-self: start; font-size: 14px; }
.doc-nav h2 {
  margin: 0 0 10px;
  font-size: 12px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--dim);
}
.doc-nav ul { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--line); }
.doc-nav a {
  display: block;
  padding: 6px 0 6px 14px;
  margin-left: -1px;
  border-left: 2px solid transparent;
  color: var(--muted);
  text-decoration: none;
}
.doc-nav a:hover { color: var(--ink); }
.doc-nav a[aria-current="page"] { color: var(--ink); border-left-color: var(--signal); font-weight: 600; }
@media (max-width: 860px) {
  .doc-layout { grid-template-columns: 1fr; gap: 28px; padding-top: 28px; }
  .doc-nav { position: static; }
  .doc-nav ul { display: flex; flex-wrap: wrap; gap: 6px; border: 0; }
  .doc-nav a { padding: 6px 12px; margin: 0; border: 1px solid var(--line); border-radius: 999px; }
  .doc-nav a[aria-current="page"] { border-color: var(--signal); }
}

.prose { max-width: 70ch; color: var(--muted); }
.prose h2 {
  margin: 44px 0 12px;
  color: var(--ink);
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.3;
}
.prose h2:first-child { margin-top: 0; }
.prose h3 { margin: 28px 0 8px; color: var(--ink); font-size: 1.05rem; font-weight: 600; }
.prose p, .prose li { text-wrap: pretty; }
.prose ul, .prose ol { padding-left: 1.25em; }
.prose li { margin: 6px 0; }
.prose li::marker { color: var(--dim); }
.prose strong { color: var(--ink); font-weight: 600; }
.prose a { color: var(--ink); }
.prose a:hover { color: var(--signal-text); }
.prose code {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 0.88em;
  padding: 1px 6px;
  border-radius: 6px;
  background: var(--tile);
  color: var(--ink);
  overflow-wrap: anywhere;
}
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 40px 0; }

.callout {
  margin: 24px 0;
  padding: 16px 18px;
  border-radius: var(--radius-card);
  border: 1px solid var(--warn-line);
  background: var(--warn-fill);
  color: var(--ink);
}
.callout p { margin: 0; }
.callout p + p { margin-top: 8px; }
.callout--plain { border-color: var(--line); background: var(--surface); }

.license-text {
  max-height: 420px;
  overflow: auto;
  padding: 16px 18px;
  border-radius: var(--radius-card);
  border: 1px solid var(--line);
  background: var(--sunken);
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 12.5px;
  line-height: 1.55;
  white-space: pre-wrap;
  color: var(--muted);
}

/* ---------- FAQ (shared by home and support) ---------- */

.faq { border-top: 1px solid var(--line); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 20px 0;
  cursor: pointer;
  list-style: none;
  font-weight: 600;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.faq summary::-webkit-details-marker { display: none; }
/* The marker is a sector cell: unread when closed, filled amber when open. */
.faq summary::after {
  content: "";
  flex: none;
  width: 14px; height: 14px;
  border-radius: 4px;
  background: var(--cell-unread);
  box-shadow: inset 0 0 0 1px var(--line-strong);
  transition: background-color 200ms ease, box-shadow 200ms ease;
}
.faq details[open] summary::after { background: var(--signal); box-shadow: none; }
.faq summary:hover::after { box-shadow: inset 0 0 0 1.5px var(--signal); }
.faq .answer { padding: 0 0 22px; max-width: 68ch; color: var(--muted); }
.faq .answer p { margin: 0 0 10px; }
.faq .answer a { color: var(--ink); }
