:root {
  --surface: #f3f0e9;
  --panel: #fffdf9;
  --muted: #ebe7de;
  --border: rgba(49, 45, 38, 0.14);
  --border-strong: rgba(49, 45, 38, 0.22);
  --text: #504b43;
  --heading: #211f1b;
  --soft: #7b7469;
  --faint: #9b9489;
  --accent: #4d7184;
  --accent-rgb: 77, 113, 132;
  --accent-soft: rgba(77, 113, 132, 0.09);
  --accent-hover: #315568;
  --header-surface: rgba(243, 240, 233, 0.72);
  --shadow-sm: 0 6px 20px rgba(33, 31, 27, 0.05);
  --shadow-md: 0 16px 42px rgba(33, 31, 27, 0.07);
  --control-surface: var(--panel);
  --control-border: rgba(33, 31, 27, 0.08);
  --control-border-hover: rgba(33, 31, 27, 0.15);
  --control-icon: var(--soft);
  --control-text-hover: var(--heading);
  --theme-motion: 280ms cubic-bezier(0.4, 0, 0.2, 1);
  --frame: 860px;
  --serif: "DM Serif Display", Georgia, "Times New Roman", serif;
  --sans: "DM Sans", Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

html[data-theme="night"] {
  --surface: #1b1d1c;
  --panel: #252826;
  --muted: #212421;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);
  --text: #bdb8ae;
  --heading: #ebe9e4;
  --soft: #89847b;
  --faint: #55534e;
  --accent: #8fb2c2;
  --accent-rgb: 143, 178, 194;
  --accent-soft: rgba(143, 178, 194, 0.10);
  --accent-hover: #aac6d2;
  --header-surface: rgba(27, 29, 28, 0.72);
  --shadow-sm: 0 6px 20px rgba(0, 0, 0, 0.16);
  --shadow-md: 0 16px 42px rgba(0, 0, 0, 0.22);
  --control-surface: #2a2d2a;
  --control-border: rgba(235, 233, 228, 0.08);
  --control-border-hover: rgba(235, 233, 228, 0.15);
  --control-icon: var(--soft);
  --control-text-hover: var(--heading);
}

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

html {
  min-height: 100%;
  -webkit-tap-highlight-color: transparent;
  background-color: var(--surface);
  background-image:
    radial-gradient(circle at 12% -10%, color-mix(in srgb, var(--accent) 10%, transparent), transparent 34rem);
  color: var(--text);
  -webkit-text-size-adjust: 100%;
  scrollbar-width: thin;
  scrollbar-color:
    rgba(var(--accent-rgb), 0.46) transparent;
}

html::-webkit-scrollbar {
  width: 10px;
}

html::-webkit-scrollbar-track {
  background: transparent;
}

html::-webkit-scrollbar-thumb {
  border: 2px solid transparent;
  border-radius: 999px;
  background: rgba(var(--accent-rgb), 0.46);
  background-clip: padding-box;
}

body {
  min-height: 100vh;
  margin: 0;
  font-family: var(--sans);
  line-height: 1.68;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent);
  text-underline-offset: 0.16em;
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid var(--border);
  background: var(--header-surface);
  backdrop-filter: blur(16px) saturate(1.1);
  -webkit-backdrop-filter: blur(16px) saturate(1.1);
}

.header-inner {
  width: 100%;
  max-width: none;
  margin-inline: 0;
  padding-inline: 1.5rem;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.brand {
  color: var(--heading);
  font-family: var(--serif);
  font-size: 1.22rem;
  font-weight: 400;
  letter-spacing: -0.01em;
  text-decoration: none;
}

.brand span {
  color: var(--accent);
}

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

.header-back,
.appearance-toggle {
  color: var(--control-icon);
  transition:
    color 220ms cubic-bezier(.2, .75, .2, 1),
    background 220ms cubic-bezier(.2, .75, .2, 1),
    border-color 220ms cubic-bezier(.2, .75, .2, 1),
    box-shadow 220ms cubic-bezier(.2, .75, .2, 1);
}

.header-back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 8px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  box-shadow: none;
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
}

.appearance-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  min-height: 38px;
  flex: 0 0 38px;
  padding: 0;
  border: 1px solid var(--control-border);
  border-radius: 12px;
  background: var(--control-surface);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
}

.header-back:hover {
  color: var(--control-text-hover);
  background: color-mix(in srgb, var(--control-surface) 58%, transparent);
}

.appearance-toggle:hover {
  color: var(--control-text-hover);
  border-color: var(--control-border-hover);
  box-shadow: var(--shadow-md);
}

.header-back:focus-visible,
.appearance-toggle:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--accent) 38%, transparent);
  outline-offset: 2px;
}

.appearance-icon {
  width: 16px;
  height: 16px;
}

.appearance-icon--sun {
  display: none;
}

html[data-theme="night"] .appearance-icon--moon {
  display: none;
}

html[data-theme="night"] .appearance-icon--sun {
  display: block;
}

.legal-main {
  width: min(calc(100% - 36px), var(--frame));
  margin-inline: auto;
  padding: 72px 0 88px;
}

.legal-kicker {
  margin: 0 0 12px;
  color: var(--accent);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  color: var(--heading);
}

h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(2.6rem, 7vw, 4.35rem);
  font-weight: 400;
  letter-spacing: -0.025em;
  line-height: 1.02;
}

.legal-lede {
  max-width: 720px;
  margin: 22px 0 0;
  color: var(--soft);
  font-size: clamp(1rem, 1.9vw, 1.12rem);
}

.legal-meta {
  margin-top: 20px;
  color: var(--faint);
  font-size: 0.82rem;
}

.legal-rule {
  height: 1px;
  margin: 42px 0 0;
  border: 0;
  background: var(--border);
}

.legal-section {
  padding-top: 42px;
}

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

h2 {
  margin: 0 0 14px;
  font-family: var(--serif);
  font-size: clamp(1.55rem, 3.4vw, 2.05rem);
  font-weight: 400;
  letter-spacing: -0.012em;
  line-height: 1.16;
}

h3 {
  margin: 28px 0 8px;
  font-size: 1rem;
  font-weight: 700;
}

p {
  margin: 0;
}

p + p {
  margin-top: 14px;
}

ul,
ol {
  margin: 14px 0 0;
  padding-left: 1.35rem;
}

li + li {
  margin-top: 8px;
}

strong,
b {
  color: inherit;
}

.legal-note {
  margin-top: 22px;
  padding: 18px 20px;
  border: 1px solid rgba(77, 113, 132, 0.20);
  border-radius: 14px;
  background: var(--accent-soft);
}

.legal-note p + p {
  margin-top: 10px;
}

.legal-footer {
  border-top: 1px solid var(--border);
  color: var(--soft);
}

.legal-footer-inner {
  width: min(calc(100% - 36px), 1120px);
  min-height: 82px;
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  font-size: 0.82rem;
}

.legal-footer-links {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.legal-footer-links a {
  color: var(--soft);
  text-decoration: none;
}

.legal-footer-links a:hover {
  color: var(--heading);
}


/*
 * One paint clock for every theme-painted element.
 * Scope the universal transition to the short-lived theme-changing state so
 * normal hover/focus interactions keep their own timing.
 */
html.theme-changing,
html.theme-changing *,
html.theme-changing *::before,
html.theme-changing *::after {
  transition:
    background-color var(--theme-motion),
    background var(--theme-motion),
    color var(--theme-motion),
    border-color var(--theme-motion),
    outline-color var(--theme-motion),
    box-shadow var(--theme-motion),
    fill var(--theme-motion),
    stroke var(--theme-motion);
}

/*
 * Larger/heavier text has a stronger perceived tail during the same color
 * interpolation. Let emphasis settle slightly earlier while preserving the
 * universal theme-transition contract everywhere else.
 */
html.theme-changing h1,
html.theme-changing h2,
html.theme-changing h3,
html.theme-changing strong,
html.theme-changing b {
  transition-duration: 140ms;
}

html.theme-changing {
  scrollbar-color:
    rgba(var(--accent-rgb), 0.46) transparent;
}

html.theme-changing::-webkit-scrollbar-thumb {
  transition: background-color var(--theme-motion);
}

@media (prefers-reduced-motion: reduce) {
  html.theme-changing,
  html.theme-changing *,
  html.theme-changing *::before,
  html.theme-changing *::after,
  html.theme-changing::-webkit-scrollbar-thumb {
    transition-duration: 0.01ms !important;
  }
}

@media (max-width: 640px) {
  .legal-main {
    padding: 54px 0 68px;
  }

  .legal-section {
    padding-top: 34px;
  }

  .legal-rule {
    margin-top: 34px;
  }

  .legal-footer-inner {
    padding: 22px 0;
    align-items: center;
    flex-direction: column;
    gap: 10px;
    text-align: center;
  }

  .legal-footer-links {
    justify-content: center;
  }
}
