/* ════════════════════════════════════════════════════════════
   LEGAL PAGES — shared editorial layout + scroll progress bar
   Used by every standalone legal page (privacy-policy.html,
   terms-of-service.html, legal-notice.html, shipping-policy.html,
   refund-policy.html). Loaded AFTER styles.css, so it inherits
   all design tokens, header/footer, and button styles from the
   main site — this file only adds what's unique to long-form
   reading pages.

   Per-page accent colors are NOT hardcoded here — each page's
   own {slug}.css sets a couple of custom properties (see bottom)
   so this file stays a single shared source of truth, not five
   copies of the same rules.
════════════════════════════════════════════════════════════ */

/* Standalone pages have no #app, so this plays #app's role —
   pushes the footer to the bottom on short pages. */
.legal-main { flex: 1; }

/* ── Scroll progress — vertical bar fixed right (desktop) with a
   live % readout, horizontal bar fixed top (mobile, no readout).
   JS only ever sets --sp + the .textContent of the % label. ── */
.legal-progress {
  position: fixed;
  top: 50%;
  right: 26px;
  transform: translateY(-50%);
  z-index: 60;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  pointer-events: none;
}
.legal-progress__track {
  width: 3px;
  height: min(38vh, 280px);
  background: var(--gray-200);
  border-radius: 3px;
  overflow: hidden;
}
.legal-progress__fill {
  width: 100%;
  height: 100%;
  background: var(--legal-accent, var(--accent));
  box-shadow: 0 0 12px var(--legal-accent-glow, rgba(167,31,69,0.35));
  transform: scaleY(var(--sp, 0));
  transform-origin: top;
  border-radius: 3px;
  transition: transform 0.12s linear;
}
.legal-progress__pct {
  font-size: 11px;
  font-weight: 800;
  color: var(--text-faint);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* Hero / title block — fades up on first paint, subtle accent glow */
.legal-hero {
  position: relative;
  isolation: isolate;
  max-width: 760px;
  margin: 0 auto;
  padding: clamp(48px, 8vh, 88px) var(--pad-x) 0;
}
.legal-hero::before {
  content: '';
  position: absolute;
  top: -70px;
  right: -8%;
  width: 380px;
  height: 380px;
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(circle, var(--legal-accent-tint, rgba(167,31,69,0.07)), transparent 70%);
}
@keyframes legalFadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}
.legal-hero__kicker,
.legal-hero__title,
.legal-hero__intro,
.legal-hero__meta { animation: legalFadeUp 0.6s var(--ease) both; }
.legal-hero__title  { animation-delay: 0.05s; }
.legal-hero__intro  { animation-delay: 0.1s; }
.legal-hero__meta   { animation-delay: 0.15s; }

.legal-hero__kicker {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--legal-accent, var(--accent));
  margin-bottom: 14px;
}
.legal-hero__title {
  font-size: clamp(32px, 4.4vw, 52px);
  font-weight: 900;
  letter-spacing: -0.03em;
  line-height: 1.05;
  color: var(--text-primary);
  margin-bottom: 16px;
}
.legal-hero__intro {
  font-size: 17px;
  line-height: 1.6;
  color: var(--text-muted);
  max-width: 38rem;
  margin-bottom: 18px;
}
.legal-hero__meta {
  font-size: 13px;
  color: var(--text-faint);
  padding-bottom: 28px;
  border-bottom: 1px solid var(--border);
}

/* Body — narrow column for readable line length (~70 char) */
.legal-body {
  max-width: 720px;
  margin: 0 auto;
  padding: 8px var(--pad-x) 0;
}

/* Each section reveals once, staggered — see initReveal() in legal-shared.js */
.legal-section {
  padding: 44px 0;
  border-bottom: 1px solid var(--border);
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.55s var(--ease), transform 0.55s var(--ease);
}
.legal-section.is-visible { opacity: 1; transform: translateY(0); }
.legal-section:last-child { border-bottom: none; }

.legal-section__head {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin-bottom: 18px;
}
.legal-section__no {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: var(--legal-accent, var(--accent));
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}
.legal-section__title {
  font-size: 23px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  scroll-margin-top: calc(var(--header-h) + 24px);
}

.legal-h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 24px 0 10px;
}

.legal-p {
  font-size: 15.5px;
  line-height: 1.78;
  color: var(--text-body);
  margin-bottom: 16px;
}
.legal-p:last-child { margin-bottom: 0; }

/* ── Contacts / business-details card (About page) ──────────
   A clean white card with icon rows — premium, not a dry list.
   Icons inherit the page accent via currentColor. */
.legal-contacts {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 6px 22px;
  margin: 4px 0 18px;
  box-shadow: var(--shadow-sm, 0 1px 2px rgba(17,17,17,0.04));
}
.legal-contacts__row {
  display: grid;
  grid-template-columns: 38px 170px 1fr;
  align-items: center;
  gap: 14px;
  padding: 15px 0;
}
.legal-contacts__row + .legal-contacts__row { border-top: 1px solid var(--gray-50, #f3f3f3); }
.legal-contacts__icon {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--legal-accent, var(--accent));
  background: var(--legal-accent-tint, rgba(17, 17, 17, 0.05));
}
.legal-contacts__icon svg { width: 19px; height: 19px; }
.legal-contacts__label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-faint);
  letter-spacing: 0.01em;
}
.legal-contacts__value {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.5;
  word-break: break-word;
}
a.legal-contacts__value { color: var(--legal-accent, var(--accent)); text-decoration: none; }
a.legal-contacts__value:hover { text-decoration: underline; text-underline-offset: 3px; }
@media (max-width: 599px) {
  /* Phones: icon + label on one line, value below — no cramped columns. */
  .legal-contacts__row {
    grid-template-columns: 38px 1fr;
    grid-template-areas: 'icon label' 'icon value';
    row-gap: 3px;
  }
  .legal-contacts__icon  { grid-area: icon; }
  .legal-contacts__label { grid-area: label; }
  .legal-contacts__value { grid-area: value; }
}

/* Fine-print disclaimer (e.g. Mojang/Microsoft non-affiliation) */
.legal-note {
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--text-faint);
  margin-top: 4px;
}

.legal-list {
  display: flex;
  flex-direction: column;
  gap: 11px;
  margin-bottom: 16px;
}
.legal-list li {
  position: relative;
  padding-left: 22px;
  font-size: 15.5px;
  line-height: 1.65;
  color: var(--text-body);
  transition: color 0.15s;
}
.legal-list li:hover { color: var(--text-primary); }
.legal-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 9px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--legal-accent, var(--accent));
  transition: transform 0.15s var(--ease-spring);
}
.legal-list li:hover::before { transform: scale(1.3); }

/* Cross-links to the other legal pages */
.legal-switch {
  max-width: 720px;
  margin: 0 auto;
  padding: 36px var(--pad-x) 96px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.legal-switch__link {
  padding: 9px 16px;
  border-radius: 999px;
  border: 1px solid var(--border);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--white);
  transition: color 0.18s, border-color 0.18s, background 0.18s, transform 0.18s var(--ease);
}
.legal-switch__link:hover {
  color: var(--text-primary);
  border-color: var(--gray-300);
  background: var(--gray-50);
  transform: translateY(-1px);
}

@media (max-width: 899px) {
  .legal-progress {
    top: var(--header-h);
    right: 0; left: 0;
    bottom: auto;
    transform: none;
    flex-direction: row;
    gap: 0;
  }
  .legal-progress__track { width: 100%; height: 3px; border-radius: 0; }
  .legal-progress__fill {
    transform: scaleX(var(--sp, 0));
    transform-origin: left;
    border-radius: 0;
    box-shadow: none;
  }
  .legal-progress__pct { display: none; }

  .legal-hero::before { display: none; }
  .legal-hero  { padding: 32px var(--pad-x-sm) 0; }
  .legal-body  { padding: 8px var(--pad-x-sm) 0; }
  .legal-switch{ padding: 28px var(--pad-x-sm) 72px; }
  .legal-hero__title { font-size: 30px; }
}

@media (prefers-reduced-motion: reduce) {
  .legal-hero::before { display: none; }
}
