/* =============================================
   LEGAL-STYLES.CSS
   Shared stylesheet for Privacy Policy + Terms of Service.
   Self-contained (tokens + nav + footer + content), matching the
   per-page-silo convention used by hw-styles.css / ce-styles.css.
   ============================================= */

:root {
  /* Core colours */
  --primary:          #4b2a63;
  --primary-light:    #844cac;
  --primary-dark:     #3a2050;
  --surface:          #f6f5f1;
  --accent:           #9bcf6a;
  --accent-ink:       #547a2f; /* same ~90° hue as --accent, darkened for AA text contrast (5:1 on white) — --accent itself only hits 3.3:1 and fails for small-caps eyebrow text */
  --amber:            #d4a04b;
  --white:            #ffffff;
  --charcoal:         #1a1a1a;

  /* Primary alpha scale */
  --primary-05:  rgba(75, 42, 99, 0.05);
  --primary-08:  rgba(75, 42, 99, 0.08);
  --primary-10:  rgba(75, 42, 99, 0.10);
  --primary-22:  rgba(75, 42, 99, 0.22);
  --primary-35:  rgba(75, 42, 99, 0.35);
  --primary-45:  rgba(75, 42, 99, 0.45);

  /* Charcoal alpha scale */
  --charcoal-04:  rgba(26, 26, 26, 0.04);
  --charcoal-07:  rgba(26, 26, 26, 0.07);
  --charcoal-10:  rgba(26, 26, 26, 0.10);
  --charcoal-50:  rgba(26, 26, 26, 0.50);
  --charcoal-60:  rgba(26, 26, 26, 0.60);
  --charcoal-75:  rgba(26, 26, 26, 0.75);

  /* Amber alpha scale — draft/review banner only */
  --amber-08:  rgba(212, 160, 75, 0.08);
  --amber-30:  rgba(212, 160, 75, 0.35);

  /* Typography */
  --font-display: "Manrope", sans-serif;
  --font-body:    Inter, -apple-system, sans-serif;
  --font-mono:    "JetBrains Mono", monospace;

  --fs-mono-xs:  9.5px;
  --fs-ui-sm:    10.5px;
  --fs-ui-md:    12px;
  --fs-body-sm:  15px;
  --fs-body-md:  16px;
  --fs-body-lg:  17px;

  /* Spacing scale */
  --spacing-2xs: 8px;
  --spacing-xs:  12px;
  --spacing-sm:  16px;
  --spacing-md:  24px;
  --spacing-lg:  32px;
  --spacing-xl:  48px;
  --spacing-2xl: 56px;
  --spacing-3xl: 72px;
  --spacing-4xl: 96px;

  /* Border radius */
  --radius-sm:   8px;
  --radius-md:   14px;
  --radius-lg:   24px;
  --radius-xl:   32px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-card:    rgba(75, 42, 99, 0.06) 0px 2px 12px;
  --shadow-card-lg: 0px 1px 2px rgba(0,0,0,0.04), 0px 4px 16px rgba(0,0,0,0.06), 0px 12px 40px rgba(75, 42, 99, 0.08);
  --shadow-btn:     rgba(75, 42, 99, 0.22) 0px 4px 12px;

  /* Motion */
  --duration-base:   250ms;
  --duration-slow:   350ms;
  --ease-soft:       cubic-bezier(0.25, 0.1, 0.25, 1);
  --ease-smooth:     cubic-bezier(0.4, 0, 0.2, 1);

  /* Borders */
  --border-light:  1px solid var(--primary-08);
}

/* =============================================
   RESET + BASE
   ============================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-body);
  font-size: var(--fs-body-md);
  line-height: 1.6;
  color: var(--charcoal);
  background: var(--surface);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--primary); text-decoration: none; }

:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--spacing-sm);
}

.eyebrow {
  display: inline-block;
  font-family: var(--font-body);
  font-size: var(--fs-ui-md);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--accent-ink);
}
/* Eyebrow reads as lime-on-white in hw/ce hero context; on our cream page
   background straight --accent (#9bcf6a) fails contrast for small caps text,
   so we use a darkened same-hue value for AA contrast while keeping the
   established "eyebrow = accent hue" convention from the industry pages. */

@media print {
  .nav, #site-footer, .legal-toc, .legal-toc-mobile { display: none !important; }
  body { background: #fff !important; }
}

/* =============================================
   NAVIGATION (matches hw/ce/blog nav exactly)
   ============================================= */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  width: 100%;
  padding: 14px clamp(16px, 3vw, 28px) 0;
  background: transparent;
}

.nav-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 8px 20px;
  border-radius: 15px;
  background: rgba(246, 245, 241, 0.72);
  backdrop-filter: blur(10px) saturate(150%);
  -webkit-backdrop-filter: blur(10px) saturate(150%);
  border: 1px solid rgba(26, 26, 26, 0.05);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.03), 0 8px 20px rgba(75, 42, 99, 0.04);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--spacing-md);
  transition: background 260ms var(--ease-smooth), backdrop-filter 260ms var(--ease-smooth),
              border-color 260ms var(--ease-smooth), box-shadow 260ms var(--ease-smooth);
}

.nav-inner.is-scrolled {
  background: rgba(246, 245, 241, 0.94);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border-color: var(--charcoal-07);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05), 0 14px 32px rgba(75, 42, 99, 0.06);
}

.nav-logo { flex-shrink: 0; display: flex; align-items: center; gap: 10px; text-decoration: none; }
.nav-logo img { display: block; width: auto; height: 26px; }

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

.nav-links { display: none; align-items: center; gap: 40px; }
.nav-links a {
  font-size: 14px;
  font-weight: 500;
  color: rgba(26, 26, 26, 0.75);
  text-decoration: none;
  transition: color var(--duration-base) var(--ease-soft);
}
.nav-links a:hover { color: var(--primary); }
.nav-links a.nav-link-active { color: var(--primary); }

.nav-ctas { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }

.nav-demo-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 18px;
  height: 36px;
  background: var(--primary);
  border-radius: var(--radius-full);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  color: #F6F5F1;
  text-decoration: none;
  white-space: nowrap;
  transition: background var(--duration-base) var(--ease-soft), transform var(--duration-base) var(--ease-soft);
}
.nav-demo-btn:hover { background: var(--primary-dark); transform: translateY(-1px); color: #F6F5F1; }

.btn-wave-bars { display: inline-flex; align-items: center; gap: 2px; height: 15px; flex-shrink: 0; }
.btn-wave-bars span {
  display: block; width: 2.5px; height: 100%; border-radius: 2px;
  background: #F6F5F1; transform-origin: center; animation: wave 1.2s var(--ease-soft) infinite;
}
.btn-wave-bars span:nth-child(2) { animation-delay: 0.1s; }
.btn-wave-bars span:nth-child(3) { animation-delay: 0.2s; }
.btn-wave-bars span:nth-child(4) { animation-delay: 0.3s; }
@keyframes wave { 0%, 100% { transform: scaleY(0.4); } 50% { transform: scaleY(1); } }

.nav-hamburger {
  display: flex; flex-direction: column; justify-content: space-between;
  width: 24px; height: 18px; background: none; border: none; cursor: pointer; padding: 0; flex-shrink: 0;
}
.nav-hamburger span { display: block; height: 2px; background: var(--charcoal); border-radius: 2px; }

@media (min-width: 768px) {
  .nav-hamburger { display: none; }
  .nav-links { display: flex; }
}

/* =============================================
   LEGAL HERO
   ============================================= */
.legal-hero {
  padding: clamp(40px, 6vh, 64px) 0 clamp(28px, 4vh, 40px);
}

.legal-hero-inner {
  max-width: 720px;
}

.legal-hero .eyebrow { margin-bottom: 14px; }

.legal-hero h1 {
  font-family: var(--font-display);
  font-size: clamp(32px, 4.4vw, 48px);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--charcoal);
  margin-bottom: 14px;
}

.legal-hero-subtitle {
  font-size: var(--fs-body-lg);
  color: var(--charcoal-75);
  line-height: 1.6;
  max-width: 56ch;
  margin-bottom: 18px;
}

/* Draft / pending-review notice — amber is the system's existing
   "uncertain/warning" semantic colour (see emotion meter), reused here
   for a non-error, non-final-content notice rather than inventing a new hue.
   Flat left-accent notice, not a card — no shadow, no full border. */
.legal-draft-banner {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  max-width: 720px;
  margin: 0 0 clamp(28px, 4vh, 36px);
  padding: 16px 20px;
  background: var(--amber-08);
  border-left: 3px solid var(--amber);
}

.legal-draft-banner-icon {
  flex-shrink: 0;
  width: 20px; height: 20px;
  margin-top: 1px;
  color: var(--amber);
}

.legal-draft-banner-title {
  font-family: var(--font-body);
  font-size: 13.5px;
  font-weight: 700;
  color: var(--charcoal);
  margin-bottom: 3px;
}

.legal-draft-banner p {
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--charcoal-75);
}

/* =============================================
   LAYOUT — sticky TOC sidebar + content column
   ============================================= */
.legal-layout {
  display: flex;
  align-items: flex-start;
  gap: 40px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--spacing-sm) var(--spacing-4xl);
}

.legal-toc {
  width: 240px;
  flex-shrink: 0;
  position: sticky;
  top: 96px;
  max-height: calc(100vh - 112px);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--primary-22) transparent;
  padding: 0 14px 32px;
  margin: 0 -14px;
}
.legal-toc::-webkit-scrollbar { width: 3px; }
.legal-toc::-webkit-scrollbar-thumb { background: var(--primary-22); border-radius: 2px; }

.legal-toc-label {
  font-family: var(--font-body);
  font-size: var(--fs-ui-sm);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--accent-ink);
  margin-bottom: 14px;
  display: block;
}

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

.legal-toc-link {
  display: block;
  font-size: 13px;
  font-weight: 400;
  color: var(--charcoal-60);
  line-height: 1.5;
  padding: 6px 0 6px 12px;
  border-left: 2px solid transparent;
  transition: color var(--duration-base) var(--ease-smooth),
              border-color var(--duration-base) var(--ease-smooth);
}
.legal-toc-link:hover { color: var(--primary); }
.legal-toc-link.is-active {
  color: var(--primary);
  font-weight: 600;
  border-left-color: var(--primary);
}

.legal-toc-contact {
  margin-top: var(--spacing-xl);
  padding: 18px 18px 20px;
  border-top: 1px solid var(--charcoal-07);
}
.legal-toc-contact-title {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  color: var(--charcoal);
  margin-bottom: 6px;
}
.legal-toc-contact p { font-size: 12.5px; line-height: 1.5; color: var(--charcoal-60); margin-bottom: 10px; }
.legal-toc-contact a.legal-toc-contact-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
}
.legal-toc-contact a.legal-toc-contact-link:hover { text-decoration: underline; }

/* Mobile TOC — tap-to-expand accordion, shown <960px only.
   Uses the grid-template-rows 0fr→1fr trick so height animates smoothly
   without JS measuring the panel. */
.legal-toc-mobile { display: none; margin-bottom: var(--spacing-lg); }

.legal-toc-mobile-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 4px;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--charcoal-10);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  color: var(--charcoal);
  cursor: pointer;
}

.legal-toc-mobile-chevron {
  width: 16px; height: 16px; color: var(--charcoal-60); flex-shrink: 0;
  transition: transform var(--duration-base) var(--ease-smooth);
}
.legal-toc-mobile.is-open .legal-toc-mobile-chevron { transform: rotate(180deg); }

.legal-toc-mobile-body {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows var(--duration-slow) var(--ease-smooth);
}
.legal-toc-mobile.is-open .legal-toc-mobile-body { grid-template-rows: 1fr; }

.legal-toc-mobile-panel { overflow: hidden; }

.legal-toc-mobile-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 4px 14px;
}
.legal-toc-mobile-list a {
  display: block;
  padding: 8px 0 8px 12px;
  border-left: 2px solid transparent;
  font-size: 14px;
  color: var(--charcoal-75);
}
.legal-toc-mobile-list a:hover,
.legal-toc-mobile-list a.is-active { color: var(--primary); border-left-color: var(--primary); }

@media (max-width: 960px) {
  .legal-toc { display: none; }
  .legal-toc-mobile { display: block; }
  .legal-layout { flex-direction: column; gap: 0; padding: 0 var(--spacing-sm) var(--spacing-2xl); }
}

/* =============================================
   CONTENT COLUMN + PROSE
   ============================================= */
.legal-content {
  flex: 1 1 0;
  max-width: calc(56ch + 40px); /* prose cap (56ch) + a little edge room, no card padding needed since there's no card */
  min-width: 0;
}

.legal-section { padding-top: clamp(28px, 4vh, 40px); scroll-margin-top: 110px; }
.legal-section:first-child { padding-top: 0; }
.legal-section + .legal-section { border-top: 1px solid var(--charcoal-07); }

.legal-section h2 {
  font-family: var(--font-display);
  font-size: clamp(20px, 2.4vw, 24px);
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--charcoal);
  line-height: 1.3;
  margin-bottom: 14px;
}

.legal-section h3 {
  font-family: var(--font-display);
  font-size: 16.5px;
  font-weight: 700;
  color: var(--charcoal);
  margin: 20px 0 8px;
}

.legal-section p {
  max-width: 56ch;
  font-size: var(--fs-body-md);
  line-height: 1.7;
  color: var(--charcoal-75);
  margin-bottom: 14px;
}

.legal-section ul,
.legal-section ol {
  max-width: 56ch;
  margin: 0 0 14px;
  padding-left: 4px;
  list-style: none;
}

.legal-section ul li,
.legal-section ol li {
  position: relative;
  padding-left: 20px;
  font-size: var(--fs-body-md);
  line-height: 1.65;
  color: var(--charcoal-75);
  margin-bottom: 9px;
}

.legal-section ul li::before {
  content: "";
  position: absolute;
  left: 2px; top: 9px;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--primary-45);
}

.legal-section ol { counter-reset: legal-ol; }
.legal-section ol li { counter-increment: legal-ol; padding-left: 26px; }
.legal-section ol li::before {
  content: counter(legal-ol) ".";
  position: absolute;
  left: 0; top: 0;
  font-weight: 600;
  color: var(--primary);
  font-size: 13px;
}

.legal-section strong { font-weight: 700; color: var(--charcoal); }

.legal-section a { text-decoration: underline; text-underline-offset: 2px; }
.legal-section a:hover { color: var(--primary-dark); }

/* Inline flagged-for-review note used inside draft Terms copy */
.legal-review-note {
  display: block;
  margin: 10px 0 16px;
  padding: 12px 16px;
  background: var(--amber-08);
  border-left: 3px solid var(--amber);
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--charcoal-75);
  max-width: 56ch;
}
.legal-review-note strong { color: var(--charcoal); }

/* Contact block closing the document — flat bordered notice, no elevation */
.legal-contact-block {
  margin-top: clamp(28px, 4vh, 40px);
  padding: 20px 24px;
  border: 1px solid var(--charcoal-10);
  border-top: 2px solid var(--primary);
}
.legal-contact-block h3 {
  font-family: var(--font-display);
  font-size: 16.5px;
  font-weight: 700;
  color: var(--charcoal);
  margin-bottom: 10px;
}
.legal-contact-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px 24px;
}
.legal-contact-row { font-size: 14px; color: var(--charcoal-75); line-height: 1.6; }
.legal-contact-row span { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--charcoal-50); margin-bottom: 2px; }
.legal-contact-row a { color: var(--primary); font-weight: 600; }

@media (max-width: 640px) {
  .legal-contact-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .legal-toc-mobile-body { transition: none; }
}

/* =============================================
   FOOTER (matches hw/ce/blog footer exactly)
   ============================================= */
#site-footer {
  background: var(--primary);
  color: rgba(255, 255, 255, 0.8);
  padding: var(--spacing-xl) 0 var(--spacing-lg);
  margin-top: clamp(48px, 8vh, 96px);
}
.footer-inner { max-width: 1200px; margin: 0 auto; padding: 0 var(--spacing-lg); display: flex; flex-direction: column; gap: var(--spacing-lg); }
.footer-top { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--spacing-xl); flex-wrap: wrap; }
.footer-logo { text-decoration: none; display: flex; align-items: center; }
.footer-logo img { height: 28px; width: auto; filter: brightness(0) invert(1); }
.footer-nav { display: flex; align-items: flex-start; gap: 0 var(--spacing-xl); flex-wrap: wrap; }
.footer-col { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.footer-col-heading {
  font-family: var(--font-body); font-weight: 600; font-size: 12px; line-height: 18px;
  letter-spacing: 1.2px; text-transform: uppercase; color: rgba(255, 255, 255, 0.5); margin-bottom: 2px;
}
.footer-nav a { font-family: var(--font-body); font-size: 14px; line-height: 21px; color: rgba(255, 255, 255, 0.6); text-decoration: none; transition: color 0.2s var(--ease-smooth); }
.footer-nav a:hover { color: var(--white); }
.footer-nav a.footer-col-heading { font-size: 12px; line-height: 18px; letter-spacing: 1.2px; text-transform: uppercase; font-weight: 600; color: rgba(255, 255, 255, 0.5); }
.footer-nav a.footer-col-heading:hover { color: rgba(255, 255, 255, 0.85); }
.footer-bottom { display: flex; align-items: center; justify-content: space-between; padding-top: var(--spacing-md); border-top: 1px solid rgba(255, 255, 255, 0.1); gap: var(--spacing-sm); flex-wrap: wrap; }
.footer-copy { font-family: var(--font-body); font-size: 13px; line-height: 20px; color: rgba(255, 255, 255, 0.35); }
.footer-social { display: flex; align-items: center; gap: var(--spacing-xs); }
.footer-social-link { display: flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, 0.18); color: rgba(255, 255, 255, 0.6); text-decoration: none; transition: background 0.2s var(--ease-smooth), color 0.2s var(--ease-smooth), border-color 0.2s var(--ease-smooth); }
.footer-social-link:hover { background: rgba(255, 255, 255, 0.1); color: var(--white); border-color: rgba(255, 255, 255, 0.4); }
.footer-social-link svg { width: 16px; height: 16px; }

@media (max-width: 768px) {
  .footer-top { flex-direction: column; align-items: flex-start; gap: var(--spacing-lg); }
  .footer-nav { gap: var(--spacing-md) var(--spacing-xl); }
  .footer-nav a { padding: 4px 0; }
  .footer-col { gap: 6px; }
  .footer-bottom { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 640px) {
  .footer-nav { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px 24px; width: 100%; }
}
