:root {
  --green-900: #0e1208;
  --green-800: #181e0d;
  --green-700: #283116;
  --accent: #4b6024;
  --paper: #f3efe7;
  --surface: #fffcf7;
  --ink: #1c1915;
  --muted: rgba(28, 25, 21, 0.88);
  --line: #ddd6c9;
  --on-dark: #f3efe7;
  --on-dark-muted: rgba(243, 239, 231, 0.74);
  --on-dark-line: rgba(243, 239, 231, 0.22);
  --radius: 16px;
  --shell: 68rem;
  --header-h: 56px;
  --header-top: 8px;
  --header-radius: 19px;
  --dock-h: 72px;
  --motion: 200ms cubic-bezier(0.22, 0.61, 0.36, 1);
  --sans: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 1rem);
}

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--ink);
  background:
    radial-gradient(ellipse 80% 50% at 10% -10%, rgba(75, 96, 36, 0.1), transparent 55%),
    radial-gradient(ellipse 60% 40% at 100% 0%, rgba(24, 30, 13, 0.07), transparent 50%),
    var(--paper);
  padding-bottom: calc(var(--dock-h) + env(safe-area-inset-bottom, 0px));
}

body.legal-page {
  min-height: 100vh;
}

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

a {
  color: var(--accent);
}

h1,
h2,
h3 {
  font-family: var(--serif);
  font-weight: 700;
  line-height: 1.18;
  color: var(--ink);
  margin: 0 0 0.65rem;
}

p {
  margin: 0 0 0.95rem;
  color: var(--muted);
}

ul,
ol {
  margin: 0 0 1rem;
  padding-left: 1.25rem;
  color: var(--muted);
}

li {
  margin-bottom: 0.4rem;
}

li::marker {
  color: var(--accent);
}

.shell {
  width: min(100% - 2rem, var(--shell));
  margin-inline: auto;
}

.skip {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip:focus {
  width: auto;
  height: auto;
  overflow: visible;
  clip-path: none;
  left: 1rem;
  top: 1rem;
  z-index: 100;
  padding: 0.75rem 1.25rem;
  background: var(--surface);
  color: var(--ink);
  font-weight: 600;
  border-radius: 999px;
  box-shadow: 0 8px 24px rgba(24, 30, 13, 0.12);
}

/* ---------- top band (photo + dark scrim) ---------- */
.legal-top {
  position: relative;
  color: var(--on-dark);
  background-color: #1a2010;
  background-image:
    linear-gradient(
      180deg,
      rgba(12, 16, 6, 0.72) 0%,
      rgba(12, 16, 6, 0.58) 45%,
      rgba(12, 16, 6, 0.78) 100%
    ),
    url("/assets/conversion/block2.png");
  background-repeat: no-repeat;
  background-position: center;
  background-size: cover;
  padding: calc(var(--header-top) + 0.15rem) 0 2rem;
  min-height: clamp(15rem, 36vh, 21rem);
}

/* Match landing masthead pill: same width, height, radius, glass. */
.legal-masthead {
  position: sticky;
  top: var(--header-top);
  z-index: 40;
  width: min(calc(100% - 16px), var(--shell));
  margin: 0 auto 1.25rem;
  border: 1px solid rgba(243, 239, 231, 0.28);
  border-radius: var(--header-radius);
  background: rgba(18, 11, 4, 0.22);
  -webkit-backdrop-filter: blur(16px) saturate(130%);
  backdrop-filter: blur(16px) saturate(130%);
  color: var(--on-dark);
}

.legal-masthead__inner {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-height: var(--header-h);
  padding: 0 0.85rem;
}

.legal-back {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  flex-shrink: 0;
  min-height: 44px;
  padding: 0.35rem 0.15rem;
  border: 0;
  background: transparent;
  color: var(--on-dark);
  font: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: opacity var(--motion);
}

.legal-back:hover {
  opacity: 0.85;
}

.legal-masthead__nav {
  display: none;
  flex-wrap: wrap;
  gap: 0.35rem 1.1rem;
  margin-inline: auto;
}

.legal-masthead__inner > .btn {
  margin-left: auto;
}

.legal-masthead__nav a {
  color: var(--on-dark-muted);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  transition: color var(--motion);
}

.legal-masthead__nav a:hover,
.legal-masthead__nav a[aria-current="page"] {
  color: var(--on-dark);
}

.legal-masthead__nav a[aria-current="page"] {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  text-decoration: none;
  color: inherit;
  flex-shrink: 0;
}

.brand img {
  width: 1.65rem;
  height: auto;
}

.brand__name {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--on-dark);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-height: 44px;
  padding: 0.55rem 1.15rem;
  border-radius: 999px;
  border: 1px solid transparent;
  text-decoration: none;
  font: inherit;
  font-weight: 600;
  font-size: 0.9375rem;
  white-space: nowrap;
  transition:
    transform var(--motion),
    background var(--motion),
    border-color var(--motion),
    color var(--motion);
}

@media (hover: hover) {
  .btn:hover {
    transform: translateY(-1px);
  }
}

.btn svg {
  flex: none;
}

.btn--primary {
  background: var(--on-dark);
  color: var(--green-900);
}

.btn--primary:hover {
  background: #fff;
}

.btn--ghost {
  border-color: var(--on-dark-line);
  color: var(--on-dark);
  background: transparent;
}

.btn--ghost:hover {
  border-color: var(--on-dark);
  background: rgba(243, 239, 231, 0.08);
}

.btn--outline {
  border-color: var(--line);
  color: var(--ink);
  background: var(--surface);
}

.btn--outline:hover {
  border-color: var(--green-800);
  background: var(--green-800);
  color: var(--on-dark);
}

.btn--sm {
  min-height: 40px;
  padding: 0.4rem 0.95rem;
  font-size: 0.875rem;
}

.legal-hero {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  height: clamp(12.75rem, 24vh, 13.5rem);
  padding: 0.5rem 0 0.25rem;
}

.eyebrow {
  display: inline-block;
  flex: none;
  margin-bottom: 0.75rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(243, 239, 231, 0.72);
}

.legal-hero h1 {
  flex: none;
  font-size: clamp(2rem, 5vw, 2.75rem);
  max-width: 18ch;
  min-height: calc(2 * 1.18em);
  color: var(--on-dark);
  margin-bottom: 0.75rem;
  text-shadow: 0 2px 28px rgba(0, 0, 0, 0.28);
}

.legal-hero__lead {
  flex: none;
  font-size: clamp(1.05rem, 2.2vw, 1.15rem);
  max-width: 42ch;
  min-height: calc(2 * 1.65em);
  color: var(--on-dark-muted);
  margin: 0;
}

.legal-hero__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1rem;
  margin: 1rem 0 0;
  font-size: 0.875rem;
  color: rgba(243, 239, 231, 0.62);
}

.legal-hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1.35rem;
}

/* ---------- content panel ---------- */
.legal-panel {
  position: relative;
  z-index: 2;
  margin-top: 24px;
  margin-bottom: 1.25rem;
  padding: clamp(1.35rem, 3vw, 2rem);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 4px);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.85) inset,
    0 24px 48px rgba(24, 30, 13, 0.1),
    0 8px 16px rgba(24, 30, 13, 0.04);
}

.legal-doc-bar {
  display: none;
}

.legal-doc-bar__link {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--paper);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--ink);
  transition:
    background var(--motion),
    border-color var(--motion),
    color var(--motion);
}

.legal-doc-bar__link:hover {
  border-color: color-mix(in srgb, var(--accent) 35%, var(--line));
  background: color-mix(in srgb, var(--accent) 8%, var(--paper));
}

.legal-doc-bar__link[aria-current="page"] {
  background: var(--green-800);
  color: var(--on-dark);
  border-color: var(--green-800);
}

.notice {
  margin: 0 0 1.5rem;
  padding: 1rem 1.15rem;
  background: color-mix(in srgb, var(--accent) 6%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--accent) 18%, var(--line));
  border-left: 3px solid var(--accent);
  border-radius: 12px;
  font-size: 0.95rem;
  color: var(--muted);
}

.notice strong {
  color: var(--ink);
}

.toc {
  margin: 0 0 1.75rem;
  padding: 1.1rem 1.2rem;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.toc__title {
  margin: 0 0 0.65rem;
  font-family: var(--serif);
  font-size: 1.08rem;
  color: var(--ink);
}

.toc ol,
.toc__list {
  margin: 0;
  padding-left: 1.35rem;
  list-style: decimal;
  columns: 1;
}

.toc ul {
  margin: 0;
  padding-left: 0;
  list-style: none;
  columns: 1;
}

.toc li {
  margin-bottom: 0.35rem;
  break-inside: avoid;
  padding-left: 0.2rem;
}

.toc li::marker {
  color: var(--accent);
  font-weight: 700;
}

.toc a {
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
}

.toc a:hover {
  text-decoration: underline;
}

.legal-prose h2 {
  font-size: clamp(1.28rem, 2.5vw, 1.58rem);
  margin-top: 2.25rem;
  padding-top: 0.15rem;
  scroll-margin-top: calc(var(--header-h) + 1rem);
}

.legal-prose h2:first-child {
  margin-top: 0;
}

.legal-prose h3 {
  font-size: 1.08rem;
  margin-top: 1.35rem;
}

.legal-prose p,
.legal-prose li {
  max-width: none;
}

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

.legal-prose hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 2rem 0;
}

.legal-prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 0.75rem 0 1.25rem;
  font-size: 0.95rem;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}

.legal-prose th,
.legal-prose td {
  text-align: left;
  vertical-align: top;
  padding: 0.75rem 0.9rem;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
}

.legal-prose th {
  background: color-mix(in srgb, var(--green-800) 6%, var(--surface));
  color: var(--ink);
  font-weight: 650;
  font-size: 0.88rem;
}

.legal-prose tr:last-child td {
  border-bottom: 0;
}

.legal-prose blockquote {
  margin: 0 0 1.25rem;
  padding: 0.9rem 1rem;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--muted);
}

.legal-prose blockquote p {
  margin-bottom: 0.35rem;
}

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

.footer {
  padding: 0;
  border-top: 0;
}

.footer__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.5rem 1.5rem;
  padding: 0.85rem 0;
  font-size: 0.875rem;
  color: var(--muted);
  text-align: center;
}

.footer .brand {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  flex-shrink: 0;
  text-decoration: none;
  color: inherit;
}

.footer .brand__logo {
  display: block;
  width: auto;
  height: 26px;
  flex-shrink: 0;
  object-fit: contain;
}

.footer .brand__name {
  font-family: var(--serif);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--ink);
  line-height: 1;
}

.footer a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}

.footer a:hover {
  text-decoration: underline;
}

.footer__links {
  display: none;
}

.footer__links a {
  display: inline-flex;
  align-items: center;
}

@media (min-width: 40rem) {
  .footer__inner {
    column-gap: 2rem;
  }
}

.footer__credit {
  display: flex;
  align-items: center;
  justify-content: center;
  border-top: 0;
  padding: 0.85rem 0 1.25rem;
  text-align: center;
  font-size: 0.8125rem;
  color: rgba(28, 25, 21, 0.6);
}

.footer__credit-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
}

.footer__credit .footer__copy,
.footer__credit .footer__dev {
  margin: 0;
  line-height: 1.45;
}

.footer__credit a {
  display: inline-flex;
  align-items: center;
  color: inherit;
  font-weight: 500;
  text-decoration: underline;
  text-decoration-color: var(--line);
  text-underline-offset: 3px;
}

.footer__credit a:hover {
  color: var(--accent);
  text-decoration-color: currentColor;
}

.dockbar {
  position: fixed;
  inset: auto 0 0 0;
  z-index: 45;
  padding: 0.65rem 1rem calc(0.65rem + env(safe-area-inset-bottom, 0px));
  background: rgba(255, 252, 247, 0.92);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
}

.dockbar__inner {
  width: min(100% - 0.5rem, var(--shell));
  margin-inline: auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.55rem;
}

.dockbar .btn--primary {
  background: var(--green-800);
  color: var(--on-dark);
}

.dockbar .btn--primary:hover {
  background: var(--green-700);
}

.dockbar .btn--ghost {
  border-color: var(--line);
  color: var(--ink);
}

@media (min-width: 720px) {
  :root {
    --header-top: 14px;
  }

  .legal-masthead__nav {
    display: flex;
  }

  .legal-masthead__inner > .btn {
    margin-left: 0;
  }

  .toc ol,
  .toc ul,
  .toc__list {
    columns: 2;
    column-gap: 2rem;
  }
}

@media (min-width: 960px) {
  .legal-panel {
    padding: 2rem 2.25rem 2.5rem;
  }
}

@media (min-width: 720px) {
  body {
    padding-bottom: 0;
  }

  .dockbar {
    display: none;
  }
}

@media (max-width: 719px) {
  .shell {
    width: min(100% - 1.25rem, var(--shell));
  }

  .legal-top {
    padding-bottom: 1.5rem;
    min-height: auto;
  }

  .legal-masthead__inner {
    gap: 0.55rem;
    padding: 0 0.65rem;
  }

  .legal-hero {
    height: auto;
    min-height: 10.5rem;
    padding-bottom: 0.5rem;
  }

  .legal-hero h1,
  .legal-hero__lead {
    min-height: 0;
    max-width: none;
  }

  .legal-hero h1 {
    font-size: clamp(1.75rem, 8vw, 2.25rem);
  }

  .legal-panel {
    margin-top: 24px;
    margin-bottom: 1.75rem;
    padding: 1.1rem 0.95rem 1.25rem;
  }

  .toc {
    padding: 0.95rem 0.9rem;
  }

  .toc ol,
  .toc ul,
  .toc__list {
    columns: 1;
    padding-left: 1.15rem;
  }

  .legal-prose table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    font-size: 0.9rem;
  }

  .legal-prose th,
  .legal-prose td {
    min-width: 7rem;
    padding: 0.65rem 0.75rem;
  }

  .to-top {
    bottom: calc(5.5rem + env(safe-area-inset-bottom, 0px));
  }
}

/* Floating back-to-top control */
.to-top {
  position: fixed;
  z-index: 50;
  right: max(1rem, env(safe-area-inset-right));
  bottom: max(1.25rem, env(safe-area-inset-bottom));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(255, 252, 247, 0.94);
  color: var(--green-900);
  box-shadow: 0 10px 28px rgba(24, 30, 13, 0.14);
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition:
    opacity var(--motion),
    transform var(--motion),
    background var(--motion);
}

.to-top.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.to-top:hover {
  background: #fff;
}

@media (min-width: 720px) {
  .to-top {
    bottom: max(1.5rem, env(safe-area-inset-bottom));
  }
}
