/* ============================================================
   Combate — shared chrome for the document pages
   (privacy, terms, support). Tokens mirror UI_THEME.md and
   AppStyle.swift: canonical belt palette, glass surfaces over a
   coloured field, quiet borders, 20px card radius.
   ============================================================ */

:root {
  color-scheme: dark;

  --yellow: #F5C747;
  --orange: #F08A50;
  --red:    #D9564B;
  --green:  #4FBE81;
  --blue:   #5B95E0;
  --purple: #A588D0;
  --brown:  #A87B5C;
  --grey:   #8C8F99;

  --f-green:  51, 148, 97;
  --f-blue:   51, 115, 209;
  --f-purple: 140, 107, 189;
  --f-orange: 237, 117, 56;
  --f-yellow: 245, 199, 71;

  --bg: #14141A;
  --text:   #FFFFFF;
  --text-2: rgba(255,255,255,.74);
  --text-3: rgba(255,255,255,.54);

  --surface:        rgba(255,255,255,.075);
  --surface-raised: rgba(255,255,255,.12);
  --surface-strong: rgba(255,255,255,.16);
  --border:         rgba(255,255,255,.17);
  --border-subtle:  rgba(255,255,255,.13);
  --divider:        rgba(255,255,255,.12);
  --shadow: 0 24px 60px rgba(0,0,0,.34);

  --radius: 20px;
  --inset: 16px;

  --font-display: ui-rounded, "SF Pro Rounded", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, system-ui, sans-serif;
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, system-ui, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

:root[data-theme="light"] {
  color-scheme: light;
  --yellow: #A8830B;
  --orange: #C85A20;
  --red:    #C73329;
  --green:  #2C7E53;
  --blue:   #2C63B4;
  --purple: #74549F;
  --brown:  #7A573D;
  --grey:   #6B6E77;

  --bg: #F5F4F0;
  --text:   #14141A;
  --text-2: rgba(20,20,26,.72);
  --text-3: rgba(20,20,26,.56);

  --surface:        rgba(255,255,255,.52);
  --surface-raised: rgba(255,255,255,.66);
  --surface-strong: rgba(255,255,255,.78);
  --border:         rgba(255,255,255,.78);
  --border-subtle:  rgba(20,20,26,.09);
  --divider:        rgba(20,20,26,.08);
  --shadow: 0 24px 56px rgba(31,35,41,.12);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Ambient colour field — glass needs something behind it to refract */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(ellipse 70% 50% at 12% 6%,  rgba(var(--f-green), .18), transparent 60%),
    radial-gradient(ellipse 60% 45% at 88% 30%, rgba(var(--f-blue), .15),  transparent 60%),
    radial-gradient(ellipse 65% 45% at 18% 70%, rgba(var(--f-purple), .14), transparent 60%),
    radial-gradient(ellipse 55% 40% at 85% 92%, rgba(var(--f-orange), .12), transparent 60%);
}
[data-theme="light"] body::before { opacity: .85; }

a { color: inherit; }
a:focus-visible, button:focus-visible {
  outline: 3px solid var(--yellow);
  outline-offset: 3px;
  border-radius: 6px;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  padding: 12px clamp(16px, 5vw, 72px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid var(--border-subtle);
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  -webkit-backdrop-filter: blur(22px) saturate(160%);
  backdrop-filter: blur(22px) saturate(160%);
}
.brand {
  display: flex; align-items: center; gap: 11px;
  color: var(--text);
  font-family: var(--font-display); font-weight: 800; letter-spacing: .12em;
  text-decoration: none;
}
.brand-mark { position: relative; width: 36px; height: 36px; flex: 0 0 36px; }
.brand-mark img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.brand-mark .mark-default { display: none; }
.brand-mark .mark-dark { display: block; }
[data-theme="light"] .brand-mark .mark-default { display: block; }
[data-theme="light"] .brand-mark .mark-dark { display: none; }

.header-actions { display: flex; align-items: center; gap: 10px; }
.back-link {
  padding: 0 14px;
  min-height: 44px;
  display: inline-flex; align-items: center;
  color: var(--text-2);
  font-size: 14px; font-weight: 600; text-decoration: none;
}
.back-link:hover { color: var(--green); }
.theme-toggle {
  min-width: 44px; min-height: 44px;
  padding: 0 14px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  background: var(--surface);
  color: inherit; font: inherit; font-size: 14px; font-weight: 600;
  cursor: pointer;
}
.theme-toggle:hover { background: var(--surface-raised); }
.theme-toggle-dot {
  width: 15px; height: 15px;
  border: 2px solid currentColor; border-radius: 50%;
  background: linear-gradient(90deg, currentColor 50%, transparent 50%);
  transform: rotate(-25deg);
}

/* ---------- Document body ---------- */
main { width: min(880px, calc(100% - 40px)); margin: 0 auto; padding: 72px 0 110px; }

.eyebrow {
  margin: 0 0 14px;
  color: var(--yellow);
  font-family: var(--font-display);
  font-size: 12px; font-weight: 800; letter-spacing: .18em; text-transform: uppercase;
}
h1 {
  margin: 0 0 18px;
  font-family: var(--font-display);
  font-size: clamp(42px, 6vw, 66px); font-weight: 800;
  line-height: 1.02; letter-spacing: -.035em;
}
h2 {
  margin: 0 0 14px;
  font-family: var(--font-display);
  font-size: clamp(24px, 3.2vw, 32px); font-weight: 700;
  line-height: 1.18; letter-spacing: -.02em;
}
h3 { margin: 0 0 10px; font-family: var(--font-display); font-size: 19px; font-weight: 700; }
.intro { margin-bottom: 32px; color: var(--text-2); font-size: 19px; }
p { margin: 0 0 16px; color: var(--text-2); }
p:last-child { margin-bottom: 0; }
main a { color: var(--green); font-weight: 600; }
ul, ol { margin: 0 0 16px; padding-left: 22px; color: var(--text-2); }
li { margin: 8px 0; }

/* Glass surfaces */
.glass {
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  background: var(--surface);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
  backdrop-filter: blur(20px) saturate(150%);
}

.dates {
  margin-bottom: 40px;
  padding: 16px 20px;
  display: flex; flex-wrap: wrap; gap: 10px 26px;
  color: var(--text-3); font-size: 14px;
}
.dates strong { color: var(--text-2); }

/* Each policy/terms clause is its own glass card */
main > section {
  margin-bottom: 16px;
  padding: 28px 30px;
}
main > section:last-of-type { margin-bottom: 0; }

/* ---------- Support page pieces ---------- */
.card-grid { display: grid; gap: 16px; margin-bottom: 16px; }
.card-grid.two { grid-template-columns: repeat(2, 1fr); }
.contact-card { padding: 28px 30px; }
.contact-card .label {
  font-family: var(--font-mono);
  font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  color: var(--text-3);
}
.button {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 50px; padding: 0 22px;
  border-radius: 999px;
  font-family: var(--font-display); font-size: 15px; font-weight: 700;
  text-decoration: none;
}
.button.primary { background: var(--green); color: #08150D; }
[data-theme="light"] .button.primary { color: #fff; }
.button.primary:hover { filter: brightness(1.06); }
.button.secondary { border: 1px solid var(--border); background: var(--surface); color: var(--text); }
.button.secondary:hover { background: var(--surface-raised); }

.support-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr);
  align-items: center;
  gap: 40px;
  margin-bottom: 48px;
}
.contact-address { display: grid; gap: 6px; margin: 14px 0 22px; font-style: normal; }
.contact-address strong { font-family: var(--font-display); font-size: 18px; }
.contact-address a { color: var(--text-2); font-weight: 500; text-decoration: none; word-break: break-word; }
.contact-address a:hover { color: var(--green); }

/* ---------- FAQ disclosure ---------- */
.faq-list { margin-top: 26px; }
details { border-top: 1px solid var(--divider); }
details:last-child { border-bottom: 1px solid var(--divider); }
details summary {
  position: relative;
  padding: 18px 34px 18px 0;
  cursor: pointer;
  list-style: none;
  font-family: var(--font-display); font-size: 18px; font-weight: 700;
  color: var(--text);
}
details summary::-webkit-details-marker { display: none; }
details summary::after {
  content: "";
  position: absolute; right: 6px; top: 50%;
  width: 9px; height: 9px; margin-top: -6px;
  border-right: 2px solid var(--text-3);
  border-bottom: 2px solid var(--text-3);
  transform: rotate(45deg);
  transition: transform .2s ease;
}
details[open] summary::after { transform: rotate(-135deg); margin-top: -2px; }
@media (prefers-reduced-motion: reduce) { details summary::after { transition: none; } }
details p { margin: 0 0 18px; }

/* ---------- Footer ---------- */
.site-footer {
  padding: 40px clamp(16px, 5vw, 72px);
  display: flex; flex-wrap: wrap; gap: 12px 28px; align-items: center; justify-content: space-between;
  border-top: 1px solid var(--divider);
  color: var(--text-3); font-size: 14px;
}
.site-footer nav { display: flex; flex-wrap: wrap; gap: 20px; }
.site-footer a { text-decoration: none; }
.site-footer a:hover { color: var(--green); }

@media (max-width: 820px) {
  .support-hero { grid-template-columns: 1fr; gap: 32px; }
}

@media (max-width: 560px) {
  body { font-size: 16px; }
  .site-header { padding-left: var(--inset); padding-right: var(--inset); }
  .site-footer { padding-left: var(--inset); padding-right: var(--inset); }
  main { width: min(100% - 32px, 880px); padding-top: 48px; }
  main > section, .contact-card { padding: 22px 20px; }
  .card-grid.two { grid-template-columns: 1fr; }
  .support-hero { grid-template-columns: 1fr; gap: 28px; margin-bottom: 32px; }
  .button { width: 100%; }
  .brand span:last-child { font-size: 14px; }
  .theme-label { display: none; }
  .theme-toggle { width: 44px; padding: 0; }
  .back-link { padding: 0 8px; font-size: 13px; }
}
