:root {
  color-scheme: light;
  --bg: #11100f;
  --bg-2: #191513;
  --bg-3: #202024;
  --ink: #eef2f7;
  --muted: #b6b0a8;
  --accent: #f2b84b;
  --accent-2: #62d6c4;
  --accent-3: #df6f9f;
  --line: #34302c;
  --card: rgba(32, 28, 25, 0.86);
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
  --radius: 20px;
  --mono: "ui-monospace", "SFMono-Regular", "Menlo", "Monaco", "Consolas", "Liberation Mono", "Courier New", monospace;
}

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

body {
  font-family: "Manrope", sans-serif;
  background:
    linear-gradient(90deg, rgba(98, 214, 196, 0.05) 1px, transparent 1px),
    linear-gradient(0deg, rgba(242, 184, 75, 0.045) 1px, transparent 1px),
    #0c0b0a;
  background-size: 44px 44px, 44px 44px, auto;
  color: var(--ink);
  line-height: 1.5;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(115deg, transparent 0 35%, rgba(98, 214, 196, 0.08) 48%, transparent 62%),
    linear-gradient(245deg, transparent 0 42%, rgba(223, 111, 159, 0.07) 50%, transparent 58%);
  mix-blend-mode: screen;
  opacity: 0.7;
  animation: pageSignal 18s ease-in-out infinite alternate;
  z-index: -1;
}

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

a.repo-ref {
  color: var(--accent-2);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

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

code {
  font-family: var(--mono);
  font-size: 0.92em;
  color: var(--accent-2);
  overflow-wrap: anywhere;
}

.page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 48px 24px 80px;
  background:
    linear-gradient(135deg, rgba(242, 184, 75, 0.08), transparent 34%),
    linear-gradient(225deg, rgba(98, 214, 196, 0.08), transparent 32%),
    var(--bg);
}

body:has(#theme-toggle:checked) {
  --bg: #f6f2ec;
  --bg-2: #fdf8f2;
  --bg-3: #f1ece6;
  --ink: #1b1b21;
  --muted: #5b6678;
  --accent: #ff7a00;
  --accent-2: #1aa2c7;
  --accent-3: #b24577;
  --line: #e1d7cd;
  --card: rgba(255, 255, 255, 0.9);
  --shadow: 0 18px 40px rgba(30, 24, 18, 0.15);
}

body:has(#theme-toggle:checked) .page {
  background:
    linear-gradient(135deg, rgba(255, 122, 0, 0.11), transparent 35%),
    linear-gradient(225deg, rgba(26, 162, 199, 0.1), transparent 32%),
    var(--bg);
}

body:has(#theme-toggle:checked) .hero {
  background: linear-gradient(140deg, #fff5e8, #f0e0d2);
  border-color: #e6d4c2;
}

body:has(#theme-toggle:checked) .hero h1 {
  color: #3a2415;
}

body:has(#theme-toggle:checked) .code {
  background: #f5efe7;
  color: #2a2a34;
}

body:has(#theme-toggle:checked) .shot {
  background: #faf6f0;
}

body:has(#theme-toggle:checked) .example-visual {
  background:
    linear-gradient(135deg, rgba(26, 162, 199, 0.12), rgba(255, 122, 0, 0.1)),
    #f7f1e9;
}

body:has(#theme-toggle:checked) .example-image-button,
body:has(#theme-toggle:checked) .example-visual img {
  background: #fffdf9;
}

.hero {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 36px;
  align-items: center;
  padding: 48px 32px;
  background:
    linear-gradient(140deg, rgba(33, 29, 25, 0.96), rgba(13, 12, 12, 0.86)),
    repeating-linear-gradient(90deg, rgba(98, 214, 196, 0.08) 0 1px, transparent 1px 24px);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
  overflow: hidden;
  position: relative;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 0 35%, rgba(242, 184, 75, 0.18) 45%, transparent 55% 100%);
  transform: translateX(-120%);
  animation: heroScan 8s ease-in-out infinite;
  pointer-events: none;
}

.hero > * {
  position: relative;
  z-index: 1;
}

.hero h1 {
  font-family: "Unbounded", sans-serif;
  font-size: clamp(2.4rem, 3.6vw, 3.6rem);
  letter-spacing: 0.02em;
  margin-bottom: 16px;
  overflow-wrap: anywhere;
}

.hero p {
  font-size: 1.05rem;
  color: var(--muted);
}

.hero .tag {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--accent);
  margin-bottom: 20px;
}

.hero .tag span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 20px rgba(255, 179, 71, 0.8);
}

.hero .panel {
  background: var(--card);
  padding: 24px;
  border-radius: 16px;
  border: 1px solid rgba(110, 231, 255, 0.2);
}

.hero .panel h3 {
  font-family: "Unbounded", sans-serif;
  font-size: 1.1rem;
  margin-bottom: 12px;
}

.hero .panel ul {
  list-style: none;
  display: grid;
  gap: 10px;
}

.hero .panel li {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  color: var(--muted);
}

.dot {
  width: 8px;
  height: 8px;
  margin-top: 8px;
  border-radius: 50%;
  background: var(--accent-2);
  box-shadow: 0 0 10px rgba(110, 231, 255, 0.6);
  flex: 0 0 auto;
}

.grid {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  margin-top: 48px;
}

.card {
  background: var(--card);
  border-radius: var(--radius);
  border: 1px solid var(--line);
  padding: 22px;
  min-height: 180px;
  position: relative;
  overflow: hidden;
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    transform 0.2s ease;
}

.card:hover {
  border-color: rgba(98, 214, 196, 0.55);
  box-shadow: 0 20px 44px rgba(0, 0, 0, 0.24);
  transform: translateY(-3px);
}

.card::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(115deg, transparent 0 58%, rgba(242, 184, 75, 0.1) 58% 59%, transparent 59%),
    linear-gradient(155deg, transparent 0 70%, rgba(98, 214, 196, 0.1) 70% 71%, transparent 71%);
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
}

.card:hover::after {
  opacity: 1;
}

.card h3 {
  font-family: "Unbounded", sans-serif;
  font-size: 1.05rem;
  margin-bottom: 10px;
}

.card p {
  color: var(--muted);
  font-size: 0.98rem;
}

.section {
  margin-top: 64px;
}

.section h2 {
  font-family: "Unbounded", sans-serif;
  font-size: clamp(1.6rem, 2.4vw, 2.2rem);
  margin-bottom: 16px;
}

.section p.lead {
  color: var(--muted);
  max-width: 760px;
}

.lang-tabs {
  margin-top: 28px;
  background: var(--bg-2);
  border-radius: var(--radius);
  border: 1px solid var(--line);
  padding: 24px;
}

.tabs {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
}

.tabs label {
  cursor: pointer;
  padding: 8px 16px;
  border-radius: 999px;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--muted);
  font-weight: 600;
  transition: all 0.2s ease;
}

input[name="lang"] {
  display: none;
}

#lang-ru:checked~.tabs label[for="lang-ru"],
#lang-en:checked~.tabs label[for="lang-en"] {
  background: linear-gradient(120deg, rgba(255, 179, 71, 0.25), rgba(110, 231, 255, 0.2));
  color: var(--ink);
  border-color: rgba(255, 179, 71, 0.6);
}

.lang-content {
  display: none;
  animation: fadeUp 0.4s ease;
}

.lang-content.is-visible {
  display: block;
}

#lang-ru:checked~.lang-ru,
#lang-en:checked~.lang-en {
  display: block;
}

.lang-content h3 {
  font-family: "Unbounded", sans-serif;
  margin-bottom: 10px;
}

.lang-content ul {
  list-style: none;
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.lang-content li {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  color: var(--muted);
}

.code {
  background: #0c1017;
  border-radius: 16px;
  border: 1px solid var(--line);
  padding: 14px 16px;
  font-family: var(--mono);
  font-size: 0.9rem;
  color: #d5e2f5;
  white-space: pre-wrap;
}

.compact-code {
  font-size: 0.75rem;
}

.code-tall {
  min-height: 180px;
}

.operator {
  display: inline-block;
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 12px;
  transition: transform 0.2s ease;
}

.operator-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.operator-card {
  min-height: 200px;
}

.operator-card:hover .operator {
  transform: translateY(-2px) rotate(-2deg);
}

.operator-accent {
  color: var(--accent);
}

.operator-blue {
  color: var(--accent-2);
}

.operator-space {
  color: var(--accent);
  font-size: 1.28rem;
  letter-spacing: 0;
}

.operator-code {
  margin-top: 12px;
  font-size: 0.8rem;
}

.code-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 24px;
}

.code-title {
  font-family: "Unbounded", sans-serif;
  font-size: 0.95rem;
  margin-bottom: 10px;
}

.split {
  display: grid;
  gap: 24px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  align-items: start;
}

.example-carousel {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 44px;
  gap: 12px;
  align-items: stretch;
  margin-top: 28px;
}

.carousel-button {
  align-self: center;
  width: 44px;
  height: 88px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(15, 22, 33, 0.92);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 1.7rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.22);
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.carousel-button:hover {
  border-color: var(--accent-2);
  transform: translateY(-1px);
}

.carousel-button:focus-visible {
  outline: 2px solid var(--accent-2);
  outline-offset: 3px;
}

.example-strip {
  display: flex;
  gap: 18px;
  overflow-x: auto;
  padding: 4px 2px 18px;
  scroll-snap-type: x mandatory;
  scrollbar-color: var(--line) transparent;
}

.example-card {
  display: grid;
  grid-template-rows: auto auto 1fr;
  flex: 0 0 min(88vw, 430px);
  min-height: 560px;
  scroll-snap-align: start;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--card);
  overflow: hidden;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.25);
}

.example-card.wide {
  flex-basis: min(92vw, 560px);
}

.example-card header {
  padding: 20px 18px 10px;
}

.example-card h3 {
  font-family: "Unbounded", sans-serif;
  font-size: 1rem;
}

.example-code {
  margin: 0 18px 18px;
  max-height: 210px;
  overflow: auto;
  font-size: 0.78rem;
}

.example-visual {
  display: grid;
  place-items: center;
  height: 320px;
  min-height: 220px;
  padding: 16px;
  background:
    linear-gradient(135deg, rgba(110, 231, 255, 0.12), rgba(255, 179, 71, 0.1)),
    #e9eef4;
  border-top: 1px solid var(--line);
}

.example-visual img {
  display: block;
  width: 100%;
  height: 100%;
  max-height: 360px;
  object-fit: contain;
  padding: 12px;
  background: #f8fafc;
}

.example-image-button {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  border: 1px solid rgba(167, 177, 194, 0.38);
  border-radius: 14px;
  padding: 0;
  background: #f8fafc;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.75),
    0 14px 28px rgba(0, 0, 0, 0.18);
  cursor: zoom-in;
  overflow: hidden;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
}

.brand {
  font-family: "Unbounded", sans-serif;
  font-size: 1rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--muted);
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
}

.repo-link {
  display: inline-flex;
  align-items: center;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
  font-weight: 600;
  white-space: nowrap;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.repo-link:hover {
  border-color: rgba(110, 231, 255, 0.45);
  transform: translateY(-1px);
}

.repo-link:focus-visible,
.toggle:focus-visible,
.carousel-button:focus-visible,
.example-image-button:focus-visible,
.lightbox-tool:focus-visible,
.lightbox .close:focus-visible {
  outline: 2px solid var(--accent-2);
  outline-offset: 3px;
}

.toggle {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--card);
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  user-select: none;
  margin-bottom: 0;
}

.switch {
  width: 42px;
  height: 22px;
  border-radius: 999px;
  background: linear-gradient(120deg, rgba(110, 231, 255, 0.4), rgba(255, 179, 71, 0.4));
  position: relative;
}

.switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--ink);
  transition: transform 0.2s ease;
}

#theme-toggle:checked+label .switch::after {
  transform: translateX(20px);
}

#theme-toggle {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(7, 10, 16, 0.9);
  display: grid;
  place-items: center;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 999;
}

.lightbox.is-open {
  opacity: 1;
  pointer-events: auto;
}

.lightbox figure {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  width: min(96vw, 1200px);
  height: min(92vh, 900px);
  background: var(--card);
  border-radius: 18px;
  border: 1px solid var(--line);
  padding: 16px;
  box-shadow: var(--shadow);
}

.lightbox-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.lightbox-hint {
  color: var(--muted);
  font-size: 0.86rem;
}

.lightbox-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.lightbox-tool,
.lightbox .close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 12px;
  background: rgba(15, 22, 33, 0.92);
  color: var(--muted);
  font-weight: 700;
  gap: 8px;
  cursor: pointer;
  white-space: nowrap;
}

.lightbox-tool:hover,
.lightbox .close:hover {
  border-color: rgba(110, 231, 255, 0.45);
  color: var(--ink);
}

.lightbox-zoom {
  min-width: 56px;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 0.9rem;
  text-align: center;
}

.lightbox-viewport {
  position: relative;
  overflow: hidden;
  min-height: 0;
  border-radius: 12px;
  background: #f8fafc;
  cursor: grab;
  touch-action: none;
}

.lightbox-viewport.is-dragging {
  cursor: grabbing;
}

.lightbox img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  background: #f8fafc;
  transform: translate(var(--pan-x, 0px), var(--pan-y, 0px)) scale(var(--zoom, 1));
  transform-origin: center;
  user-select: none;
  pointer-events: none;
}

.lightbox .close {
  margin-top: 12px;
  justify-self: end;
  font-weight: 600;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(110, 231, 255, 0.15);
  color: #c9f4ff;
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.cta-section {
  text-align: center;
  padding: 48px 24px;
  background:
    linear-gradient(120deg, rgba(98, 214, 196, 0.09), transparent 30%),
    linear-gradient(240deg, rgba(242, 184, 75, 0.11), transparent 32%),
    var(--bg-2);
  border-radius: var(--radius);
  border: 1px solid var(--line);
}

.cta-section .lead {
  max-width: 600px;
  margin: 0 auto 24px;
}

.cta-actions {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

.footer {
  margin-top: 80px;
  padding: 24px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.9rem;
  text-align: center;
}

@keyframes pageSignal {
  from {
    transform: translate3d(-2%, -1%, 0);
  }

  to {
    transform: translate3d(2%, 1%, 0);
  }
}

@keyframes heroScan {
  0%,
  55% {
    transform: translateX(-120%);
  }

  75%,
  100% {
    transform: translateX(120%);
  }
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 720px) {
  .hero {
    padding: 32px 24px;
  }

  .hero h1 {
    font-size: 2.45rem;
    line-height: 1.2;
  }

  .tabs {
    flex-wrap: wrap;
  }

  .topbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .top-actions {
    margin-left: 0;
    flex-wrap: wrap;
  }

  .code-grid {
    grid-template-columns: 1fr;
  }

  .example-card {
    flex-basis: 86vw;
    min-height: 520px;
  }

  .example-carousel {
    grid-template-columns: 32px minmax(0, 1fr) 32px;
    gap: 8px;
  }

  .carousel-button {
    width: 32px;
    height: 72px;
    font-size: 1.35rem;
  }

  .example-visual {
    height: 260px;
  }

  .lightbox {
    padding: 12px;
  }

  .lightbox figure {
    height: 94vh;
    padding: 12px;
  }

  .lightbox-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .lightbox-controls {
    width: 100%;
    flex-wrap: wrap;
  }

  .lightbox-tool {
    flex: 1 1 44px;
  }
}
