:root {
  --bg: #fafafa;
  --fg: #111113;
  --muted: #6e6e77;
  --border: #e4e4e7;
  --border-strong: #d1d1d6;
  --surface: rgba(255, 255, 255, 0.88);
  --accent-bg: #f0f0f3;
  --domain-bg: #eeeef1;
  --domain-border: #dadadd;
  --active-pill: #111113;
  --active-pill-fg: #fafafa;
  --shadow: 0 20px 50px rgba(0, 0, 0, 0.08), 0 4px 12px rgba(0, 0, 0, 0.04);
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --theme-duration: 0.7s;
}

[data-theme="dark"] {
  --bg: #0b0b0d;
  --fg: #f4f4f6;
  --muted: #8e8e98;
  --border: #232329;
  --border-strong: #32323a;
  --surface: rgba(20, 20, 24, 0.88);
  --accent-bg: #18181d;
  --domain-bg: #19191f;
  --domain-border: #2c2c35;
  --active-pill: #f4f4f6;
  --active-pill-fg: #0b0b0d;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.55), 0 4px 16px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  min-height: 100%;
  background-color: var(--bg);
  color: var(--fg);
  font-family: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition:
    background-color var(--theme-duration) var(--ease-out-expo),
    color var(--theme-duration) var(--ease-out-expo);
}

html.vt-switching,
html.vt-switching *,
html.vt-switching *::before,
html.vt-switching *::after {
  transition: none !important;
}

::view-transition-old(root),
::view-transition-new(root) {
  animation: none;
  mix-blend-mode: normal;
}

::view-transition-old(root) {
  z-index: 1;
}

::view-transition-new(root) {
  z-index: 9999;
}

body {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 100dvh;
  padding: clamp(1.5rem, 4vw, 3rem);
  overflow-x: hidden;
}

::selection {
  background: var(--fg);
  color: var(--bg);
}

header.site-header,
body > header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  max-width: clamp(58rem, 82vw, 68rem);
  margin: 0 auto;
  position: relative;
  z-index: 50;
  direction: ltr;
  gap: 1rem;
}

body.home-body header.site-header,
body.home-body > header {
  max-width: none;
}

.brand {
  flex-shrink: 0;
  font-family: "Outfit", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 1.12rem;
  font-weight: 600;
  letter-spacing: -0.025em;
  color: var(--fg);
  text-decoration: none;
  display: inline-flex;
  align-items: baseline;
  transition: opacity 0.3s var(--ease-out-expo), transform 0.3s var(--ease-out-expo);
}

.brand .brand-tld {
  color: var(--muted);
  font-weight: 500;
  transition: color 0.3s var(--ease-out-expo);
}

.brand:hover .brand-tld {
  color: var(--fg);
}

.controls {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  position: static;
}

.lang-wrapper {
  position: static;
  min-width: 0;
}

.lang-trigger {
  max-width: 100%;
  appearance: none;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--fg);
  height: 2.15rem;
  padding: 0 0.85rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  user-select: none;
  transition:
    background-color 0.35s var(--ease-out-expo),
    border-color 0.35s var(--ease-out-expo),
    color 0.35s var(--ease-out-expo),
    transform 0.25s var(--ease-spring);
}

.lang-trigger:hover {
  background-color: var(--accent-bg);
  border-color: var(--muted);
}

.lang-trigger:active {
  transform: scale(0.95);
}

.lang-trigger svg.globe-icon {
  width: 0.9rem;
  height: 0.9rem;
  stroke: var(--muted);
  fill: none;
  stroke-width: 1.75;
  transition: transform 0.6s var(--ease-spring), stroke 0.35s var(--ease-out-expo);
}

.lang-trigger:hover svg.globe-icon,
.lang-wrapper.open .lang-trigger svg.globe-icon {
  stroke: var(--fg);
  transform: rotate(25deg);
}

.lang-trigger-label {
  min-width: 0;
  display: inline-block;
  max-width: 9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: opacity 0.25s var(--ease-out-expo), transform 0.25s var(--ease-out-expo);
}

.lang-trigger svg.chevron-icon {
  width: 0.75rem;
  height: 0.75rem;
  stroke: var(--muted);
  fill: none;
  stroke-width: 2;
  transition: transform 0.45s var(--ease-spring), stroke 0.35s var(--ease-out-expo);
}

.lang-wrapper.open .lang-trigger svg.chevron-icon {
  transform: rotate(180deg);
  stroke: var(--fg);
}

.lang-popover {
  position: absolute;
  top: calc(100% + 0.65rem);
  right: 0;
  width: min(26rem, 100%);
  max-height: min(23rem, calc(100dvh - 7rem));
  background: var(--surface);
  backdrop-filter: blur(22px) saturate(180%);
  -webkit-backdrop-filter: blur(22px) saturate(180%);
  border: 1px solid var(--border);
  border-radius: 1.05rem;
  box-shadow: var(--shadow);
  padding: 0.7rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-10px) scale(0.94);
  transform-origin: top right;
  transition:
    opacity 0.38s var(--ease-out-expo),
    transform 0.45s var(--ease-spring),
    border-color var(--theme-duration) var(--ease-out-expo),
    background-color var(--theme-duration) var(--ease-out-expo);
}

.lang-wrapper.open .lang-popover {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.lang-search-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.lang-search {
  width: 100%;
  background: var(--accent-bg);
  border: 1px solid transparent;
  border-radius: 0.65rem;
  padding: 0.48rem 0.75rem;
  font-size: 0.78rem;
  font-family: inherit;
  color: var(--fg);
  outline: none;
  transition: border-color 0.25s var(--ease-out-expo), background-color 0.25s var(--ease-out-expo);
}

.lang-search::placeholder {
  color: var(--muted);
}

.lang-search:focus {
  border-color: var(--muted);
}

.lang-grid-scroll {
  position: relative;
  overflow-y: auto;
  overflow-x: hidden;
  max-height: 17.5rem;
  padding-right: 0.2rem;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.lang-grid-scroll::-webkit-scrollbar {
  width: 4px;
}

.lang-grid-scroll::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 999px;
}

.lang-grid {
  position: relative;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(7.2rem, 1fr));
  gap: 0.25rem;
}

.lang-glider {
  position: absolute;
  top: 0;
  left: 0;
  width: 0;
  height: 0;
  border-radius: 0.55rem;
  background-color: var(--active-pill);
  pointer-events: none;
  z-index: 0;
  opacity: 0;
  will-change: transform, width, height;
  transition:
    transform 0.42s var(--ease-out-expo),
    width 0.42s var(--ease-out-expo),
    height 0.42s var(--ease-out-expo),
    opacity 0.25s var(--ease-out-expo),
    background-color var(--theme-duration) var(--ease-out-expo);
}

.lang-option {
  position: relative;
  z-index: 1;
  appearance: none;
  background: transparent;
  border: none;
  border-radius: 0.55rem;
  padding: 0.48rem 0.65rem;
  text-align: left;
  cursor: pointer;
  display: flex;
  align-items: center;
  color: var(--fg);
  font-family: inherit;
  font-size: 0.78rem;
  transition:
    color 0.28s var(--ease-out-expo),
    background-color 0.2s var(--ease-out-expo),
    transform 0.2s var(--ease-out-expo);
}

.lang-option:hover:not(.active) {
  background-color: var(--accent-bg);
}

.lang-option:active {
  transform: scale(0.96);
}

.lang-option.active {
  color: var(--active-pill-fg);
  font-weight: 500;
}

.lang-option .lang-native {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lang-option.hidden {
  display: none !important;
}

.theme-toggle {
  flex-shrink: 0;
  position: relative;
  appearance: none;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
  width: 2.15rem;
  height: 2.15rem;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  overflow: hidden;
  transition:
    color 0.35s var(--ease-out-expo),
    border-color 0.35s var(--ease-out-expo),
    background-color 0.35s var(--ease-out-expo),
    transform 0.3s var(--ease-spring);
}

.theme-toggle:hover {
  color: var(--fg);
  background-color: var(--accent-bg);
  border-color: var(--muted);
}

.theme-toggle:active {
  transform: scale(0.88);
}

.theme-toggle svg {
  position: absolute;
  width: 1rem;
  height: 1rem;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition:
    transform 0.65s var(--ease-spring),
    opacity 0.45s var(--ease-out-expo);
}

[data-theme="light"] .icon-moon {
  opacity: 1;
  transform: rotate(0deg) scale(1);
}

[data-theme="light"] .icon-sun {
  opacity: 0;
  transform: rotate(120deg) scale(0.3);
}

[data-theme="dark"] .icon-sun {
  opacity: 1;
  transform: rotate(0deg) scale(1);
}

[data-theme="dark"] .icon-moon {
  opacity: 0;
  transform: rotate(-120deg) scale(0.3);
}

main.home-main {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  text-align: center;
  padding: 2rem 0;
}

.statement {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: clamp(1.35rem, 3.2vw, 2.25rem);
  font-weight: 400;
  line-height: 1.65;
  letter-spacing: -0.01em;
  max-width: 38ch;
  will-change: transform, opacity, filter;
  transition:
    opacity 0.45s var(--ease-out-expo),
    transform 0.5s var(--ease-out-expo),
    filter 0.45s var(--ease-out-expo);
}

.statement[dir="rtl"],
.statement.no-tracking {
  letter-spacing: 0;
  line-height: 1.8;
}

.statement.switching-out {
  opacity: 0;
  transform: translateY(-12px) scale(0.97);
  filter: blur(8px);
}

.statement.switching-in {
  opacity: 0;
  transform: translateY(12px) scale(0.97);
  filter: blur(8px);
  transition: none;
}

.domain {
  font-family: "Outfit", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-weight: 600;
  font-size: 0.94em;
  letter-spacing: -0.015em;
  color: var(--fg);
  background-color: var(--domain-bg);
  border: 1px solid var(--domain-border);
  border-radius: 0.42em;
  padding: 0.04em 0.38em 0.08em;
  margin: 0 0.14em;
  display: inline-block;
  direction: ltr;
  unicode-bidi: isolate;
  vertical-align: baseline;
  line-height: 1.25;
  transition:
    background-color 0.35s var(--ease-out-expo),
    border-color 0.35s var(--ease-out-expo),
    transform 0.25s var(--ease-spring);
}

.statement:hover .domain {
  border-color: var(--muted);
  transform: translateY(-1px);
}

main.doc-main {
  flex: 1;
  width: 100%;
  max-width: clamp(58rem, 82vw, 68rem);
  margin: 0 auto;
  padding: clamp(2rem, 5vh, 4rem) 0 clamp(4rem, 8vh, 6rem);
}

.doc-container {
  width: 100%;
}

.doc-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  margin-bottom: 3.5rem;
  gap: 1rem;
}

.doc-back {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.25s var(--ease-out-expo);
}

.doc-back:hover {
  color: var(--fg);
}

.doc-back svg {
  width: 0.85rem;
  height: 0.85rem;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

[dir="rtl"] .doc-back svg {
  transform: scaleX(-1);
}

.doc-switch {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.25rem;
}

.doc-tab {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  padding: 0.25rem 0;
  border-bottom: 1.5px solid transparent;
  transition: color 0.25s var(--ease-out-expo), border-color 0.25s var(--ease-out-expo);
}

.doc-tab:hover {
  color: var(--fg);
}

.doc-tab.active {
  color: var(--fg);
  border-bottom-color: var(--fg);
  font-weight: 600;
}

.doc-content {
  width: 100%;
  will-change: transform, opacity, filter;
  transition:
    opacity 0.35s var(--ease-out-expo),
    transform 0.35s var(--ease-out-expo),
    filter 0.35s var(--ease-out-expo);
}

.doc-content[dir="rtl"],
.doc-content.no-tracking {
  letter-spacing: 0;
  line-height: 1.85;
}

.doc-content.switching-out {
  opacity: 0;
  transform: translateY(-8px);
  filter: blur(4px);
}

.doc-content.switching-in {
  opacity: 0;
  transform: translateY(8px);
  filter: blur(4px);
  transition: none;
}

.doc-title {
  overflow-wrap: anywhere;
  font-size: clamp(2rem, 4.5vw, 2.75rem);
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.2;
  color: var(--fg);
  margin-bottom: 0.65rem;
}

.doc-subtitle {
  overflow-wrap: anywhere;
  font-size: clamp(0.95rem, 1.6vw, 1.1rem);
  font-weight: 400;
  color: var(--muted);
  line-height: 1.6;
  margin-bottom: 1.5rem;
}

.doc-meta-line {
  font-size: 0.78rem;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  padding-bottom: 2rem;
  margin-bottom: 2.25rem;
  border-bottom: 1px solid var(--border);
}

.doc-preamble {
  overflow-wrap: anywhere;
  font-size: 0.95rem;
  line-height: 1.85;
  color: var(--fg);
  margin-bottom: 3.5rem;
  padding-inline-start: 1.25rem;
  border-inline-start: 2px solid var(--border-strong);
}

.doc-sections {
  display: flex;
  flex-direction: column;
  gap: 3.25rem;
}

.doc-section {
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
}

.doc-section-title {
  overflow-wrap: anywhere;
  font-size: clamp(1.15rem, 2.2vw, 1.35rem);
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--fg);
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  line-height: 1.35;
}

.doc-section-num {
  font-family: "Outfit", monospace;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--muted);
  direction: ltr;
  flex-shrink: 0;
}

.doc-clauses {
  display: flex;
  flex-direction: column;
  gap: 0.95rem;
}

.doc-clause {
  font-size: 0.9rem;
  line-height: 1.8;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.doc-external {
  color: var(--fg);
  text-underline-offset: 0.2em;
}

footer.site-footer,
body > footer {
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 0.75rem;
  color: var(--muted);
  letter-spacing: 0.01em;
  text-align: center;
}

.footer-bar {
  max-width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  transition:
    color var(--theme-duration) var(--ease-out-expo),
    opacity 0.4s var(--ease-out-expo),
    transform 0.4s var(--ease-out-expo),
    filter 0.4s var(--ease-out-expo);
}

.footer-bar.switching-out {
  opacity: 0;
  transform: translateY(5px);
  filter: blur(4px);
}

.footer-copy {
  overflow-wrap: anywhere;
  color: var(--muted);
  line-height: 1.4;
}

.footer-nav {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  line-height: 1.4;
}

.footer-sep {
  opacity: 0.45;
  user-select: none;
}

.footer-link {
  color: var(--muted);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  padding-bottom: 0.05em;
  transition:
    color 0.25s var(--ease-out-expo),
    border-color 0.25s var(--ease-out-expo);
}

.footer-link:hover,
.footer-link.active {
  color: var(--fg);
  border-color: var(--muted);
}

@media print {
  body {
    background: #ffffff !important;
    color: #000000 !important;
    padding: 0 !important;
  }

  header.site-header,
  .doc-nav,
  footer.site-footer {
    display: none !important;
  }

  main.doc-main,
  .doc-container,
  .doc-content {
    max-width: 100% !important;
    width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  .doc-section {
    page-break-inside: avoid;
  }
}
