:root {
  --bg: #000;
  --text: #fafafa;
  --text-body: rgba(250, 250, 250, 0.66);
  --text-muted: rgba(250, 250, 250, 0.62);
  --text-dim: rgba(250, 250, 250, 0.4);
  --border: rgba(255, 255, 255, 0.1);
  --pill-bg: rgba(255, 255, 255, 0.04);
  --pill-border: rgba(255, 255, 255, 0.15);
  --blue: #6cb6ff;
  --blue-bg: rgba(10, 132, 255, 0.16);
  --header-height: 44px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Helvetica Neue', sans-serif;
  --font-display: 'Unbounded', var(--font);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html {
  scroll-behavior: smooth;
}

body {
  padding-top: var(--header-height);
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-weight: 400;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  animation: page-in 0.6s ease both;
}

body.leaving {
  opacity: 0;
  transition: opacity 0.25s ease;
}

a {
  color: inherit;
  text-decoration: none;
}

#page {
  transition: opacity 0.18s ease;
}

#page.lang-fade {
  opacity: 0;
}

@keyframes page-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes intro-up {
  from {
    opacity: 0;
    transform: translateY(22px);
    filter: blur(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
  }
}

header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 200;
  height: var(--header-height);
  background: rgba(0, 0, 0, 0.7);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
}

.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  padding: 0 22px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.logo-icon {
  display: block;
  flex-shrink: 0;
  width: 16px;
  height: 16px;
}

.lang-dropdown {
  position: relative;
  display: inline-block;
}

.lang-dropdown-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  background: var(--pill-bg);
  border: 1px solid var(--pill-border);
  border-radius: 999px;
  color: rgba(250, 250, 250, 0.85);
  font-family: var(--font);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.2s, background 0.2s, border-color 0.2s;
}

.lang-dropdown-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.3);
}

.lang-dropdown-btn svg {
  width: 9px;
  height: 9px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.7;
  transition: transform 0.25s ease;
}

.lang-dropdown.open .lang-dropdown-btn svg {
  transform: rotate(180deg);
}

.lang-dropdown-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 160px;
  padding: 8px;
  background: #121212;
  border: 1px solid var(--pill-border);
  border-radius: 26px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: all 0.2s ease;
}

.lang-dropdown-menu::before {
  content: '';
  position: absolute;
  top: -10px;
  left: 0;
  right: 0;
  height: 10px;
}

.lang-dropdown.open .lang-dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.lang-dropdown-menu button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: transparent;
  border: none;
  border-radius: 18px;
  color: rgba(250, 250, 250, 0.55);
  font-family: var(--font);
  font-size: 12px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.lang-dropdown-menu button:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}

.lang-dropdown-menu button.active {
  background: rgba(255, 255, 255, 0.12);
  color: var(--text);
}

@media (hover: hover) {
  .lang-dropdown:hover .lang-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }

  .lang-dropdown:hover .lang-dropdown-btn svg {
    transform: rotate(180deg);
  }
}

.layout {
  max-width: 1080px;
  margin: 0 auto;
  padding: 72px 24px 96px;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 36px;
  color: var(--text-dim);
  font-size: 13px;
  font-weight: 600;
  transition: color 0.2s;
}

.back-link:hover {
  color: var(--text);
}

.doc-head {
  display: flex;
  align-items: flex-end;
  gap: 20px;
}

.hero-icon {
  flex-shrink: 0;
  width: clamp(46px, 7.4vw, 80px);
  height: auto;
  margin-bottom: 4px;
}

.doc-eyebrow {
  margin-bottom: 4px;
  color: var(--text-dim);
  font-size: 14px;
}

.doc-head h1 {
  color: var(--text);
  font-size: clamp(32px, 5.6vw, 60px);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.04em;
}

.doc-sub {
  max-width: 600px;
  margin-top: 26px;
  color: var(--text-muted);
  font-size: 20px;
  line-height: 1.45;
}

.doc-updated {
  margin-top: 16px;
  color: var(--text-dim);
  font-size: 13px;
}

.back-link,
.doc-head,
.doc-sub,
.doc-updated,
.toc {
  animation: intro-up 0.9s var(--ease) both;
}

.back-link { animation-delay: 0.05s; }
.doc-head { animation-delay: 0.15s; }
.doc-sub { animation-delay: 0.3s; }
.doc-updated { animation-delay: 0.4s; }
.toc { animation-delay: 0.5s; }

.grid {
  display: grid;
  grid-template-columns: 230px 1fr;
  align-items: start;
  gap: 64px;
  margin-top: 72px;
}

.toc {
  position: sticky;
  top: calc(var(--header-height) + 32px);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.toc-label {
  margin: 0 12px 14px;
  color: var(--text-dim);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.toc-indicator {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 0;
  background: var(--blue-bg);
  border-radius: 10px;
  opacity: 0;
  pointer-events: none;
  transition:
    transform 0.5s var(--ease),
    height 0.5s var(--ease),
    opacity 0.3s ease;
}

.toc a {
  position: relative;
  z-index: 1;
  display: block;
  padding: 9px 12px;
  border-radius: 10px;
  color: var(--text-muted);
  font-size: 13.5px;
  transition: background 0.25s, color 0.25s;
}

.toc a:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
}

.toc a.active {
  color: var(--blue);
}

.section {
  padding: 40px 0;
  scroll-margin-top: calc(var(--header-height) + 24px);
}

.section:first-child {
  padding-top: 0;
}

.section h2 {
  margin-bottom: 18px;
  font-size: 30px;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.03em;
}

.section p,
.section li {
  color: var(--text-body);
  font-size: 15.5px;
  line-height: 1.7;
}

.section p + p,
.section p + ul,
.section ul + p,
.section .sub + p {
  margin-top: 14px;
}

.section ul {
  display: flex;
  flex-direction: column;
  gap: 12px;
  list-style: none;
}

.section li {
  position: relative;
  padding-left: 22px;
}

.section li::before {
  content: '';
  position: absolute;
  top: 0.72em;
  left: 3px;
  width: 5px;
  height: 5px;
  background: rgba(250, 250, 250, 0.4);
  border-radius: 50%;
}

.section a {
  color: var(--text);
  border-bottom: 1px solid rgba(255, 255, 255, 0.3);
}

.section a:hover {
  border-bottom-color: #fff;
}

.sub {
  margin-top: 26px;
}

.sub h3 {
  margin-bottom: 6px;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.reveal {
  opacity: 0;
  transform: translateY(26px);
  filter: blur(6px);
  transition:
    opacity 0.8s var(--ease),
    transform 0.8s var(--ease),
    filter 0.8s var(--ease);
}

.section.visible .reveal {
  opacity: 1;
  transform: translateY(0);
  filter: blur(0);
}

footer {
  padding-top: 88px;
  border-top: 1px solid var(--border);
  overflow: hidden;
}

.container {
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 24px;
}

.footer-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px;
  padding-bottom: 36px;
  border-bottom: 1px solid var(--border);
}

.footer-desc {
  max-width: 420px;
  color: var(--text-muted);
  font-size: 16px;
  line-height: 1.6;
}

.footer-socials {
  display: flex;
  align-items: center;
  gap: 14px;
}

.social-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 13px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
  color: var(--text);
  transition: all 0.25s ease;
}

.social-icon svg {
  display: block;
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.social-icon:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.45);
  box-shadow: 0 8px 25px rgba(255, 255, 255, 0.15);
  transform: translateY(-3px);
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
  padding: 24px 0 48px;
}

.copyright,
.footer-link {
  color: var(--text-dim);
  font-size: 12px;
}

.footer-link {
  transition: color 0.25s ease;
}

.footer-link:hover {
  color: var(--text);
}

.footer-mark {
  height: calc(var(--mark-size, 120px) * 0.78);
  overflow: hidden;
  line-height: 1;
  text-align: left;
}

.footer-mark-inner {
  display: inline-block;
  font-family: var(--font-display);
  font-size: var(--mark-size, 120px);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.04em;
  white-space: nowrap;
}

.letter {
  display: inline-block;
  background: linear-gradient(180deg, #fff 0%, rgba(255, 255, 255, 0.9) 38%, rgba(255, 255, 255, 0) 95%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  opacity: 0;
  filter: blur(12px);
  transform: translateY(105%);
  transition:
    transform 1.3s var(--ease),
    opacity 1s ease,
    filter 1.2s ease;
}

.footer-mark.in-view .letter {
  opacity: 1;
  filter: blur(0);
  transform: translateY(0);
}

@media (max-width: 900px) {
  .layout {
    padding: 44px 20px 72px;
  }

  .grid {
    grid-template-columns: 1fr;
    gap: 0;
    margin-top: 44px;
  }

  .toc {
    display: none;
  }

  .section,
  .section:first-child {
    padding: 34px 0;
  }

  .section h2 {
    font-size: 24px;
  }

  .doc-sub {
    font-size: 17px;
  }

  footer {
    padding-top: 64px;
  }

  .footer-desc {
    margin: 0 auto;
    text-align: center;
  }

  .footer-socials {
    justify-content: center;
    width: 100%;
  }

  .footer-bottom {
    flex-direction: column;
    justify-content: center;
    text-align: center;
  }
}

@media (max-width: 600px) {
  .navbar {
    padding: 0 14px;
  }

  .doc-head {
    gap: 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  body,
  .back-link,
  .doc-head,
  .doc-sub,
  .doc-updated,
  .toc {
    animation: none;
  }

  .reveal {
    opacity: 1;
    transform: none;
    filter: none;
    transition: none;
  }

  .toc-indicator {
    transition: none;
  }
}