/* CouchWand utility pages: support, privacy, terms, gestures, acknowledgements.
   Self-contained. Palette and type follow BRIEF section 2. No external resources. */

:root {
  --night: #1E0E1B;
  --night-soft: #34182E;
  --paper: #F6EAD0;
  --paper-dim: #C8B79B;
  --ion: #E3A92F;
  --ember: #EC7A42;
  --aubergine: #4B2342;
  --ink: #2B2118;
  --graphite: #9C8795;
  --hair: rgba(156, 135, 149, 0.4);
  --sans: system-ui, -apple-system, "SF Pro Display", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --head-h: 56px;
}

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

html {
  background: var(--night);
  color-scheme: dark;
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: calc(var(--head-h) + 16px);
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--night);
  color: var(--paper);
  font-family: var(--sans);
  font-weight: 400;
  font-size: clamp(16px, 1.25vw, 18px);
  line-height: 1.5;
  overflow-wrap: break-word;
}

/* The one decoration: a thin fixed beam line, the underline of the top bar. */
.beam {
  position: fixed;
  left: 0;
  right: 0;
  top: calc(var(--head-h) - 1px);
  height: 1px;
  z-index: 30;
  pointer-events: none;
  background: linear-gradient(90deg, transparent 0, var(--ion) 14%, var(--ion) 86%, transparent 100%);
  box-shadow: 0 0 10px 1px rgba(227, 169, 47, 0.45);
}

/* Focus */
a:focus-visible, button:focus-visible, [tabindex]:focus-visible, summary:focus-visible {
  outline: 2px solid var(--ion);
  outline-offset: 3px;
  border-radius: 2px;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -80px;
  z-index: 100;
  padding: 12px 16px;
  background: var(--ion);
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
  border-radius: 6px;
}
.skip-link:focus { top: 12px; }

/* Shared mono label style */
.endorse, .foot-brand, th, .g-os, .g-nav a, figcaption, .legal {
  font-family: var(--mono);
}
.endorse, th, .g-os, .g-nav a {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 11px;
  font-weight: 500;
}

/* Top bar */
.top {
  position: sticky;
  top: 0;
  z-index: 20;
  height: var(--head-h);
  background: rgba(30, 14, 27, 0.92);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
.top-in {
  height: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 16px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  color: var(--paper);
  font-weight: 800;
  font-size: 18px;
  letter-spacing: -0.02em;
  text-decoration: none;
}
.brand img { border-radius: 7px; display: block; }
.top .endorse { color: var(--paper-dim); }
.top-nav { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.top-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 12px;
  color: var(--paper);
  text-decoration: none;
  font-size: 15px;
  border-radius: 6px;
}
.top-nav a:hover { color: var(--ion); }
.top-nav a.get {
  color: var(--ink);
  background: var(--ion);
  font-weight: 700;
  white-space: nowrap;
  min-height: 36px;
  padding: 0 14px;
  border-radius: 999px;
}
.top-nav a.get:hover { color: var(--ink); filter: brightness(1.08); }
.top-nav a.get:focus-visible { outline-offset: 3px; }
@media (max-width: 420px) {
  .top .endorse { display: none; }
  .top-in { gap: 8px; }
}

/* Reading column */
main {
  flex: 1 0 auto;
  width: 100%;
  padding: clamp(32px, 6vw, 72px) 16px clamp(48px, 8vw, 96px);
}
main .wrap { max-width: 68ch; margin: 0 auto; }
main.wide .wrap { max-width: 1040px; }
main.wide .wrap > p,
main.wide .g-section > p { max-width: 68ch; }

h1, h2, h3 { color: var(--paper); text-wrap: balance; }
h1 {
  margin: 0 0 0.5em;
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 0.98;
  font-size: clamp(30px, 5.6vw, 84px);
}
h2 {
  margin: 2.2em 0 0.6em;
  padding-top: 0.9em;
  border-top: 1px solid var(--hair);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.08;
  font-size: clamp(24px, 3vw, 34px);
}
h1 + p + h2, h1 + h2 { margin-top: 1.8em; }
h3 {
  margin: 1.8em 0 0.4em;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.2;
  font-size: clamp(18px, 1.6vw, 21px);
}
p { margin: 0 0 1em; }
em { font-style: italic; }
strong, b { font-weight: 700; }

a { color: var(--ion); text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }

ul, ol { margin: 0 0 1.2em; padding-left: 1.3em; }
li { margin: 0.5em 0; padding-left: 0.2em; }
li::marker { color: var(--ion); }

code {
  font-family: var(--mono);
  font-size: 0.88em;
  background: var(--night-soft);
  border: 1px solid var(--hair);
  border-radius: 4px;
  padding: 0.08em 0.4em;
  overflow-wrap: anywhere;
}
pre {
  margin: 0 0 1.4em;
  padding: 16px;
  background: var(--night-soft);
  border: 1px solid var(--hair);
  border-radius: 10px;
  overflow-x: auto;
  font-size: 13px;
  line-height: 1.5;
  max-width: 100%;
}
pre code { background: none; border: 0; padding: 0; font-size: inherit; overflow-wrap: normal; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 22px;
  border-radius: 999px;
  font-weight: 700;
  text-decoration: none;
}
.btn-primary { background: var(--ion); color: var(--ink); }
.btn-primary:hover { filter: brightness(1.08); }

/* Tables */
.table-wrap {
  margin: 0 0 1.6em;
  overflow-x: auto;
  border: 1px solid var(--hair);
  border-radius: 10px;
  background: rgba(52, 24, 46, 0.55);
}
table { border-collapse: collapse; width: 100%; font-size: 14px; line-height: 1.4; }
th, td { text-align: left; vertical-align: top; padding: 10px 14px; }
th {
  color: var(--paper-dim);
  background: var(--night-soft);
  border-bottom: 1px solid var(--graphite);
  white-space: nowrap;
}
td { border-bottom: 1px solid var(--hair); }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: rgba(227, 169, 47, 0.06); }
td:first-child { min-width: 11em; }
td:nth-child(2) { white-space: nowrap; }
.table-wrap td:last-child { min-width: 13em; }
/* Acknowledgements tables are wider than the 68ch column on purpose; text stays 68ch. */
main .wrap:has(.table-wrap) { max-width: 1040px; }
main .wrap:has(.table-wrap) > p,
main .wrap:has(.table-wrap) > ul,
main .wrap:has(.table-wrap) > h1,
main .wrap:has(.table-wrap) > h2,
main .wrap:has(.table-wrap) > h3 { max-width: 68ch; }

/* Gestures page */
.g-nav {
  list-style: none;
  margin: 1.6em 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.g-nav li { margin: 0; padding: 0; }
.g-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 16px;
  color: var(--paper);
  text-decoration: none;
  border: 1px solid var(--graphite);
  border-radius: 999px;
}
.g-nav a:hover { color: var(--ion); border-color: var(--ion); }

.g-section { margin-top: 0; }
.g-grid {
  list-style: none;
  margin: 1.4em 0 1.8em;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
  gap: 14px;
}
.g-card {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin: 0;
  padding: 16px;
  background: var(--night-soft);
  border: 1px solid var(--hair);
  border-radius: 12px;
}
.g-card h3 { margin: 0 0 0.35em; font-size: 18px; }
.g-card p { margin: 0 0 0.6em; font-size: 15px; color: var(--paper-dim); }
.g-card p:last-child { margin-bottom: 0; }
.g-card > div { min-width: 0; }
.g-ill {
  flex: 0 0 76px;
  width: 76px;
  height: 76px;
  background: var(--night);
  border: 1px solid var(--hair);
  border-radius: 12px;
}
.g-os { display: block; margin-top: 0.6em; color: var(--paper); letter-spacing: 0.1em; line-height: 1.5; }
@media (max-width: 360px) {
  .g-card { flex-direction: column; }
}

.g-shot {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  align-items: flex-end;
  margin: 0 0 1.5em;
}
.g-shot figure { margin: 0; max-width: 100%; }
.phone { width: 230px; max-width: 100%; }
.phone.landscape { width: 560px; }
.phone .screen {
  padding: 6px;
  border: 1px solid var(--graphite);
  border-radius: 22px;
  background: var(--night-soft);
  overflow: hidden;
}
.phone .screen img { display: block; width: 100%; height: auto; border-radius: 16px; }
figcaption {
  margin-top: 10px;
  color: var(--paper-dim);
  font-size: 12px;
  letter-spacing: 0.04em;
  line-height: 1.4;
}

/* Footer */
.foot {
  flex-shrink: 0;
  border-top: 1px solid var(--hair);
  background: var(--night);
  padding: 32px 16px 40px;
}
.foot-in { max-width: 1040px; margin: 0 auto; }
.foot-brand { margin: 0 0 14px; color: var(--paper); font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; }
.foot-brand .endorse { color: var(--paper-dim); }
.foot-links { list-style: none; margin: 0 0 20px; padding: 0; display: flex; flex-wrap: wrap; gap: 0 6px; }
.foot-links li { margin: 0; padding: 0; }
.foot-links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 10px 0 0;
  color: var(--paper);
  font-size: 14px;
  text-decoration: none;
}
.foot-links a:hover { color: var(--ion); text-decoration: underline; }
.foot-links a[aria-current="page"] { color: var(--ion); }
.legal { margin: 0; max-width: 78ch; color: var(--paper-dim); font-size: 11px; letter-spacing: 0.04em; line-height: 1.6; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
@media print {
  .beam, .top, .skip-link { display: none; }
  html, body { background: #fff; color: #000; }
}
