/* ============================================================
   Legal pages (privacy.html, terms.html)
   Calm and readable: a dark summary card, a sticky contents rail,
   numbered sections, and highlighted callouts for the promises that matter.
   ============================================================ */

/* Reading progress */
.legal-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  z-index: 60;
  background: transparent;
  pointer-events: none;
}
.legal-progress i {
  display: block;
  height: 100%;
  width: 100%;
  background: var(--ink);
  transform: scaleX(0);
  transform-origin: left center;
}

/* Hero */
.legal-hero {
  max-width: var(--container);
  margin: 0 auto;
  padding: 180px 80px 64px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: center;
}
.legal-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 24px;
}
.legal-eyebrow::before {
  content: '';
  width: 20px;
  height: 1px;
  background: var(--brand);
  opacity: .6;
}
.legal-title {
  font-family: var(--font-display);
  font-size: clamp(2.6rem, 4.6vw, 4.2rem);
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.03em;
  line-height: 1.02;
  margin: 0 0 22px;
}
.legal-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 24px;
}
.legal-meta span {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
  padding: 6px 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-pill);
  background: rgba(255, 255, 255, .6);
}
.legal-intro {
  font-size: 1.125rem;
  line-height: 1.7;
  color: var(--muted);
  max-width: 440px;
  margin: 0;
}

/* Summary card */
.legal-summary {
  position: relative;
  background: var(--ink);
  color: #fff;
  border-radius: var(--r-panel);
  padding: 40px 42px;
  box-shadow: var(--shadow-l);
  overflow: hidden;
}
.legal-summary::after {
  content: '';
  position: absolute;
  right: -90px;
  top: -90px;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, .10), transparent 68%);
  pointer-events: none;
}
.legal-summary h2 {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .55);
  margin: 0 0 22px;
}
.legal-summary ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.legal-summary li {
  position: relative;
  font-size: 0.97rem;
  line-height: 1.6;
  color: rgba(255, 255, 255, .88);
  margin: 0 0 14px;
  padding-left: 30px;
}
.legal-summary li:last-child { margin-bottom: 0; }
.legal-summary li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 3px;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .14);
}
.legal-summary li::after {
  content: '';
  position: absolute;
  left: 6px;
  top: 7px;
  width: 4px;
  height: 7px;
  border: solid #fff;
  border-width: 0 1.5px 1.5px 0;
  transform: rotate(45deg);
}
.legal-summary .fine {
  font-size: 13px;
  line-height: 1.55;
  color: rgba(255, 255, 255, .5);
  margin: 24px 0 0;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, .14);
}

/* Body: contents rail + text */
.legal-wrap {
  max-width: var(--container);
  margin: 0 auto;
  padding: 24px 80px 0;
  display: grid;
  grid-template-columns: 232px 1fr;
  gap: 64px;
  align-items: start;
}
.legal-toc {
  position: sticky;
  top: 112px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px;
  max-height: calc(100vh - 220px);
  overflow-y: auto;
  scrollbar-width: none;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-s);
}
.legal-toc::-webkit-scrollbar { display: none; }
.legal-toc a {
  font-family: var(--font-body);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  line-height: 1.3;
  padding: 6px 12px;
  border-radius: 10px;
  transition: color .18s ease, background-color .18s ease;
}
.legal-toc a:hover { color: var(--ink); background: var(--brand-ghost); }
.legal-toc a.is-active {
  color: #fff;
  background: var(--ink);
  font-weight: 600;
}

.legal-content { max-width: 700px; padding-bottom: 220px; }
.legal-section {
  padding: 40px 0;
  border-top: 1px solid var(--line);
  scroll-margin-top: 100px;
}
.legal-section:first-of-type { border-top: none; padding-top: 0; }
.legal-section h2 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.5rem;
  line-height: 1.2;
  letter-spacing: -0.015em;
  color: var(--ink);
  margin: 0 0 18px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.legal-section h2 .num {
  flex: none;
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--muted);
  padding: 5px 10px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-pill);
  background: var(--surface);
}
.legal-section p {
  font-size: 1.0125rem;
  line-height: 1.78;
  color: var(--ink-soft);
  margin: 0 0 14px;
}
.legal-section p:last-child { margin-bottom: 0; }
.legal-section ul {
  list-style: none;
  margin: 0 0 14px;
  padding: 0;
}
.legal-section ul:last-child { margin-bottom: 0; }
.legal-section li {
  position: relative;
  font-size: 1.0125rem;
  line-height: 1.72;
  color: var(--ink-soft);
  margin: 0 0 10px;
  padding-left: 22px;
}
.legal-section li::before {
  content: '';
  position: absolute;
  left: 4px;
  top: 0.72em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--ink);
  opacity: .35;
}
.legal-section strong { color: var(--ink); font-weight: 600; }
.legal-section a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--line-strong);
  text-underline-offset: 3px;
  transition: text-decoration-color .18s ease;
}
.legal-section a:hover { text-decoration-color: var(--ink); }

/* The promises that matter: refund, guarantees */
.legal-section p.legal-callout {
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 3px solid var(--ink);
  border-radius: 14px;
  padding: 18px 22px;
  margin: 18px 0;
  color: var(--ink);
  box-shadow: var(--shadow-s);
}

/* Contact card */
.legal-contact {
  margin-top: 48px;
  background: var(--ink);
  border-radius: var(--r-panel);
  padding: 52px 44px;
  text-align: center;
  box-shadow: var(--shadow-l);
}
.legal-contact h2 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.75rem;
  letter-spacing: -0.015em;
  color: #fff;
  margin: 0 0 10px;
}
.legal-contact p {
  font-size: 1rem;
  line-height: 1.6;
  color: rgba(255, 255, 255, .62);
  margin: 0 0 24px;
}
.legal-contact a.mail {
  display: inline-block;
  font-weight: 600;
  font-size: 0.97rem;
  color: var(--ink);
  background: #fff;
  text-decoration: none;
  padding: 14px 28px;
  border-radius: var(--r-pill);
  transition: transform .25s var(--ease-out), box-shadow .25s var(--ease-out);
}
.legal-contact a.mail:hover { transform: translateY(-2px); box-shadow: 0 10px 28px rgba(0, 0, 0, .3); }
.legal-crosslink {
  text-align: center;
  margin-top: 28px;
}
.legal-crosslink a {
  display: inline-block;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--ink);
  text-decoration: none;
  padding: 11px 22px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-pill);
  background: var(--surface);
  transition: border-color .2s, transform .25s var(--ease-out);
}
.legal-crosslink a:hover { border-color: var(--ink); transform: translateY(-1px); }

@media (max-width: 900px) {
  .legal-hero {
    grid-template-columns: 1fr;
    padding: 140px 32px 40px;
    gap: 36px;
  }
  .legal-intro { max-width: none; }
  .legal-wrap {
    grid-template-columns: 1fr;
    padding: 0 32px;
    gap: 28px;
  }
  .legal-toc {
    position: static;
    flex-direction: row;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding: 8px;
    gap: 4px;
    scrollbar-width: none;
  }
  .legal-toc::-webkit-scrollbar { display: none; }
  .legal-toc a { white-space: nowrap; flex: none; }
  .legal-content { max-width: none; }
}
@media (max-width: 600px) {
  .legal-hero { padding: 130px 20px 32px; }
  .legal-wrap { padding: 0 20px; }
  .legal-summary { padding: 30px 24px; }
  .legal-contact { padding: 38px 24px; }
  .legal-section { padding: 32px 0; }
  .legal-section h2 { font-size: 1.3rem; }
}
@media (prefers-reduced-motion: reduce) {
  .legal-contact a.mail, .legal-crosslink a { transition: none; }
}
@media print {
  .legal-progress, .legal-toc, .legal-contact, .legal-crosslink { display: none; }
  .legal-wrap { display: block; padding: 0; }
  .legal-summary { background: none; color: #000; box-shadow: none; border: 1px solid #999; }
  .legal-summary li, .legal-summary h2, .legal-summary .fine { color: #000; }
}
