/* ---------- Legal page hero ---------- */

.legal-hero {
  position: relative;
  padding: calc(var(--header-h) + 64px) 0 56px;
  border-bottom: 1px solid var(--line);
  background:
    radial-gradient(50% 80% at 90% 0%, rgba(52, 89, 166, 0.09), transparent 70%),
    linear-gradient(180deg, #f8fafd, var(--white));
}

.legal-title {
  margin-top: 24px;
  font-size: clamp(42px, 6.4vw, 76px);
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: -0.045em;
}

/* ---------- Shared legal typography ---------- */

.legal-prose p,
.legal-prose li {
  font-size: 16.5px;
  line-height: 1.75;
  color: var(--ink-2);
}

.legal-prose p {
  margin: 0 0 16px;
}

.legal-prose strong {
  font-weight: 600;
  color: var(--ink);
}

.legal-prose a {
  color: var(--blue);
  text-decoration: underline;
  text-decoration-color: rgba(52, 89, 166, 0.35);
  text-underline-offset: 3px;
  overflow-wrap: anywhere;
  transition: text-decoration-color 0.2s ease;
}

.legal-prose a:hover {
  text-decoration-color: var(--blue);
}

.legal-prose ul {
  margin: 0 0 16px;
  padding-left: 22px;
  list-style: disc;
}

.legal-prose li {
  margin-bottom: 10px;
  padding-left: 4px;
}

.legal-prose li::marker {
  color: var(--blue);
}

/* ---------- Imprint ---------- */

.imprint {
  padding: 56px 0 120px;
}

.imprint-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
}

.imprint-card {
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--white);
}

.imprint-card .dropdown-icon {
  margin-bottom: 24px;
}

.imprint-card h2 {
  margin: 0 0 12px;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.015em;
}

.imprint-card p:last-child {
  margin-bottom: 0;
}

.imprint-company {
  display: grid;
  gap: 24px;
  background: #f6f8fc;
}

.imprint-company p {
  margin: 0;
  color: var(--ink);
}

/* ---------- Privacy policy ---------- */

.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 110;
  height: 3px;
  background: var(--blue);
  transform: scaleX(0);
  transform-origin: left;
  pointer-events: none;
}

.legal-layout {
  display: grid;
  gap: 32px;
  padding-top: 48px;
  padding-bottom: 120px;
}

.toc-mobile {
  border: 1px solid var(--line);
  border-radius: 20px;
  background: #f6f8fc;
}

.toc-mobile summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  font-size: 15px;
  font-weight: 600;
  list-style: none;
  cursor: pointer;
}

.toc-mobile summary::-webkit-details-marker {
  display: none;
}

.toc-mobile summary svg {
  width: 16px;
  height: 16px;
  transition: transform 0.35s var(--ease);
}

.toc-mobile[open] summary svg {
  transform: rotate(180deg);
}

.toc-mobile ol {
  padding: 0 12px 12px;
}

.toc-desktop {
  display: none;
}

.toc-label {
  margin-bottom: 16px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-2);
}

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

.toc-link {
  display: flex;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 14.5px;
  font-weight: 500;
  line-height: 1.4;
  color: var(--ink-2);
  transition: background-color 0.25s ease, color 0.25s ease;
}

.toc-link:hover {
  color: var(--ink);
  background: rgba(11, 13, 18, 0.04);
}

.toc-link .toc-num {
  flex: none;
  width: 18px;
  font-weight: 600;
  color: rgba(11, 13, 18, 0.3);
  transition: color 0.25s ease;
}

.toc-link.is-active {
  color: var(--ink);
  background: var(--blue-50);
}

.toc-link.is-active .toc-num {
  color: var(--blue);
}

.privacy-content {
  min-width: 0;
  max-width: 760px;
}

.privacy-content h2 {
  margin: 72px 0 20px;
  padding-top: 40px;
  border-top: 1px solid var(--line);
  font-size: clamp(26px, 3vw, 34px);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.025em;
  scroll-margin-top: calc(var(--header-h) + 24px);
}

.privacy-content h2:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.privacy-content h3 {
  margin: 40px 0 12px;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: -0.015em;
}

.privacy-content h4 {
  margin: 28px 0 10px;
  font-size: 16.5px;
  font-weight: 600;
  line-height: 1.45;
}

.privacy-content h2 + h3 {
  margin-top: 0;
}

/* ---------- Breakpoints ---------- */

@media (min-width: 768px) {
  .imprint-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .imprint-company {
    grid-column: 1 / -1;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    padding: 36px;
  }

  .imprint-company .dropdown-icon {
    grid-column: 1 / -1;
    margin-bottom: 0;
  }
}

@media (min-width: 1024px) {
  .legal-hero {
    padding: calc(var(--header-h) + 96px) 0 72px;
  }

  .legal-layout {
    grid-template-columns: 280px minmax(0, 1fr);
    gap: 88px;
    padding-top: 72px;
    padding-bottom: 140px;
  }

  .toc-mobile {
    display: none;
  }

  .toc-desktop {
    display: block;
    position: sticky;
    top: calc(var(--header-h) + 40px);
    align-self: start;
  }
}
