/* CodeConstitutions — legal pages (privacy, terms)
   Premium dark theme, sharp corners, lightweight. */

@font-face {
  font-family: 'Salmond';
  src:
    url('../../Fonts/Salmond.woff') format('woff'),
    url('Salmond.ttf') format('truetype'),
    url('../../Fonts/Salmond.ttf') format('truetype'),
    url('../../Fonts/Salmond.otf') format('opentype');
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

:root {
  --cc-bg: #0e0e11;
  --cc-surface: #141418;
  --cc-elevated: #1a1a20;
  --cc-border: #2a2a32;
  --cc-border-strong: #3a3a44;
  --cc-text: #e4e4ec;
  --cc-text-muted: #9a9aa8;
  --cc-text-dim: #6a6a78;
  --cc-cyan: #00d4ff;
  --cc-magenta: #e535ab;
  --cc-lime: #a3e635;
  --cc-accent: #00d4ff;
  --cc-topbar-h: 52px;
  --cc-font-display: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --cc-font-body: 'Salmond', 'Inter', 'Segoe UI', system-ui, sans-serif;
  --cc-max: 920px;
  --cc-ease: cubic-bezier(0.22, 0.68, 0, 1);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--cc-topbar-h) + 12px);
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

.cc-legal-body {
  margin: 0;
  min-height: 100vh;
  background: var(--cc-bg);
  color: var(--cc-text);
  font-family: var(--cc-font-body);
  font-size: 17px;
  line-height: 1.65;
  letter-spacing: 0.02em;
  -webkit-font-smoothing: antialiased;
}

@media (max-width: 640px) {
  .cc-legal-body {
    font-size: 16px;
  }
}

/* Skip link */
.cc-legal-skip {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  padding: 0.5rem 1rem;
  background: var(--cc-surface);
  color: var(--cc-cyan);
  text-decoration: none;
  border: 1px solid var(--cc-border);
  border-radius: 0;
}
.cc-legal-skip:focus {
  left: 0.75rem;
  top: 0.75rem;
}
.cc-legal-skip:focus-visible {
  outline: 2px solid var(--cc-cyan);
  outline-offset: 2px;
}

/* Brand wordmark */
.cc-legal-brand {
  font-family: var(--cc-font-display);
  font-weight: 800;
  letter-spacing: -0.03em;
  font-size: 1.05rem;
  text-decoration: none;
  color: var(--cc-text);
  background: linear-gradient(105deg, var(--cc-cyan) 0%, var(--cc-magenta) 55%, var(--cc-lime) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  white-space: nowrap;
}
.cc-legal-brand:hover {
  opacity: 0.88;
}
.cc-legal-brand:focus-visible {
  outline: 2px solid var(--cc-cyan);
  outline-offset: 3px;
  border-radius: 0;
}
.cc-legal-topbar__inner > .cc-legal-brand {
  flex-shrink: 0;
}

/* Slim top bar */
.cc-legal-topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--cc-topbar-h);
  border-bottom: 1px solid var(--cc-border);
  background: rgba(14, 14, 17, 0.98);
}

.cc-legal-topbar__inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.25rem;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.cc-legal-topbar__toggle {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--cc-border);
  background: var(--cc-surface);
  color: var(--cc-text);
  cursor: pointer;
  border-radius: 0;
}
.cc-legal-topbar__toggle:focus-visible {
  outline: 2px solid var(--cc-cyan);
  outline-offset: 2px;
}
.cc-legal-topbar__toggle-bar {
  display: block;
  width: 18px;
  height: 2px;
  background: currentColor;
  margin: 3px 0;
  border-radius: 0;
}

.cc-legal-topbar__nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex-wrap: nowrap;
}

.cc-legal-topbar__nav a {
  font-family: var(--cc-font-display);
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--cc-text-muted);
  text-decoration: none;
  padding: 0.45rem 0.65rem;
  border: 1px solid transparent;
  border-radius: 0;
  white-space: nowrap;
  transition: color 0.15s var(--cc-ease), border-color 0.15s var(--cc-ease);
}
.cc-legal-topbar__nav a:hover {
  color: var(--cc-text);
  border-color: var(--cc-border);
  background: var(--cc-surface);
}
.cc-legal-topbar__nav a:focus-visible {
  outline: 2px solid var(--cc-cyan);
  outline-offset: 2px;
}
.cc-legal-topbar__nav a.cc-legal-topbar__nav--current {
  color: var(--cc-cyan);
  border-color: rgba(0, 212, 255, 0.25);
  background: rgba(0, 212, 255, 0.06);
}

@media (max-width: 900px) and (min-width: 721px) {
  .cc-legal-topbar__nav a {
    font-size: 0.75rem;
    padding: 0.42rem 0.55rem;
  }
}

@media (max-width: 720px) {
  .cc-legal-topbar__toggle {
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
  }
  .cc-legal-topbar__nav {
    position: fixed;
    top: var(--cc-topbar-h);
    left: 0;
    right: 0;
    z-index: 60;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 0.5rem 1rem 1rem;
    background: var(--cc-bg);
    border-bottom: 1px solid var(--cc-border);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
    transform: translateY(-100%);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: transform 0.2s var(--cc-ease), opacity 0.2s var(--cc-ease), visibility 0.2s;
  }
  .cc-legal-topbar__nav.is-open {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }
  .cc-legal-topbar__nav a {
    padding: 0.85rem 1rem;
    min-height: 44px;
    display: flex;
    align-items: center;
    border: 1px solid var(--cc-border);
    border-bottom: none;
    background: var(--cc-surface);
  }
  .cc-legal-topbar__nav a:last-child {
    border-bottom: 1px solid var(--cc-border);
  }
}

@media (prefers-reduced-motion: reduce) {
  .cc-legal-topbar__nav {
    transition: none;
  }
}

/* Hero */
.cc-legal-hero {
  max-width: var(--cc-max);
  margin: 0 auto;
  padding: 2rem 1.25rem 1.5rem;
  border-bottom: 1px solid var(--cc-border);
}

.cc-legal-hero__eyebrow {
  font-family: var(--cc-font-display);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--cc-cyan);
  margin: 0 0 0.65rem;
}

.cc-legal-hero__title {
  font-family: var(--cc-font-display);
  font-size: clamp(1.65rem, 4vw, 2.15rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin: 0 0 0.75rem;
  color: var(--cc-text);
  background: linear-gradient(90deg, var(--cc-text) 0%, #c8dcf0 40%, var(--cc-text) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.cc-legal-hero__intro {
  margin: 0 0 1.25rem;
  color: var(--cc-text-muted);
  max-width: 52ch;
  font-size: 0.98rem;
  line-height: 1.6;
}

.cc-legal-hero__intro a {
  color: #5ee7ff;
  text-decoration: none;
  border-bottom: 1px solid rgba(0, 212, 255, 0.35);
}
.cc-legal-hero__intro a:hover {
  color: #9ef0ff;
  border-bottom-color: rgba(158, 240, 255, 0.5);
}
.cc-legal-hero__intro a:focus-visible {
  outline: 2px solid var(--cc-cyan);
  outline-offset: 2px;
}

.cc-legal-hero__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.cc-legal-badge {
  font-family: var(--cc-font-display);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.35rem 0.65rem;
  border: 1px solid var(--cc-border);
  background: var(--cc-surface);
  color: var(--cc-text-muted);
  border-radius: 0;
}
.cc-legal-badge--accent {
  border-color: rgba(0, 212, 255, 0.28);
  color: var(--cc-cyan);
  background: rgba(0, 212, 255, 0.06);
}

/* Layout: TOC + article */
.cc-legal-wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem 1.25rem 3rem;
}

.cc-legal-layout {
  display: grid;
  grid-template-columns: minmax(200px, 230px) minmax(0, 1fr);
  gap: 2.5rem;
  align-items: start;
}

@media (max-width: 880px) {
  .cc-legal-layout {
    grid-template-columns: 1fr;
    gap: 1.75rem;
  }
}

/* TOC */
.cc-legal-toc {
  position: sticky;
  top: calc(var(--cc-topbar-h) + 1rem);
  align-self: start;
  max-height: calc(100vh - var(--cc-topbar-h) - 2rem);
  overflow-y: auto;
  padding: 0.75rem 0;
  border: 1px solid var(--cc-border);
  background: var(--cc-surface);
  border-radius: 0;
}

@media (max-width: 880px) {
  .cc-legal-toc {
    position: relative;
    top: auto;
    max-height: none;
  }
}

.cc-legal-toc__label {
  font-family: var(--cc-font-display);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--cc-text-dim);
  margin: 0 0 0.65rem;
  padding: 0 1rem;
}

.cc-legal-toc nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.cc-legal-toc a {
  display: block;
  padding: 0.45rem 1rem;
  font-family: var(--cc-font-display);
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--cc-text-muted);
  text-decoration: none;
  border-left: 2px solid transparent;
  border-radius: 0;
  transition: color 0.12s var(--cc-ease), border-color 0.12s var(--cc-ease), background 0.12s var(--cc-ease);
}
.cc-legal-toc a:hover {
  color: var(--cc-text);
  background: var(--cc-elevated);
}
.cc-legal-toc a:focus-visible {
  outline: 2px solid var(--cc-cyan);
  outline-offset: -2px;
}
.cc-legal-toc a.is-active {
  color: var(--cc-text);
  border-left-color: var(--cc-cyan);
  background: rgba(0, 212, 255, 0.06);
}

/* Long TOC (Terms): tighter rhythm, still readable */
.cc-legal-toc--dense a {
  padding-top: 0.32rem;
  padding-bottom: 0.32rem;
  font-size: 0.78125rem;
  line-height: 1.35;
}
@media (min-width: 881px) {
  .cc-legal-toc--dense {
    max-height: calc(100vh - var(--cc-topbar-h) - 1.5rem);
  }
}

/* Article */
.cc-legal-main {
  min-width: 0;
}

.cc-legal-article {
  max-width: 52rem;
}

.cc-legal-article section {
  scroll-margin-top: calc(var(--cc-topbar-h) + 14px);
  padding-bottom: 2rem;
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--cc-border);
}

.cc-legal-article section:last-of-type {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.cc-legal-article h2 {
  font-family: var(--cc-font-display);
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0 0 1rem;
  color: #e8eaf4;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(0, 212, 255, 0.18);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04);
}

.cc-legal-article h3 {
  font-family: var(--cc-font-display);
  font-size: 1rem;
  font-weight: 700;
  margin: 1.5rem 0 0.65rem;
  color: #c4d0e8;
}

.cc-legal-article p {
  margin: 0 0 1rem;
  color: var(--cc-text-muted);
}

.cc-legal-article ul,
.cc-legal-article ol {
  margin: 0 0 1rem;
  padding-left: 1.35rem;
  color: var(--cc-text-muted);
}

.cc-legal-article li {
  margin-bottom: 0.4rem;
}

.cc-legal-article a {
  color: #5ee7ff;
  text-decoration: none;
  border-bottom: 1px solid rgba(0, 212, 255, 0.28);
  text-underline-offset: 0.15em;
}
.cc-legal-article a:hover {
  color: #9ef0ff;
  border-bottom-color: rgba(158, 240, 255, 0.45);
}
.cc-legal-article a:focus-visible {
  outline: 2px solid var(--cc-cyan);
  outline-offset: 2px;
  border-radius: 0;
}

.cc-legal-placeholder-note {
  font-size: 0.875rem;
  color: var(--cc-text-dim);
  font-style: italic;
  padding: 0.75rem 1rem;
  border: 1px dashed var(--cc-border-strong);
  background: var(--cc-elevated);
  margin-bottom: 1rem;
  border-radius: 0;
}

/* Callout: read with checkout / cookie notices */
.cc-legal-clarity {
  margin: 1rem 0 1.5rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--cc-border);
  border-left: 3px solid var(--cc-cyan);
  background: var(--cc-surface);
  font-size: 0.9375rem;
  line-height: 1.55;
  color: var(--cc-text-muted);
  border-radius: 0;
}

/* Final contact block inside article */
.cc-legal-article__contact {
  padding-top: 0.25rem;
  margin-top: 0.5rem;
  border-bottom: none;
}
.cc-legal-article__contact h2 {
  border-bottom-color: rgba(0, 212, 255, 0.2);
}

/* Contact block */
.cc-legal-contact {
  max-width: var(--cc-max);
  margin: 0 auto;
  padding: 2rem 1.25rem 3rem;
  border-top: 1px solid var(--cc-border);
}

.cc-legal-contact__inner {
  padding: 1.25rem 1.35rem;
  border: 1px solid var(--cc-border);
  background: var(--cc-surface);
  border-radius: 0;
}

.cc-legal-contact__title {
  font-family: var(--cc-font-display);
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--cc-cyan);
  margin: 0 0 0.65rem;
}

.cc-legal-contact p {
  margin: 0 0 0.75rem;
  color: var(--cc-text-muted);
  font-size: 0.9375rem;
}

.cc-legal-contact a {
  color: var(--cc-cyan);
  text-decoration: none;
  font-weight: 600;
  border-bottom: 1px solid rgba(0, 212, 255, 0.35);
}
.cc-legal-contact a:hover {
  color: #5ee7ff;
  border-bottom-color: rgba(94, 231, 255, 0.55);
}
.cc-legal-contact a:focus-visible {
  outline: 2px solid var(--cc-cyan);
  outline-offset: 2px;
}

/* Footer */
.cc-legal-footer {
  border-top: 1px solid var(--cc-border);
  padding: 1.5rem 1.25rem;
  background: var(--cc-surface);
}

.cc-legal-footer__inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.cc-legal-footer__brand {
  font-family: var(--cc-font-display);
  font-weight: 800;
  font-size: 0.9375rem;
  text-decoration: none;
}
a.cc-legal-footer__brand:focus-visible {
  outline: 2px solid var(--cc-cyan);
  outline-offset: 3px;
}

.cc-legal-footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.cc-legal-footer__links a {
  font-family: var(--cc-font-display);
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--cc-text-muted);
  text-decoration: none;
}
.cc-legal-footer__links a:hover {
  color: var(--cc-cyan);
}
.cc-legal-footer__links a:focus-visible {
  outline: 2px solid var(--cc-cyan);
  outline-offset: 2px;
}

.cc-legal-footer__note {
  width: 100%;
  margin: 0;
  font-size: 0.75rem;
  color: var(--cc-text-dim);
  line-height: 1.5;
}
