:root {
  --policy-gutter: clamp(20px, 4vw, 64px);
  --policy-max: 1440px;
  scroll-padding-top: 96px;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  overflow-x: hidden;
  color: var(--brand-text);
  background: var(--brand-canvas);
  font-size: 16px;
  line-height: 1.65;
}

body::before {
  position: fixed;
  z-index: -1;
  inset: 0;
  pointer-events: none;
  content: "";
  background-image: url("/static/assets/brand/braided-r-micro.svg");
  background-repeat: no-repeat;
  background-position: calc(100% + 180px) -160px;
  background-size: min(44vw, 660px);
  opacity: 0.018;
}

a {
  color: inherit;
  text-underline-offset: 0.18em;
}

button,
a {
  touch-action: manipulation;
}

.policy-header {
  position: sticky;
  z-index: 100;
  top: 0;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  min-height: 76px;
  padding: 12px var(--policy-gutter);
  background: color-mix(in srgb, var(--brand-canvas) 94%, transparent);
  border-bottom: 1px solid var(--brand-line);
  backdrop-filter: blur(16px);
}

.policy-header-label {
  color: var(--brand-muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.policy-header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

.theme-cycle {
  gap: 8px;
  text-transform: capitalize;
}

.theme-symbol {
  color: var(--brand-accent);
  font-size: 1rem;
}

.back-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 14px;
  color: var(--brand-text);
  border: 1px solid var(--brand-line);
  border-radius: var(--brand-radius-small);
  font-size: 0.86rem;
  font-weight: 650;
  text-decoration: none;
}

.back-link:hover,
.theme-cycle:hover {
  border-color: var(--brand-line-strong);
  background: var(--brand-surface);
}

.policy-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(360px, 0.65fr);
  width: min(100%, var(--policy-max));
  min-height: 620px;
  margin-inline: auto;
  padding: clamp(70px, 10vw, 148px) var(--policy-gutter) clamp(72px, 9vw, 132px);
  border-bottom: 1px solid var(--brand-line);
}

.policy-hero-copy {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 380px;
  padding-right: clamp(32px, 7vw, 112px);
}

.eyebrow,
.section-number {
  margin: 0;
  color: var(--brand-accent);
  font-size: 0.72rem;
  font-weight: 750;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.policy-hero h1 {
  max-width: 10ch;
  margin: 28px 0 30px;
  font-size: clamp(3.2rem, 7.8vw, 7.2rem);
  font-weight: 540;
  letter-spacing: -0.055em;
  line-height: 0.91;
  text-wrap: balance;
}

.policy-lede {
  max-width: 650px;
  margin: 0;
  color: var(--brand-muted);
  font-size: clamp(1.05rem, 1.6vw, 1.32rem);
  line-height: 1.55;
}

.policy-date {
  margin: 52px 0 0;
  color: var(--brand-muted);
  font-size: 0.82rem;
}

.policy-snapshot {
  align-self: end;
  padding: clamp(24px, 4vw, 40px);
  background: var(--brand-surface-raised);
  border: 1px solid var(--brand-line);
  border-radius: var(--brand-radius);
  box-shadow: var(--brand-shadow-material);
}

.policy-snapshot dl {
  margin: 24px 0 0;
}

.policy-snapshot dl > div {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 18px;
  padding: 18px 0;
  border-top: 1px solid var(--brand-line);
}

.policy-snapshot dt {
  font-size: 0.78rem;
  font-weight: 720;
}

.policy-snapshot dd {
  margin: 0;
  color: var(--brand-muted);
  font-size: 0.82rem;
  line-height: 1.55;
}

.policy-frame {
  display: grid;
  grid-template-columns: 230px minmax(0, 820px);
  justify-content: center;
  gap: clamp(56px, 9vw, 150px);
  width: min(100%, var(--policy-max));
  margin-inline: auto;
  padding: clamp(70px, 10vw, 142px) var(--policy-gutter) 120px;
}

.policy-toc {
  position: sticky;
  top: 112px;
  align-self: start;
}

.policy-toc > p {
  margin: 0 0 18px;
  color: var(--brand-muted);
  font-size: 0.7rem;
  font-weight: 740;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.policy-toc ol {
  display: grid;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: policy-sections;
}

.policy-toc li {
  counter-increment: policy-sections;
}

.policy-toc a {
  display: grid;
  grid-template-columns: 24px 1fr;
  align-items: center;
  min-height: 44px;
  color: var(--brand-muted);
  font-size: 0.78rem;
  line-height: 1.25;
  text-decoration: none;
}

.policy-toc a::before {
  color: var(--brand-line-strong);
  content: counter(policy-sections, decimal-leading-zero);
  font-size: 0.62rem;
  font-variant-numeric: tabular-nums;
}

.policy-toc a:hover {
  color: var(--brand-text);
}

.policy-article {
  min-width: 0;
}

.policy-caution {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 28px;
  margin-bottom: clamp(76px, 10vw, 126px);
  padding: 24px 0;
  border-top: 3px solid var(--brand-accent);
  border-bottom: 1px solid var(--brand-line);
}

.policy-caution strong {
  font-size: 0.92rem;
}

.policy-caution p {
  margin: 0;
  color: var(--brand-muted);
  font-size: 0.94rem;
  line-height: 1.65;
}

.policy-article > section {
  padding: 0 0 clamp(72px, 9vw, 112px);
  scroll-margin-top: 110px;
}

.policy-article > section + section {
  padding-top: clamp(68px, 8vw, 96px);
  border-top: 1px solid var(--brand-line);
}

.policy-article h2 {
  max-width: 16ch;
  margin: 16px 0 32px;
  font-size: clamp(2rem, 4.4vw, 3.8rem);
  font-weight: 570;
  letter-spacing: -0.04em;
  line-height: 1;
  text-wrap: balance;
}

.policy-article h3 {
  margin: 0 0 8px;
  font-size: 1rem;
  font-weight: 720;
  letter-spacing: -0.01em;
}

.policy-article p,
.policy-article li {
  font-size: clamp(1rem, 1.5vw, 1.12rem);
  line-height: 1.78;
}

.policy-article p {
  margin: 0 0 1.25em;
}

.policy-article ul {
  display: grid;
  gap: 12px;
  margin: 28px 0;
  padding-left: 1.2em;
}

.policy-article li::marker {
  color: var(--brand-accent);
}

.policy-article a:not(.contact-link) {
  color: var(--brand-accent-strong);
  font-weight: 620;
}

.data-groups {
  margin-top: 46px;
  border-top: 1px solid var(--brand-line);
}

.data-groups > div {
  display: grid;
  grid-template-columns: minmax(150px, 0.35fr) minmax(0, 1fr);
  gap: clamp(24px, 5vw, 72px);
  padding: 26px 0;
  border-bottom: 1px solid var(--brand-line);
}

.data-groups p {
  margin: 0;
  color: var(--brand-muted);
  font-size: 0.94rem;
  line-height: 1.66;
}

.policy-note {
  margin: 38px 0;
  padding: 24px 26px;
  background: var(--brand-accent-soft);
  border-left: 3px solid var(--brand-accent);
}

.policy-note p {
  margin: 0;
  font-size: 0.96rem;
}

.table-wrap {
  width: 100%;
  margin: 36px 0;
  overflow-x: auto;
  border: 1px solid var(--brand-line);
  border-radius: var(--brand-radius);
}

table {
  width: 100%;
  min-width: 650px;
  border-collapse: collapse;
  background: var(--brand-surface-raised);
  font-size: 0.82rem;
}

th,
td {
  padding: 16px 18px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--brand-line);
}

th {
  color: var(--brand-muted);
  background: var(--brand-surface);
  font-size: 0.68rem;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

tbody tr:last-child td {
  border-bottom: 0;
}

td:first-child {
  width: 24%;
  font-weight: 680;
}

td:nth-child(2) {
  width: 51%;
}

code {
  padding: 0.12em 0.3em;
  color: var(--brand-text);
  background: var(--brand-accent-soft);
  border-radius: 4px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.88em;
}

.contact-section {
  margin-top: 12px;
  padding: clamp(32px, 5vw, 52px) !important;
  background: var(--brand-surface-raised);
  border: 1px solid var(--brand-line) !important;
  border-radius: var(--brand-radius);
  box-shadow: var(--brand-shadow-material);
}

.contact-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  gap: 20px;
  margin-top: 30px;
  padding-top: 18px;
  color: var(--brand-text);
  border-top: 1px solid var(--brand-line);
  text-decoration: none;
}

.contact-link span {
  color: var(--brand-muted);
  font-size: 0.78rem;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.contact-link strong {
  overflow-wrap: anywhere;
  color: var(--brand-accent-strong);
  font-size: 1rem;
}

.policy-footer {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 40px;
  width: min(100%, var(--policy-max));
  margin-inline: auto;
  padding: 36px var(--policy-gutter);
  color: var(--brand-muted);
  border-top: 1px solid var(--brand-line);
  font-size: 0.78rem;
}

.policy-footer .brand-lockup {
  font-size: 1rem;
}

.policy-footer .brand-lockup img {
  width: 30px;
  height: 30px;
}

.policy-footer p {
  margin: 0;
}

@media (max-width: 980px) {
  .policy-header {
    grid-template-columns: 1fr auto;
  }

  .policy-header-label {
    display: none;
  }

  .policy-hero {
    grid-template-columns: 1fr;
    min-height: 0;
    gap: 56px;
  }

  .policy-hero-copy {
    min-height: 0;
    padding-right: 0;
  }

  .policy-snapshot {
    width: min(100%, 640px);
  }

  .policy-frame {
    grid-template-columns: 1fr;
    gap: 52px;
  }

  .policy-toc {
    position: static;
    padding-bottom: 28px;
    border-bottom: 1px solid var(--brand-line);
  }

  .policy-toc ol {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 28px;
  }
}

@media (max-width: 680px) {
  :root {
    --policy-gutter: 20px;
  }

  .policy-header {
    min-height: 68px;
  }

  .policy-header .brand-lockup {
    font-size: 1.05rem;
  }

  .policy-header .brand-lockup img {
    width: 30px;
    height: 30px;
  }

  .theme-cycle {
    padding-inline: 10px;
  }

  .theme-cycle [data-theme-label] {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }

  .back-link {
    display: none;
  }

  .policy-hero {
    gap: 42px;
    padding-top: 60px;
    padding-bottom: 72px;
  }

  .policy-hero h1 {
    font-size: clamp(3.2rem, 17vw, 5rem);
  }

  .policy-date {
    margin-top: 36px;
  }

  .policy-snapshot {
    padding: 22px;
  }

  .policy-snapshot dl > div {
    grid-template-columns: 1fr;
    gap: 5px;
  }

  .policy-frame {
    padding-top: 64px;
    padding-bottom: 80px;
  }

  .policy-toc ol {
    grid-template-columns: 1fr;
  }

  .policy-toc a {
    min-height: 44px;
  }

  .policy-caution,
  .data-groups > div {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .policy-article h2 {
    margin-top: 12px;
  }

  .policy-article p,
  .policy-article li {
    font-size: 1rem;
    line-height: 1.72;
  }

  .contact-section {
    margin-inline: -4px;
    padding: 28px 22px !important;
  }

  .contact-link {
    align-items: flex-start;
    flex-direction: column;
    gap: 5px;
  }

  .policy-footer {
    grid-template-columns: 1fr;
    gap: 18px;
  }
}

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

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
