/* ═══════════════════════════════════════════════════════════
   RentAI Legal Pages — legal.css
   XI Ventures, Inc. d/b/a RentAI
   ═══════════════════════════════════════════════════════════ */

:root {
  --white: #fafaf8;
  --ink: #111110;
  --ink-secondary: #3f3f3e;
  --rule: #e8e4dc;
  --rule-mid: #d0ccc4;
  --surface: #f4f1eb;
  --gold-display: #b8902a;
  --gold-text: #8B6914;
  --gold-hover: #7a5c10;
}

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

body {
  background: var(--white);
  color: var(--ink);
  font-family: 'Syne', sans-serif;
  font-size: 1rem;
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

a { color: var(--gold-text); text-decoration: none; transition: color 0.15s; }
a:hover { color: var(--gold-hover); }

/* ── Header ─────────────────────────────────────────────── */
.legal-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--white);
  border-bottom: 1px solid var(--rule);
}

.legal-header-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 1.25rem clamp(1.5rem, 5vw, 4rem);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.header-logo {
  font-family: 'DM Mono', monospace;
  font-size: .95rem;
  font-weight: 500;
  letter-spacing: .1em;
  color: var(--ink);
  text-decoration: none;
}

.logo-dot { color: var(--gold-display); }

.header-nav {
  display: flex;
  gap: 2rem;
}

.header-nav a {
  font-family: 'DM Mono', monospace;
  font-size: .7rem;
  font-weight: 500;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-secondary);
  text-decoration: none;
  transition: color 0.15s;
}

.header-nav a:hover { color: var(--ink); }

/* ── Breadcrumb ─────────────────────────────────────────── */
.breadcrumb {
  border-bottom: 1px solid var(--rule);
  background: var(--surface);
}

.breadcrumb-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: .6rem clamp(1.5rem, 5vw, 4rem);
  font-family: 'DM Mono', monospace;
  font-size: .65rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink-secondary);
}

.breadcrumb a { color: var(--ink-secondary); }
.breadcrumb a:hover { color: var(--ink); }
.breadcrumb-sep { margin: 0 .5rem; color: var(--rule-mid); }
.breadcrumb-current { color: var(--ink); }

/* ── Layout ─────────────────────────────────────────────── */
.legal-layout {
  max-width: 1280px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 0;
  min-height: calc(100vh - 200px);
}

/* ── Sidebar ────────────────────────────────────────────── */
.legal-sidebar {
  padding: 2.5rem clamp(1.5rem, 3vw, 2.5rem);
  border-right: 1px solid var(--rule);
  position: sticky;
  top: 60px;
  height: fit-content;
  max-height: calc(100vh - 60px);
  overflow-y: auto;
}

.sidebar-label {
  font-family: 'DM Mono', monospace;
  font-size: .6rem;
  font-weight: 500;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--gold-text);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: .65rem;
}

.sidebar-label::before {
  content: '';
  display: block;
  width: 1.5rem;
  height: 1px;
  background: var(--gold-text);
}

.sidebar-nav {
  list-style: none;
  margin-bottom: 2.5rem;
}

.sidebar-nav li { margin-bottom: .25rem; }

.sidebar-link {
  display: block;
  font-family: 'Syne', sans-serif;
  font-size: .85rem;
  color: var(--ink-secondary);
  padding: .5rem .75rem;
  border-left: 2px solid transparent;
  transition: all 0.15s;
}

.sidebar-link:hover {
  color: var(--ink);
  background: var(--surface);
}

.sidebar-link.active {
  color: var(--ink);
  border-left-color: var(--gold-text);
  background: var(--surface);
  font-weight: 500;
}

.sidebar-contact {
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
  margin-bottom: 1.5rem;
}

.sidebar-email {
  font-family: 'DM Mono', monospace;
  font-size: .75rem;
  color: var(--gold-text);
}

.btn-print {
  display: block;
  width: 100%;
  font-family: 'DM Mono', monospace;
  font-size: .7rem;
  font-weight: 500;
  letter-spacing: .1em;
  text-transform: uppercase;
  text-align: center;
  padding: .65rem 1rem;
  background: transparent;
  color: var(--ink-secondary);
  border: 1px solid var(--rule-mid);
  cursor: pointer;
  transition: all 0.15s;
}

.btn-print:hover {
  background: var(--ink);
  color: var(--white);
  border-color: var(--ink);
}

/* ── Content ────────────────────────────────────────────── */
.legal-content {
  padding: 3rem clamp(2rem, 5vw, 4rem) 5rem;
  max-width: 800px;
}

.legal-content h1 {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(2rem, 4vw, 2.75rem);
  font-weight: 300;
  line-height: 1.15;
  color: var(--ink);
  margin-bottom: .5rem;
}

.legal-content .doc-meta {
  font-family: 'DM Mono', monospace;
  font-size: .65rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink-secondary);
  margin-bottom: 2.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--rule);
}

.legal-content h2 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.5rem;
  font-weight: 400;
  color: var(--ink);
  margin-top: 3rem;
  margin-bottom: 1rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
  scroll-margin-top: 80px;
}

.legal-content h3 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.15rem;
  font-weight: 500;
  color: var(--ink);
  margin-top: 2rem;
  margin-bottom: .75rem;
  scroll-margin-top: 80px;
}

.legal-content h4 {
  font-family: 'DM Mono', monospace;
  font-size: .75rem;
  font-weight: 500;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--gold-text);
  margin-top: 1.5rem;
  margin-bottom: .5rem;
}

.legal-content p {
  color: var(--ink-secondary);
  font-size: .95rem;
  line-height: 1.85;
  margin-bottom: 1rem;
}

.legal-content ul,
.legal-content ol {
  color: var(--ink-secondary);
  font-size: .95rem;
  line-height: 1.85;
  margin-bottom: 1rem;
  padding-left: 1.5rem;
}

.legal-content li { margin-bottom: .35rem; }

.legal-content strong { color: var(--ink); font-weight: 600; }

.legal-content a { color: var(--gold-text); }
.legal-content a:hover { color: var(--gold-hover); }

/* Table of Contents */
.toc {
  background: var(--surface);
  border: 1px solid var(--rule);
  padding: 1.5rem 2rem;
  margin-bottom: 2.5rem;
}

.toc-label {
  font-family: 'DM Mono', monospace;
  font-size: .6rem;
  font-weight: 500;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--gold-text);
  margin-bottom: .75rem;
  display: flex;
  align-items: center;
  gap: .65rem;
}

.toc-label::before {
  content: '';
  display: block;
  width: 1.5rem;
  height: 1px;
  background: var(--gold-text);
}

.toc ol {
  list-style: none;
  padding-left: 0;
  margin-bottom: 0;
}

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

.toc a {
  font-family: 'Syne', sans-serif;
  font-size: .85rem;
  color: var(--ink-secondary);
  transition: color 0.15s;
}

.toc a:hover { color: var(--ink); }

.toc a.active-section {
  color: var(--gold-text);
  font-weight: 500;
}

/* Contact block */
.contact-block {
  background: var(--surface);
  border: 1px solid var(--rule);
  padding: 1.25rem 1.5rem;
  margin: 1.5rem 0;
}

.contact-block p {
  font-size: .85rem;
  margin-bottom: .35rem;
}

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

/* Definition list styling */
.legal-content dl {
  margin-bottom: 1rem;
}

.legal-content dt {
  font-weight: 600;
  color: var(--ink);
  font-size: .95rem;
  margin-top: .75rem;
}

.legal-content dd {
  color: var(--ink-secondary);
  font-size: .95rem;
  line-height: 1.85;
  margin-left: 1.5rem;
  margin-bottom: .5rem;
}

/* ── Footer ─────────────────────────────────────────────── */
.legal-footer {
  background: var(--ink);
  color: var(--white);
  border-top: 1px solid var(--rule);
}

.legal-footer-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 3rem clamp(1.5rem, 5vw, 4rem) 2rem;
}

.footer-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 3rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid rgba(250, 250, 248, 0.12);
}

.footer-logo {
  font-family: 'DM Mono', monospace;
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: .1em;
  color: var(--white);
}

.footer-tagline {
  font-family: 'DM Mono', monospace;
  font-size: .65rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: rgba(250, 250, 248, 0.5);
  margin-top: .35rem;
}

.footer-links {
  display: flex;
  gap: 4rem;
}

.footer-col {
  display: flex;
  flex-direction: column;
  gap: .35rem;
}

.footer-col-label {
  font-family: 'DM Mono', monospace;
  font-size: .6rem;
  font-weight: 500;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: rgba(250, 250, 248, 0.5);
  margin-bottom: .5rem;
}

.footer-col a {
  font-family: 'Syne', sans-serif;
  font-size: .8rem;
  color: rgba(250, 250, 248, 0.7);
  transition: color 0.15s;
}

.footer-col a:hover { color: var(--white); }

.footer-bottom {
  padding-top: 1.5rem;
  font-family: 'DM Mono', monospace;
  font-size: .6rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: rgba(250, 250, 248, 0.35);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer-bottom p { color: inherit; font-size: inherit; margin: 0; }

/* ── Back to top ────────────────────────────────────────── */
.back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 40px;
  height: 40px;
  background: var(--ink);
  color: var(--white);
  border: 1px solid var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s, visibility 0.2s, background 0.15s;
  z-index: 90;
}

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

.back-to-top:hover {
  background: var(--white);
  color: var(--ink);
}

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 900px) {
  .legal-layout {
    grid-template-columns: 1fr;
  }

  .legal-sidebar {
    position: relative;
    top: 0;
    border-right: none;
    border-bottom: 1px solid var(--rule);
    padding: 1.5rem clamp(1.5rem, 5vw, 4rem);
    max-height: none;
  }

  .sidebar-nav {
    display: flex;
    flex-wrap: wrap;
    gap: .25rem;
    margin-bottom: 1.5rem;
  }

  .sidebar-nav li { margin-bottom: 0; }

  .sidebar-link {
    border-left: none;
    border-bottom: 2px solid transparent;
    padding: .4rem .6rem;
    font-size: .8rem;
  }

  .sidebar-link.active {
    border-left-color: transparent;
    border-bottom-color: var(--gold-text);
  }

  .sidebar-contact { display: none; }
  .btn-print { display: none; }

  .legal-content {
    padding: 2rem clamp(1.5rem, 5vw, 4rem) 4rem;
  }

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

@media (max-width: 600px) {
  .header-nav { gap: 1rem; }

  .header-nav a { font-size: .6rem; }

  .legal-content h1 { font-size: 1.75rem; }

  .legal-content h2 { font-size: 1.25rem; }

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

/* ── Print ──────────────────────────────────────────────── */
@media print {
  .legal-header,
  .breadcrumb,
  .legal-sidebar,
  .legal-footer,
  .back-to-top,
  .btn-print { display: none !important; }

  .legal-layout {
    grid-template-columns: 1fr;
  }

  .legal-content {
    padding: 0;
    max-width: 100%;
  }

  .legal-content h1 { font-size: 1.75rem; }
  .legal-content h2 { break-before: auto; }

  body { font-size: .9rem; }

  a { color: var(--ink) !important; }
  a[href]::after { content: " (" attr(href) ")"; font-size: .75rem; color: var(--ink-secondary); }

  .toc { break-inside: avoid; }
}
