:root {
  color-scheme: light;
  --bg: #f5f7fa;
  --surface: #ffffff;
  --surface-soft: #eef2f7;
  --ink: #152033;
  --muted: #5f6e82;
  --line: #dce3ec;
  --brand: #ad7412;
  --brand-bright: #e2a52e;
  --header: rgba(250, 252, 255, .9);
  --shadow: 0 24px 70px rgba(15, 23, 42, .09);
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #07111f;
  --surface: #0e1a2c;
  --surface-soft: #111f34;
  --ink: #f4f7fb;
  --muted: #a8b5c8;
  --line: rgba(148, 163, 184, .17);
  --brand: #f2c25c;
  --brand-bright: #efb744;
  --header: rgba(7, 17, 31, .9);
  --shadow: 0 26px 80px rgba(0, 0, 0, .24);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at 90% 0, rgba(226, 165, 46, .12), transparent 28rem),
    var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.7;
  text-rendering: optimizeLegibility;
}

a {
  color: inherit;
}

.site-header {
  position: sticky;
  z-index: 50;
  top: 0;
  border-bottom: 1px solid var(--line);
  background: var(--header);
  backdrop-filter: blur(18px);
}

.header-shell,
.page-shell,
.footer-shell {
  width: min(100% - 40px, 1180px);
  margin-inline: auto;
}

.header-shell {
  display: flex;
  min-height: 72px;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.brand img {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  border: 2px solid rgba(226, 165, 46, .38);
  border-radius: 50%;
  object-fit: cover;
  object-position: center top;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: .96rem;
  line-height: 1.2;
}

.brand small {
  margin-top: 2px;
  color: var(--muted);
  font-size: .67rem;
  font-weight: 650;
  line-height: 1.3;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.header-link,
.theme-toggle {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: .76rem;
  font-weight: 700;
  text-decoration: none;
}

.header-link {
  padding: 0 16px;
}

.theme-toggle {
  width: 40px;
  padding: 0;
  cursor: pointer;
}

.header-link:hover,
.theme-toggle:hover {
  border-color: rgba(226, 165, 46, .6);
}

.legal-hero {
  padding: clamp(70px, 9vw, 118px) 0 clamp(48px, 6vw, 76px);
}

.legal-kicker {
  margin: 0;
  color: var(--brand);
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .2em;
  text-transform: uppercase;
}

.legal-title {
  max-width: 900px;
  margin: 18px 0 0;
  font-size: clamp(2.65rem, 6vw, 5.7rem);
  font-weight: 760;
  letter-spacing: -.055em;
  line-height: .98;
  text-wrap: balance;
}

.legal-lead {
  max-width: 800px;
  margin: 28px 0 0;
  color: var(--muted);
  font-size: clamp(1rem, 1.8vw, 1.17rem);
  line-height: 1.8;
}

.legal-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 28px;
}

.legal-meta span {
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: .72rem;
  font-weight: 650;
}

.legal-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: clamp(36px, 6vw, 78px);
  align-items: start;
  padding-bottom: clamp(80px, 10vw, 132px);
}

.legal-toc {
  position: sticky;
  top: 96px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.legal-toc h2 {
  margin: 0 0 13px;
  color: var(--brand);
  font-size: .67rem;
  letter-spacing: .17em;
  text-transform: uppercase;
}

.legal-toc nav {
  display: grid;
  gap: 3px;
}

.legal-toc a {
  padding: 8px 10px;
  border-radius: 10px;
  color: var(--muted);
  font-size: .78rem;
  font-weight: 650;
  line-height: 1.35;
  text-decoration: none;
}

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

.legal-content {
  min-width: 0;
}

.legal-section {
  scroll-margin-top: 100px;
  padding: 0 0 38px;
}

.legal-section + .legal-section {
  padding-top: 38px;
  border-top: 1px solid var(--line);
}

.legal-section h2 {
  margin: 0;
  font-size: clamp(1.5rem, 2.7vw, 2.15rem);
  letter-spacing: -.025em;
  line-height: 1.2;
  text-wrap: balance;
}

.legal-section h3 {
  margin: 28px 0 0;
  font-size: 1rem;
  line-height: 1.4;
}

.legal-section p,
.legal-section ul,
.legal-section ol {
  max-width: 780px;
  margin: 15px 0 0;
  color: var(--muted);
}

.legal-section ul,
.legal-section ol {
  padding-left: 1.25rem;
}

.legal-section li + li {
  margin-top: 9px;
}

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

.legal-section a {
  color: var(--brand);
  font-weight: 700;
  text-underline-offset: 3px;
}

.legal-callout {
  margin-top: 22px;
  padding: 20px 22px;
  border: 1px solid rgba(226, 165, 46, .32);
  border-left: 4px solid var(--brand-bright);
  border-radius: 16px;
  background: var(--surface-soft);
}

.legal-callout p {
  margin-top: 0;
}

.legal-table-wrap {
  margin-top: 22px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: var(--surface);
}

.legal-table {
  width: 100%;
  min-width: 640px;
  border-collapse: collapse;
  text-align: left;
}

.legal-table th,
.legal-table td {
  padding: 15px 17px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  font-size: .8rem;
  line-height: 1.6;
}

.legal-table th {
  color: var(--ink);
  background: var(--surface-soft);
}

.legal-table td {
  color: var(--muted);
}

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

.contact-card {
  margin-top: 22px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.contact-card p:first-child {
  margin-top: 0;
}

.legal-footer {
  border-top: 1px solid rgba(148, 163, 184, .15);
  background: #050e1a;
  color: #f5f7fb;
}

.footer-main {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) repeat(2, minmax(150px, .55fr));
  gap: 46px;
  padding: 54px 0 42px;
}

.footer-brand {
  max-width: 470px;
}

.footer-brand p {
  margin: 16px 0 0;
  color: #9dacc0;
  font-size: .8rem;
  line-height: 1.75;
}

.legal-footer h2 {
  margin: 3px 0 15px;
  color: #f0c15b;
  font-size: .68rem;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.footer-links {
  display: grid;
  gap: 10px;
}

.footer-links a {
  width: max-content;
  color: #9dacc0;
  font-size: .77rem;
  text-decoration: none;
}

.footer-links a:hover {
  color: #fff;
}

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 19px 0 26px;
  border-top: 1px solid rgba(148, 163, 184, .15);
  color: #7f90a7;
  font-size: .7rem;
}

.footer-bottom nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 17px;
}

.footer-bottom a {
  color: #9dacc0;
  text-decoration: none;
}

.footer-bottom a:hover {
  color: #fff;
}

@media (max-width: 850px) {
  .legal-layout {
    grid-template-columns: 1fr;
  }

  .legal-toc {
    position: static;
  }

  .legal-toc nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .footer-main {
    grid-template-columns: 1fr 1fr;
  }

  .footer-brand {
    grid-column: 1 / -1;
  }
}

@media (max-width: 600px) {
  .header-shell,
  .page-shell,
  .footer-shell {
    width: min(100% - 28px, 1180px);
  }

  .header-shell {
    min-height: 64px;
  }

  .brand small,
  .header-link {
    display: none;
  }

  .legal-hero {
    padding-top: 58px;
  }

  .legal-title {
    font-size: clamp(2.45rem, 13vw, 4rem);
  }

  .legal-toc nav {
    grid-template-columns: 1fr;
  }

  .legal-section {
    padding-bottom: 31px;
  }

  .legal-section + .legal-section {
    padding-top: 31px;
  }

  .footer-main {
    grid-template-columns: 1fr;
    gap: 30px;
  }

  .footer-brand {
    grid-column: auto;
  }

  .footer-bottom {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}
