/* Ownly - Obsidian Vault Legal & Privacy Design System */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500;600&family=Space+Grotesk:wght@500;600;700&display=swap');

:root {
  --bg-primary: #070A10;
  --bg-surface: #0E1524;
  --bg-surface-elevated: #141E33;
  --bg-surface-card: rgba(20, 30, 51, 0.7);
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-highlight: rgba(16, 185, 129, 0.3);
  --border-accent: rgba(6, 182, 212, 0.3);
  
  --emerald-500: #10B981;
  --emerald-400: #34D399;
  --emerald-glow: rgba(16, 185, 129, 0.18);
  --cyan-500: #06B6D4;
  --cyan-400: #22D3EE;
  --cyan-glow: rgba(6, 182, 212, 0.18);
  --amber-500: #F59E0B;
  --rose-500: #EF4444;

  --text-primary: #F8FAFC;
  --text-secondary: #94A3B8;
  --text-muted: #64748B;
  --text-inverse: #070A10;

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-display: 'Space Grotesk', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  --shadow-vault: 0 20px 40px -15px rgba(0, 0, 0, 0.7), 0 0 1px 1px rgba(255, 255, 255, 0.05);
  --shadow-glow: 0 0 25px -5px rgba(16, 185, 129, 0.35);
}

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

html {
  scroll-behavior: smooth;
  color-scheme: dark;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.7;
  font-size: 16px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  background-image: 
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(16, 185, 129, 0.12), transparent),
    radial-gradient(ellipse 60% 40% at 100% 60%, rgba(6, 182, 212, 0.06), transparent),
    radial-gradient(ellipse 50% 30% at 0% 90%, rgba(16, 185, 129, 0.05), transparent);
  background-attachment: fixed;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
  background: #1e293b;
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--emerald-500);
}

/* Header & Nav */
.vault-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  background: rgba(7, 10, 16, 0.85);
  border-bottom: 1px solid var(--border-subtle);
  transition: border-color 0.2s ease;
}

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

.brand-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--text-primary);
}

.brand-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.2), rgba(6, 182, 212, 0.2));
  border: 1px solid var(--border-highlight);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--emerald-400);
  box-shadow: 0 0 15px rgba(16, 185, 129, 0.2);
}

.brand-text {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #FFFFFF 40%, var(--emerald-400) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-badge {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-full);
  background: rgba(16, 185, 129, 0.1);
  color: var(--emerald-400);
  border: 1px solid rgba(16, 185, 129, 0.3);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

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

.nav-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.925rem;
  font-weight: 500;
  transition: all 0.2s ease;
  position: relative;
  padding: 0.4rem 0.2rem;
}

.nav-link:hover, .nav-link.active {
  color: var(--text-primary);
}

.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--emerald-500), var(--cyan-500));
  border-radius: var(--radius-full);
}

.btn-cta {
  background: linear-gradient(135deg, var(--emerald-500), #059669);
  color: #FFFFFF;
  padding: 0.55rem 1.15rem;
  border-radius: var(--radius-full);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.25s ease;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.25);
}

.btn-cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}

/* Page Hero */
.hero-section {
  padding: 4rem 1.5rem 2.5rem;
  text-align: center;
  position: relative;
}

.hero-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.25);
  padding: 0.35rem 0.9rem;
  border-radius: var(--radius-full);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--emerald-400);
  margin-bottom: 1.5rem;
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(2.25rem, 5vw, 3.5rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin-bottom: 1rem;
}

.hero-subtitle {
  color: var(--text-secondary);
  font-size: 1.125rem;
  max-width: 680px;
  margin: 0 auto;
}

.meta-tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
  margin-top: 1.5rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.meta-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

/* Legal Layout: Sidebar + Document */
.doc-wrapper {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.5rem 1.5rem 5rem;
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 2.5rem;
  align-items: start;
}

.doc-wrapper.full-width {
  grid-template-columns: 1fr;
  max-width: 1000px;
}

/* Sticky TOC Sidebar */
.toc-sidebar {
  position: sticky;
  top: 90px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
  box-shadow: var(--shadow-vault);
}

.toc-title {
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--emerald-400);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.toc-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.toc-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.875rem;
  line-height: 1.4;
  padding: 0.35rem 0.6rem;
  border-radius: var(--radius-sm);
  display: block;
  transition: all 0.15s ease;
  border-left: 2px solid transparent;
}

.toc-link:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.03);
  border-left-color: var(--emerald-500);
}

/* Document Body Card */
.doc-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: clamp(1.75rem, 4vw, 3.5rem);
  box-shadow: var(--shadow-vault);
  backdrop-filter: blur(20px);
}

.doc-section {
  margin-bottom: 3rem;
  scroll-margin-top: 100px;
}

.doc-section:last-child {
  margin-bottom: 0;
}

.section-num {
  font-family: var(--font-mono);
  font-size: 0.825rem;
  font-weight: 600;
  color: var(--emerald-400);
  background: rgba(16, 185, 129, 0.1);
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-sm);
  display: inline-block;
  margin-bottom: 0.5rem;
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.section-heading {
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 2.5vw, 1.85rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin-bottom: 1rem;
}

.doc-section p {
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

.doc-section p strong {
  color: var(--text-primary);
}

.doc-section ul, .doc-section ol {
  margin-left: 1.25rem;
  margin-bottom: 1.25rem;
  color: var(--text-secondary);
}

.doc-section li {
  margin-bottom: 0.5rem;
}

.doc-section li strong {
  color: var(--text-primary);
}

/* Custom Highlight Banners */
.highlight-box {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.07), rgba(6, 182, 212, 0.04));
  border: 1px solid var(--border-highlight);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  margin: 1.5rem 0;
  position: relative;
}

.highlight-box.warning {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.08), rgba(239, 68, 68, 0.04));
  border-color: rgba(245, 158, 11, 0.3);
}

.highlight-box.alert {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.1), rgba(239, 68, 68, 0.03));
  border-color: rgba(239, 68, 68, 0.35);
}

.highlight-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.975rem;
  color: var(--emerald-400);
  margin-bottom: 0.4rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.highlight-box.warning .highlight-title {
  color: var(--amber-500);
}

.highlight-box.alert .highlight-title {
  color: var(--rose-500);
}

.highlight-box p {
  font-size: 0.925rem;
  color: var(--text-secondary);
  margin-bottom: 0;
}

/* Feature Grid / Cards */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem;
  margin: 1.5rem 0;
}

.feature-card {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.feature-card:hover {
  border-color: var(--border-highlight);
  transform: translateY(-2px);
}

.feature-card-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: rgba(16, 185, 129, 0.12);
  color: var(--emerald-400);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.75rem;
}

.feature-card h4 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
  color: var(--text-primary);
}

.feature-card p {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: 0;
}

/* Action Banner */
.action-banner {
  background: linear-gradient(135deg, #131E35 0%, #0A1220 100%);
  border: 1px solid var(--border-highlight);
  border-radius: var(--radius-lg);
  padding: 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
  margin-top: 2.5rem;
}

.action-banner h3 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  color: var(--text-primary);
  margin-bottom: 0.35rem;
}

.action-banner p {
  color: var(--text-secondary);
  font-size: 0.925rem;
  margin-bottom: 0;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  padding: 0.6rem 1.25rem;
  border-radius: var(--radius-full);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.2s ease;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-danger {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #FCA5A5;
  padding: 0.6rem 1.25rem;
  border-radius: var(--radius-full);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.2s ease;
}

.btn-danger:hover {
  background: rgba(239, 68, 68, 0.25);
  border-color: rgba(239, 68, 68, 0.5);
  color: #FFFFFF;
}

/* Footer */
.vault-footer {
  margin-top: auto;
  background: #05080E;
  border-top: 1px solid var(--border-subtle);
  padding: 3rem 1.5rem 2rem;
}

.footer-container {
  max-width: 1200px;
  margin: 0 auto;
}

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

.footer-brand p {
  color: var(--text-muted);
  font-size: 0.875rem;
  max-width: 340px;
  margin-top: 0.75rem;
}

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

.footer-col h5 {
  font-family: var(--font-display);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--emerald-400);
  margin-bottom: 1rem;
}

.footer-col ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.footer-col a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.875rem;
  transition: color 0.15s ease;
}

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

.footer-bottom {
  padding-top: 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.825rem;
  color: var(--text-muted);
}

.footer-badges {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.security-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--emerald-400);
  background: rgba(16, 185, 129, 0.08);
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-full);
  border: 1px solid rgba(16, 185, 129, 0.2);
}

/* Table Style for Legal Definitions / Subscriptions */
.legal-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin: 1.5rem 0;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-subtle);
}

.legal-table th, .legal-table td {
  padding: 0.85rem 1rem;
  text-align: left;
  font-size: 0.875rem;
}

.legal-table th {
  background: var(--bg-surface-elevated);
  color: var(--text-primary);
  font-weight: 600;
  font-family: var(--font-display);
  border-bottom: 1px solid var(--border-subtle);
}

.legal-table td {
  background: var(--bg-surface);
  color: var(--text-secondary);
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

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

/* Hub Index Cards */
.hub-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.5rem;
  margin: 2rem 0;
}

.hub-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 2rem;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  transition: all 0.25s ease;
  position: relative;
  overflow: hidden;
}

.hub-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, transparent, transparent);
  transition: background 0.3s ease;
}

.hub-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-highlight);
  box-shadow: 0 16px 32px -8px rgba(0, 0, 0, 0.8), var(--shadow-glow);
}

.hub-card:hover::before {
  background: linear-gradient(90deg, var(--emerald-500), var(--cyan-500));
}

.hub-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: rgba(16, 185, 129, 0.1);
  color: var(--emerald-400);
  border: 1px solid rgba(16, 185, 129, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.25rem;
}

.hub-card h3 {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.hub-card p {
  color: var(--text-secondary);
  font-size: 0.925rem;
  line-height: 1.6;
  flex-grow: 1;
}

.hub-link-action {
  margin-top: 1.5rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--emerald-400);
}

/* Responsive */
@media (max-width: 900px) {
  .doc-wrapper {
    grid-template-columns: 1fr;
  }
  .toc-sidebar {
    display: none;
  }
  .nav-links {
    display: none;
  }
}

/* Print Styles */
@media print {
  body {
    background: #FFFFFF !important;
    color: #111827 !important;
    font-size: 11pt;
  }
  .vault-header, .toc-sidebar, .vault-footer, .btn-cta, .action-banner {
    display: none !important;
  }
  .doc-wrapper {
    display: block;
    padding: 0;
    max-width: 100%;
  }
  .doc-card {
    border: none;
    box-shadow: none;
    padding: 0;
    background: transparent;
  }
  .section-heading {
    color: #000000;
    page-break-after: avoid;
  }
  .doc-section {
    page-break-inside: avoid;
  }
  .highlight-box {
    border: 1px solid #D1D5DB;
    background: #F3F4F6 !important;
    color: #111827;
  }
}
