:root {
  color-scheme: light;
  --bg: #f6f5fb;
  --surface: #ffffff;
  --tint: #ece8fb;
  --tint-2: #e1dbf8;
  --text: #16131f;
  --muted: #5d586b;
  --line: rgba(40, 25, 90, 0.1);
  --accent: #6340e0;
  --on-accent: #ffffff;
  --shadow: 0 24px 60px -28px rgba(70, 45, 160, 0.35);
  --logo-filter: brightness(0.6) saturate(1.5);
  --glass: rgba(255, 255, 255, 0.7);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    color-scheme: dark;
    --bg: #0f0d16;
    --surface: #191623;
    --tint: #211c33;
    --tint-2: #2a2442;
    --text: #f1eff7;
    --muted: #aaa4bb;
    --line: rgba(200, 185, 255, 0.12);
    --accent: #a78bfa;
    --on-accent: #120f1b;
    --shadow: 0 24px 60px -28px rgba(0, 0, 0, 0.8);
    --logo-filter: none;
    --glass: rgba(25, 22, 35, 0.7);
  }
}
:root[data-theme='dark'] {
  color-scheme: dark;
  --bg: #0f0d16;
  --surface: #191623;
  --tint: #211c33;
  --tint-2: #2a2442;
  --text: #f1eff7;
  --muted: #aaa4bb;
  --line: rgba(200, 185, 255, 0.12);
  --accent: #a78bfa;
  --on-accent: #120f1b;
  --shadow: 0 24px 60px -28px rgba(0, 0, 0, 0.8);
  --logo-filter: none;
  --glass: rgba(25, 22, 35, 0.7);
}
* {
  box-sizing: border-box;
}
html {
  scroll-padding-top: 96px;
}
@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Outfit', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a {
  color: inherit;
}
a,
button {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
img {
  display: block;
  max-width: 100%;
  height: auto;
}
h1,
h2,
h3,
p {
  margin: 0;
}
.wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 clamp(16px, 4vw, 40px);
  padding-left: max(clamp(16px, 4vw, 40px), env(safe-area-inset-left));
  padding-right: max(clamp(16px, 4vw, 40px), env(safe-area-inset-right));
}
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 24px;
  border-radius: 999px;
  font-family: inherit;
  font-weight: 600;
  font-size: 16px;
  text-decoration: none;
  white-space: nowrap;
  border: 0;
  cursor: pointer;
  transition:
    transform 0.25s var(--ease),
    box-shadow 0.25s,
    background 0.2s;
}
.btn:active {
  transform: scale(0.97);
}
.btn-primary {
  background: var(--accent);
  color: var(--on-accent);
  box-shadow: 0 10px 24px -12px var(--accent);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 30px -12px var(--accent);
}
.btn-soft {
  background: var(--tint);
  color: var(--text);
}
.btn-soft:hover {
  background: var(--tint-2);
}

.policy-page {
  padding-block: clamp(40px, 6vw, 80px) clamp(56px, 8vw, 112px);
}
.policy-grid {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: clamp(40px, 6vw, 96px);
  align-items: start;
}
.policy-aside {
  position: sticky;
  top: 104px;
}
.policy-main {
  min-width: 0;
  max-width: 760px;
}
.policy-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: clamp(28px, 4vw, 44px);
}
.policy-close {
  flex-shrink: 0;
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  font-size: 20px;
  line-height: 1;
  transition:
    background 0.2s,
    border-color 0.2s;
}
.policy-close:hover {
  background: var(--tint);
  border-color: var(--accent);
}
@media (max-width: 1099px) {
  .policy-grid {
    grid-template-columns: 1fr;
  }
  .policy-aside {
    display: none;
  }
  .policy-main {
    margin-inline: auto;
    width: 100%;
  }
}

.toc-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 12px;
}
.toc ol {
  list-style: none;
  margin: 0;
  padding: 0;
  border-left: 1px solid var(--line);
}
.toc a {
  display: block;
  padding: 7px 0 7px 16px;
  margin-left: -1px;
  border-left: 2px solid transparent;
  font-size: 14.5px;
  line-height: 1.35;
  color: var(--muted);
  text-decoration: none;
  transition:
    color 0.2s,
    border-color 0.2s;
}
.toc a:hover {
  color: var(--text);
}
.toc a[aria-current='true'] {
  color: var(--accent);
  border-left-color: var(--accent);
  font-weight: 600;
}
.toc ol {
  position: relative;
}
.toc ol::before {
  content: '';
  position: absolute;
  left: -1px;
  top: 0;
  width: 2px;
  height: var(--fill, 0px);
  border-radius: 2px;
  background: var(--accent);
  transition: height 0.15s linear;
}
.toc-meta {
  margin-top: 16px;
  padding-left: 17px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.read-bar {
  display: none;
}
@media (max-width: 1099px) {
  .read-bar {
    display: block;
    position: sticky;
    top: 84px;
    z-index: 40;
    margin: 0 0 28px;
    border-radius: 22px;
    background: var(--surface);
    border: 1px solid var(--line);
    box-shadow:
      0 -14px 0 6px var(--bg),
      var(--shadow);
    overflow: hidden;
  }
  .policy-panel .policy-h {
    scroll-margin-top: 156px;
  }
}
@media (max-width: 520px) {
  .read-bar {
    top: 80px;
    border-radius: 18px;
  }
}
.rb-toggle {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 52px;
  padding: 8px 16px;
  border: 0;
  background: none;
  color: var(--text);
  font-family: inherit;
  font-size: 15px;
  text-align: left;
  cursor: pointer;
}
.rb-count {
  flex-shrink: 0;
  font-size: 13px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--accent);
  background: var(--tint);
  padding: 4px 10px;
  border-radius: 999px;
}
.rb-label {
  flex: 1;
  min-width: 0;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rb-pct {
  flex-shrink: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.rb-toggle:hover {
  background: var(--tint);
}
.rb-toggle i {
  flex-shrink: 0;
  font-size: 18px;
  transition: transform 0.3s var(--ease);
}
.rb-toggle[aria-expanded='true'] i {
  transform: rotate(180deg);
}
.rb-progress {
  display: block;
  height: 3px;
  background: var(--tint);
}
.rb-progress span {
  display: block;
  height: 100%;
  width: 100%;
  background: var(--accent);
  transform-origin: left;
  transform: scaleX(var(--p, 0));
}
.rb-list {
  list-style: none;
  overscroll-behavior: contain;
  margin: 0;
  padding: 8px;
  max-height: min(60vh, 420px);
  overflow-y: auto;
  border-top: 1px solid var(--line);
}
.rb-list a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 8px 12px;
  border-radius: 12px;
  font-size: 15px;
  line-height: 1.35;
  color: var(--muted);
  text-decoration: none;
}
.rb-list a:hover {
  background: var(--tint);
  color: var(--text);
}
.rb-list a[aria-current='true'] {
  color: var(--accent);
  font-weight: 600;
  background: var(--tint);
}
@media (max-width: 374px) {
  .rb-pct {
    display: none;
  }
  .rb-toggle {
    gap: 8px;
    padding-inline: 12px;
  }
}

.policy-title {
  font-size: clamp(36px, 4.6vw, 58px);
  line-height: 1.04;
  letter-spacing: -0.03em;
  font-weight: 700;
  text-wrap: balance;
}
.policy-panel p.policy-meta {
  margin-top: 14px;
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--muted);
  max-width: 68ch;
}
.policy-panel p.policy-meta + p.policy-meta {
  margin-top: 6px;
  font-size: 13px;
  opacity: 0.85;
}
.policy-h {
  scroll-margin-top: 96px;
  margin: clamp(44px, 5vw, 64px) 0 16px;
  padding-top: clamp(28px, 3vw, 36px);
  border-top: 1px solid var(--line);
  font-size: clamp(23px, 2.3vw, 30px);
  line-height: 1.15;
  letter-spacing: -0.02em;
  font-weight: 700;
  text-wrap: balance;
}
.policy-sub {
  margin: 30px 0 10px;
  text-wrap: balance;
  font-size: 19px;
  line-height: 1.3;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--accent);
}
.policy-panel p {
  margin: 0 0 16px;
  font-size: 17px;
  line-height: 1.7;
  color: var(--muted);
  max-width: 68ch;
}
.policy-panel p.policy-lead {
  margin-bottom: 10px;
}
.policy-panel p.policy-tight {
  margin-bottom: 6px;
}
.policy-panel p.policy-last {
  margin-bottom: 32px;
}
.policy-panel b {
  color: var(--text);
  font-weight: 600;
}
.policy-panel ul {
  list-style: none;
  margin: 0 0 18px;
  padding: 0;
  display: grid;
  gap: 10px;
  max-width: 68ch;
}
.policy-panel li {
  position: relative;
  padding-left: 24px;
  font-size: 17px;
  line-height: 1.6;
  color: var(--muted);
}
.policy-panel li::before {
  content: '';
  position: absolute;
  left: 4px;
  top: 0.62em;
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--accent);
}
.policy-panel a:not(.policy-btn) {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  overflow-wrap: anywhere;
}
.policy-panel a:not(.policy-btn):hover {
  text-decoration-thickness: 2px;
}
.policy-panel code {
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 0.88em;
  color: var(--text);
  background: var(--tint);
  padding: 1px 6px;
  border-radius: 6px;
}
.policy-panel a.policy-btn {
  margin-top: 8px;
  min-height: 48px;
  text-decoration: none;
}
@media (max-width: 520px) {
  .policy-panel p,
  .policy-panel li {
    font-size: 16px;
  }
  .policy-panel a.policy-btn {
    width: 100%;
    justify-content: center;
  }
}

.policy-switch {
  position: relative;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 20px;
  border-bottom: 1px solid var(--line);
}
.ps-group {
  display: flex;
  gap: 28px;
}
.ps-divider {
  width: 1px;
  height: 20px;
  background: var(--muted);
  opacity: 0.35;
}
.ps-link {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 2px 12px;
  font-size: 16px;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.3s var(--ease);
}
.ps-link i {
  font-size: 18px;
}
.ps-link:hover {
  color: var(--text);
}
.policy-switch[data-active='website'] .ps-link[data-key='website'],
.policy-switch[data-active='donations'] .ps-link[data-key='donations'],
.policy-switch[data-active='cookies'] .ps-link[data-key='cookies'] {
  color: var(--text);
}
.ps-track {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 3px;
  pointer-events: none;
}
.ps-thumb {
  position: absolute;
  display: block;
  top: 0;
  bottom: 0;
  border-radius: 3px;
  background: var(--accent);
  left: var(--website-l);
  right: var(--website-r);
}
.policy-switch[data-active='donations'] .ps-thumb {
  left: var(--donations-l);
  right: var(--donations-r);
}
.policy-switch[data-active='cookies'] .ps-thumb {
  left: var(--cookies-l);
  right: var(--cookies-r);
}
.policy-switch[data-dir='right'] .ps-thumb {
  transition:
    right 0.32s var(--ease),
    left 0.32s var(--ease) 0.14s;
}
.policy-switch[data-dir='left'] .ps-thumb {
  transition:
    left 0.32s var(--ease),
    right 0.32s var(--ease) 0.14s;
}
.policy-switch:not(.ready) .ps-thumb {
  opacity: 0;
  transition: none !important;
}
/* Phones: drop the icons so all three tabs stay on one line beside the close button. */
@media (max-width: 480px) {
  .policy-switch {
    gap: 14px;
  }
  .ps-group {
    gap: 20px;
  }
  .ps-link i {
    display: none;
  }
}
@media (max-width: 340px) {
  .policy-switch {
    gap: 10px;
  }
  .ps-group {
    gap: 14px;
  }
  .ps-link {
    font-size: 15px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ps-thumb,
  .ps-link {
    transition: none !important;
  }
}

/* Cookie table (cookie-policy.html): grouped by type; stacks into labelled rows when its column is narrow. */
.cookie-table-wrap {
  container: cookie-table / inline-size;
  margin: 8px 0 24px;
}
.cookie-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
  font-size: 15px;
  line-height: 1.6;
}
.cookie-table caption {
  caption-side: top;
  text-align: left;
  padding-bottom: 12px;
  font-size: 14px;
  color: var(--muted);
}
.cookie-table th,
.cookie-table td {
  padding: 14px 16px;
  text-align: left;
  vertical-align: top;
  border-top: 1px solid var(--line);
}
.cookie-table thead th {
  border-top: 0;
  padding-block: 14px 10px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--muted);
}
.cookie-table thead th:nth-child(3) {
  width: 36%;
}
.cookie-table tbody th[scope='row'] {
  font-weight: 400;
}
.cookie-table td {
  color: var(--muted);
}
.cookie-table td[data-label='Originator'] {
  color: var(--text);
  font-weight: 500;
}
.cookie-table td[data-label='Duration'] {
  white-space: nowrap;
}
.cookie-table .ct-group th {
  padding-block: 12px;
  background: var(--tint);
}
.ct-group-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 12px;
}
.ct-group-name {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}
.ct-group-meta {
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
}
.ct-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 12px 3px 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
  white-space: nowrap;
}
.ct-badge i {
  font-size: 14px;
}
.ct-badge-essential {
  background: var(--tint-2);
  color: var(--text);
}
.ct-badge-optional {
  padding-block: 2px;
  border: 1px solid var(--accent);
  color: var(--accent);
}
@container cookie-table (width < 620px) {
  .cookie-table,
  .cookie-table caption,
  .cookie-table tbody,
  .cookie-table tr,
  .cookie-table th,
  .cookie-table td {
    display: block;
  }
  /* Column headers are replaced by the per-cell labels below. */
  .cookie-table thead {
    display: none;
  }
  .cookie-table caption {
    padding: 14px 16px 12px;
  }
  .cookie-table tbody tr:not(.ct-group) {
    padding: 10px 16px;
    border-top: 1px solid var(--line);
  }
  .cookie-table tbody tr:not(.ct-group) > [data-label] {
    display: grid;
    grid-template-columns: 96px minmax(0, 1fr);
    gap: 12px;
    padding: 5px 0;
    border-top: 0;
  }
  .cookie-table [data-label]::before {
    content: attr(data-label);
    font-size: 13px;
    font-weight: 600;
    color: var(--muted);
  }
  .cookie-table td[data-label='Duration'] {
    white-space: normal;
  }
  .cookie-table [data-label] > code,
  .cookie-table .ct-badge {
    justify-self: start;
  }
}
