:root {
  color-scheme: light dark;
  --background: #edeef0;
  --surface: #f7f8f9;
  --surface-elevated: #ffffff;
  --text-primary: #161715;
  --text-secondary: #52534e;
  --text-tertiary: #6a6b65;
  --stroke: #d1d1cc;
  --accent: #2a2c2b;
  --on-accent: #ffffff;
  --focus: #2a6df4;
}

@media (prefers-color-scheme: dark) {
  :root {
    --background: #000000;
    --surface: #131416;
    --surface-elevated: #1c1e21;
    --text-primary: #f0f0ee;
    --text-secondary: #abaca6;
    --text-tertiary: #92938d;
    --stroke: #3a3b39;
    --accent: #e6e6e3;
    --on-accent: #000000;
    --focus: #75a7ff;
  }
}

* {
  box-sizing: border-box;
}

html {
  background: var(--background);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Arabic", system-ui, sans-serif;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  margin: 0;
  padding: env(safe-area-inset-top) max(16px, env(safe-area-inset-right)) env(safe-area-inset-bottom) max(16px, env(safe-area-inset-left));
  background: var(--background);
  color: var(--text-primary);
  font-size: 1rem;
  line-height: 1.65;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: var(--text-primary);
  text-decoration-color: var(--text-tertiary);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

a:hover {
  text-decoration-color: currentColor;
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  z-index: 10;
  inset-block-start: 12px;
  inset-inline-start: 12px;
  padding: 8px 12px;
  border-radius: 10px;
  background: var(--accent);
  color: var(--on-accent);
  transform: translateY(-180%);
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header,
main,
.site-footer {
  width: min(100%, 720px);
  margin-inline: auto;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-block: 24px 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  color: var(--text-primary);
  text-decoration: none;
}

.brand img {
  display: block;
  width: 180px;
  height: auto;
}

.language-switcher {
  display: inline-grid;
  grid-template-columns: 1fr 1fr;
  padding: 3px;
  border: 0.5px solid var(--stroke);
  border-radius: 999px;
  background: var(--surface);
}

.language-switcher button {
  min-height: 44px;
  padding: 8px 12px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--text-secondary);
  font: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
}

.language-switcher button[aria-pressed="true"] {
  background: var(--accent);
  color: var(--on-accent);
}

.policy {
  overflow: hidden;
  border: 0.5px solid var(--stroke);
  border-radius: 14px;
  background: var(--surface);
}

.policy[hidden] {
  display: none;
}

.policy-header,
.policy section {
  padding: 24px;
}

.policy-header {
  padding-block: 32px;
  border-block-end: 0.5px solid var(--stroke);
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 600;
}

h1,
h2,
p,
ul {
  margin-block-start: 0;
}

h1 {
  margin-block-end: 8px;
  font-size: clamp(2rem, 9vw, 3rem);
  line-height: 1.12;
  letter-spacing: -0.012em;
  font-weight: 600;
}

[dir="rtl"] h1 {
  letter-spacing: 0;
  line-height: 1.32;
}

[dir="rtl"] .policy,
[dir="rtl"] .summary {
  line-height: 1.85;
}

[dir="rtl"] h2 {
  line-height: 1.6;
}

[dir="rtl"] h2,
[dir="rtl"] .eyebrow {
  font-weight: 500;
}

.updated {
  margin-block-end: 24px;
  color: var(--text-tertiary);
  font-size: 0.875rem;
}

.summary {
  max-width: 60ch;
  margin-block-end: 0;
  color: var(--text-secondary);
  font-size: 1.08rem;
  line-height: 1.7;
}

.policy section + section {
  border-block-start: 0.5px solid var(--stroke);
}

h2 {
  margin-block-end: 12px;
  font-size: 1.15rem;
  line-height: 1.35;
  font-weight: 600;
}

.policy section p:last-child,
.policy section ul:last-child {
  margin-block-end: 0;
}

.policy section p,
.policy section li {
  max-width: 66ch;
  color: var(--text-secondary);
}

.technical,
.contact-address {
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-size: 0.92em;
  unicode-bidi: isolate;
}

.site-footer {
  padding-block: 24px 32px;
  color: var(--text-tertiary);
  text-align: center;
  font-size: 0.8rem;
}

.site-footer p {
  margin: 0;
}

@media (max-width: 520px) {
  .site-header {
    align-items: stretch;
    flex-direction: column;
  }

  .language-switcher {
    align-self: stretch;
  }

  .policy-header,
  .policy section {
    padding: 16px;
  }

  .policy-header {
    padding-block: 24px;
  }
}

@media (min-width: 760px) {
  body {
    padding-inline: 24px;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .language-switcher button,
  .skip-link {
    transition: background-color 160ms ease, color 160ms ease, transform 160ms ease;
  }
}

@media print {
  :root {
    --background: #ffffff;
    --surface: #ffffff;
    --surface-elevated: #ffffff;
    --text-primary: #000000;
    --text-secondary: #222222;
    --text-tertiary: #444444;
    --stroke: #cccccc;
  }

  body {
    padding: 0;
  }

  .site-header,
  .site-footer,
  [data-language-panel][hidden] {
    display: none;
  }

  .policy {
    border: 0;
  }

  .policy-header,
  .policy section {
    padding-inline: 0;
  }

  a {
    color: inherit;
  }
}
