/* ═══════════════════════════════════════════════════
   The Space — Privacy Policy
   styles.css
═══════════════════════════════════════════════════ */

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

/* ── Design Tokens ───────────────────────────────── */
:root {
  --dark:          #2A2625;
  --accent:        #C5542C;
  --bg:            #ffffff;
  --text:          #2A2625;
  --text-secondary:#6b6360;
  --border:        #e6e2df;
  --surface:       #f8f6f4;
  --accent-subtle: rgba(197, 84, 44, 0.08);
  --code-bg:       #f2efed;

  --sidebar-w:     272px;
  --content-max:   700px;

  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui,
          Helvetica, Arial, sans-serif;

  --ease:          cubic-bezier(0.16, 1, 0.3, 1);
  --dur-fast:      140ms;
  --dur-base:      220ms;
}

/* ── Base ────────────────────────────────────────── */
html {
  scroll-behavior: smooth;
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── Layout Shell ────────────────────────────────── */
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar-w);
  background: var(--bg);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 100;

  /* Custom scrollbar */
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.sidebar::-webkit-scrollbar        { width: 4px; }
.sidebar::-webkit-scrollbar-track  { background: transparent; }
.sidebar::-webkit-scrollbar-thumb  { background: var(--border); border-radius: 2px; }

.sidebar-inner {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  padding: 36px 0 28px;
}

.main-content {
  margin-left: var(--sidebar-w);
}

.content-wrap {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 72px 52px 128px;
  counter-reset: section-counter;
}

/* ── Sidebar Brand ───────────────────────────────── */
.sidebar-brand {
  padding: 0 28px 28px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
  flex-shrink: 0;
}

.sidebar-brand-row {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 4px;
}

.sidebar-logo {
  width: 28px;
  height: 28px;
  object-fit: contain;
  flex-shrink: 0;
  border-radius: 6px;
}

.sidebar-brand-name {
  font-size: 14.5px;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--dark);
  line-height: 1;
}

.sidebar-brand-label {
  display: block;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.065em;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* ── Sidebar Navigation ──────────────────────────── */
.sidebar-nav {
  flex: 1;
  padding: 0 12px;
}

.sidebar-nav ul {
  list-style: none;
}

.sidebar-nav li {
  margin-bottom: 1px;
}

.nav-link {
  display: flex;
  align-items: baseline;
  gap: 9px;
  padding: 6.5px 14px;
  font-size: 12.5px;
  font-weight: 450;
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: 5px;
  line-height: 1.45;
  transition:
    color      var(--dur-fast) ease,
    background var(--dur-fast) ease;
}

.nav-link:hover {
  color: var(--dark);
  background: var(--surface);
}

.nav-link.is-active {
  color: var(--accent);
  background: var(--accent-subtle);
  font-weight: 500;
  border-radius: 0 5px 5px 0;
  box-shadow: inset 3px 0 0 var(--accent);
}

.nav-num {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.05em;
  opacity: 0.45;
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
  transition: opacity var(--dur-fast) ease;
  line-height: 1;
  margin-top: 1px;
}

.nav-link.is-active .nav-num {
  opacity: 0.65;
}

/* ── Sidebar Footer ──────────────────────────────── */
.sidebar-foot {
  margin-top: 20px;
  padding: 20px 28px 0;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

.sidebar-foot-label {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.sidebar-foot-value {
  font-size: 12px;
  font-weight: 500;
  color: var(--dark);
}

/* ── Mobile Bar ──────────────────────────────────── */
.mobile-bar {
  display: none;
  position: sticky;
  top: 0;
  z-index: 200;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

.mobile-bar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
}

.mobile-brand {
  font-size: 14.5px;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--dark);
}

/* Hamburger */
.nav-toggle {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 34px;
  height: 34px;
  padding: 6px;
  background: none;
  border: none;
  cursor: pointer;
  border-radius: 5px;
  transition: background var(--dur-fast) ease;
}

.nav-toggle:hover {
  background: var(--surface);
}

.nav-toggle span {
  display: block;
  width: 18px;
  height: 1.5px;
  background: var(--dark);
  border-radius: 1px;
  transform-origin: center;
  transition:
    transform var(--dur-base) var(--ease),
    opacity   var(--dur-fast) ease;
}

.nav-toggle.is-open span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.nav-toggle.is-open span:nth-child(2) { opacity: 0; }
.nav-toggle.is-open span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* ── Overlay ─────────────────────────────────────── */
.nav-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(42, 38, 37, 0.28);
  z-index: 90;
  opacity: 0;
  transition: opacity var(--dur-base) ease;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}

.nav-overlay.is-visible {
  opacity: 1;
}

/* ── Page Header ─────────────────────────────────── */
.page-header {
  padding-bottom: 52px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 64px;
}

.page-header-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
}

.meta-badge {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.075em;
  text-transform: uppercase;
  color: var(--accent);
}

.meta-sep {
  color: var(--border);
  font-weight: 400;
  font-size: 13px;
}

.meta-date {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 400;
}

.page-title {
  font-size: 38px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
  color: var(--dark);
  margin-bottom: 14px;
}

.page-lead {
  font-size: 16.5px;
  color: var(--text-secondary);
  line-height: 1.7;
  max-width: 540px;
  margin-bottom: 24px;
  font-weight: 400;
}

.effective-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 13px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 5px;
  font-size: 12px;
}

.effective-pill-label {
  font-weight: 600;
  color: var(--text-secondary);
}

.effective-pill-value {
  font-weight: 500;
  color: var(--dark);
}

/* ── Policy Sections ─────────────────────────────── */
.policy-section {
  padding-bottom: 60px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 60px;
  scroll-margin-top: 32px;
  counter-increment: section-counter;
}

.policy-section--last {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

/* Section heading row */
.section-hd {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-bottom: 26px;
}

.section-num {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.055em;
  color: var(--accent);
  opacity: 0.75;
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}

.section-hd h2 {
  font-size: 22px;
  font-weight: 640;
  letter-spacing: -0.025em;
  color: var(--dark);
  line-height: 1.25;
  flex: 1;
}

/* Copy anchor button */
.copy-anchor {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  background: none;
  border: 1px solid transparent;
  border-radius: 5px;
  cursor: pointer;
  color: var(--text-secondary);
  opacity: 0;
  transition:
    opacity     var(--dur-fast) ease,
    color       var(--dur-fast) ease,
    background  var(--dur-fast) ease,
    border-color var(--dur-fast) ease;
}

.section-hd:hover .copy-anchor,
.copy-anchor:focus-visible {
  opacity: 1;
}

.copy-anchor:hover {
  color: var(--accent);
  background: var(--surface);
  border-color: var(--border);
}

.copy-anchor:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ── Section Body ────────────────────────────────── */
.section-bd h3 {
  font-size: 14px;
  font-weight: 650;
  letter-spacing: -0.01em;
  color: var(--dark);
  margin: 28px 0 10px;
  padding-left: 10px;
  border-left: 2px solid rgba(197, 84, 44, 0.32);
}

.section-bd h3:first-child {
  margin-top: 0;
}

.section-bd p {
  font-size: 15px;
  color: #3c3836;
  line-height: 1.78;
  margin-bottom: 14px;
}

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

.section-bd ul,
.section-bd ol {
  list-style: none;
  padding: 0;
  margin: 10px 0 18px;
}

.section-bd li {
  position: relative;
  font-size: 15px;
  color: #3c3836;
  line-height: 1.7;
  padding: 6px 0 6px 22px;
}

.section-bd li::before {
  content: '';
  position: absolute;
  left: 2px;
  top: 15px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.4;
}

.section-bd li strong {
  font-weight: 600;
  color: var(--dark);
}

.section-bd a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid rgba(197, 84, 44, 0.28);
  transition: border-color var(--dur-fast) ease;
}

.section-bd a:hover {
  border-color: var(--accent);
}

.section-bd a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}

.section-bd code {
  font-family: 'SF Mono', 'Fira Code', 'Fira Mono', Menlo, Consolas, monospace;
  font-size: 13px;
  background: var(--code-bg);
  padding: 1px 5px;
  border-radius: 3px;
  color: var(--dark);
}

/* ── Callout / Note ──────────────────────────────── */
.callout {
  display: block;
  padding: 14px 18px;
  background: var(--surface);
  border-left: 3px solid var(--accent);
  border-radius: 0 5px 5px 0;
  margin-top: 18px !important;
  margin-bottom: 0 !important;
  font-size: 13.5px !important;
  color: var(--text-secondary) !important;
  line-height: 1.65 !important;
}

/* ── Tables ──────────────────────────────────────── */
.tbl-wrap {
  overflow-x: auto;
  margin: 16px 0 20px;
  border: 1px solid var(--border);
  border-radius: 7px;
  -webkit-overflow-scrolling: touch;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 360px;
}

thead {
  background: var(--surface);
}

th {
  padding: 11px 16px;
  text-align: left;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.055em;
  text-transform: uppercase;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

td {
  padding: 11px 16px;
  font-size: 13.5px;
  color: #3c3836;
  line-height: 1.55;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

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

tbody tr {
  transition: background var(--dur-fast) ease;
}

tbody tr:hover {
  background: var(--surface);
}

/* ── Contact Card ────────────────────────────────── */
.contact-card {
  margin-top: 20px;
  padding: 24px 28px;
  border: 1px solid var(--border);
  border-top: 2.5px solid var(--accent);
  border-radius: 0 0 8px 8px;
  background: var(--surface);
}

.contact-name {
  font-size: 15px !important;
  font-weight: 700 !important;
  color: var(--dark) !important;
  letter-spacing: -0.02em;
  margin-bottom: 14px !important;
}

.contact-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.contact-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 0;
  font-size: 14px;
  color: var(--text-secondary);
}

.contact-list li::before {
  display: none;
}

.contact-icon {
  display: flex;
  align-items: center;
  color: var(--accent);
  opacity: 0.7;
  flex-shrink: 0;
}

.contact-list a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid rgba(197, 84, 44, 0.28);
  font-size: 14px;
  transition: border-color var(--dur-fast) ease;
}

.contact-list a:hover {
  border-color: var(--accent);
}

/* ── Footer ──────────────────────────────────────── */
.site-footer {
  margin-left: var(--sidebar-w);
  border-top: 1px solid var(--border);
  background: var(--surface);
}

.footer-inner {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 24px 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.footer-left,
.footer-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.footer-brand {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--dark);
  letter-spacing: -0.015em;
}

.footer-label {
  font-size: 12.5px;
  color: var(--text-secondary);
}

.footer-divider {
  color: var(--border);
  font-size: 13px;
}

.footer-right {
  font-size: 11.5px;
  color: var(--text-secondary);
}

/* ── Toast ───────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(12px);
  background: var(--dark);
  color: #fff;
  padding: 9px 16px;
  border-radius: 6px;
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: 0.01em;
  opacity: 0;
  pointer-events: none;
  z-index: 600;
  white-space: nowrap;
  transition:
    opacity   var(--dur-base) ease,
    transform var(--dur-base) var(--ease);
}

.toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ── Focus Visible ───────────────────────────────── */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ── Scroll Progress Bar ─────────────────────────── */
.progress-bar {
  position: fixed;
  top: 0;
  left: var(--sidebar-w);
  right: 0;
  height: 2px;
  background: var(--accent);
  transform-origin: left center;
  transform: scaleX(0);
  z-index: 195;
  will-change: transform;
}

/* ── Section & Header Reveal ─────────────────────── */
@media (prefers-reduced-motion: no-preference) {
  .page-header,
  .policy-section {
    opacity: 0;
    transform: translateY(22px);
    transition:
      opacity   600ms cubic-bezier(0.22, 1, 0.36, 1),
      transform 600ms cubic-bezier(0.22, 1, 0.36, 1);
  }

  .page-header.is-revealed,
  .policy-section.is-revealed {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ── Section Number Watermark (CSS counter) ──────── */
.section-hd {
  position: relative;
  overflow: hidden;
}

.section-hd::after {
  content: counter(section-counter, decimal-leading-zero);
  position: absolute;
  right: -4px;
  top: 50%;
  transform: translateY(-52%);
  font-size: 72px;
  font-weight: 800;
  color: var(--dark);
  opacity: 0.04;
  letter-spacing: -0.05em;
  line-height: 1;
  pointer-events: none;
  user-select: none;
  font-variant-numeric: tabular-nums;
  z-index: 0;
}

/* Keep heading text above watermark */
.section-num,
.section-hd h2,
.copy-anchor {
  position: relative;
  z-index: 1;
}

/* ── Header Compliance Chips ─────────────────────── */
.header-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 24px;
}

.chip {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.025em;
  color: var(--text-secondary);
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 4px 10px;
  border-radius: 100px;
  white-space: nowrap;
}

/* ── Table — First Cell Treatment ───────────────── */
td:first-child {
  font-weight: 500;
  color: var(--dark);
}

/* ── Back to Top ─────────────────────────────────── */
.back-top {
  position: fixed;
  bottom: 32px;
  right: 32px;
  width: 38px;
  height: 38px;
  background: var(--dark);
  color: #fff;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  box-shadow: 0 2px 14px rgba(42, 38, 37, 0.2);
  transition:
    opacity     var(--dur-base) ease,
    transform   var(--dur-base) var(--ease),
    background  var(--dur-fast) ease;
  z-index: 400;
}

.back-top.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.back-top:hover {
  background: var(--accent);
}

.back-top:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* ── Responsive: 1024px ──────────────────────────── */
@media (max-width: 1060px) {
  :root {
    --sidebar-w: 248px;
  }

  .content-wrap {
    padding: 60px 40px 100px;
  }
}

/* ── Responsive: 768px ───────────────────────────── */
@media (max-width: 768px) {
  .mobile-bar {
    display: block;
  }

  .nav-overlay {
    display: block;
  }

  /* Sidebar slides in from left */
  .sidebar {
    transform: translateX(-100%);
    transition: transform var(--dur-base) var(--ease),
                box-shadow var(--dur-base) ease;
    top: 0;
    height: 100%;
    z-index: 150;
  }

  .sidebar.is-open {
    transform: translateX(0);
    box-shadow: 4px 0 32px rgba(42, 38, 37, 0.1);
  }

  .main-content {
    margin-left: 0;
  }

  .site-footer {
    margin-left: 0;
  }

  .content-wrap {
    padding: 40px 24px 80px;
  }

  .page-title {
    font-size: 30px;
  }

  .page-lead {
    font-size: 15px;
  }

  .section-hd h2 {
    font-size: 19px;
  }

  .footer-inner {
    padding: 20px 24px;
  }

  .policy-section {
    scroll-margin-top: 64px; /* account for sticky mobile bar */
  }

  .progress-bar {
    left: 0;
    top: 53px; /* below sticky mobile bar */
    z-index: 190;
  }

  .back-top {
    bottom: 20px;
    right: 20px;
    width: 36px;
    height: 36px;
  }
}

/* ── Responsive: 480px ───────────────────────────── */
@media (max-width: 480px) {
  .content-wrap {
    padding: 28px 16px 72px;
  }

  .page-title {
    font-size: 26px;
  }

  .page-lead {
    font-size: 14.5px;
  }

  .section-hd h2 {
    font-size: 17.5px;
  }

  /* Always show copy button on touch devices */
  .copy-anchor {
    opacity: 1;
  }

  .contact-card {
    padding: 18px 18px;
  }

  .footer-right {
    display: none;
  }
}

/* ── Print ───────────────────────────────────────── */
@media print {
  .sidebar,
  .mobile-bar,
  .copy-anchor,
  .toast {
    display: none !important;
  }

  .main-content,
  .site-footer {
    margin-left: 0 !important;
  }

  .content-wrap {
    padding: 0 !important;
    max-width: 100% !important;
  }

  .policy-section {
    break-inside: avoid;
  }
}
