:root {
  --color-primary: #7C3AED;
  --color-secondary: #06B6D4;
  --color-accent: #F97316;
  --color-background: #070A12;
  --color-surface: #0E1426;
  --color-text: #E7E9F2;
  --color-text-muted: #A7AEC6;
  --color-border: #26304A;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  --max-width: 1120px;
  --transition-speed: 0.25s;
}

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

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.6;
  color: var(--color-text);
  background-color: var(--color-background);
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  grid-template-columns: 100%;
}

img, picture, video, canvas, svg {
  display: block;
  max-width: 100%;
  height: auto;
}

input, button, textarea, select {
  font: inherit;
}

p, h1, h2, h3, h4, h5, h6 {
  overflow-wrap: break-word;
}

a {
  color: var(--color-secondary);
  text-decoration: none;
  transition: color var(--transition-speed) ease, border-color var(--transition-speed) ease;
  border-bottom: 1px solid transparent;
}

a:hover {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
}

a:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
  border-radius: 2px;
}

header {
  background: linear-gradient(135deg, var(--color-surface) 0%, rgba(14, 20, 38, 0.95) 100%);
  border-bottom: 1px solid var(--color-border);
  padding: 1.5rem 1rem;
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 100;
}

header .header-container {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: center;
}

header .site-name {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-text);
  letter-spacing: 0.5px;
  background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

header .site-name a {
  border: none;
  background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

header .site-name a:hover {
  opacity: 0.85;
}

nav ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  justify-content: center;
  align-items: center;
}

nav a {
  color: var(--color-text-muted);
  font-weight: 500;
  padding: 0.5rem 0;
  border-bottom: 2px solid transparent;
  transition: color var(--transition-speed) ease, border-color var(--transition-speed) ease;
}

nav a:hover {
  color: var(--color-text);
  border-bottom-color: var(--color-accent);
}

nav a:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 4px;
}

main {
  max-width: var(--max-width);
  width: 100%;
  margin: 0 auto;
  padding: 2rem 1rem;
  display: grid;
  grid-template-columns: 1fr;
  gap: 3rem;
}

h1 {
  font-size: 1.875rem;
  line-height: 1.2;
  margin-bottom: 1.5rem;
  color: var(--color-text);
  font-weight: 700;
  letter-spacing: -0.5px;
}

h2 {
  font-size: 1.5rem;
  line-height: 1.3;
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  color: var(--color-text);
  font-weight: 700;
  position: relative;
  padding-bottom: 0.5rem;
}

h2::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 60px;
  height: 3px;
  background: linear-gradient(90deg, var(--color-primary), var(--color-secondary));
  border-radius: 2px;
}

h3 {
  font-size: 1.25rem;
  line-height: 1.4;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
  color: var(--color-text);
  font-weight: 600;
}

p {
  margin-bottom: 1rem;
  color: var(--color-text);
}

section, article, aside {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: var(--shadow);
  position: relative;
  background-image: linear-gradient(135deg, rgba(124, 58, 237, 0.03) 0%, rgba(6, 182, 212, 0.03) 100%);
}

section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--color-primary), var(--color-secondary), transparent);
  opacity: 0.3;
}

.breadcrumbs {
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0 0 1rem 0;
  margin-bottom: 1rem;
  font-size: 0.875rem;
}

.breadcrumbs::before {
  display: none;
}

.breadcrumbs a {
  color: var(--color-text-muted);
}

.breadcrumbs a:hover {
  color: var(--color-secondary);
}

.breadcrumbs span {
  color: var(--color-text-muted);
  margin: 0 0.5rem;
}

blockquote {
  background: var(--color-surface);
  border-left: 4px solid var(--color-accent);
  padding: 1.5rem;
  margin: 2rem 0;
  border-radius: 0 var(--radius) var(--radius) 0;
  font-style: italic;
  color: var(--color-text);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  position: relative;
}

blockquote::before {
  content: '"';
  font-size: 3rem;
  color: var(--color-accent);
  opacity: 0.3;
  position: absolute;
  top: 0.5rem;
  left: 0.5rem;
  line-height: 1;
}

blockquote p:last-child {
  margin-bottom: 0;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin: 2rem 0;
  background: var(--color-surface);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid var(--color-border);
}

table caption {
  caption-side: top;
  padding: 1rem;
  font-weight: 700;
  font-size: 1.125rem;
  color: var(--color-text);
  text-align: left;
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.1), rgba(6, 182, 212, 0.1));
  border-bottom: 2px solid var(--color-border);
}

thead {
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.15), rgba(6, 182, 212, 0.15));
  border-bottom: 2px solid var(--color-border);
}

th {
  padding: 1rem;
  text-align: left;
  font-weight: 600;
  color: var(--color-text);
  font-size: 0.9375rem;
  letter-spacing: 0.3px;
}

td {
  padding: 1rem;
  border-bottom: 1px solid var(--color-border);
  color: var(--color-text);
}

tbody tr {
  transition: background-color var(--transition-speed) ease;
}

tbody tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.02);
}

tbody tr:hover {
  background: rgba(124, 58, 237, 0.08);
}

tbody tr:last-child td {
  border-bottom: none;
}

.table-wrapper {
  overflow-x: auto;
  margin: 2rem 0;
  border-radius: var(--radius);
  border: 1px solid var(--color-border);
}

.table-wrapper table {
  margin: 0;
  border: none;
}

details {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 0;
  margin-bottom: 1rem;
  transition: background-color var(--transition-speed) ease, border-color var(--transition-speed) ease;
}

details:hover {
  border-color: var(--color-primary);
  background: rgba(124, 58, 237, 0.05);
}

details[open] {
  border-color: var(--color-secondary);
  background: rgba(6, 182, 212, 0.05);
}

summary {
  padding: 1.25rem;
  cursor: pointer;
  font-weight: 600;
  color: var(--color-text);
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: color var(--transition-speed) ease;
  user-select: none;
}

summary::-webkit-details-marker {
  display: none;
}

summary::after {
  content: '+';
  font-size: 1.5rem;
  color: var(--color-accent);
  transition: transform var(--transition-speed) ease;
  flex-shrink: 0;
  margin-left: 1rem;
}

details[open] summary::after {
  content: '−';
  transform: rotate(180deg);
}

summary:hover {
  color: var(--color-secondary);
}

summary:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
  border-radius: var(--radius);
}

details .details-content {
  padding: 0 1.25rem 1.25rem 1.25rem;
  color: var(--color-text);
  border-top: 1px solid var(--color-border);
}

details[open] .details-content {
  animation: slideDown var(--transition-speed) ease;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

footer {
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  padding: 2rem 1rem;
  text-align: center;
  color: var(--color-text-muted);
  font-size: 0.875rem;
  margin-top: 4rem;
}

footer .footer-container {
  max-width: var(--max-width);
  margin: 0 auto;
}

footer a {
  color: var(--color-secondary);
}

footer a:hover {
  color: var(--color-primary);
}

ul:not(nav ul) {
  list-style-position: inside;
  margin-bottom: 1rem;
  padding-left: 1rem;
}

ol {
  list-style-position: inside;
  margin-bottom: 1rem;
  padding-left: 1rem;
}

li {
  margin-bottom: 0.5rem;
  color: var(--color-text);
}

strong {
  font-weight: 700;
  color: var(--color-text);
}

em {
  font-style: italic;
}

code {
  background: rgba(0, 0, 0, 0.3);
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  font-family: "Courier New", Courier, monospace;
  font-size: 0.9em;
  color: var(--color-secondary);
  border: 1px solid var(--color-border);
}

@media (min-width: 768px) {
  html {
    font-size: 17px;
  }

  header .header-container {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }

  header .site-name {
    font-size: 1.75rem;
  }

  nav ul {
    gap: 2rem;
  }

  main {
    padding: 3rem 2rem;
    gap: 4rem;
  }

  h1 {
    font-size: 2.5rem;
    margin-bottom: 2rem;
  }

  h2 {
    font-size: 1.875rem;
    margin-top: 3rem;
  }

  h3 {
    font-size: 1.5rem;
  }

  section, article, aside {
    padding: 2.5rem;
  }

  table {
    font-size: 0.9375rem;
  }
}

@media (min-width: 1024px) {
  html {
    font-size: 18px;
  }

  main {
    padding: 4rem 2rem;
  }

  h1 {
    font-size: 3rem;
  }

  h2 {
    font-size: 2.25rem;
  }

  h3 {
    font-size: 1.75rem;
  }

  section, article, aside {
    padding: 3rem;
  }

  thead {
    position: sticky;
    top: 0;
    z-index: 10;
  }

  table {
    font-size: 1rem;
  }

  .table-wrapper {
    overflow-x: visible;
  }
}

@media print {
  * {
    background: white !important;
    color: black !important;
    box-shadow: none !important;
    text-shadow: none !important;
  }

  a, a:visited {
    text-decoration: underline;
    color: black !important;
  }

  a[href]::after {
    content: " (" attr(href) ")";
    font-size: 0.8em;
  }

  header, footer, nav {
    display: none;
  }

  main {
    max-width: 100%;
    padding: 0;
  }

  section, article, aside {
    page-break-inside: avoid;
    border: 1px solid #ccc;
    padding: 1rem;
    margin-bottom: 1rem;
  }

  h1, h2, h3 {
    page-break-after: avoid;
  }

  table {
    border-collapse: collapse;
    border: 1px solid black;
  }

  th, td {
    border: 1px solid black;
    padding: 0.5rem;
  }

  details {
    border: 1px solid #ccc;
  }

  summary::after {
    display: none;
  }

  details .details-content {
    display: block !important;
  }
}