/* RFChat support site — Quiet Field UI / Warm Technical Minimalism.
   Tokens mirror App/Shared/Theme.swift (dark palette). Static, no frameworks. */

:root {
  --bg: #2B2926;
  --surface: #37332F;
  --elevated: #443E39;
  --border: #554D46;
  --border-strong: #6D6258;
  --primary: #D05A40;
  --primary-pressed: #E06850;
  --secondary: #E8A17A;
  --text: #F0E2D2;
  --text-secondary: #A1A1AA;
  --success: #34D399;
  --warning: #D6A84B;
  --error: #F87171;
  --teal: #367E78;
  --teal-light: #5FA8A0;
  --radius: 16px;
  --radius-sm: 10px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; animation: none !important; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.68 -apple-system, BlinkMacSystemFont, "SF Pro Text",
        "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.wrap { max-width: 840px; margin: 0 auto; padding: 0 20px; }

/* ---------- Header ---------- */

.site-header {
  background: rgba(43, 41, 38, 0.94);
  backdrop-filter: blur(8px);
  position: sticky; top: 0; z-index: 10;
}
.site-header .bar {
  display: flex; align-items: center; gap: 12px;
  min-height: 60px;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  text-decoration: none; color: var(--text);
  font-weight: 700; font-size: 1.05rem; letter-spacing: 0.01em;
}
.brand img { width: 30px; height: 30px; border-radius: 8px; display: block; }
.site-nav { margin-left: auto; display: flex; gap: 4px; flex-wrap: wrap; }
.site-nav a {
  color: var(--text-secondary); text-decoration: none;
  font-size: 0.92rem; font-weight: 600;
  padding: 7px 12px; border-radius: 999px;
  transition: color 0.15s, background 0.15s;
}
.site-nav a:hover { color: var(--text); background: var(--elevated); }
.site-nav a[aria-current="page"] { color: var(--text); background: var(--surface); }
@media (max-width: 480px) {
  .site-header .bar { flex-wrap: wrap; padding: 10px 0; row-gap: 2px; }
  .site-nav { margin-left: -8px; width: 100%; }
}

/* ---------- Hero (index) ---------- */

.hero {
  margin: 28px 0;
  /* Exact background of the antenna artwork (no alpha) — must match so the
     image blends into the panel without a seam. */
  background: #2D6F6B;
  border-radius: var(--radius);
  overflow: hidden;
  display: grid; grid-template-columns: 1fr 1.3fr; align-items: center;
}
.hero .copy { padding: 36px 32px 36px 8px; }
.hero h1 {
  margin: 0 0 10px; font-size: 2rem; line-height: 1.15;
  color: #F0E2D2; letter-spacing: -0.01em;
}
.hero p { margin: 0 0 6px; color: rgba(240, 226, 210, 0.85); font-size: 1.02rem; }
/* Description sits two lines below the tagline, quieter and smaller. */
.hero p.desc {
  margin-top: 2.2em;
  font-size: 0.9rem;
  line-height: 1.6;
  color: rgba(240, 226, 210, 0.78);
}
.hero .art { align-self: stretch; display: flex; align-items: center; justify-content: center; }
/* Keep the artwork's native 1122x1402 aspect — never stretch. */
.hero .art img {
  height: 320px; width: auto;
  max-width: 100%; object-fit: contain;
  display: block;
}
@media (max-width: 640px) {
  .hero { grid-template-columns: 1fr; }
  .hero .art img { height: 220px; }
  .hero .copy { padding: 4px 24px 30px; }
}

/* ---------- Cards (index nav tiles) ---------- */

.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: 26px 0 34px; }
@media (max-width: 640px) { .tiles { grid-template-columns: 1fr; } }
.tile {
  display: block; text-decoration: none; color: var(--text);
  background: var(--surface);
  border-radius: var(--radius); padding: 20px 18px;
  transition: background 0.15s, transform 0.15s;
}
.tile:hover { background: var(--elevated); transform: translateY(-2px); }
.tile h2 { margin: 8px 0 6px; font-size: 1.06rem; }
.tile p { margin: 0; color: var(--text-secondary); font-size: 0.92rem; line-height: 1.5; }
.tile .glyph { width: 26px; height: 26px; }

/* ---------- Article pages ---------- */

main { padding-bottom: 24px; }
article { max-width: 760px; }
.page-title { margin: 34px 0 6px; font-size: 1.75rem; letter-spacing: -0.01em; }
.page-sub { margin: 0 0 26px; color: var(--text-secondary); font-size: 0.98rem; }

article h2 {
  margin: 38px 0 12px; font-size: 1.22rem;
  display: flex; align-items: center; gap: 10px;
}
article h2 img { width: 24px; height: 24px; flex: none; }
article h3 { margin: 24px 0 8px; font-size: 1.02rem; color: var(--secondary); }
article p, article li { color: var(--text); }
article li { margin: 5px 0; }
article a { color: var(--teal-light); }
article a:hover { color: var(--text); }

code, .mono {
  font-family: ui-monospace, "SF Mono", SFMono-Regular, Menlo, monospace;
  font-size: 0.9em;
  background: var(--elevated);
  border-radius: 6px;
  padding: 2px 6px;
}

hr { border: none; margin: 34px 0; }

/* Callouts */
.note, .warn {
  border-radius: var(--radius-sm);
  padding: 13px 16px; margin: 16px 0;
  font-size: 0.95rem;
}
.note { background: rgba(54, 126, 120, 0.2); }
.warn { background: rgba(214, 168, 75, 0.16); }
.note strong, .warn strong { color: var(--text); }

/* Pending-confirmation marker — must be absent from the final build. */
.tbc {
  display: inline-block;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 0.82em; font-weight: 700;
  color: var(--warning);
  background: rgba(214, 168, 75, 0.14);
  border: 1px dashed var(--warning);
  border-radius: 6px; padding: 1px 8px;
}

/* Troubleshooting accordions */
details {
  background: var(--surface);
  border-radius: var(--radius-sm);
  margin: 10px 0; padding: 0 16px;
}
details[open] { background: var(--elevated); }
summary {
  cursor: pointer; font-weight: 600; padding: 13px 0;
  list-style: none; position: relative; padding-right: 26px;
}
summary::-webkit-details-marker { display: none; }
summary::after {
  content: "+"; position: absolute; right: 2px; top: 50%;
  transform: translateY(-52%);
  color: var(--secondary); font-weight: 700; font-size: 1.1rem;
}
details[open] summary::after { content: "–"; }
details .body { padding: 0 0 14px; color: var(--text); font-size: 0.95rem; }
details .body p { margin: 6px 0; }

/* Definition rows (privacy) */
.facts .row {
  display: grid; grid-template-columns: 220px 1fr; gap: 14px;
  padding: 12px 15px; margin: 8px 0;
  background: var(--surface); border-radius: var(--radius-sm);
  font-size: 0.95rem;
}
.facts .k { color: var(--text-secondary); font-weight: 600; }
@media (max-width: 560px) { .facts .row { grid-template-columns: 1fr; gap: 3px; } }

/* Buttons */
.btn {
  display: inline-block; text-decoration: none; font-weight: 700;
  background: var(--primary); color: #F0E2D2;
  border-radius: 12px; padding: 11px 22px; font-size: 0.98rem;
  transition: background 0.15s;
}
.btn:hover { background: var(--primary-pressed); }
.btn.quiet { background: var(--elevated); color: var(--text); }
.btn.quiet:hover { background: var(--border); }

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

.site-footer {
  margin-top: 48px; padding: 26px 0 40px;
  color: var(--text-secondary); font-size: 0.88rem;
}
.site-footer .cols { display: flex; gap: 24px; flex-wrap: wrap; justify-content: space-between; }
.site-footer nav { display: flex; gap: 16px; flex-wrap: wrap; }
.site-footer a { color: var(--text-secondary); text-decoration: none; }
.site-footer a:hover { color: var(--text); }

/* Focus visibility (keyboard) */
a:focus-visible, summary:focus-visible, .btn:focus-visible {
  outline: 2px solid var(--teal-light);
  outline-offset: 2px;
  border-radius: 6px;
}

img { max-width: 100%; }
