/* ============================================
   Brevy Legal Pages — Shared Stylesheet
   ============================================ */

/* ---------- Reset & Base ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
    Oxygen, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif;
  background: #0a0a0a;
  color: #e0e0e0;
  line-height: 1.7;
  font-size: 16px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: #0DE099;
  text-decoration: none;
  transition: color 0.2s ease;
}
a:hover {
  color: #0fc98a;
  text-decoration: underline;
}

img {
  max-width: 100%;
  height: auto;
}

/* ---------- Typography ---------- */
h1 {
  font-size: 2.25rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.25;
  margin-bottom: 0.5rem;
}

h2 {
  font-size: 1.625rem;
  font-weight: 600;
  color: #fff;
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

h3 {
  font-size: 1.25rem;
  font-weight: 600;
  color: #fff;
  margin-top: 1.75rem;
  margin-bottom: 0.75rem;
}

h4 {
  font-size: 1.1rem;
  font-weight: 600;
  color: #fff;
  margin-top: 1.25rem;
  margin-bottom: 0.5rem;
}

p {
  margin-bottom: 1rem;
  color: #999;
}

strong {
  color: #e0e0e0;
  font-weight: 600;
}

/* ---------- Sticky Navigation ---------- */
.top-nav {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(10, 10, 10, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
}

.brand-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: #0DE099;
  color: #0a0a0a;
  font-weight: 700;
  font-size: 1rem;
  border-radius: 8px;
}

.brand-name {
  font-weight: 700;
  font-size: 1.125rem;
  color: #fff;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.nav-link {
  color: #999;
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  transition: color 0.2s ease;
}
.nav-link:hover {
  color: #fff;
  text-decoration: none;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1.125rem;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: all 0.2s ease;
}

.btn-primary {
  background: #0DE099;
  color: #0a0a0a;
}
.btn-primary:hover {
  background: #0fc98a;
  color: #0a0a0a;
  text-decoration: none;
}

.mobile-menu-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}
.mobile-menu-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: #fff;
  border-radius: 2px;
  transition: 0.3s;
}
.mobile-menu-toggle.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}
.mobile-menu-toggle.active span:nth-child(2) {
  opacity: 0;
}
.mobile-menu-toggle.active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* ---------- Effective Date Badge ---------- */
.date-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  background: rgba(13, 224, 153, 0.1);
  color: #0DE099;
  font-size: 0.8125rem;
  font-weight: 600;
  padding: 0.375rem 0.875rem;
  border-radius: 20px;
  border: 1px solid rgba(13, 224, 153, 0.2);
  margin-bottom: 1rem;
}

/* ---------- Layout ---------- */
.legal-wrapper {
  display: flex;
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
  gap: 3rem;
  flex: 1;
}

/* ---------- Table of Contents Sidebar ---------- */
.toc-aside {
  width: 240px;
  flex-shrink: 0;
}

.toc-sidebar {
  position: sticky;
  top: 88px;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
}

.toc-sidebar h3 {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #666;
  margin-bottom: 0.75rem;
  margin-top: 0;
  border: none;
  padding-bottom: 0;
}

.toc-sidebar ul {
  list-style: none;
  padding: 0;
}

.toc-sidebar li {
  margin-bottom: 0.125rem;
}

.toc-sidebar a {
  display: block;
  padding: 0.375rem 0.75rem;
  color: #999;
  font-size: 0.8125rem;
  font-weight: 500;
  border-radius: 6px;
  text-decoration: none;
  transition: all 0.2s ease;
  border-left: 2px solid transparent;
}

.toc-sidebar a:hover {
  color: #0DE099;
  background: rgba(13, 224, 153, 0.05);
  text-decoration: none;
}

.toc-sidebar a.active {
  color: #0DE099;
  background: rgba(13, 224, 153, 0.08);
  border-left-color: #0DE099;
}

/* ---------- Main Content Area ---------- */
.legal-main {
  flex: 1;
  min-width: 0;
}

.legal-header {
  margin-bottom: 2rem;
}

.legal-header h1 {
  margin-bottom: 0.5rem;
}

.legal-header .subtitle {
  color: #666;
  font-size: 1rem;
}

.legal-content {
  color: #ccc;
}

.legal-content section {
  margin-bottom: 2.5rem;
  scroll-margin-top: 80px;
}

.legal-content h2 {
  scroll-margin-top: 80px;
}

/* ---------- Paragraphs, Lists ---------- */
.legal-content p {
  color: #bbb;
  line-height: 1.8;
}

.legal-content ul,
.legal-content ol {
  margin-bottom: 1rem;
  padding-left: 1.5rem;
}

.legal-content li {
  margin-bottom: 0.5rem;
  color: #bbb;
  line-height: 1.7;
}

.legal-content ul li::marker {
  color: #0DE099;
}

.legal-content ol li::marker {
  color: #0DE099;
  font-weight: 600;
}

/* ---------- Tables ---------- */
.legal-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  background: #111;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.legal-content thead th {
  background: #1a1a1a;
  color: #fff;
  font-weight: 600;
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.875rem 1.25rem;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.legal-content tbody td {
  padding: 0.875rem 1.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  color: #bbb;
  font-size: 0.9375rem;
}

.legal-content tbody tr:last-child td {
  border-bottom: none;
}

.legal-content tbody tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

/* ---------- Blockquotes / Callouts ---------- */
.legal-content blockquote,
.callout {
  background: rgba(13, 224, 153, 0.06);
  border-left: 3px solid #0DE099;
  border-radius: 0 8px 8px 0;
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
  color: #ccc;
}

.callout p:last-child {
  margin-bottom: 0;
}

/* ---------- Inline Code ---------- */
.legal-content code {
  background: #1a1a1a;
  color: #0DE099;
  padding: 0.125rem 0.375rem;
  border-radius: 4px;
  font-size: 0.875em;
  font-family: 'Fira Code', 'Cascadia Code', 'JetBrains Mono', monospace;
}

/* ---------- Back to Top ---------- */
.back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 44px;
  height: 44px;
  background: #0DE099;
  color: #0a0a0a;
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(13, 224, 153, 0.3);
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  z-index: 999;
  font-size: 1.25rem;
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
}

.back-to-top:hover {
  background: #0fc98a;
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(13, 224, 153, 0.4);
}

/* ---------- Footer ---------- */
.site-footer {
  background: #111;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding: 3.5rem 0 0;
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem 2.5rem;
  display: flex;
  gap: 4rem;
}

.footer-brand {
  flex: 0 0 280px;
}

.footer-brand p {
  margin-top: 0.75rem;
  font-size: 0.875rem;
  color: #666;
}

.footer-links {
  flex: 1;
  display: flex;
  gap: 3rem;
  flex-wrap: wrap;
}

.footer-column {
  min-width: 120px;
}

.footer-column h4 {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #666;
  margin-bottom: 1rem;
}

.footer-column a {
  display: block;
  color: #999;
  font-size: 0.875rem;
  margin-bottom: 0.5rem;
  text-decoration: none;
  transition: color 0.2s;
}

.footer-column a:hover {
  color: #0DE099;
  text-decoration: none;
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.footer-bottom p {
  font-size: 0.8125rem;
  color: #666;
}

.social-links {
  display: flex;
  gap: 1rem;
}

.social-links a {
  color: #666;
  transition: color 0.2s;
}

.social-links a:hover {
  color: #0DE099;
}

/* ---------- Section Anchors ---------- */
section[id] {
  scroll-margin-top: 80px;
}

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .toc-aside {
    display: none;
  }

  .legal-wrapper {
    padding: 1.5rem 1.25rem 3rem;
    gap: 0;
  }
}

@media (max-width: 768px) {
  h1 {
    font-size: 1.75rem;
  }

  h2 {
    font-size: 1.375rem;
  }

  h3 {
    font-size: 1.125rem;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: #111;
    flex-direction: column;
    padding: 1rem 1.5rem;
    gap: 0.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  }

  .nav-links.mobile-open {
    display: flex;
  }

  .mobile-menu-toggle {
    display: flex;
  }

  .legal-content table {
    display: block;
    overflow-x: auto;
  }

  .footer-content {
    flex-direction: column;
    gap: 2rem;
  }

  .footer-brand {
    flex: none;
  }

  .footer-links {
    gap: 2rem;
  }

  .footer-bottom {
    flex-direction: column;
    gap: 0.75rem;
    text-align: center;
  }
}

@media (max-width: 480px) {
  h1 {
    font-size: 1.5rem;
  }

  .legal-wrapper {
    padding: 1rem 1rem 2.5rem;
  }

  .legal-content table {
    font-size: 0.8125rem;
  }

  .legal-content thead th,
  .legal-content tbody td {
    padding: 0.625rem 0.75rem;
  }
}

/* ---------- Print Styles ---------- */
@media print {
  body {
    background: #fff;
    color: #000;
  }

  .top-nav,
  .site-footer,
  .toc-aside,
  .back-to-top,
  .mobile-menu-toggle {
    display: none !important;
  }

  .legal-wrapper {
    display: block;
    padding: 0;
    max-width: none;
  }

  .legal-main {
    width: 100%;
  }

  .legal-content h1,
  .legal-content h2,
  .legal-content h3,
  .legal-content h4 {
    color: #000;
    border-bottom-color: #ccc;
  }

  .legal-content p,
  .legal-content li {
    color: #333;
  }

  .legal-content a {
    color: #000;
    text-decoration: underline;
  }

  .legal-content a::after {
    content: " (" attr(href) ")";
    font-size: 0.75rem;
    color: #666;
  }

  .legal-content table {
    border: 1px solid #ccc;
  }

  .legal-content thead th {
    background: #f0f0f0;
    color: #000;
  }

  .legal-content tbody td {
    color: #333;
  }

  .date-badge {
    border: 1px solid #0DE099;
    color: #0a7a4d;
    background: rgba(13, 224, 153, 0.05);
  }

  .callout {
    border-left-color: #0a7a4d;
    background: #f5f5f5;
  }
}
