/* THaiva legal pages — shared visual system with the redesigned landing page. */

body.legal-shell {
  min-width: 0;
  overflow-x: clip;
  background:
    radial-gradient(circle at 8% -4%, rgba(87, 96, 255, .18), transparent 34rem),
    radial-gradient(circle at 92% 8%, rgba(156, 78, 255, .13), transparent 30rem),
    #070810;
  color: var(--text);
  font-family: Inter, "Noto Sans Thai", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

body.legal-shell::before {
  content: "";
  position: fixed;
  z-index: -1;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(105, 112, 180, .045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(105, 112, 180, .045) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: linear-gradient(to bottom, #000 0, rgba(0,0,0,.62) 36rem, transparent 74rem);
}

.legal-shell .site-header__inner {
  background: rgba(7, 8, 16, .76);
}

.legal-page {
  position: relative;
  min-height: 100svh;
  padding: calc(var(--header-h) + 98px) 0 130px;
}

.legal-page::before {
  content: "";
  position: absolute;
  top: 2rem;
  left: 50%;
  width: min(82rem, 120vw);
  height: 38rem;
  transform: translateX(-50%);
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(112, 91, 255, .18), rgba(79, 193, 255, .05) 42%, transparent 70%);
  filter: blur(38px);
  pointer-events: none;
}

.legal-page > .container {
  position: relative;
  z-index: 1;
}

.legal-page__hero {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(300px, .55fr);
  gap: 20px clamp(46px, 7vw, 105px);
  align-items: end;
  margin-bottom: 68px;
}

.legal-page__eyebrow {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--blue);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .14em;
  line-height: 1.4;
  text-transform: uppercase;
}

.legal-page__title {
  max-width: 880px;
  margin: 0;
  color: var(--text);
  font-size: clamp(3.2rem, 6.6vw, 7rem);
  font-weight: 780;
  letter-spacing: -.068em;
  line-height: .91;
  text-wrap: balance;
}

.legal-page__intro {
  max-width: 560px;
  margin: 0 0 6px;
  color: var(--text-soft);
  font-size: clamp(.98rem, 1.25vw, 1.1rem);
  line-height: 1.72;
}

.legal-page__intro a {
  color: var(--blue);
  text-decoration: underline;
  text-decoration-color: rgba(103,215,255,.35);
  text-underline-offset: 3px;
}

.legal-card {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(190, 198, 255, .18);
  border-radius: 34px;
  background:
    radial-gradient(circle at 100% 0, rgba(122, 91, 255, .12), transparent 25rem),
    linear-gradient(155deg, rgba(20, 23, 36, .98), rgba(10, 12, 20, .98));
  box-shadow: 0 42px 120px rgba(0, 0, 0, .46), inset 0 1px 0 rgba(255,255,255,.055);
}

.legal-card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(185, 194, 255, .04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(185, 194, 255, .04) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: linear-gradient(to bottom, #000, transparent 24rem);
}

.legal-card__inner {
  position: relative;
  z-index: 1;
  padding: clamp(30px, 5vw, 68px);
}

.legal-meta {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  margin-bottom: 42px;
  padding: 9px 12px;
  border: 1px solid rgba(130, 108, 255, .27);
  border-radius: 999px;
  background: rgba(130, 108, 255, .09);
  color: var(--text-soft);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: .69rem;
  line-height: 1.35;
}

.legal-meta strong {
  color: #fff;
  font-weight: 760;
}

.legal-content {
  display: grid;
  gap: 0;
  counter-reset: legal-section;
}

.legal-section {
  position: relative;
  display: grid;
  grid-template-columns: minmax(210px, .34fr) minmax(0, 1fr);
  column-gap: clamp(34px, 6vw, 82px);
  row-gap: 14px;
  padding: 34px 0;
  counter-increment: legal-section;
}

.legal-section:first-child {
  padding-top: 0;
}

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

.legal-section h2 {
  position: relative;
  grid-column: 1;
  grid-row: 1;
  align-self: start;
  margin: 0;
  padding: 0 0 0 30px;
  color: #fff;
  font-size: clamp(1.05rem, 1.55vw, 1.34rem);
  font-weight: 720;
  letter-spacing: -.03em;
  line-height: 1.3;
  scroll-margin-top: 120px;
}

.legal-section h2::before {
  content: counter(legal-section, decimal-leading-zero);
  position: absolute;
  top: .16em;
  left: 0;
  color: var(--blue);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: .64rem;
  font-weight: 800;
  letter-spacing: .08em;
}

.legal-section > :not(h2) {
  grid-column: 2;
}

.legal-section h3 {
  margin: 16px 0 2px;
  color: #eef0ff;
  font-size: 1rem;
  font-weight: 740;
  letter-spacing: -.02em;
  line-height: 1.45;
  scroll-margin-top: 120px;
}

.legal-section h2 + h3,
.legal-section h2 + p,
.legal-section h2 + ul {
  margin-top: 0;
}

.legal-section p,
.legal-section li {
  color: var(--text-soft);
  font-size: .94rem;
  line-height: 1.78;
}

.legal-section p {
  margin: 0;
}

.legal-section ul {
  display: grid;
  gap: 9px;
  margin: 2px 0 4px;
  padding: 0;
  list-style: none;
}

.legal-section li {
  position: relative;
  padding-left: 22px;
}

.legal-section li::before {
  content: "";
  position: absolute;
  top: .72em;
  left: 0;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: linear-gradient(135deg, var(--blue), var(--violet));
  box-shadow: 0 0 12px rgba(103, 215, 255, .28);
}

.legal-section strong {
  color: #f5f6ff;
  font-weight: 720;
}

.legal-section a,
.legal-footer-note a {
  color: var(--blue);
  text-decoration: underline;
  text-decoration-color: rgba(103, 215, 255, .34);
  text-underline-offset: 3px;
  transition: color .2s ease, text-decoration-color .2s ease;
}

.legal-section a:hover,
.legal-footer-note a:hover {
  color: var(--cyan);
  text-decoration-color: currentColor;
}

.legal-section code {
  padding: 2px 6px;
  border: 1px solid rgba(184, 192, 255, .13);
  border-radius: 6px;
  background: rgba(255,255,255,.045);
  color: #d8d4ff;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: .84em;
  overflow-wrap: anywhere;
}

.legal-divider {
  height: 1px;
  margin: 0;
  background: linear-gradient(90deg, transparent, rgba(184, 192, 255, .14) 14%, rgba(184, 192, 255, .14) 86%, transparent);
}

.legal-footer-note {
  margin: 46px 0 0;
  padding: 22px 24px;
  border: 1px solid rgba(103, 215, 255, .13);
  border-radius: 16px;
  background: rgba(103, 215, 255, .035);
  color: var(--text-soft);
  font-size: .86rem;
  line-height: 1.7;
}

/* Legal footer markup is intentionally simpler than the marketing footer. */
.legal-shell .site-footer {
  padding: 0;
  background: #06070d;
}

.legal-shell .site-footer__inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, .72fr);
  gap: 70px;
  align-items: start;
  padding: 58px 0 48px;
}

.legal-shell .site-footer__brand {
  display: grid;
  max-width: 600px;
  gap: 12px;
}

.legal-shell .site-footer__copy {
  margin: 0;
  color: var(--text-muted);
  font-size: .78rem;
  line-height: 1.55;
}

.legal-shell .site-footer__links {
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  justify-content: flex-end;
  gap: 9px 18px;
}

.legal-shell .site-footer__links a {
  padding: 5px 0;
  color: var(--text-muted);
  font-size: .78rem;
  line-height: 1.35;
}

.legal-shell .site-footer__links a:hover,
.legal-shell .site-footer__links a[aria-current="page"] {
  color: #fff;
}

.legal-shell .site-footer__links a[aria-current="page"] {
  text-decoration: underline;
  text-decoration-color: var(--blue);
  text-underline-offset: 5px;
}

@media (max-width: 980px) {
  .legal-page {
    padding-top: 145px;
  }

  .legal-page__hero {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .legal-page__eyebrow,
  .legal-page__title,
  .legal-page__intro {
    grid-column: 1;
  }

  .legal-page__intro {
    max-width: 760px;
  }

  .legal-section {
    grid-template-columns: 180px minmax(0, 1fr);
    column-gap: 34px;
  }

  .legal-shell .site-footer__inner {
    grid-template-columns: 1fr;
    gap: 34px;
  }

  .legal-shell .site-footer__links {
    justify-content: flex-start;
  }
}

@media (max-width: 760px) {
  body.legal-shell {
    font-size: 15px;
  }

  body.legal-shell::before {
    background-size: 42px 42px;
  }

  .legal-page {
    padding: 122px 0 86px;
  }

  .legal-page__hero {
    margin-bottom: 42px;
  }

  .legal-page__title {
    font-size: clamp(2.7rem, 13.8vw, 4.35rem);
    line-height: .93;
  }

  .legal-card {
    border-radius: 24px;
  }

  .legal-card__inner {
    padding: 26px 20px;
  }

  .legal-meta {
    margin-bottom: 24px;
    border-radius: 13px;
  }

  .legal-section {
    display: block;
    padding: 28px 0;
  }

  .legal-section h2 {
    position: relative;
    top: auto;
    margin-bottom: 18px;
    padding-left: 28px;
    font-size: 1.12rem;
  }

  .legal-section h3 {
    margin-top: 20px;
  }

  .legal-section p,
  .legal-section li {
    font-size: .9rem;
    line-height: 1.72;
  }

  .legal-footer-note {
    margin-top: 30px;
    padding: 18px;
  }

  .legal-shell .site-footer__inner {
    padding: 44px 0 92px;
  }
}

@media (max-width: 420px) {
  .legal-page__title {
    font-size: clamp(2.45rem, 13.6vw, 3.7rem);
  }

  .legal-card__inner {
    padding: 24px 16px;
  }

  .legal-shell .site-footer__links {
    display: grid;
    justify-content: stretch;
    gap: 4px;
  }
}
