/* ─── BITHARBOUR LEGAL PAGES — shared stylesheet ─── */
:root {
  --bg:         #0b0f1a;
  --bg-card:    #111827;
  --bg-card2:   #161d2e;
  --border:     rgba(255,255,255,0.07);
  --border2:    rgba(255,255,255,0.12);
  --text:       #f0f4ff;
  --text-muted: #8b95b0;
  --text-dim:   #4a5568;
  --green:      #00e676;
  --green-dim:  rgba(0,230,118,0.12);
  --green-glow: rgba(0,230,118,0.25);
  --blue:       #4f8eff;
  --purple:     #a855f7;
  --grad:       linear-gradient(135deg, #00e676, #4f8eff);
  --grad-text:  linear-gradient(90deg, #00e676 0%, #4f8eff 60%, #a855f7 100%);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', -apple-system, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body::after {
  content: '';
  position: fixed; inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 9999;
  opacity: 0.5;
}

/* ─── NAV ─── */
nav {
  position: fixed; top: 0; left: 0; right: 0;
  z-index: 100;
  height: 64px;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 2rem;
  background: rgba(11,15,26,0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}

.nav-logo {
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  text-decoration: none;
  background: var(--grad-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.nav-links { display: flex; gap: 2rem; list-style: none; }

.nav-links a {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s;
}

.nav-links a:hover, .nav-links a.active { color: var(--text); }
.nav-links a.active { color: var(--green); }

.pulse {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--green);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%,100% { opacity:1; box-shadow: 0 0 0 0 var(--green-glow); }
  50%      { opacity:.6; box-shadow: 0 0 0 5px transparent; }
}

/* ─── LEGAL HEADER ─── */
.legal-hero {
  padding: 9rem 2rem 3rem;
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
}

.legal-hero::before {
  content: '';
  position: absolute;
  top: -40%; left: 50%;
  transform: translateX(-50%);
  width: 900px; height: 500px;
  background: radial-gradient(ellipse at center,
    rgba(79,142,255,0.10) 0%,
    rgba(0,230,118,0.05) 40%,
    transparent 70%);
  pointer-events: none;
}

.legal-hero-inner { max-width: 1150px; margin: 0 auto; position: relative; }

.breadcrumb {
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-bottom: 1.5rem;
  display: flex; align-items: center; gap: 0.5rem;
  flex-wrap: wrap;
}

.breadcrumb a { color: var(--text-muted); text-decoration: none; transition: color 0.2s; }
.breadcrumb a:hover { color: var(--green); }
.breadcrumb span.sep { color: var(--text-dim); }

.section-kicker {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--green);
  margin-bottom: 1rem;
  display: flex; align-items: center; gap: 0.5rem;
}

.section-kicker::before {
  content: '';
  width: 20px; height: 2px;
  background: var(--green);
  border-radius: 2px;
}

.legal-hero h1 {
  font-size: clamp(2.2rem, 5vw, 3.6rem);
  font-weight: 900;
  letter-spacing: -0.04em;
  line-height: 1.05;
  margin-bottom: 1rem;
  max-width: 700px;
}

.grad-text {
  background: var(--grad-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.legal-hero p.lede {
  font-size: 0.98rem;
  color: var(--text-muted);
  max-width: 620px;
  line-height: 1.75;
}

/* meta chips */
.legal-meta {
  display: flex; gap: 0.75rem; flex-wrap: wrap;
  margin-top: 2rem;
}

.meta-chip {
  background: var(--bg-card);
  border: 1px solid var(--border2);
  border-radius: 12px;
  padding: 0.8rem 1.2rem;
}

.meta-chip-label {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 0.2rem;
}

.meta-chip-value { font-size: 0.88rem; font-weight: 700; color: var(--text); }
.meta-chip-value.green { color: var(--green); }

/* download buttons */
.dl-row { display: flex; gap: 0.75rem; flex-wrap: wrap; margin-top: 2rem; }

.btn-dl {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-size: 0.82rem; font-weight: 600;
  color: var(--text-muted);
  border: 1px solid var(--border2);
  padding: 0.65rem 1.3rem;
  border-radius: 100px;
  text-decoration: none;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}

.btn-dl:hover { color: var(--text); border-color: rgba(255,255,255,0.25); background: rgba(255,255,255,0.03); }

.btn-dl.primary {
  color: #000; background: var(--green); border-color: var(--green); font-weight: 700;
}
.btn-dl.primary:hover { opacity: 0.9; color: #000; background: var(--green); }

.dl-icon {
  width: 14px; height: 14px;
  display: inline-block;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2.5'%3E%3Cpath d='M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4M7 10l5 5 5-5M12 15V3'/%3E%3C/svg%3E") center/contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2.5'%3E%3Cpath d='M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4M7 10l5 5 5-5M12 15V3'/%3E%3C/svg%3E") center/contain no-repeat;
}

/* ─── LAYOUT: TOC + BODY ─── */
.legal-wrap {
  max-width: 1150px;
  margin: 0 auto;
  padding: 3.5rem 2rem 6rem;
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 4rem;
  align-items: start;
}

.toc {
  position: sticky;
  top: 90px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--bg-card);
  padding: 1.4rem;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
}

.toc-label {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 0.9rem;
}

.toc ol { list-style: none; counter-reset: toc; }

.toc li { margin-bottom: 0.1rem; }

.toc a {
  display: block;
  font-size: 0.78rem;
  color: var(--text-muted);
  text-decoration: none;
  padding: 0.35rem 0.5rem;
  border-radius: 6px;
  border-left: 2px solid transparent;
  line-height: 1.45;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}

.toc a:hover { color: var(--text); background: rgba(255,255,255,0.03); }
.toc a.active { color: var(--green); border-left-color: var(--green); background: var(--green-dim); }

/* body copy */
.legal-body { min-width: 0; }

.legal-body h2 {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.25;
  margin: 3rem 0 1rem;
  scroll-margin-top: 90px;
  padding-bottom: 0.7rem;
  border-bottom: 1px solid var(--border);
}

.legal-body h2:first-child { margin-top: 0; }

.legal-body h3 {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 1.8rem 0 0.7rem;
  color: var(--text);
  scroll-margin-top: 90px;
}

.legal-body p {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.85;
  margin-bottom: 1rem;
}

.legal-body p strong, .legal-body li strong { color: var(--text); font-weight: 600; }

.legal-body ul, .legal-body ol { margin: 0 0 1.2rem 0; padding-left: 0; list-style: none; }

.legal-body ul li {
  position: relative;
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.8;
  padding: 0.35rem 0 0.35rem 1.5rem;
}

.legal-body ul li::before {
  content: '';
  position: absolute;
  left: 0.25rem; top: 0.95rem;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--green);
  opacity: 0.7;
}

.legal-body ol { counter-reset: item; }

.legal-body ol > li {
  counter-increment: item;
  position: relative;
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.8;
  padding: 0.35rem 0 0.35rem 2rem;
}

.legal-body ol > li::before {
  content: counter(item) '.';
  position: absolute;
  left: 0; top: 0.35rem;
  font-weight: 700;
  color: var(--green);
  font-size: 0.8rem;
}

.clause-num {
  color: var(--green);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  margin-right: 0.35rem;
}

.legal-body a { color: var(--blue); text-decoration: none; }
.legal-body a:hover { text-decoration: underline; }

/* callout */
.callout {
  border: 1px solid var(--border2);
  border-left: 3px solid var(--green);
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(0,230,118,0.06), rgba(79,142,255,0.04));
  padding: 1.2rem 1.4rem;
  margin: 1.5rem 0;
}

.callout p { margin-bottom: 0; font-size: 0.85rem; }
.callout p + p { margin-top: 0.7rem; }

.callout-title {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--green);
  margin-bottom: 0.6rem;
  display: block;
}

.callout.warn { border-left-color: var(--blue); background: linear-gradient(135deg, rgba(79,142,255,0.07), rgba(168,85,247,0.04)); }
.callout.warn .callout-title { color: var(--blue); }

/* data tables */
.legal-table {
  border: 1px solid var(--border2);
  border-radius: 14px;
  overflow: hidden;
  background: var(--bg-card);
  margin: 1.5rem 0;
}

.legal-table .trow {
  display: grid;
  grid-template-columns: 190px 1fr;
  border-bottom: 1px solid var(--border);
}

.legal-table .trow:last-child { border-bottom: none; }

.legal-table .tk {
  padding: 0.85rem 1.1rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-dim);
  background: rgba(255,255,255,0.02);
  border-right: 1px solid var(--border);
  display: flex; align-items: flex-start;
  line-height: 1.5;
}

.legal-table .tv {
  padding: 0.85rem 1.1rem;
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.7;
}

.legal-table .tv strong { color: var(--text); }
.legal-table .tv.green { color: var(--green); font-weight: 700; }

/* wide table (sub-processors) */
.table-scroll { overflow-x: auto; margin: 1.5rem 0; }

table.grid {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid var(--border2);
  border-radius: 14px;
  overflow: hidden;
  background: var(--bg-card);
  font-size: 0.8rem;
  min-width: 560px;
}

table.grid th {
  text-align: left;
  padding: 0.85rem 1.1rem;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
  background: rgba(255,255,255,0.02);
  border-bottom: 1px solid var(--border2);
}

table.grid td {
  padding: 0.85rem 1.1rem;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  line-height: 1.6;
  vertical-align: top;
}

table.grid tr:last-child td { border-bottom: none; }
table.grid td strong { color: var(--text); font-weight: 600; }

/* signature block */
.sig-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin: 1.5rem 0;
}

.sig-card {
  border: 1px solid var(--border2);
  border-radius: 14px;
  background: var(--bg-card);
  padding: 1.5rem;
}

.sig-card h4 {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--green);
  margin-bottom: 1.2rem;
}

.sig-line {
  font-size: 0.78rem;
  color: var(--text-dim);
  border-bottom: 1px solid var(--border2);
  padding: 1.1rem 0 0.4rem;
}

.sig-line:first-of-type { padding-top: 0.4rem; }

/* footer */
footer {
  background: var(--bg);
  border-top: 1px solid var(--border);
  padding: 1.5rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.foot-left { font-size: 0.75rem; color: var(--text-dim); line-height: 1.7; }
.foot-right { font-size: 0.72rem; color: var(--text-dim); text-align: right; line-height: 1.7; }
.foot-left a, .foot-right a { color: rgba(79,142,255,0.7); text-decoration: none; }
.foot-left a:hover, .foot-right a:hover { color: var(--blue); }

/* legal band above footer */
.legal-band {
  background: linear-gradient(135deg, #0d1a12, #0d1222);
  border-top: 1px solid rgba(0,230,118,0.15);
  border-bottom: 1px solid var(--border);
  padding: 3rem 2rem;
}

.lb-inner {
  max-width: 1150px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 2rem;
  flex-wrap: wrap;
}

.lb-text { flex: 1; min-width: 250px; font-size: 0.9rem; color: var(--text-muted); line-height: 1.75; }
.lb-text strong { color: var(--text); font-weight: 600; }

/* ─── RESPONSIVE ─── */
@media (max-width: 950px) {
  nav { padding: 0 1.25rem; }
  .nav-links { display: none; }
  .legal-hero { padding: 8rem 1.25rem 2.5rem; }
  .legal-wrap { grid-template-columns: 1fr; gap: 2rem; padding: 2.5rem 1.25rem 4rem; }
  .toc { position: static; max-height: none; }
  .sig-grid { grid-template-columns: 1fr; }
  .legal-table .trow { grid-template-columns: 1fr; }
  .legal-table .tk { border-right: none; border-bottom: 1px solid var(--border); }
  footer { flex-direction: column; text-align: center; }
  .foot-right { text-align: center; }
}
