/* ──────────────────────────────────────────────────────────────
   The Union Hub · shared shell for legal / info pages
   Brand tokens locked. No shadows. No gradients. 0.5px borders.
   Used by: privacy, terms, data-processing, security,
            about, contact, status, audit-log.
   ────────────────────────────────────────────────────────────── */

:root {
  --forest:        #0F6E56;
  --active:        #1D9E75;
  --mint:          #E1F5EE;
  --deep-forest:   #0D1F1A;
  --near-black:    #111111;
  --off-white:     #F5F4F1;
  --paper:         #FAF9F5;
  --alert:         #E24B4A;
  --warn:          #C68A1B;
  --mid-gray:      #888780;

  --ink:           #111111;
  --ink-soft:      #2A2A2A;
  --muted:         #888780;
  --hair:          rgba(0,0,0,0.15);
  --hair-on-dark:  rgba(245,244,241,0.18);

  --pad-x:         clamp(20px, 5vw, 88px);
  --rad:           12px;
  --rad-sm:        8px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
body {
  margin: 0;
  background: var(--off-white);
  color: var(--ink);
  font-family: 'DM Sans', system-ui, -apple-system, sans-serif;
  font-weight: 300;
  font-size: 16px;
  line-height: 1.65;
}
::selection { background: var(--forest); color: var(--off-white); }
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; }

.wrap { max-width: 1240px; margin: 0 auto; padding: 0 var(--pad-x); }

h1, h2, h3, h4 {
  font-family: 'Playfair Display', serif;
  color: var(--deep-forest);
  margin: 0;
  letter-spacing: -0.01em;
}
h1 em, h2 em, h3 em, h4 em { font-style: italic; color: var(--forest); }

.eyebrow {
  font-family: 'DM Mono', monospace;
  font-weight: 500;
  font-size: 10.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--forest);
}
.eyebrow .dash::before {
  content:''; display:inline-block;
  width:22px; height:0.5px; background: currentColor;
  margin-right: 12px; vertical-align: middle;
}

/* ════════════ UTILITY BAR ════════════ */
.util {
  background: var(--deep-forest);
  color: rgba(245,244,241,0.85);
  font-family: 'DM Mono', monospace;
  font-weight: 500;
  font-size: 10.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.util .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 34px;
}
.util-left::before {
  content: '';
  display: inline-block;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--active);
  margin-right: 10px;
  vertical-align: middle;
}
.util-right { display: flex; gap: 24px; }
.util a { color: inherit; }
.util a:hover { color: #fff; }
@media (max-width: 760px) {
  .util .wrap { height: auto; padding-top: 8px; padding-bottom: 8px; gap: 6px; flex-wrap: wrap; }
  .util-right { gap: 14px; flex-wrap: wrap; }
}

/* ════════════ NAV ════════════ */
.nav-shell {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--off-white);
  border-bottom: 0.5px solid var(--hair);
  transition: padding 0.18s ease;
}
.nav-shell.is-scrolled { padding-top: 0; padding-bottom: 0; }

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  height: 78px;
}
.nav-shell.is-scrolled .nav { height: 62px; }

.nav-brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.nav-brand svg { width: 36px; height: 36px; }
.nav-brand-stack { display: flex; flex-direction: column; line-height: 1.1; }
.nav-brand-name {
  font-family: 'Playfair Display', serif;
  font-weight: 700;
  font-size: 18px;
  color: var(--deep-forest);
}
.nav-brand-tag {
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

.nav-links { display: flex; align-items: center; gap: 28px; }
.nav-links a {
  font-size: 13.5px;
  color: var(--ink-soft);
  font-weight: 500;
  letter-spacing: 0.01em;
  position: relative;
}
.nav-links a:hover { color: var(--forest); }
.nav-links a[aria-current="page"] {
  color: var(--forest);
}
.nav-links a[aria-current="page"]::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: -22px;
  height: 1.5px;
  background: var(--forest);
}

.nav-cta { display: flex; align-items: center; gap: 18px; }
.nav-signin {
  font-size: 13.5px;
  color: var(--ink-soft);
  font-weight: 500;
}
.nav-signin:hover { color: var(--forest); }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 22px;
  border-radius: var(--rad);
  border: 0.5px solid transparent;
  font-family: 'DM Sans', sans-serif;
  font-weight: 500;
  font-size: 13.5px;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.btn-primary { background: var(--forest); color: var(--off-white); }
.btn-primary:hover { background: var(--active); }
.btn-ghost { background: transparent; color: var(--deep-forest); border-color: var(--hair); }
.btn-ghost:hover { border-color: var(--forest); color: var(--forest); }
.btn .arrow { transition: transform 0.15s ease; }
.btn:hover .arrow { transform: translateX(2px); }

@media (max-width: 980px) {
  .nav-links { display: none; }
  .nav-brand-tag { display: none; }
}

/* ════════════ PAGE HEAD ════════════ */
.page-head {
  padding: clamp(48px, 8vw, 96px) 0 clamp(36px, 6vw, 64px);
  border-bottom: 0.5px solid var(--hair);
}
.page-head .eyebrow { margin-bottom: 18px; }
.page-head h1 {
  font-size: clamp(36px, 5.5vw, 64px);
  font-weight: 700;
  line-height: 1.05;
  max-width: 18ch;
  margin-bottom: 18px;
}
.page-head .dek {
  font-size: clamp(16px, 1.6vw, 19px);
  line-height: 1.6;
  color: var(--ink-soft);
  max-width: 64ch;
  font-weight: 400;
}
.page-head .meta {
  display: flex;
  flex-wrap: wrap;
  gap: 28px;
  margin-top: 28px;
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
.page-head .meta strong {
  display: block;
  color: var(--deep-forest);
  font-weight: 500;
  margin-top: 4px;
  letter-spacing: 0.08em;
}

/* ════════════ PROSE / LONG-FORM ════════════ */
.prose {
  display: grid;
  grid-template-columns: minmax(0, 220px) minmax(0, 1fr);
  gap: clamp(32px, 5vw, 80px);
  padding: clamp(40px, 6vw, 80px) 0 clamp(48px, 8vw, 96px);
}
.prose-toc {
  position: sticky;
  top: 110px;
  align-self: start;
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.prose-toc h4 {
  font-family: 'DM Mono', monospace;
  font-size: 10.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 500;
  margin-bottom: 14px;
}
.prose-toc ol {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: toc;
}
.prose-toc li {
  counter-increment: toc;
  border-top: 0.5px solid var(--hair);
  padding: 10px 0;
}
.prose-toc li::before {
  content: counter(toc, decimal-leading-zero);
  margin-right: 10px;
  color: var(--muted);
}
.prose-toc a { color: var(--ink-soft); }
.prose-toc a:hover { color: var(--forest); }

.prose-body { max-width: 68ch; }
.prose-body section { padding: 28px 0 32px; border-top: 0.5px solid var(--hair); }
.prose-body section:first-child { border-top: 0; padding-top: 0; }
.prose-body h2 {
  font-size: clamp(24px, 2.8vw, 32px);
  margin-bottom: 14px;
  scroll-margin-top: 100px;
}
.prose-body h2::before {
  content: counter(s, decimal-leading-zero) " · ";
  font-family: 'DM Mono', monospace;
  font-size: 12px;
  letter-spacing: 0.16em;
  color: var(--forest);
  vertical-align: middle;
  margin-right: 4px;
}
.prose-body { counter-reset: s; }
.prose-body section { counter-increment: s; }
.prose-body h3 {
  font-size: 18px;
  font-weight: 600;
  margin: 24px 0 8px;
  color: var(--deep-forest);
}
.prose-body p { margin: 0 0 14px; }
.prose-body p + p { margin-top: 0; }
.prose-body ul, .prose-body ol { padding-left: 22px; margin: 0 0 16px; }
.prose-body li { margin-bottom: 6px; }
.prose-body strong { font-weight: 600; color: var(--deep-forest); }
.prose-body code {
  font-family: 'DM Mono', monospace;
  font-size: 0.92em;
  background: var(--paper);
  padding: 1px 6px;
  border: 0.5px solid var(--hair);
  border-radius: 4px;
}
.prose-body a { color: var(--forest); border-bottom: 0.5px solid var(--forest); }
.prose-body a:hover { color: var(--active); border-color: var(--active); }
.prose-body hr {
  border: 0;
  border-top: 0.5px solid var(--hair);
  margin: 32px 0;
}

/* Definition tables (used in DPA, Security, Privacy) */
.deftable {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  margin: 16px 0 24px;
}
.deftable th, .deftable td {
  text-align: left;
  vertical-align: top;
  padding: 12px 14px;
  border-top: 0.5px solid var(--hair);
}
.deftable th {
  font-family: 'DM Mono', monospace;
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--forest);
  width: 32%;
  background: var(--paper);
}

/* Pull-quote / callout for Security and About */
.callout {
  border: 0.5px solid var(--hair);
  border-left: 1.5px solid var(--forest);
  padding: 22px 24px;
  margin: 24px 0;
  background: var(--paper);
}
.callout p:last-child { margin-bottom: 0; }
.callout em {
  font-family: 'Playfair Display', serif;
  font-style: italic;
  color: var(--forest);
}

@media (max-width: 900px) {
  .prose { grid-template-columns: 1fr; }
  .prose-toc { position: static; }
}

/* ════════════ STATUS-PAGE PRIMITIVES ════════════ */
.status-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 0;
  border: 0.5px solid var(--hair);
  border-radius: var(--rad);
  overflow: hidden;
  background: var(--paper);
  margin: 28px 0 32px;
}
.status-card {
  padding: 22px 24px;
  border-right: 0.5px solid var(--hair);
  border-bottom: 0.5px solid var(--hair);
}
.status-card:last-child { border-right: 0; }
.status-card .label {
  font-family: 'DM Mono', monospace;
  font-size: 10.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}
.status-card .name {
  font-family: 'Playfair Display', serif;
  font-size: 20px;
  font-weight: 600;
  color: var(--deep-forest);
  margin-bottom: 14px;
}
.status-card .pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 6px 12px;
  border-radius: 999px;
  border: 0.5px solid var(--hair);
}
.status-card .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--mid-gray);
}
.status-card[data-status="ok"]      .dot { background: var(--active); }
.status-card[data-status="degraded"].dot,
.status-card[data-status="degraded"] .dot { background: var(--warn); }
.status-card[data-status="down"]    .dot { background: var(--alert); }
.status-card .latency {
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  color: var(--muted);
  margin-top: 12px;
  letter-spacing: 0.05em;
}
.status-banner {
  display: flex; align-items: center; gap: 14px;
  padding: 18px 22px;
  border: 0.5px solid var(--hair);
  border-left: 1.5px solid var(--active);
  background: var(--mint);
  border-radius: var(--rad);
  font-family: 'DM Mono', monospace;
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--deep-forest);
}
.status-banner[data-state="degraded"] {
  border-left-color: var(--warn);
  background: #FBF1DC;
}
.status-banner[data-state="down"] {
  border-left-color: var(--alert);
  background: #FBE0DF;
}

/* ════════════ CONTACT PAGE ════════════ */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 0;
  border: 0.5px solid var(--hair);
  border-radius: var(--rad);
  overflow: hidden;
  margin: 28px 0;
}
.contact-card {
  padding: 28px;
  border-right: 0.5px solid var(--hair);
  border-bottom: 0.5px solid var(--hair);
  background: var(--paper);
}
.contact-card:last-child { border-right: 0; }
.contact-card .role {
  font-family: 'DM Mono', monospace;
  font-size: 10.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--forest);
  margin-bottom: 10px;
}
.contact-card h3 {
  font-family: 'Playfair Display', serif;
  font-size: 22px;
  margin-bottom: 12px;
}
.contact-card p { font-size: 14px; color: var(--ink-soft); margin-bottom: 14px; }
.contact-card a.email {
  font-family: 'DM Mono', monospace;
  font-size: 13px;
  color: var(--forest);
  border-bottom: 0.5px solid var(--forest);
}

/* ════════════ FOOTER ════════════ */
footer {
  background: var(--deep-forest);
  color: rgba(245,244,241,0.78);
  padding: clamp(56px, 8vw, 96px) 0 32px;
  margin-top: 0;
}
footer h4 {
  font-family: 'DM Mono', monospace;
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--off-white);
  margin-bottom: 16px;
}
.foot-grid {
  display: grid;
  grid-template-columns: 2fr repeat(4, 1fr);
  gap: clamp(28px, 4vw, 56px);
  padding-bottom: 56px;
  border-bottom: 0.5px solid var(--hair-on-dark);
}
.foot-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: 'Playfair Display', serif;
  font-weight: 700;
  font-size: 22px;
  color: var(--off-white);
  margin-bottom: 14px;
}
.foot-brand svg { width: 32px; height: 32px; }
.foot-tag {
  display: block;
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--active);
  margin-bottom: 14px;
}
.foot-line {
  font-size: 14px;
  line-height: 1.6;
  max-width: 32ch;
  color: rgba(245,244,241,0.6);
  margin: 0 0 18px;
}
.foot-social { display: flex; gap: 10px; }
.foot-social a {
  width: 32px; height: 32px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 0.5px solid var(--hair-on-dark);
  border-radius: 50%;
  font-family: 'DM Mono', monospace;
  font-size: 12px;
  color: rgba(245,244,241,0.78);
}
.foot-social a:hover { border-color: var(--active); color: var(--active); }
.foot-col ul { list-style: none; padding: 0; margin: 0; }
.foot-col li { margin-bottom: 8px; }
.foot-col a { font-size: 13px; color: rgba(245,244,241,0.7); }
.foot-col a:hover { color: var(--off-white); }
.foot-bar {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding-top: 28px;
  font-family: 'DM Mono', monospace;
  font-size: 10.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(245,244,241,0.5);
}
@media (max-width: 900px) {
  .foot-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  .foot-grid { grid-template-columns: 1fr; }
}
