/* Legal pages — Privacy & Terms (Pacewin) */
.legal-body {
  --legal-navy: #01284f;
  --legal-teal: #005f8d;
  --legal-ink: #132536;
  --legal-mute: rgba(19, 37, 54, 0.72);
  --legal-line: rgba(1, 40, 79, 0.1);
  --legal-soft: #eef6fb;
  --legal-pop: #ff4d2e;
  --legal-display: "Plus Jakarta Sans", "IBM Plex Sans", sans-serif;
  --legal-body: "IBM Plex Sans", "Plus Jakarta Sans", sans-serif;
  /*
    Cancel the sitewide white body offset. The blue legal header itself
    clears the fixed navbar so there is no empty white band underneath it.
  */
  --page-top-offset: 0px;
  padding-top: 0;
  background:
    radial-gradient(1200px 520px at 8% -10%, rgba(0, 95, 141, 0.14), transparent 55%),
    radial-gradient(900px 480px at 92% 8%, rgba(255, 77, 46, 0.08), transparent 50%),
    linear-gradient(180deg, #f7fbfd 0%, #eef4f8 42%, #f8fafc 100%);
  color: var(--legal-ink);
  font-family: var(--legal-body);
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.legal-hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  /* Clear fixed navbar inside the blue band (not as white page padding) */
  padding: calc(var(--nav-bar-h, 4.35rem) + 0.55rem) 0 0.7rem;
  background:
    linear-gradient(135deg, #001830 0%, #01284f 48%, #005f8d 100%);
  color: #fff;
}

.legal-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 90% at 90% 0%, rgba(220, 238, 246, 0.12), transparent 55%);
  pointer-events: none;
  z-index: 0;
}

.legal-hero__grid {
  display: none;
}

.legal-hero__inner {
  position: relative;
  z-index: 1;
  width: min(1120px, calc(100% - 2.5rem));
  margin-inline: auto;
}

.legal-back {
  display: none;
}

.legal-hero__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.35rem;
}

.legal-hero__top .legal-crumbs {
  margin-bottom: 0;
}

.legal-crumbs a {
  color: rgba(255, 255, 255, 0.72);
  text-decoration: none;
  transition: color 0.2s ease;
}

.legal-crumbs a:hover {
  color: #fff;
}

.legal-brand {
  display: none;
}

.legal-hero h1 {
  font-family: var(--legal-display);
  font-size: clamp(1.25rem, 2.2vw, 1.5rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin: 0 0 0.3rem;
  max-width: none;
  color: #fff;
  text-wrap: balance;
}

.legal-hero__lede {
  margin: 0;
  max-width: 42rem;
  font-family: var(--legal-body);
  font-size: clamp(0.88rem, 1.5vw, 0.95rem);
  font-weight: 400;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.74);
  text-wrap: pretty;
}

.legal-hero__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem 0.75rem;
  margin-top: 0.55rem;
}

.legal-updated {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--legal-body);
  font-size: 0.78rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.65);
}

.legal-updated::before {
  content: "";
  width: 0.38rem;
  height: 0.38rem;
  border-radius: 50%;
  background: #3ee0d0;
  box-shadow: 0 0 0 3px rgba(62, 224, 208, 0.16);
}

.legal-switch {
  display: inline-flex;
  gap: 0.25rem;
  padding: 0.2rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(8px);
}

.legal-switch a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2rem;
  min-width: 4.5rem;
  padding: 0.25rem 0.85rem;
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.78);
  text-decoration: none;
  font-family: var(--legal-display);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  transition: background 0.2s ease, color 0.2s ease;
}

.legal-switch a:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.legal-switch a.is-active {
  background: #fff;
  color: var(--legal-navy);
}

.legal-shell {
  width: min(1120px, calc(100% - 2.5rem));
  margin: 1.25rem auto 0;
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(12rem, 15.5rem) minmax(0, 1fr);
  gap: clamp(1.25rem, 3vw, 2.5rem);
  padding-bottom: clamp(3rem, 7vw, 5rem);
  align-items: start;
}

.legal-toc {
  position: sticky;
  top: calc(var(--nav-bar-h, 72px) + 1rem);
  padding: 1.1rem 1rem;
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid var(--legal-line);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 12px 32px rgba(1, 40, 79, 0.06);
}

.legal-toc__label {
  margin: 0 0 0.75rem;
  font-family: var(--legal-display);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--legal-mute);
}

.legal-toc ol {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.2rem;
}

.legal-toc a {
  display: block;
  padding: 0.55rem 0.65rem;
  border-radius: 0.55rem;
  color: var(--legal-navy);
  text-decoration: none;
  font-family: var(--legal-body);
  font-size: 0.88rem;
  font-weight: 500;
  line-height: 1.35;
  border-left: 2px solid transparent;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

.legal-toc a:hover {
  background: var(--legal-soft);
}

.legal-toc a.is-active {
  background: linear-gradient(90deg, rgba(0, 95, 141, 0.1), transparent);
  border-left-color: var(--legal-teal);
  color: var(--legal-teal);
  font-weight: 600;
}

.legal-doc {
  min-width: 0;
  display: grid;
  gap: 0.9rem;
}

.legal-intro {
  padding: 1.35rem 1.45rem;
  border-radius: 1.1rem;
  background: #fff;
  border: 1px solid var(--legal-line);
  box-shadow: 0 14px 36px rgba(1, 40, 79, 0.05);
}

.legal-intro p {
  margin: 0;
  color: var(--legal-mute);
  font-family: var(--legal-body);
  font-size: clamp(0.98rem, 1.4vw, 1.06rem);
  font-weight: 400;
  line-height: 1.7;
  text-wrap: pretty;
}

.legal-section {
  --i: 0;
  position: relative;
  padding: 1.35rem 1.45rem 1.45rem 1.55rem;
  border-radius: 1.1rem;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--legal-line);
  box-shadow: 0 10px 28px rgba(1, 40, 79, 0.04);
  content-visibility: auto;
  contain-intrinsic-size: 220px;
  opacity: 0;
  transform: translateY(16px);
  transition:
    opacity 0.55s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.55s cubic-bezier(0.16, 1, 0.3, 1);
  transition-delay: calc(var(--i) * 40ms);
}

.legal-section::before {
  content: "";
  position: absolute;
  left: 0;
  top: 1rem;
  bottom: 1rem;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: linear-gradient(180deg, var(--legal-teal), var(--legal-pop));
}

.legal-section.is-inview {
  opacity: 1;
  transform: none;
}

.legal-section__index {
  display: none;
}

.legal-section h2 {
  font-family: var(--legal-display);
  font-size: clamp(1.12rem, 2vw, 1.32rem);
  font-weight: 800;
  letter-spacing: -0.025em;
  color: var(--legal-navy);
  margin: 0 0 0.7rem;
  scroll-margin-top: calc(var(--nav-bar-h, 72px) + 1.25rem);
  text-wrap: balance;
}

.legal-section p,
.legal-section li {
  color: var(--legal-mute);
  font-family: var(--legal-body);
  font-size: clamp(0.95rem, 1.35vw, 1.02rem);
  font-weight: 400;
  line-height: 1.72;
  letter-spacing: 0.005em;
}

.legal-section p {
  margin: 0 0 0.8rem;
  text-wrap: pretty;
  max-width: 65ch;
}

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

.legal-section ul {
  margin: 0.15rem 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.65rem;
  max-width: 65ch;
}

.legal-section li {
  position: relative;
  padding-left: 1.35rem;
}

.legal-section li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.62rem;
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: color-mix(in srgb, var(--legal-teal) 70%, #fff);
  box-shadow: 0 0 0 3px rgba(0, 95, 141, 0.12);
}

.legal-section a {
  color: var(--legal-teal);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  word-break: break-word;
}

.legal-section a:hover {
  color: var(--legal-pop);
}

.legal-cta {
  margin-top: 0.35rem;
  padding: 1.45rem 1.5rem;
  border-radius: 1.15rem;
  background:
    linear-gradient(135deg, rgba(1, 40, 79, 0.96), rgba(0, 95, 141, 0.92));
  color: #fff;
  display: grid;
  gap: 0.85rem;
  box-shadow: 0 18px 40px rgba(1, 40, 79, 0.18);
}

.legal-cta h2 {
  margin: 0;
  font-family: var(--legal-display);
  font-size: clamp(1.1rem, 2vw, 1.28rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.legal-cta p {
  margin: 0;
  font-family: var(--legal-body);
  font-size: 0.95rem;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.78);
  line-height: 1.6;
  max-width: 38rem;
  text-wrap: pretty;
}

.legal-cta__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.legal-cta__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.65rem;
  padding: 0.55rem 1.15rem;
  border-radius: 0.7rem;
  font-family: var(--legal-display);
  font-weight: 700;
  font-size: 0.92rem;
  text-decoration: none;
  transition: transform 0.18s ease, background 0.18s ease, color 0.18s ease;
}

.legal-cta__btn--primary {
  background: #fff;
  color: var(--legal-navy);
}

.legal-cta__btn--primary:hover {
  transform: translateY(-1px);
  background: #dceef6;
}

.legal-cta__btn--ghost {
  border: 1px solid rgba(255, 255, 255, 0.28);
  color: #fff;
  background: transparent;
}

.legal-cta__btn--ghost:hover {
  background: rgba(255, 255, 255, 0.08);
}

@media (prefers-reduced-motion: reduce) {
  .legal-section {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* Tablet */
@media (max-width: 900px) {
  .legal-shell {
    grid-template-columns: 1fr;
    margin-top: 1rem;
    gap: 0.95rem;
  }

  .legal-toc {
    position: relative;
    top: auto;
    padding: 0.85rem 0.85rem 0.7rem;
  }

  .legal-toc__label {
    margin-bottom: 0.55rem;
  }

  .legal-toc ol {
    display: flex;
    gap: 0.4rem;
    overflow-x: auto;
    padding-bottom: 0.35rem;
    margin: 0 -0.15rem;
    padding-inline: 0.15rem;
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x proximity;
  }

  .legal-toc a {
    white-space: nowrap;
    border-left: 0;
    border-bottom: 2px solid transparent;
    padding: 0.55rem 0.8rem;
    scroll-snap-align: start;
    font-size: 0.84rem;
  }

  .legal-toc a.is-active {
    border-left-color: transparent;
    border-bottom-color: var(--legal-teal);
  }
}

/* Phones */
@media (max-width: 640px) {
  .legal-hero {
    padding: calc(var(--nav-bar-h, 3.55rem) + 0.45rem) 0 0.65rem;
  }

  .legal-hero__inner,
  .legal-shell {
    width: min(100% - 1.25rem, 1120px);
  }

  .legal-hero h1 {
    font-size: 1.28rem;
  }

  .legal-hero__lede {
    font-size: 0.88rem;
    line-height: 1.45;
    display: none; /* keep mobile header compact */
  }

  .legal-hero__meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.55rem;
    margin-top: 0.65rem;
  }

  .legal-back {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    flex-shrink: 0;
    min-height: 2.1rem;
    padding: 0.3rem 0.7rem 0.3rem 0.5rem;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    text-decoration: none;
    font-family: var(--legal-display);
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    -webkit-tap-highlight-color: transparent;
  }

  .legal-back svg {
    width: 1rem;
    height: 1rem;
    display: block;
  }

  .legal-back:active {
    background: rgba(255, 255, 255, 0.2);
  }

  .legal-hero__top {
    margin-bottom: 0.55rem;
  }

  .legal-hero__top .legal-crumbs {
    display: none;
  }

  .legal-switch {
    width: 100%;
  }

  .legal-switch a {
    flex: 1;
    min-height: 2.35rem;
  }

  .legal-shell {
    margin-top: 0.85rem;
    padding-bottom: 2.5rem;
    gap: 0.75rem;
  }

  .legal-intro,
  .legal-section,
  .legal-cta {
    padding: 1.05rem 1rem 1.1rem;
    border-radius: 0.95rem;
  }

  .legal-section {
    padding-left: 1.15rem;
  }

  .legal-section::before {
    top: 0.85rem;
    bottom: 0.85rem;
  }

  .legal-section h2 {
    font-size: 1.08rem;
    margin-bottom: 0.55rem;
    scroll-margin-top: calc(var(--nav-bar-h, 64px) + 0.85rem);
  }

  .legal-intro p,
  .legal-section p,
  .legal-section li {
    font-size: 0.95rem;
    line-height: 1.68;
  }

  .legal-section p,
  .legal-section ul {
    max-width: none;
  }

  .legal-cta {
    gap: 0.7rem;
  }

  .legal-cta h2 {
    font-size: 1.08rem;
  }

  .legal-cta p {
    font-size: 0.9rem;
  }

  .legal-cta__actions {
    flex-direction: column;
    width: 100%;
  }

  .legal-cta__btn {
    width: 100%;
    min-height: 2.75rem;
  }
}

/* Small phones + safe areas */
@media (max-width: 400px) {
  .legal-hero__inner,
  .legal-shell {
    width: min(100% - 1rem, 1120px);
  }

  .legal-hero__lede {
    display: none;
  }

  .legal-toc a {
    font-size: 0.8rem;
    padding: 0.5rem 0.7rem;
  }
}

@supports (padding: max(0px)) {
  .legal-hero__inner,
  .legal-shell {
    padding-left: env(safe-area-inset-left, 0);
    padding-right: env(safe-area-inset-right, 0);
  }
}
