/* SOCIETY-LEGAL-CSS v4 */
/* ═══════════════════════════════════════════════════════════════════════
   SOCIETY — legal & help pages
   Complete stylesheet. Replaces style.css entirely.

   ── The brief ─────────────────────────────────────────────────────────
   These pages open in an in-app browser, straight out of a dark app whose
   first screen is a gold compass on a rose map at dusk. A pink-and-violet
   document on near-white paper reads as a different company. Every colour
   here is lifted from assets/video/welcome_loop.mp4.

   ── What changed structurally ─────────────────────────────────────────
   • Dark by default; light is the opt-in. The app is dark.
   • Serif display face (Fraunces) for titles — the film's wordmark is a
     gold serif, and a serif also makes a legal page feel considered
     rather than generated.
   • The contents sidebar was a plain numbered list. It is now a sticky
     rail with a gold marker that tracks your position, and on mobile it
     collapses into a disclosure instead of eating the first screen.
   • Section numbers are set as small gold labels above the heading
     rather than inline, so headings start at the left margin and scan.
   • .note and .instrument are proper cards with hairline rules.
   • Nothing truncates anywhere: overflow-wrap: anywhere on every text
     surface, and the FAQ uses expanding disclosures.

   Classes covered (all of them, from grepping the HTML):
   masthead, masthead__inner, wordmark, progress, frame, contents,
   contents__label, doc, doc__eyebrow, doc__title, doc__standfirst,
   instrument, note, note__label, num, fill, tag, faq, faq__body, foot,
   hub, hub__title, hub__lede, docgrid
   ═══════════════════════════════════════════════════════════════════════ */

@import url("https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,500;9..144,600;9..144,700&family=Figtree:ital,wght@0,400;0,500;0,600;0,700;1,400&display=swap");

/* ── Tokens ─────────────────────────────────────────────────────────── */
:root {
  --brand: #e3be79; /* gold */
  --brand-strong: #f2d7a3;
  --rose: #c98b86;
  --grad: linear-gradient(115deg, #e3be79 0%, #c98b86 52%, #8c5d72 100%);

  --bg: #120810;
  --surface: #1d0f19;
  --surface-2: #281521;

  --ink: #fbf4e8;
  --body: #d5c9be;
  --muted: #9c8c8a;

  --line: #33202c;
  --line-2: #462e3c;

  --tokenbg: rgba(227, 190, 121, 0.13);
  --tokenln: #e3be79;

  --display: "Fraunces", Georgia, serif;
  --sans: "Figtree", system-ui, -apple-system, sans-serif;

  --r-lg: 20px;
  --r-md: 14px;
  --r-sm: 10px;
  --measure: 68ch;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.35), 0 16px 44px rgba(0, 0, 0, 0.42);
}

@media (prefers-color-scheme: light) {
  :root {
    --brand: #9a6b1f;
    --brand-strong: #7d5516;
    --rose: #8c5d72;
    --bg: #fbf6ee;
    --surface: #ffffff;
    --surface-2: #f6ede1;
    --ink: #24131e;
    --body: #4d3c46;
    --muted: #8b7a80;
    --line: #ece0d2;
    --line-2: #ddcdbb;
    --tokenbg: rgba(154, 107, 31, 0.12);
    --shadow:
      0 1px 2px rgba(36, 19, 30, 0.05), 0 12px 34px rgba(36, 19, 30, 0.08);
  }
}

/* ── Reset ──────────────────────────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  overflow-x: hidden;
  scroll-padding-top: 96px; /* so anchors clear the sticky masthead */
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--body);
  font-family: var(--sans);
  font-size: 16.5px;
  line-height: 1.72;
  -webkit-font-smoothing: antialiased;
  /* The same warm bloom the app's Flags screen uses, so the plum never
     reads as flat black. */
  background-image: radial-gradient(
    900px 420px at 50% -140px,
    rgba(227, 190, 121, 0.16),
    transparent 70%
  );
  background-repeat: no-repeat;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}

/* Nothing may ever be cut off — this was the original complaint. */
p,
li,
dd,
dt,
h1,
h2,
h3,
summary,
a {
  overflow-wrap: anywhere;
}

/* ── Reading progress (injected by doc.js) ──────────────────────────── */
.progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  width: 0;
  background: var(--grad);
  z-index: 60;
}

/* ── Masthead ───────────────────────────────────────────────────────── */
.masthead {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: saturate(150%) blur(14px);
  -webkit-backdrop-filter: saturate(150%) blur(14px);
  border-bottom: 1px solid var(--line);
}

.masthead__inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 15px 26px;
  display: flex;
  align-items: center;
  gap: 18px;
}

/* The cross-page links beside the Society wordmark. Hidden here rather than
   deleted from each HTML file, so every legal page — privacy, terms, safety,
   guidelines, data deletion — loses them in one change. Each page now shows
   only its own document. */
.masthead nav {
  display: none !important;
}

.wordmark {
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.32rem;
  letter-spacing: 0.01em;
  color: var(--brand);
  text-decoration: none;
}

/* ── Layout ─────────────────────────────────────────────────────────── */
.frame {
  /* One centred column. Was a 232px sidebar + document; with the contents
     rail gone, a two-column grid would leave a 232px hole on the left. */
  max-width: 880px;
  margin: 0 auto;
  padding: 46px 26px 90px;
  display: block;
}

/* ── Contents rail — REMOVED ────────────────────────────────────────────
   Hidden here rather than deleted from seven HTML files. The jump-to-section
   list was the "old UI" complaint, and on a phone it pushed the document off
   the first screen entirely. Hiding it in CSS means one file to paste and
   every page changes at once; the markup can stay exactly as it is.
   doc.js still looks for these links, finds them, and quietly does nothing.
   ──────────────────────────────────────────────────────────────────────── */
.contents {
  display: none !important;
}

.contents__label {
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.19em;
  text-transform: uppercase;
  color: var(--brand);
  margin-bottom: 14px;
}

.contents ol {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: toc;
  border-left: 1px solid var(--line);
}

.contents li {
  counter-increment: toc;
}

.contents a {
  display: block;
  position: relative;
  padding: 7px 0 7px 18px;
  margin-left: -1px;
  border-left: 2px solid transparent;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.875rem;
  line-height: 1.45;
  transition:
    color 0.16s ease,
    border-color 0.16s ease;
}

.contents a::before {
  content: counter(toc, decimal-leading-zero);
  font-variant-numeric: tabular-nums;
  font-size: 0.7rem;
  color: var(--line-2);
  margin-right: 9px;
}

.contents a:hover {
  color: var(--ink);
}

/* Gold marker tracks the section you are reading (doc.js sets is-active) */
.contents a.is-active {
  color: var(--brand);
  border-left-color: var(--brand);
  font-weight: 600;
}

.contents a.is-active::before {
  color: var(--brand);
}

/* ── Document ───────────────────────────────────────────────────────── */
.doc {
  max-width: none;
  min-width: 0;
  margin: 0 auto;
}

.doc__eyebrow {
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.19em;
  text-transform: uppercase;
  color: var(--rose);
  margin-bottom: 14px;
}

.doc__title {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(2.3rem, 6vw, 3.5rem);
  line-height: 1.04;
  letter-spacing: -0.015em;
  color: var(--ink);
  margin: 0 0 20px;
}

.doc__standfirst {
  font-size: 1.1rem;
  line-height: 1.66;
  color: var(--body);
  margin: 0 0 34px;
  padding-bottom: 30px;
  border-bottom: 1px solid var(--line);
}

/* ── Sections ───────────────────────────────────────────────────────── */
.doc section {
  padding-top: 40px;
}

.doc h2 {
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.72rem;
  line-height: 1.22;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin: 0 0 16px;
}

/* The section number sits ABOVE the heading as a gold label, so every
   heading starts at the same left margin and the page scans cleanly. */
.num {
  display: block;
  font-family: var(--sans);
  font-size: 0.63rem;
  font-weight: 800;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--brand);
  margin-bottom: 9px;
}

.doc h3 {
  font-family: var(--sans);
  font-weight: 700;
  font-size: 1.04rem;
  color: var(--ink);
  margin: 28px 0 8px;
}

.doc p {
  margin: 0 0 15px;
}

.doc ul,
.doc ol:not(.contents ol) {
  margin: 0 0 16px;
  padding-left: 4px;
  list-style: none;
}

.doc ul li,
.doc ol:not(.contents ol) li {
  position: relative;
  padding-left: 22px;
  margin-bottom: 8px;
}

.doc ul li::before {
  content: "";
  position: absolute;
  left: 3px;
  top: 0.72em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--brand);
  opacity: 0.75;
}

.doc ol:not(.contents ol) {
  counter-reset: li;
}

.doc ol:not(.contents ol) li {
  counter-increment: li;
}

.doc ol:not(.contents ol) li::before {
  content: counter(li);
  position: absolute;
  left: 0;
  top: 0;
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--brand);
}

.doc a {
  color: var(--brand);
  text-decoration: none;
  border-bottom: 1px solid color-mix(in srgb, var(--brand) 45%, transparent);
  transition:
    border-color 0.16s ease,
    color 0.16s ease;
}

.doc a:hover {
  color: var(--brand-strong);
  border-bottom-color: var(--brand-strong);
}

.doc strong {
  color: var(--ink);
  font-weight: 700;
}

/* ── Tables ─────────────────────────────────────────────────────────────
   There are ten tables across these pages and NONE of them carry a class,
   so they were falling through to browser defaults: zero cell padding, no
   rules, text pressed flat against the edge of the screen on a phone.

   Wrapped in a scroller rather than squeezed: a three-column table at 360px
   either gets a horizontal scroll or it breaks every word in half, and the
   scroll is the honest choice.
   ──────────────────────────────────────────────────────────────────────── */
.doc table {
  width: 100%;
  margin: 22px 0;
  border-collapse: separate;
  border-spacing: 0;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  overflow: hidden;
  font-size: 0.93rem;
  line-height: 1.6;
  background: var(--surface);
}

.doc th,
.doc td {
  /* The fix. 14px of breathing room on every side, 18px at the outer edge. */
  padding: 13px 16px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
  overflow-wrap: anywhere;
}

.doc th:first-child,
.doc td:first-child {
  padding-left: 18px;
}

.doc th:last-child,
.doc td:last-child {
  padding-right: 18px;
}

.doc thead th {
  background: var(--surface-2);
  color: var(--brand);
  font-family: var(--sans);
  font-weight: 800;
  font-size: 0.66rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--line-2);
  white-space: nowrap;
}

.doc tbody tr:last-child td {
  border-bottom: none;
}

/* Zebra striping so a long row is followed across the width without
   losing your place. */
.doc tbody tr:nth-child(even) td {
  background: color-mix(in srgb, var(--surface-2) 45%, transparent);
}

/* First column reads as the label for the row. */
.doc tbody td:first-child {
  color: var(--ink);
  font-weight: 600;
}

@media (max-width: 760px) {
  .doc table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    white-space: normal;
  }

  .doc th,
  .doc td {
    padding: 12px 14px;
  }

  .doc th:first-child,
  .doc td:first-child {
    padding-left: 15px;
  }

  .doc th:last-child,
  .doc td:last-child {
    padding-right: 15px;
  }
}

/* ── .fill — a value written into the document ──────────────────────── */
.fill {
  display: inline;
  padding: 1px 7px;
  border-radius: 5px;
  background: var(--tokenbg);
  box-shadow: inset 0 -1px 0 color-mix(in srgb, var(--tokenln) 40%, transparent);
  color: var(--ink);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* ── .instrument — the Effective / Version / Law block ──────────────── */
.instrument {
  display: grid;
  /* 160px could not hold grievance.societyapp@gmail.com — 30 characters —
     so it broke mid-word on every phone. */
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 0;
  margin: 0 0 34px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface);
  overflow: hidden;
}

.instrument > div {
  padding: 15px 18px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.instrument dt {
  font-size: 0.63rem;
  font-weight: 800;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 5px;
}

.instrument dd {
  margin: 0;
  color: var(--ink);
  font-weight: 600;
  font-size: 0.95rem;
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* Below this, two columns cannot hold an email or a street address. One
   full-width row each, and every value fits on a single line. */
@media (max-width: 760px) {
  .instrument {
    grid-template-columns: minmax(0, 1fr);
  }
  .instrument > div {
    border-right: none;
  }
}

/* ── .note — a callout ──────────────────────────────────────────────── */
.note {
  position: relative;
  margin: 24px 0;
  padding: 18px 20px 18px 22px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 3px solid var(--brand);
  border-radius: var(--r-md);
}

.note__label {
  display: block;
  font-size: 0.63rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--brand);
  margin-bottom: 8px;
}

.note p:last-child {
  margin-bottom: 0;
}

/* ── .tag ───────────────────────────────────────────────────────────── */
.tag {
  display: inline-block;
  padding: 3px 11px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  background: var(--surface-2);
  color: var(--brand);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  vertical-align: middle;
}

/* ── FAQ disclosures ────────────────────────────────────────────────── */
.faq {
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface);
  margin: 10px 0;
  overflow: hidden;
  transition:
    border-color 0.18s ease,
    background 0.18s ease;
}

.faq[open] {
  border-color: color-mix(in srgb, var(--brand) 55%, transparent);
  background: var(--surface-2);
}

.faq summary {
  cursor: pointer;
  list-style: none;
  padding: 15px 48px 15px 18px;
  font-weight: 600;
  font-size: 1rem;
  color: var(--ink);
  position: relative;
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary::marker {
  content: "";
}

.faq summary::after {
  content: "";
  position: absolute;
  right: 19px;
  top: 50%;
  width: 10px;
  height: 10px;
  margin-top: -6px;
  border-right: 2px solid var(--brand);
  border-bottom: 2px solid var(--brand);
  transform: rotate(45deg);
  transform-origin: 70% 70%;
  transition: transform 0.2s ease;
}

.faq[open] summary::after {
  transform: rotate(-135deg);
}

.faq summary:hover {
  color: var(--brand-strong);
}

.faq summary:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: -2px;
}

.faq__body {
  padding: 14px 18px 16px;
  border-top: 1px solid var(--line);
}

.faq__body p:last-child {
  margin-bottom: 0;
}

/* ── Hub (index.html) ───────────────────────────────────────────────── */
.hub {
  max-width: 1180px;
  margin: 0 auto;
  padding: 70px 26px 30px;
}

.hub__title {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(2.4rem, 7vw, 3.9rem);
  line-height: 1.03;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin: 0 0 16px;
}

.hub__lede {
  font-size: 1.12rem;
  color: var(--body);
  max-width: 58ch;
  margin: 0;
}

.docgrid {
  max-width: 1180px;
  margin: 0 auto;
  padding: 34px 26px 90px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(258px, 1fr));
  gap: 16px;
}

.docgrid > a {
  display: block;
  padding: 22px 22px 24px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
  color: var(--body);
  text-decoration: none;
  transition:
    border-color 0.18s ease,
    transform 0.18s ease,
    box-shadow 0.18s ease;
}

.docgrid > a:hover {
  border-color: color-mix(in srgb, var(--brand) 55%, transparent);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.docgrid h2,
.docgrid h3 {
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.22rem;
  color: var(--ink);
  margin: 0 0 7px;
}

.docgrid p {
  margin: 0;
  font-size: 0.93rem;
  color: var(--muted);
  line-height: 1.6;
}

/* ── Footer ─────────────────────────────────────────────────────────── */
.foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 20px;
  margin-top: 64px;
  padding-top: 26px;
  border-top: 1px solid var(--line);
  font-size: 0.86rem;
  color: var(--muted);
}

.foot a {
  color: var(--muted);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  /* Labels wrap onto the next line rather than being clipped — "Community
     Guidelines" and "Delete data" were losing their second word. */
  white-space: normal;
  overflow-wrap: anywhere;
}

.foot a:hover {
  color: var(--brand);
  border-bottom-color: var(--brand);
}

/* ── Mobile ─────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .frame {
    padding: 28px 20px 70px;
  }

  .doc__standfirst {
    font-size: 1.03rem;
  }

  .masthead__inner {
    padding: 13px 20px;
  }
}

@media (max-width: 480px) {
  body {
    font-size: 16px;
  }

  .doc section {
    padding-top: 32px;
  }
}
