/* =============================================================================
   SaptAlpha by Crucible — Legal, Compliance & Information Page Styling
   Brand Identity: Quiet Luxury, Warm Linen & Cream Canvas, Midnight Navy
   Entity: Crucible Technologies Private Limited
   ============================================================================= */

:root {
  --cream: #FBF9F5;
  --cream2: #F5F1EA;
  --cream3: #F0EBE1;
  --green: #18221D;
  --green2: #1C2822;
  --deep: #1B2E28;
  --gold: #B89047;
  --gold-hover: #9E7A35;
  --gold-dark: #96702E;
  --gold-light: #DFC894;
  --gold-tint: rgba(184, 144, 71, 0.08);
  --gold-tint-strong: rgba(184, 144, 71, 0.16);
  --sage: #78857E;
  --sage-border: #C8D0C4;
  --ink: #111815;
  --body-text: #49544E;
  --muted: #78857E;
  --dim: #9FAAA4;
  --line: rgba(28, 35, 30, 0.08);
  --line-medium: rgba(28, 35, 30, 0.14);
  --line-strong: rgba(28, 35, 30, 0.22);
  --surface: #FFFFFF;
  --surface-soft: #F5F1EA;
  --inverse: #FAF8F5;
  --inverse-muted: #A3B0A9;
  --accent-emerald: #108A56;
  --accent-emerald-soft: rgba(16, 138, 86, 0.10);
  --accent-amber: #D97706;
  --canvas-pure: #FFFFFF;
  --border-line: rgba(28, 35, 30, 0.14);
  --text-navy: #18221D;
  --text-muted: #78857E;
  --font-serif: 'Newsreader', Iowan Old Style, Palatino Linotype, Palatino, serif;
  --font-deva: 'Tiro Devanagari Hindi', 'Noto Serif Devanagari', Noto Serif, serif;
  --font-sans: 'Sora', Avenir Next, "Segoe UI", sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  --radius-pill: 9999px;
  --shadow-sm: 0 1px 3px rgba(13, 22, 20, 0.04);
  --shadow-md: 0 4px 16px -2px rgba(13, 22, 20, 0.06);
  --shadow-lg: 0 16px 36px -8px rgba(13, 22, 20, 0.08);
  --shadow-elevated: 0 24px 48px -12px rgba(13, 22, 20, 0.12);
}

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

html {
  scroll-behavior: smooth;
  scrollbar-color: var(--gold) var(--cream3);
  font-size: 16px;
}

body {
  font-family: var(--font-sans);
  color: var(--body-text);
  background-color: var(--cream);
  background-image: linear-gradient(180deg, rgba(251, 249, 245, 0.88), rgba(245, 241, 234, 0.92)), url('/static/luxury_ivory_gold.jpg');
  background-size: auto, 560px;
  background-repeat: no-repeat, repeat;
  background-attachment: fixed, scroll;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.7;
}

/* Texture overlay */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.22;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.legal-page-wrap {
  position: relative;
  z-index: 1;
}

/* Nav */
nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(251, 249, 245, 0.90);
  backdrop-filter: blur(16px) saturate(1.2);
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
  border-bottom: 1px solid var(--line);
}

.nav-in {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1220px;
  margin: 0 auto;
  padding: 14px 36px;
  padding-left: max(36px, env(safe-area-inset-left, 0px));
  padding-right: max(36px, env(safe-area-inset-right, 0px));
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.brand-mark {
  display: block;
  flex-shrink: 0;
}

.brand-titles {
  display: flex;
  flex-direction: column;
}

.wordmark {
  font-family: var(--font-serif);
  font-size: 21px;
  letter-spacing: 0.3px;
  color: var(--green);
  font-weight: 500;
  display: inline-flex;
  align-items: baseline;
  line-height: 1;
}

.wm-sapt {
  font-family: var(--font-deva);
  font-weight: 400;
  font-size: 1.12em;
}

.wm-alpha {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 500;
  letter-spacing: 0.25px;
  margin-left: 0.16em;
}

.brand-by {
  font-family: var(--font-sans);
  font-size: 8px;
  letter-spacing: 1.8px;
  color: var(--gold-dark);
  text-transform: uppercase;
  font-weight: 700;
  margin-top: 3px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-links {
  display: flex;
  gap: 24px;
  font-size: 13.5px;
  font-weight: 500;
}

.nav-links a {
  color: var(--body-text);
  text-decoration: none;
  transition: color 0.2s ease;
}

.nav-links a:hover, .nav-links a.active {
  color: var(--green);
  font-weight: 600;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn {
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  padding: 10px 20px;
  border-radius: var(--radius-pill);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
}

.btn-ghost {
  background: transparent;
  color: var(--body-text);
  border: 1px solid var(--line-medium);
}

.btn-ghost:hover {
  background: var(--surface-soft);
  color: var(--green);
}

.btn-dark {
  background: var(--green);
  color: var(--inverse);
}

.btn-dark:hover {
  background: var(--green2);
}

/* Page Header / Hero */
.legal-hero {
  padding: 68px 0 44px;
  border-bottom: 1px solid var(--line);
  position: relative;
  background: linear-gradient(180deg, rgba(251, 249, 245, 0.4), rgba(245, 241, 234, 0.8));
}

.wrap {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 36px;
  padding-left: max(36px, env(safe-area-inset-left, 0px));
  padding-right: max(36px, env(safe-area-inset-right, 0px));
}

.eyebrow {
  font-family: var(--font-sans);
  font-size: 10.5px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--gold-dark);
  font-weight: 700;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.eyebrow-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gold);
}

.legal-title {
  font-family: var(--font-serif);
  font-size: 46px;
  line-height: 1.15;
  color: var(--green);
  font-weight: 500;
  letter-spacing: -0.02em;
  margin-bottom: 14px;
}

.legal-lead {
  font-size: 16px;
  line-height: 1.7;
  color: var(--body-text);
  max-width: 68ch;
  margin-bottom: 24px;
}

.meta-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.meta-pill {
  font-family: var(--font-mono);
  font-size: 11px;
  background: var(--surface);
  border: 1px solid var(--line-medium);
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  color: var(--muted);
  font-weight: 500;
}

.meta-pill strong {
  color: var(--green);
}

/* Two-column Layout: Sidebar TOC + Main Content */
.legal-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 56px;
  padding: 56px 0 96px;
  align-items: start;
}

/* Sidebar Navigation */
.toc-sidebar {
  position: sticky;
  top: 96px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 22px 20px;
  box-shadow: var(--shadow-sm);
}

.toc-title {
  font-size: 11px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.toc-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.toc-list a {
  font-size: 12.5px;
  color: var(--body-text);
  text-decoration: none;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
  display: block;
  line-height: 1.4;
}

.toc-list a:hover {
  background: var(--surface-soft);
  color: var(--green);
}

.toc-list a.active {
  background: var(--gold-tint);
  color: var(--gold-dark);
  font-weight: 600;
  border-left: 2px solid var(--gold);
}

/* Main Document Body */
.doc-content {
  display: flex;
  flex-direction: column;
  gap: 40px;
}

.doc-section {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 36px 38px;
  box-shadow: var(--shadow-sm);
  position: relative;
}

.doc-section:target {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-tint);
}

.section-num {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--gold);
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.doc-section h2 {
  font-family: var(--font-serif);
  font-size: 28px;
  line-height: 1.25;
  color: var(--green);
  font-weight: 500;
  margin-bottom: 16px;
  letter-spacing: -0.01em;
}

.doc-section h3 {
  font-family: var(--font-sans);
  font-size: 17px;
  color: var(--green);
  font-weight: 600;
  margin: 22px 0 8px;
}

.doc-section p {
  font-size: 15px;
  line-height: 1.75;
  color: var(--body-text);
  margin-bottom: 14px;
}

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

.doc-section ul, .doc-section ol {
  margin: 14px 0 16px 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 14.5px;
  line-height: 1.65;
  color: var(--body-text);
}

/* Highlight / Callout Box */
.callout {
  background: var(--surface-soft);
  border-left: 3px solid var(--gold);
  padding: 18px 22px;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  margin: 18px 0;
}

.callout-title {
  font-weight: 700;
  font-size: 13px;
  color: var(--green);
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.callout p {
  font-size: 14px;
  line-height: 1.6;
  color: var(--body-text);
  margin: 0;
}

.callout-emerald {
  background: var(--accent-emerald-soft);
  border-left-color: var(--accent-emerald);
}

.callout-emerald .callout-title {
  color: var(--accent-emerald);
}

/* Tables */
.table-wrap {
  overflow-x: auto;
  margin: 20px 0;
  border: 1px solid var(--line-medium);
  border-radius: var(--radius-md);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
  text-align: left;
}

th {
  background: var(--surface-soft);
  padding: 12px 16px;
  font-family: var(--font-sans);
  font-weight: 600;
  color: var(--green);
  border-bottom: 1px solid var(--line-medium);
  letter-spacing: 0.3px;
}

td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  color: var(--body-text);
  vertical-align: top;
}

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

.code-badge {
  font-family: var(--font-mono);
  font-size: 12px;
  background: var(--surface-soft);
  padding: 2px 7px;
  border-radius: 4px;
  color: var(--green);
  border: 1px solid var(--line);
}

/* Footer */
footer {
  background: var(--deep);
  color: var(--inverse-muted);
  padding: 72px 0 36px;
  border-top: 1px solid rgba(184, 144, 71, 0.2);
  position: relative;
}

.footer-in {
  display: grid;
  grid-template-columns: 1.8fr repeat(4, 1fr);
  gap: 40px;
  margin-bottom: 48px;
}

.footer-brand b {
  font-family: var(--font-serif);
  font-size: 24px;
  color: var(--inverse);
  display: block;
  margin-bottom: 6px;
}

.footer-brand p {
  font-size: 13px;
  line-height: 1.6;
  max-width: 34ch;
  margin-bottom: 18px;
}

.crucible-endorse {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(184, 144, 71, 0.25);
  border-radius: var(--radius-md);
  margin-top: 14px;
}

.crucible-endorse img {
  height: 22px;
  display: block;
}

.crucible-endorse-text {
  font-size: 11px;
  line-height: 1.4;
  color: var(--inverse-muted);
}

.crucible-endorse-text strong {
  color: var(--inverse);
  display: block;
  font-size: 12px;
}

.footer-col h4 {
  font-family: var(--font-sans);
  font-size: 11px;
  letter-spacing: 1.8px;
  text-transform: uppercase;
  color: var(--gold-light);
  font-weight: 700;
  margin-bottom: 16px;
}

.footer-col ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 9px;
  font-size: 13px;
}

.footer-col a {
  color: var(--inverse-muted);
  text-decoration: none;
  transition: color 0.2s ease;
}

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

.footer-bottom {
  padding-top: 28px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11.5px;
  flex-wrap: wrap;
  gap: 16px;
}

.footer-reg {
  color: var(--inverse-muted);
}

.footer-reg strong {
  color: var(--gold-light);
}

.support-form input,
.support-form select,
.support-form textarea {
  width: 100%;
  padding: 12px 14px;
  background: var(--canvas-pure);
  border: 1px solid var(--border-line);
  border-radius: 6px;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  color: var(--text-navy);
}

.support-form label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 6px;
}

/* Responsive */
@media (max-width: 1100px) {
  .nav-links {
    display: none;
  }
}

@media (max-width: 960px) {
  .legal-layout {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  .toc-sidebar {
    position: static;
  }
  .footer-in {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 640px) {
  .nav-in {
    padding: 12px 20px;
  }
  .wrap {
    padding: 0 20px;
  }
  .legal-hero {
    padding: 44px 0 28px;
  }
  .legal-title {
    font-size: 34px;
  }
  .doc-section {
    padding: 24px 20px;
  }
  .footer-in {
    grid-template-columns: 1fr;
  }
  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
  }
}
