/*
 * MusiX legal pages — shared theme.
 *
 * Palette and gradient are sampled from the app: the four-stop brand gradient
 * (amber → orange → coral → raspberry) defined in MusiXBrand.swift, and the
 * #FC6A45 accent from AccentColor.colorset.
 *
 * The app sets type in BBC Reith Sans, which is a licensed typeface and cannot
 * be redistributed to the web. The stack below names it first so it renders on
 * machines that have it, then falls back to the system UI face — which on iOS
 * and macOS is SF Pro, the closest widely-available neo-grotesque.
 */

:root {
  --amber: #fcb13a;
  --orange: #fc8c36;
  --coral: #fb5350;
  --raspberry: #fa495b;
  --accent: #fc6a45;

  --brand-gradient: linear-gradient(
    135deg,
    var(--amber) 0%,
    var(--orange) 30%,
    var(--coral) 72%,
    var(--raspberry) 100%
  );

  --bg: #0b0b0d;
  --surface: #141417;
  --surface-2: #1c1c21;
  --border: rgba(255, 255, 255, 0.09);
  --text: #f4f4f6;
  --text-dim: #a1a1aa;
  --text-faint: #71717a;

  --radius: 14px;
  --maxw: 760px;

  --font: "BBCReithSans-Regular", "BBC Reith Sans", -apple-system,
    BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, system-ui, sans-serif;
}

/* The app is dark-canvas first (Color.appBackground = .black), so the pages
   default to dark and lighten only when the visitor explicitly prefers it. */
@media (prefers-color-scheme: light) {
  :root {
    --bg: #ffffff;
    --surface: #fafafa;
    --surface-2: #f4f4f5;
    --border: rgba(0, 0, 0, 0.1);
    --text: #18181b;
    --text-dim: #52525b;
    --text-faint: #71717a;
  }
}

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

html {
  -webkit-text-size-adjust: 100%;
  /* The page body must never scroll sideways; wide content scrolls inside
     its own container instead (see .table-wrap). */
  overflow-x: hidden;
}

body {
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  max-width: 100vw;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

.hero {
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
  padding: 56px 24px 40px;
  text-align: center;
}

/* A soft wash of the brand gradient behind the icon, echoing the paywall's
   dimmed-artwork hero without competing with the body copy. */
.hero::before {
  content: "";
  position: absolute;
  inset: -60% 0 auto 0;
  height: 320px;
  background: var(--brand-gradient);
  opacity: 0.16;
  filter: blur(64px);
  pointer-events: none;
}

.hero-inner {
  position: relative;
  max-width: var(--maxw);
  margin: 0 auto;
}

.app-icon {
  width: 88px;
  height: 88px;
  border-radius: 20px;
  display: block;
  margin: 0 auto 20px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

.wordmark {
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0;
  line-height: 1.2;
}

.doc-title {
  margin: 6px 0 0;
  font-size: 17px;
  font-weight: 500;
  /* The one loud element, mirroring the app's gradient PREMIUM chip. */
  background: var(--brand-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.updated {
  margin: 14px 0 0;
  font-size: 13px;
  color: var(--text-faint);
}

/* ---------- Layout ---------- */

main {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 40px 24px 24px;
}

/* No box, no border, no callout — the opening summary is simply set as a
   lead paragraph: larger and lighter than body copy, separated by a rule. */
.summary {
  margin: 0 0 40px;
  padding: 0 0 32px;
  border-bottom: 1px solid var(--border);
}

.summary h2 {
  margin: 0 0 14px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.summary p {
  font-size: 18px;
  line-height: 1.6;
  color: var(--text);
  font-weight: 400;
}

.summary p:last-child {
  margin-bottom: 0;
}

h2 {
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 44px 0 12px;
  scroll-margin-top: 20px;
}

h3 {
  font-size: 17px;
  font-weight: 600;
  margin: 28px 0 8px;
}

p,
li {
  color: var(--text-dim);
}

p {
  margin: 0 0 14px;
}

ul,
ol {
  padding-left: 22px;
  margin: 0 0 16px;
}

li {
  margin-bottom: 7px;
}

strong {
  color: var(--text);
  font-weight: 600;
}

a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid rgba(252, 106, 69, 0.35);
}

a:hover {
  border-bottom-color: var(--accent);
}

code {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
  font-size: 0.88em;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 1px 5px;
}

/* ---------- Table ---------- */

/* Wide tables scroll inside their own box so the page body never scrolls
   sideways on a phone. */
.table-wrap {
  overflow-x: auto;
  margin: 0 0 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  -webkit-overflow-scrolling: touch;
}

table {
  border-collapse: collapse;
  width: 100%;
  /* Enough to keep columns legible; below this the wrapper scrolls rather
     than the page. Kept modest so two-column tables fit a phone outright. */
  min-width: 420px;
  font-size: 15px;
}

th,
td {
  text-align: left;
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

th {
  background: var(--surface-2);
  color: var(--text);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

td {
  color: var(--text-dim);
}

tbody tr:last-child td {
  border-bottom: none;
}

/* ---------- Contact ---------- */

.contact {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-top: 24px;
}

.contact p:last-child {
  margin-bottom: 0;
}

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

footer {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 32px 24px 56px;
  border-top: 1px solid var(--border);
  margin-top: 48px;
  font-size: 14px;
  color: var(--text-faint);
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  align-items: center;
  justify-content: space-between;
}

footer nav {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

@media (max-width: 560px) {
  body {
    font-size: 16px;
  }
  .hero {
    padding: 40px 20px 32px;
  }
  main {
    padding: 32px 20px 20px;
  }
  .wordmark {
    font-size: 26px;
  }
  h2 {
    font-size: 19px;
  }
  .summary {
    padding: 0 0 26px;
    margin-bottom: 32px;
  }
  .summary p {
    font-size: 16.5px;
  }
  footer {
    justify-content: flex-start;
  }
}
