:root {
  color-scheme: dark;
  --offmat-bg: #050505;
  --offmat-surface: #0e0e0e;
  --offmat-surface-elevated: #161616;
  --offmat-red: #e63946;
  --offmat-red-light: #ff4d5a;
  --offmat-text: #f5f5f7;
  --offmat-muted: #a1a1a6;
  --offmat-border: #2a2a2d;
  --offmat-tint: #fdecdf;
  --font-system: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--offmat-bg);
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  background:
    radial-gradient(circle at 84% -12%, rgba(230, 57, 70, 0.12), transparent 30rem),
    var(--offmat-bg);
  color: var(--offmat-text);
  font-family: var(--font-system);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a {
  color: inherit;
}

a:focus-visible,
button:focus-visible {
  outline: 3px solid var(--offmat-red-light);
  outline-offset: 4px;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 20;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--offmat-text);
  color: var(--offmat-bg);
  font-weight: 800;
  text-decoration: none;
  transform: translateY(-160%);
  transition: transform 160ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(5, 5, 5, 0.88);
  backdrop-filter: blur(16px) saturate(150%);
  -webkit-backdrop-filter: blur(16px) saturate(150%);
}

.header-inner,
.legal-shell,
.site-footer-inner {
  width: min(100% - 48px, 900px);
  margin: 0 auto;
}

.header-inner {
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.brand-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  color: var(--offmat-text);
  font-size: 0.94rem;
  font-weight: 900;
  letter-spacing: -0.02em;
  text-decoration: none;
}

.brand-link img {
  width: 30px;
  height: 30px;
  object-fit: contain;
  filter: contrast(1.06) saturate(1.06);
}

.back-link,
.footer-link {
  color: var(--offmat-muted);
  font-size: 0.875rem;
  font-weight: 700;
  text-decoration: none;
  transition: color 160ms ease;
}

.back-link:hover,
.footer-link:hover {
  color: var(--offmat-text);
}

.legal-shell {
  padding: 72px 0 52px;
}

.legal-kicker {
  margin: 0 0 12px;
  color: var(--offmat-red-light);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  color: var(--offmat-text);
  font-weight: 850;
  letter-spacing: -0.035em;
  line-height: 1.05;
}

h1 {
  max-width: 760px;
  margin: 0;
  font-size: clamp(2.55rem, 8vw, 4.75rem);
}

.last-updated {
  margin: 18px 0 0;
  color: var(--offmat-muted);
  font-size: 0.95rem;
}

.intro {
  max-width: 760px;
  margin: 28px 0 0;
  color: #d4d4d8;
  font-size: 1.08rem;
}

.legal-alert {
  margin: 36px 0 42px;
  padding: 20px;
  border: 1px solid rgba(230, 57, 70, 0.7);
  border-radius: 16px;
  background: rgba(230, 57, 70, 0.1);
  box-shadow: 0 14px 44px rgba(0, 0, 0, 0.18);
}

.legal-alert strong {
  display: block;
  margin-bottom: 8px;
  color: #fff;
  font-size: 0.94rem;
}

.legal-alert p,
.legal-alert ul {
  margin: 0;
}

.legal-alert ul {
  margin-top: 10px;
  padding-left: 1.25rem;
}

.legal-alert code {
  padding: 0.12em 0.38em;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.9em;
}

.table-of-contents {
  margin: 0 0 48px;
  padding: 22px;
  border: 1px solid var(--offmat-border);
  border-radius: 16px;
  background: rgba(22, 22, 22, 0.72);
}

.table-of-contents h2 {
  margin: 0 0 12px;
  font-size: 1rem;
  letter-spacing: -0.015em;
}

.table-of-contents ol {
  columns: 2;
  gap: 30px;
  margin: 0;
  padding-left: 1.25rem;
}

.table-of-contents li {
  margin: 4px 0;
  break-inside: avoid;
}

.table-of-contents a {
  color: var(--offmat-muted);
  font-size: 0.9rem;
  text-decoration: none;
}

.table-of-contents a:hover {
  color: var(--offmat-text);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.legal-content {
  max-width: 780px;
}

.legal-section {
  scroll-margin-top: 100px;
  padding: 30px 0;
  border-top: 1px solid var(--offmat-border);
}

.legal-section:first-child {
  border-top: 0;
}

.legal-section h2 {
  margin: 0 0 14px;
  font-size: clamp(1.35rem, 4vw, 1.78rem);
}

.legal-section h3 {
  margin: 22px 0 8px;
  font-size: 1.08rem;
}

.legal-section p,
.legal-section li {
  color: #d0d0d4;
}

.legal-section p {
  margin: 0 0 14px;
}

.legal-section ul,
.legal-section ol {
  margin: 0 0 14px;
  padding-left: 1.3rem;
}

.legal-section li + li {
  margin-top: 8px;
}

.legal-section a {
  color: #fff;
  font-weight: 700;
  text-decoration-color: rgba(230, 57, 70, 0.8);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

.legal-section a:hover {
  color: var(--offmat-red-light);
}

.info-card {
  margin: 18px 0;
  padding: 20px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  background: var(--offmat-surface-elevated);
}

.info-card h3 {
  margin-top: 0;
}

.path {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 4px 0;
  color: #fff;
  font-weight: 800;
  letter-spacing: -0.015em;
}

.path-separator {
  color: var(--offmat-red-light);
}

.contact-box {
  margin-top: 18px;
  padding: 20px;
  border-left: 3px solid var(--offmat-red);
  border-radius: 0 14px 14px 0;
  background: rgba(230, 57, 70, 0.08);
}

.contact-box p:last-child,
.info-card p:last-child {
  margin-bottom: 0;
}

.site-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.09);
  background: rgba(0, 0, 0, 0.28);
}

.site-footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  padding: 28px 0 calc(32px + env(safe-area-inset-bottom));
}

.footer-brand {
  margin: 0;
  color: var(--offmat-muted);
  font-size: 0.8rem;
}

.footer-brand strong {
  color: var(--offmat-text);
  letter-spacing: -0.01em;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 14px 22px;
}

@media (max-width: 640px) {
  .header-inner,
  .legal-shell,
  .site-footer-inner {
    width: min(100% - 40px, 900px);
  }

  .header-inner {
    min-height: 62px;
  }

  .back-link {
    font-size: 0.8rem;
  }

  .legal-shell {
    padding: 52px 0 38px;
  }

  h1 {
    font-size: clamp(2.35rem, 13vw, 3.3rem);
  }

  .intro {
    font-size: 1rem;
  }

  .legal-alert,
  .table-of-contents,
  .info-card,
  .contact-box {
    padding: 18px;
  }

  .table-of-contents ol {
    columns: 1;
  }

  .site-footer-inner {
    align-items: flex-start;
    flex-direction: column;
  }

  .footer-links {
    justify-content: flex-start;
  }
}

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

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
