:root {
  --sd-bg: #0b0d12;
  --sd-bg-elevated: #12151c;
  --sd-surface: rgba(22, 26, 36, 0.72);
  --sd-border: rgba(255, 255, 255, 0.1);
  --sd-border-strong: rgba(255, 255, 255, 0.2);
  --sd-text: #e8ecf4;
  --sd-text-muted: #b0b8c9;
  --sd-accent: #00e5c0;
  --sd-accent-2: #7c4dff;
  --sd-gradient: linear-gradient(135deg, var(--sd-accent) 0%, var(--sd-accent-2) 100%);
  --sd-header-h: 4rem;
  --sd-radius: 1rem;
  --sd-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
  --sd-font: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, "Roboto", "Helvetica Neue", Arial, sans-serif;
  --sd-mono: "Cascadia Code", "Fira Code", Consolas, monospace;
  --sd-ease: cubic-bezier(0.22, 1, 0.36, 1);
  color-scheme: dark;
}

@property --sd-glow-angle {
  syntax: "<angle>";
  inherits: false;
  initial-value: 0deg;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  text-size-adjust: 100%;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

body.sd-has-shell {
  margin: 0;
  padding-top: var(--sd-header-h);
  min-height: 100vh;
  font-family: var(--sd-font);
  background: var(--sd-bg);
  color: var(--sd-text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
}

body.sd-has-shell h1,
body.sd-has-shell h2,
body.sd-has-shell h3,
body.sd-has-shell h4 {
  color: var(--sd-text);
}

.sd-layout {
  flex: 1;
  display: flex;
  flex-direction: column;
  width: 100%;
}

.sd-main,
.sd-page-content {
  width: min(1280px, 100%);
  margin: 0 auto;
  padding: clamp(1.25rem, 4vw, 2.5rem) clamp(1rem, 3vw, 1.5rem) 3rem;
}

body.sd-legacy-page.container,
body.sd-legacy-page .container:first-child {
  max-width: min(1280px, 100%);
  margin-left: auto;
  margin-right: auto;
  padding-top: 0;
}

body.sd-legacy-page.container {
  width: 100%;
  padding-left: clamp(1rem, 3vw, 1.5rem);
  padding-right: clamp(1rem, 3vw, 1.5rem);
}

.sd-page-content > .container,
.sd-page-content.container {
  max-width: 100%;
  padding-top: 0;
}

.sd-page-content h1:first-child,
.sd-page-content > h1:first-of-type {
  margin-top: 0;
  padding-top: 0.5rem;
}

body.sd-has-shell::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(ellipse 80% 50% at 20% -10%, rgba(0, 229, 192, 0.12), transparent),
    radial-gradient(ellipse 60% 40% at 90% 10%, rgba(124, 77, 255, 0.1), transparent),
    var(--sd-bg);
  pointer-events: none;
}

.sd-site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10000;
  height: var(--sd-header-h);
  display: flex;
  align-items: center;
  padding: 0 clamp(0.75rem, 3vw, 1.5rem);
  background: var(--sd-surface);
  border-bottom: 1px solid var(--sd-border);
  backdrop-filter: blur(16px) saturate(1.4);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
  transition: box-shadow 0.35s var(--sd-ease), background 0.35s var(--sd-ease);
}

.sd-site-header.is-scrolled {
  box-shadow: var(--sd-shadow);
  background: var(--sd-header-scrolled-bg);
}

.sd-header-inner {
  width: min(1280px, 100%);
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.sd-logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: var(--sd-text);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
  flex-shrink: 0;
}

.sd-logo img {
  width: 2rem;
  height: 2rem;
  border-radius: 0.45rem;
}

.sd-logo span {
  background: var(--sd-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.sd-nav-toggle {
  display: none;
  margin-left: auto;
  width: 2.75rem;
  height: 2.75rem;
  border: 1px solid var(--sd-border);
  border-radius: 0.65rem;
  background: transparent;
  cursor: pointer;
  position: relative;
}

.sd-nav-toggle span,
.sd-nav-toggle::before,
.sd-nav-toggle::after {
  content: "";
  position: absolute;
  left: 50%;
  width: 1.25rem;
  height: 2px;
  background: var(--sd-text);
  border-radius: 1px;
  transition: transform 0.35s var(--sd-ease), opacity 0.25s;
}

.sd-nav-toggle::before { transform: translate(-50%, -6px); }
.sd-nav-toggle span { transform: translate(-50%, 0); }
.sd-nav-toggle::after { transform: translate(-50%, 6px); }

.sd-nav-toggle[aria-expanded="true"]::before { transform: translate(-50%, 0) rotate(45deg); }
.sd-nav-toggle[aria-expanded="true"] span { opacity: 0; }
.sd-nav-toggle[aria-expanded="true"]::after { transform: translate(-50%, 0) rotate(-45deg); }

.sd-nav {
  margin-left: auto;
}

.sd-nav-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.15rem 0.35rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.sd-nav-list a {
  display: block;
  padding: 0.45rem 0.7rem;
  border-radius: 0.5rem;
  color: var(--sd-text-muted);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: color 0.25s, background 0.25s;
  white-space: nowrap;
}

.sd-nav-list a:hover,
.sd-nav-list a:focus-visible {
  color: var(--sd-text);
  background: var(--sd-nav-hover-bg);
}

.sd-nav-list a[aria-current="page"] {
  color: var(--sd-text);
  background: var(--sd-nav-hover-bg);
  box-shadow: inset 0 -2px 0 var(--sd-accent);
}

.sd-nav-list a:active {
  color: var(--sd-accent);
}

@media (max-width: 960px) {
  .sd-nav-toggle { display: block; }
  .sd-nav {
    position: fixed;
    top: var(--sd-header-h);
    left: 0;
    right: 0;
    max-height: 0;
    overflow: hidden;
    background: var(--sd-mobile-nav-bg);
    border-bottom: 1px solid transparent;
    transition: max-height 0.45s var(--sd-ease), border-color 0.3s;
  }
  .sd-nav.is-open {
    max-height: calc(100vh - var(--sd-header-h));
    overflow-y: auto;
    border-bottom-color: var(--sd-border);
  }
  .sd-nav-list {
    flex-direction: column;
    align-items: stretch;
    padding: 0.75rem;
  }
  .sd-nav-list a { padding: 0.75rem 1rem; font-size: 1rem; }
}

.sd-main {
  width: min(1280px, 100%);
  margin: 0 auto;
  padding: clamp(1.25rem, 4vw, 2.5rem) clamp(1rem, 3vw, 1.5rem) 3rem;
}

.sd-hero {
  text-align: center;
  padding: clamp(2rem, 6vw, 4rem) 0 clamp(1.5rem, 4vw, 2.5rem);
  animation: sd-fade-up 0.8s var(--sd-ease) both;
}

.sd-hero h1 {
  font-size: clamp(1.75rem, 5vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin: 0 0 1rem;
}

.sd-hero p {
  font-size: clamp(1rem, 2.5vw, 1.2rem);
  color: var(--sd-text-muted);
  max-width: 42rem;
  margin: 0 auto;
}

.sd-hero-cta-inline {
  margin-top: 1.25rem !important;
}

.sd-hero-glow {
  display: inline-block;
  background: var(--sd-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.sd-hero--left {
  text-align: left;
}

.sd-hero--left .sd-lead {
  margin-left: 0;
}

.sd-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 17rem), 1fr));
  gap: 1rem;
}

.sd-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1.25rem;
  border-radius: var(--sd-radius);
  background: var(--sd-bg-elevated);
  border: 1px solid var(--sd-border);
  text-decoration: none;
  color: inherit;
  overflow: hidden;
  transition: transform 0.35s var(--sd-ease), border-color 0.35s, box-shadow 0.35s;
  animation: sd-fade-up 0.7s var(--sd-ease) both;
  animation-timeline: view();
  animation-range: entry 0% cover 30%;
}

@supports not (animation-timeline: view()) {
  .sd-card { animation: sd-fade-up 0.7s var(--sd-ease) both; }
}

.sd-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--sd-gradient);
  opacity: 0;
  transition: opacity 0.35s;
}

.sd-card:hover {
  transform: translateY(-4px);
  border-color: rgba(0, 229, 192, 0.35);
  box-shadow: 0 16px 48px rgba(0, 229, 192, 0.08);
}

.sd-card:hover::before { opacity: 0.06; }

.sd-card > * { position: relative; z-index: 1; }

.sd-card h2, .sd-card h3 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
}

.sd-card p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--sd-text-muted);
  flex: 1;
}

.sd-card-tag {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--sd-accent);
}

.sd-section {
  margin-top: 2.5rem;
}

.sd-section h2 {
  font-size: 1.35rem;
  margin: 0 0 1rem;
  font-weight: 700;
}

.sd-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  list-style: none;
  margin: 0 0 1.25rem;
  padding: 0;
  font-size: 0.85rem;
  color: var(--sd-text-muted);
}

.sd-breadcrumb a {
  color: var(--sd-accent);
  text-decoration: none;
}

.sd-breadcrumb a:hover { text-decoration: underline; }

.sd-breadcrumb li:not(:last-child)::after {
  content: "›";
  margin-left: 0.35rem;
  color: var(--sd-text-muted);
}

.sd-dl {
  margin: 1.5rem 0;
  padding: 1.25rem;
  border-radius: var(--sd-radius);
  background: var(--sd-bg-elevated);
  border: 1px solid var(--sd-border);
}

.sd-dl dt {
  font-weight: 700;
  color: var(--sd-accent);
  margin-top: 0.75rem;
}

.sd-dl dt:first-child { margin-top: 0; }

.sd-dl dd {
  margin: 0.25rem 0 0;
  color: var(--sd-text-muted);
}

.sd-table-wrap {
  overflow-x: auto;
  margin: 1rem 0;
  border-radius: var(--sd-radius);
  border: 1px solid var(--sd-border);
}

.sd-table-wrap table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.sd-table-wrap caption {
  caption-side: top;
  text-align: left;
  padding: 0.75rem 1rem;
  font-weight: 600;
  background: var(--sd-bg-elevated);
}

.sd-table-wrap th,
.sd-table-wrap td {
  padding: 0.65rem 1rem;
  border-bottom: 1px solid var(--sd-border);
  text-align: left;
}

.sd-table-wrap th {
  background: var(--sd-nav-hover-bg);
  font-weight: 600;
}

.sd-table-wrap tr:last-child td { border-bottom: none; }

.sd-site-footer {
  margin-top: auto;
  padding: 2rem clamp(1rem, 3vw, 1.5rem);
  border-top: 1px solid var(--sd-border);
  background: var(--sd-bg-elevated);
}

.sd-footer-inner {
  width: min(1280px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
  gap: 1.5rem;
}

.sd-footer-inner h3 {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--sd-text-muted);
  margin: 0 0 0.75rem;
}

.sd-footer-inner ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.sd-footer-inner a {
  color: var(--sd-text-muted);
  text-decoration: none;
  font-size: 0.875rem;
  line-height: 1.8;
  transition: color 0.2s;
}

.sd-footer-inner a:hover { color: var(--sd-accent); }

.sd-footer-copy {
  grid-column: 1 / -1;
  padding-top: 1rem;
  border-top: 1px solid var(--sd-border);
  font-size: 0.8rem;
  color: var(--sd-text-muted);
  text-align: center;
}

.sd-link-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.5rem;
}

.sd-link-list a {
  display: block;
  padding: 0.75rem 1rem;
  border-radius: 0.65rem;
  background: var(--sd-bg-elevated);
  border: 1px solid var(--sd-border);
  color: var(--sd-text);
  text-decoration: none;
  transition: border-color 0.25s, transform 0.25s;
}

.sd-link-list a:hover {
  border-color: rgba(0, 229, 192, 0.4);
  transform: translateX(4px);
}

.sd-content-legacy {
  padding: 1rem;
}

abbr[title] {
  text-decoration: underline dotted;
  cursor: help;
}

@keyframes sd-fade-up {
  from {
    opacity: 0;
    transform: translateY(1.25rem);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: 0.35s;
}

/* --- Кастомный курсор: точка + плавный хвост --- */
.sd-cursor {
  position: fixed;
  inset: 0;
  z-index: 2147483647;
  pointer-events: none;
  overflow: visible;
}

.sd-cursor__tip,
.sd-cursor__trail-i {
  position: fixed;
  top: 0;
  left: 0;
  display: block;
  pointer-events: none;
  border-radius: 50%;
  will-change: transform, opacity;
  -webkit-transform: translate3d(-100px, -100px, 0);
  transform: translate3d(-100px, -100px, 0);
}

.sd-cursor__tip {
  width: 8px;
  height: 8px;
  margin: -4px 0 0 -4px;
  background: #00e5c0;
  border: none;
  box-shadow: 0 0 12px rgba(0, 229, 192, 0.75);
  opacity: 0;
  z-index: 2;
  transition: background 0.15s ease, box-shadow 0.15s ease;
}

.sd-cursor.is-ready .sd-cursor__tip {
  opacity: 1;
}

.sd-cursor__trail-i {
  width: 4px;
  height: 4px;
  margin: -2px 0 0 -2px;
  background: rgba(0, 229, 192, 0.45);
  box-shadow: 0 0 8px rgba(0, 229, 192, 0.3);
}

.sd-cursor.is-hover .sd-cursor__tip {
  width: 16px;
  height: 16px;
  margin: -8px 0 0 -8px;
  background: #7c4dff;
  border: none;
  box-shadow: 0 0 20px rgba(124, 77, 255, 0.65), 0 0 32px rgba(0, 229, 192, 0.35);
  animation: sd-cursor-hover-pulse 0.9s ease-in-out infinite;
}

@keyframes sd-cursor-hover-pulse {
  0%, 100% {
    box-shadow: 0 0 16px rgba(124, 77, 255, 0.55), 0 0 24px rgba(0, 229, 192, 0.25);
    filter: brightness(1);
  }
  50% {
    box-shadow: 0 0 28px rgba(124, 77, 255, 0.85), 0 0 44px rgba(0, 229, 192, 0.45);
    filter: brightness(1.2);
  }
}

.sd-cursor.is-press .sd-cursor__tip {
  width: 6px;
  height: 6px;
  margin: -3px 0 0 -3px;
  animation: none;
}

body.sd-cursor-hide-system,
body.sd-cursor-hide-system a,
body.sd-cursor-hide-system button,
body.sd-cursor-hide-system input,
body.sd-cursor-hide-system select,
body.sd-cursor-hide-system textarea,
body.sd-cursor-hide-system label,
body.sd-cursor-hide-system [role="button"],
body.sd-cursor-hide-system .sd-btn,
body.sd-cursor-hide-system .sd-card,
body.sd-cursor-hide-system .sd-theme-toggle,
body.sd-cursor-hide-system .sd-nav-toggle,
body.sd-cursor-hide-system .btn,
body.sd-cursor-hide-system abbr[title] {
  cursor: none !important;
}

@media (hover: none), (pointer: coarse) {
  .sd-cursor { display: none !important; }
  body.sd-custom-cursor { cursor: auto !important; }
}
