/* Apex Routing — shared styles for interior pages (privacy, terms, support).
   Design tokens mirror the inline styles in index.html. */

:root {
  --bg: #f5f2ec;
  --white: #ffffff;
  --ink: #0a0a0a;
  --ink2: #1a1a1a;
  --muted: #888880;
  --accent: #c8371a;
  --border: #e0ddd6;
  --surface: #edeae3;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: 'Epilogue', sans-serif;
  font-weight: 300;
  overflow-x: hidden;
}

/* NAV — matches index.html */
nav {
  position: fixed; top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 24px 64px;
  display: flex; align-items: center; justify-content: space-between;
  background: var(--bg);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s;
}
nav.scrolled { border-color: var(--border); }
.logo {
  font-family: 'Playfair Display', serif;
  font-weight: 900;
  font-size: 1.1rem;
  letter-spacing: 0.02em;
  color: var(--ink);
  text-decoration: none;
}
.logo span { color: var(--accent); }
.nav-links { display: flex; gap: 40px; list-style: none; }
.nav-links a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 400;
  letter-spacing: 0.04em;
  transition: color 0.2s;
}
.nav-links a:hover { color: var(--ink); }
.nav-cta {
  background: var(--ink);
  color: var(--bg);
  padding: 10px 24px;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  transition: background 0.2s;
}
.nav-cta:hover { background: var(--accent); }

/* PAGE HEADER */
.doc-head {
  padding: 160px 64px 56px;
  border-bottom: 1px solid var(--border);
}
.doc-head-inner { max-width: 1200px; margin: 0 auto; }
.doc-eyebrow {
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 24px;
  font-weight: 400;
}
.doc-head h1 {
  font-family: 'Playfair Display', serif;
  font-size: clamp(2.6rem, 5vw, 4.4rem);
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.02em;
  margin-bottom: 28px;
}
.doc-head h1 em { font-style: italic; color: var(--accent); }
.doc-lede {
  font-size: 0.95rem;
  line-height: 1.8;
  color: var(--muted);
  max-width: 620px;
  font-weight: 300;
}
.doc-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 32px;
  margin-top: 36px;
  padding-top: 28px;
  border-top: 1px solid var(--border);
}
.doc-meta-label {
  font-size: 0.65rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}
.doc-meta-value {
  font-size: 0.85rem;
  color: var(--ink);
  font-weight: 400;
}

/* BODY LAYOUT — sticky TOC + prose */
.doc-body {
  padding: 72px 64px 100px;
  border-bottom: 1px solid var(--border);
}
.doc-body-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 80px;
  align-items: start;
}
/* min-width:0 is required on both grid items. Without it their default
   min-width:auto resolves to min-content, and a wide .doc-table pushes the
   1fr track past the viewport instead of scrolling inside .table-scroll. */
.toc { position: sticky; top: 120px; min-width: 0; }
.toc-label {
  font-size: 0.65rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.toc ol { list-style: none; counter-reset: toc; }
.toc li { counter-increment: toc; margin-bottom: 12px; }
.toc a {
  font-size: 0.78rem;
  line-height: 1.5;
  color: var(--muted);
  text-decoration: none;
  display: block;
  transition: color 0.2s;
}
.toc a::before {
  content: counter(toc, decimal-leading-zero);
  font-family: 'Playfair Display', serif;
  font-weight: 700;
  font-size: 0.68rem;
  color: var(--border);
  margin-right: 10px;
}
.toc a:hover { color: var(--ink); }
.toc a:hover::before { color: var(--accent); }

/* PROSE */
.prose { max-width: 720px; min-width: 0; }
.prose section { margin-bottom: 56px; scroll-margin-top: 110px; }
.prose section:last-child { margin-bottom: 0; }
.prose h2 {
  font-family: 'Playfair Display', serif;
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.prose h2 .sec-num {
  font-size: 0.8rem;
  color: var(--accent);
  margin-right: 12px;
  vertical-align: 2px;
}
.prose h3 {
  font-family: 'Playfair Display', serif;
  font-size: 1rem;
  font-weight: 700;
  margin: 28px 0 12px;
}
.prose p {
  font-size: 0.88rem;
  line-height: 1.9;
  color: var(--muted);
  margin-bottom: 16px;
  font-weight: 300;
}
.prose strong { color: var(--ink); font-weight: 500; }
.prose a { color: var(--accent); text-decoration: none; border-bottom: 1px solid rgba(200,55,26,0.3); }
.prose a:hover { border-bottom-color: var(--accent); }
.prose ul, .prose ol { margin: 0 0 16px 20px; }
.prose li {
  font-size: 0.88rem;
  line-height: 1.9;
  color: var(--muted);
  margin-bottom: 8px;
  font-weight: 300;
  padding-left: 6px;
}
.prose li::marker { color: var(--accent); }

/* Callout */
.callout {
  background: var(--white);
  border-left: 3px solid var(--accent);
  padding: 24px 28px;
  margin: 28px 0;
}
.callout p { margin-bottom: 0; color: var(--ink2); }
.callout p + p { margin-top: 12px; }

/* Definition table */
.doc-table {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0;
  background: var(--white);
  border: 1px solid var(--border);
}
.doc-table th, .doc-table td {
  text-align: left;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  font-size: 0.82rem;
  line-height: 1.7;
  font-weight: 300;
  color: var(--muted);
  vertical-align: top;
}
.doc-table th {
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink);
  font-weight: 500;
  background: var(--surface);
}
.doc-table tr:last-child td { border-bottom: none; }
.doc-table td strong { color: var(--ink); font-weight: 500; }
/* Wide tables scroll inside their own container rather than the page.
   min-width keeps columns readable instead of crushing them on narrow screens. */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table-scroll .doc-table { min-width: 520px; }

/* CONTACT CARDS — support page */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  margin: 40px 0 0;
}
.contact-card {
  background: var(--white);
  padding: 32px;
  display: flex;
  flex-direction: column;
}
.contact-card-num {
  font-family: 'Playfair Display', serif;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 20px;
}
.contact-card h3 {
  font-family: 'Playfair Display', serif;
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 12px;
}
.contact-card p {
  font-size: 0.8rem;
  line-height: 1.8;
  color: var(--muted);
  font-weight: 300;
  margin-bottom: 20px;
  flex-grow: 1;
}
.contact-mail {
  font-size: 0.85rem;
  color: var(--accent);
  text-decoration: none;
  letter-spacing: 0.01em;
  border-bottom: 1px solid rgba(200,55,26,0.3);
  align-self: flex-start;
}
.contact-mail:hover { border-bottom-color: var(--accent); }
.contact-note {
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 16px;
}

/* SLA strip */
.sla-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  margin: 40px 0 0;
}
.sla-item { background: var(--white); padding: 32px; }
.sla-num {
  font-family: 'Playfair Display', serif;
  font-size: 2.4rem;
  font-weight: 900;
  color: var(--ink);
  line-height: 1;
  margin-bottom: 10px;
}
.sla-num span { color: var(--accent); }
.sla-label {
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

/* CTA — matches index.html */
.cta-section { background: var(--ink); padding: 100px 64px; }
.cta-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 80px;
  align-items: center;
}
.cta-eyebrow {
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 16px;
}
.cta-inner h2 {
  font-family: 'Playfair Display', serif;
  font-size: clamp(2rem, 4vw, 3.2rem);
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: white;
  margin-bottom: 20px;
}
.cta-inner h2 em { font-style: italic; color: var(--accent); }
.cta-inner p {
  font-size: 0.88rem;
  line-height: 1.8;
  color: rgba(255,255,255,0.5);
  font-weight: 300;
  max-width: 460px;
}
.cta-right { display: flex; flex-direction: column; gap: 16px; align-items: flex-start; }
.btn-primary {
  background: var(--accent);
  color: white;
  padding: 14px 32px;
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  transition: all 0.2s;
  display: inline-block;
}
.btn-primary:hover { background: var(--white); color: var(--ink); transform: translateY(-2px); }
.cta-email-line { font-size: 0.75rem; color: rgba(255,255,255,0.4); letter-spacing: 0.04em; }
.cta-email-line a { color: rgba(255,255,255,0.7); text-decoration: none; }
.cta-email-line a:hover { color: white; }

/* FOOTER — matches index.html */
footer {
  padding: 32px 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--border);
  gap: 24px;
  flex-wrap: wrap;
}
.footer-copy { font-size: 0.72rem; color: var(--muted); }
.footer-links { display: flex; gap: 32px; list-style: none; flex-wrap: wrap; }
.footer-links a {
  font-size: 0.72rem;
  color: var(--muted);
  text-decoration: none;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition: color 0.2s;
}
.footer-links a:hover { color: var(--ink); }

@media (max-width: 900px) {
  nav { padding: 20px 24px; }
  .nav-links { display: none; }
  .doc-head { padding: 110px 24px 40px; }
  .doc-body { padding: 48px 24px 60px; }
  .doc-body-inner { grid-template-columns: 1fr; gap: 40px; }
  .toc { position: static; }
  .cta-section { padding: 60px 24px; }
  .cta-inner { grid-template-columns: 1fr; gap: 40px; }
  footer { flex-direction: column; align-items: flex-start; gap: 20px; padding: 24px; }
  .footer-links { gap: 20px; }
}
