:root {
  --legal-ink: #1a2230;
  --legal-copy: #3f4955;
  --legal-muted: #66707b;
  --legal-line: rgba(26, 34, 48, 0.14);
  --legal-gold: #6495ed;
  --legal-gutter: clamp(20px, 3vw, 24px);
}

.privacy-hero__heading-row,
.terms-hero__heading-row {
  width: fit-content;
  display: grid;
  gap: 10px;
}

.privacy-hero .utility-hero__meta,
.terms-hero .utility-hero__meta {
  margin: 0;
  padding: 0 0 0 1px;
  border-top: 0;
  color: #6d7278;
  font-family: "Sarabun", sans-serif;
  font-size: 0.78rem;
  font-weight: 300;
  letter-spacing: 0.045em;
  line-height: 1.35;
  text-align: left;
}

.privacy-hero .utility-hero__description {
  margin-top: 12px;
}

.privacy-hero .utility-hero__art .hero-banner__matter-field,
.terms-hero .utility-hero__art .hero-banner__matter-field {
  transform: translate3d(0, var(--legal-hero-field-y, 0), 0) scale(1.2);
  transform-origin: 50% 50%;
  will-change: transform;
}

@media (prefers-reduced-motion: reduce) {
  .privacy-hero .utility-hero__art .hero-banner__matter-field,
  .terms-hero .utility-hero__art .hero-banner__matter-field {
    transform: none;
    will-change: auto;
  }
}

body.accessibility-mode :is(
  .privacy-hero .utility-hero__art .hero-banner__matter-field,
  .terms-hero .utility-hero__art .hero-banner__matter-field
) {
  transform: none;
  will-change: auto;
}

@media (max-width: 640px) and (prefers-reduced-motion: no-preference) {
  body:not(.accessibility-mode) :is(
    .privacy-hero .utility-hero__art .hero-banner__matter-field,
    .terms-hero .utility-hero__art .hero-banner__matter-field
  ) {
    transform: translate3d(0, var(--legal-hero-field-y, 0), 0) scale(1.2);
  }
}

.legal-document {
  width: min(calc(100% - (2 * var(--legal-gutter))), 900px);
  margin: clamp(64px, 7vw, 96px) auto clamp(88px, 10vw, 132px);
  color: var(--legal-copy);
  font-family: "Sarabun", sans-serif;
  font-size: clamp(1rem, 1.15vw, 1.08rem);
  font-weight: 200;
  line-height: 1.78;
  overflow-wrap: anywhere;
}

.legal-document > p:first-child {
  max-width: 52rem;
  margin: 0 0 clamp(48px, 6vw, 72px);
  color: var(--legal-ink);
  font-size: clamp(1.08rem, 1.4vw, 1.22rem);
  line-height: 1.68;
}

.legal-document p,
.legal-document ul,
.legal-document ol {
  margin: 0 0 1.15rem;
}

.legal-document h2,
.legal-document h3 {
  color: var(--legal-ink);
  font-family: "Cormorant Garamond", serif;
  font-weight: 300;
  text-align: left;
}

.legal-document h2 {
  margin: 0 0 1.15rem;
  font-size: clamp(2rem, 3.2vw, 2.65rem);
  letter-spacing: -0.025em;
  line-height: 1;
}

.legal-document h3 {
  margin: 2rem 0 0.7rem;
  font-size: clamp(1.35rem, 2vw, 1.65rem);
  letter-spacing: -0.015em;
  line-height: 1.12;
}

.legal-document ul,
.legal-document ol {
  padding-left: 1.35rem;
}

.legal-document li {
  margin: 0.58rem 0;
  padding-left: 0.2rem;
}

.legal-document li::marker {
  color: var(--legal-gold);
}

.legal-document a {
  color: #6f5d3b;
  text-decoration-color: rgba(111, 93, 59, 0.44);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  transition: color 180ms ease, text-decoration-color 180ms ease;
}

.legal-document a:hover {
  color: var(--legal-ink);
  text-decoration-color: currentColor;
}

.legal-document a:focus-visible {
  border-radius: 2px;
  outline: 2px solid var(--legal-gold);
  outline-offset: 4px;
}

.legal-document code {
  padding: 0.08rem 0.3rem;
  border-radius: 0.2rem;
  background: rgba(136, 114, 68, 0.09);
  color: var(--legal-ink);
  font-size: 0.88em;
}

.document-toc {
  margin: 0 0 clamp(48px, 6vw, 72px);
  padding: clamp(28px, 4vw, 42px) 0;
  border-top: 1px solid var(--legal-line);
  border-bottom: 1px solid var(--legal-line);
}

.document-toc h2 {
  margin-bottom: 1.45rem;
  color: var(--legal-gold);
  font-family: "Sarabun", sans-serif;
  font-size: 0.75rem;
  font-weight: 400;
  letter-spacing: 0.16em;
  line-height: 1.3;
  text-transform: uppercase;
}

.document-toc ol {
  columns: 2 19rem;
  column-gap: clamp(48px, 7vw, 88px);
  margin: 0;
  padding-left: 1.4rem;
}

.document-toc li {
  break-inside: avoid;
  margin: 0 0 0.65rem;
  color: var(--legal-muted);
}

.document-toc a {
  color: var(--legal-ink);
  text-decoration: none;
}

.document-toc a:hover {
  color: var(--legal-gold);
}

.legal-document section.card {
  scroll-margin-top: 96px;
  margin: 0;
  padding: clamp(42px, 5.5vw, 64px) 0;
  border: 0;
  border-top: 1px solid var(--legal-line);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.legal-document section.card:first-of-type {
  border-top: 0;
  padding-top: 0;
}

.legal-document section.card > :last-child {
  margin-bottom: 0;
}

.legal-document section.card strong {
  color: var(--legal-ink);
  font-weight: 400;
}

.legal-document .subsection-title {
  margin-top: 0;
  color: var(--legal-muted);
  font-family: "Sarabun", sans-serif;
  font-size: 1rem;
  font-weight: 400;
  letter-spacing: 0.08em;
  line-height: 1.4;
  text-transform: uppercase;
}

.legal-document address {
  margin-top: 1.4rem;
  padding-left: 1.25rem;
  border-left: 1px solid var(--legal-gold);
  color: var(--legal-muted);
  font-style: normal;
}

@media (max-width: 760px) {
  .privacy-hero__heading-row,
  .terms-hero__heading-row {
    width: 100%;
    gap: 8px;
  }

  .privacy-hero .utility-hero__meta,
  .terms-hero .utility-hero__meta {
    width: 100%;
    margin: 0;
  }
}

@media (max-width: 640px) {
  .legal-document {
    margin-top: 48px;
    margin-bottom: 84px;
    line-height: 1.7;
  }

  .legal-document > p:first-child {
    margin-bottom: 42px;
  }

  .document-toc {
    margin-bottom: 46px;
    padding: 28px 0;
  }

  .document-toc ol {
    columns: 1;
  }

  .document-toc li {
    margin: 0;
  }

  .document-toc a {
    min-height: 44px;
    display: flex;
    align-items: center;
    padding: 7px 0;
    border-bottom: 1px solid rgba(26, 34, 48, 0.08);
    line-height: 1.4;
  }

  .document-toc li:last-child a {
    border-bottom: 0;
  }

  .legal-document section.card {
    padding: 42px 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .legal-document,
  .legal-document * {
    scroll-behavior: auto;
  }
}
