/* CybrGate legal pages. Loaded after site.css, so tokens, header, footer and focus rings are shared.
   Structure and section rhythm follow the nCryptic reference suite; the palette is CybrGate's. */

.legal-page { padding: clamp(32px, 5vw, 64px) 0 clamp(72px, 9vw, 120px); }
.legal-layout {
  display: grid; grid-template-columns: 260px minmax(0, 74ch); gap: 0 clamp(32px, 5vw, 72px);
  align-items: start; justify-content: start;
}

/* contents panel */
.toc {
  position: sticky; top: 88px; max-height: calc(100vh - 110px); overflow-y: auto;
  border: 1px solid var(--line); border-radius: var(--r-lg);
  background: color-mix(in srgb, var(--field-2) 86%, transparent);
  padding: 20px 20px 14px;
}
.toc summary { cursor: pointer; list-style: none; min-height: 44px; display: flex; align-items: center; justify-content: space-between;
  font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-text); }
.toc summary::-webkit-details-marker { display: none; }
.toc summary::after { content: "+"; font-size: 1.1rem; }
.toc[open] summary::after { content: "\2212"; }
.toc ol { list-style: none; margin: 6px 0 0; padding: 0; display: flex; flex-direction: column; }
.toc a {
  display: block; padding: 6px 10px; margin: 0 -10px; font-size: 0.875rem; line-height: 1.35;
  color: var(--muted); text-decoration: none; border-left: 2px solid transparent; border-radius: 0 var(--r-sm) var(--r-sm) 0;
  min-height: 32px; transition: color 0.16s var(--ease), border-color 0.16s var(--ease), background 0.16s var(--ease);
}
.toc a:hover, .toc a:focus-visible { color: var(--paper); background: var(--line); border-left-color: var(--ink); }

/* document */
.legal-doc { min-width: 0; }
.doc-kicker { font-family: var(--mono); font-size: 0.75rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--ink-text); margin-bottom: 16px; }
.doc-title { font-family: var(--serif); font-weight: 400; font-size: clamp(2.6rem, 6vw, 4.6rem); line-height: 0.98; letter-spacing: -0.02em; max-width: 16ch; }
.doc-dates { margin: 20px 0 0; display: flex; gap: 8px 24px; flex-wrap: wrap; font-family: var(--mono); font-size: 0.8125rem; color: var(--muted-dim); }
.doc-intro { margin-top: 26px; font-size: 1.125rem; color: var(--muted); max-width: 66ch; }
.doc-intro strong { color: var(--paper); }

.short-version { margin-top: 36px; position: relative; border: 1px solid var(--line-strong); border-radius: var(--r-lg); padding: 24px 28px;
  background: linear-gradient(155deg, color-mix(in srgb, var(--ink) 10%, var(--field-2)), var(--field-2) 60%); overflow: hidden; }
.short-version::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: linear-gradient(180deg, var(--ink), transparent); }
.short-version h2 { font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-text); font-weight: 500; }
.short-version ul { margin: 14px 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 10px; }
.short-version li { position: relative; padding-left: 24px; color: var(--paper); font-size: 1rem; }
.short-version li::before { content: ""; position: absolute; left: 0; top: 0.8em; width: 12px; height: 2px; background: var(--ink); }

.legal-doc section { margin-top: 60px; padding-top: 30px; border-top: 1px solid var(--line); position: relative; scroll-margin-top: 92px; }
.legal-doc section::before { content: ""; position: absolute; top: -1px; left: 0; width: 72px; height: 1px; background: var(--ink); }
.legal-doc section:target > h2 { color: var(--ink-text); }
.legal-doc section > h2 { font-family: var(--serif); font-weight: 400; font-size: 2rem; line-height: 1.1; letter-spacing: -0.01em; display: flex; align-items: baseline; gap: 14px; }
.legal-doc section > h2 .num { font-family: var(--mono); font-size: 0.85rem; color: var(--muted-dim); flex: none; }
.legal-doc section > h2 a.anchor { font-family: var(--mono); font-size: 0.9rem; color: var(--muted-dim); text-decoration: none; opacity: 0; min-width: 24px; min-height: 24px; display: inline-flex; align-items: center; justify-content: center; }
.legal-doc section:hover > h2 a.anchor, .legal-doc section > h2 a.anchor:focus-visible { opacity: 1; }
.legal-doc h3 { font-family: var(--sans); font-weight: 700; font-size: 1.05rem; margin: 28px 0 6px; color: var(--paper); letter-spacing: 0; }
.legal-doc p { margin: 14px 0 0; color: var(--muted); }
.legal-doc p strong, .legal-doc li strong { color: var(--paper); }
.legal-doc ul, .legal-doc ol.list { margin: 14px 0 0; padding-left: 22px; display: flex; flex-direction: column; gap: 8px; color: var(--muted); }
.legal-doc li::marker { color: var(--ink-text); }
.legal-doc .caps { text-transform: uppercase; letter-spacing: 0.01em; font-size: 0.95rem; }
.legal-doc .table-wrap { margin-top: 20px; }
.legal-doc table { min-width: 720px; font-size: 0.85rem; }
.legal-doc td, .legal-doc th { padding: 11px 14px; }
.legal-doc td strong { color: var(--paper); }
.legal-doc .callout { margin-top: 20px; }
.legal-doc .callout p { margin: 0; color: var(--muted); }
.legal-doc .callout p + p { margin-top: 10px; }
.legal-doc dl.facts { margin: 18px 0 0; display: grid; grid-template-columns: 12rem minmax(0, 1fr); gap: 0; border-top: 1px solid var(--line); }
.legal-doc dl.facts dt, .legal-doc dl.facts dd { padding: 11px 0; border-bottom: 1px solid var(--line); margin: 0; }
.legal-doc dl.facts dt { font-family: var(--mono); font-size: 0.75rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted-dim); padding-top: 14px; }
.legal-doc dl.facts dd { color: var(--paper); }

/* policies index */
.policy-index { list-style: none; margin: 40px 0 0; padding: 0; counter-reset: p; border-top: 1px solid var(--line); }
.policy-index li { counter-increment: p; display: grid; grid-template-columns: 3.2rem minmax(0, 1fr); gap: 2px 8px; padding: 22px 0; border-bottom: 1px solid var(--line); position: relative; }
.policy-index li::before { content: counter(p, decimal-leading-zero); font-family: var(--mono); font-size: 0.78rem; color: var(--ink-text); padding-top: 8px; grid-row: 1 / span 2; }
.policy-index a { font-family: var(--serif); font-size: 1.9rem; line-height: 1.1; color: var(--paper); text-decoration: none; display: inline-block; min-height: 44px; }
.policy-index a:hover { color: var(--ink-text); text-decoration: underline; }
.policy-index p { margin: 0; color: var(--muted); font-size: 0.95rem; }
.policy-index .when { font-family: var(--mono); font-size: 0.75rem; color: var(--muted-dim); margin-top: 4px; }

#gpc-status { margin-top: 16px; }

@media (max-width: 960px) {
  .legal-layout { grid-template-columns: minmax(0, 1fr); }
  .toc { position: static; max-height: none; margin-bottom: 36px; }
  .legal-doc dl.facts { grid-template-columns: 1fr; }
  .legal-doc dl.facts dt { border-bottom: 0; padding-bottom: 0; }
}
@media (max-width: 520px) {
  .legal-doc section > h2 { font-size: 1.65rem; }
  .short-version { padding: 20px; }
}
