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

:root {
  --color-primary: #4338ca;
  --color-secondary: #312e81;
  --color-accent: #c7d2fe;
  --color-bg: #ffffff;
  --color-surface: #f5f3ff;
  --color-text: #1e1b4b;
  --color-text-muted: #6366a0;
  --color-border: #d4d0e8;
  --font-main: 'Courier New', 'Lucida Console', Monaco, monospace;
  --max-width: 1100px;
  --radius: 16px;
  --shadow-sm: 0 2px 8px rgba(67, 56, 202, 0.08);
  --shadow-md: 0 4px 16px rgba(67, 56, 202, 0.12);
  --shadow-lg: 0 8px 24px rgba(67, 56, 202, 0.16);
}

body {
  font-family: var(--font-main);
  font-size: 16px;
  line-height: 1.7;
  color: var(--color-text);
  background-color: var(--color-bg);
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
  font-weight: bold;
  line-height: 1.3;
  margin-bottom: 1rem;
  color: var(--color-secondary);
}

h1 {
  font-size: 2.5rem;
  margin-bottom: 1.5rem;
  position: relative;
  padding-left: 1rem;
}

h1::before {
  content: '';
  position: absolute;
  left: -8px;
  top: 8px;
  width: 6px;
  height: 100%;
  background: var(--color-primary);
  border-radius: 3px;
}

h2 {
  font-size: 2rem;
  margin-top: 2.5rem;
  transform: translateX(-12px);
}

h3 {
  font-size: 1.5rem;
  margin-top: 2rem;
  color: var(--color-primary);
}

h4 {
  font-size: 1.25rem;
  margin-top: 1.5rem;
}

h5 {
  font-size: 1.125rem;
  margin-top: 1.25rem;
}

h6 {
  font-size: 1rem;
  margin-top: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

p {
  margin-bottom: 1.25rem;
}

a {
  color: var(--color-primary);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
  transition: color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}

a:hover {
  color: var(--color-secondary);
  text-decoration-thickness: 3px;
}

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

strong {
  font-weight: bold;
  color: var(--color-secondary);
}

em {
  font-style: italic;
  color: var(--color-text-muted);
}

blockquote {
  margin: 2rem 0 2rem 1.5rem;
  padding: 1.5rem 1.5rem 1.5rem 2rem;
  background: var(--color-surface);
  border-left: 6px solid var(--color-primary);
  border-radius: 0 var(--radius) var(--radius) 0;
  box-shadow: var(--shadow-sm);
  font-style: italic;
  color: var(--color-text-muted);
  position: relative;
  transform: translateX(8px);
}

blockquote::before {
  content: '"';
  position: absolute;
  top: -10px;
  left: 10px;
  font-size: 4rem;
  color: var(--color-accent);
  line-height: 1;
  font-style: normal;
}

::selection {
  background: var(--color-accent);
  color: var(--color-secondary);
}

.site-header {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
  color: var(--color-bg);
  padding: 2rem 1.5rem;
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
}

.site-header::after {
  content: '';
  position: absolute;
  top: -50px;
  right: -50px;
  width: 200px;
  height: 200px;
  background: rgba(199, 210, 254, 0.1);
  border-radius: 50%;
}

.site-header .container {
  position: relative;
  z-index: 1;
}

.site-header h1 {
  color: var(--color-bg);
  font-size: 2.25rem;
  margin-bottom: 0.5rem;
  padding-left: 0;
}

.site-header h1::before {
  display: none;
}

.site-header p {
  color: var(--color-accent);
  margin-bottom: 0;
  font-size: 0.95rem;
}

.site-nav {
  background: var(--color-surface);
  padding: 0;
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 2px solid var(--color-border);
}

.site-nav ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  padding: 0;
  margin: 0;
}

.site-nav li {
  flex: 1 1 auto;
}

.site-nav a {
  display: block;
  padding: 1rem 1.5rem;
  text-decoration: none;
  color: var(--color-text);
  font-weight: bold;
  transition: background-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
  position: relative;
  text-align: center;
}

.site-nav a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 3px;
  background: var(--color-primary);
  transition: width 0.2s ease, left 0.2s ease;
}

.site-nav a:hover {
  background: var(--color-accent);
  color: var(--color-secondary);
}

.site-nav a:hover::after {
  width: 100%;
  left: 0;
}

.site-nav a:focus-visible {
  outline: 3px solid var(--color-primary);
  outline-offset: -3px;
}

.site-main {
  min-height: 60vh;
  padding: 3rem 1.5rem;
}

.site-footer {
  background: var(--color-secondary);
  color: var(--color-accent);
  padding: 2.5rem 1.5rem 2rem;
  margin-top: 4rem;
  border-top: 4px solid var(--color-primary);
  position: relative;
}

.site-footer::before {
  content: '';
  position: absolute;
  top: -20px;
  left: 5%;
  width: 90%;
  height: 20px;
  background: var(--color-surface);
  border-radius: var(--radius) var(--radius) 0 0;
  box-shadow: var(--shadow-md);
}

.site-footer a {
  color: var(--color-accent);
  text-decoration-color: var(--color-accent);
}

.site-footer a:hover {
  color: var(--color-bg);
}

.site-footer p {
  margin-bottom: 0.75rem;
  text-align: center;
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  list-style: none;
  padding: 1rem 0 1.5rem;
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.breadcrumbs li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.breadcrumbs li:not(:last-child)::after {
  content: '›';
  color: var(--color-text-muted);
  font-weight: bold;
}

.breadcrumbs a {
  color: var(--color-text-muted);
  text-decoration: none;
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.breadcrumbs a:hover {
  background: var(--color-surface);
  color: var(--color-primary);
}

.breadcrumbs li:last-child {
  color: var(--color-text);
  font-weight: bold;
}

.card {
  background: var(--color-surface);
  border: 2px solid var(--color-border);
  border-radius: var(--radius);
  padding: 2rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow-md);
  transition: box-shadow 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
  position: relative;
}

.card::before {
  content: '';
  position: absolute;
  top: -8px;
  right: -8px;
  width: 100%;
  height: 100%;
  background: var(--color-accent);
  border-radius: var(--radius);
  z-index: -1;
  opacity: 0.4;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.card:hover {
  box-shadow: var(--shadow-lg);
  border-color: var(--color-primary);
  transform: translateY(-4px);
}

.card:hover::before {
  opacity: 0.7;
  transform: translate(4px, 4px);
}

.card h2, .card h3 {
  margin-top: 0;
  transform: none;
}

.card h2::before, .card h3::before {
  display: none;
}

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

table thead {
  background: var(--color-primary);
  color: var(--color-bg);
}

table th {
  padding: 1rem;
  text-align: left;
  font-weight: bold;
  border-bottom: 2px solid var(--color-secondary);
}

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

table tbody tr {
  transition: background-color 0.2s ease;
}

table tbody tr:nth-child(even) {
  background: var(--color-surface);
}

table tbody tr:hover {
  background: var(--color-accent);
}

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

details {
  margin: 1.5rem 0;
  border: 2px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--color-bg);
  box-shadow: var(--shadow-sm);
  position: relative;
  left: -4px;
}

summary {
  padding: 1.25rem 1.5rem;
  background: var(--color-surface);
  cursor: pointer;
  font-weight: bold;
  color: var(--color-primary);
  list-style: none;
  transition: background-color 0.2s ease, color 0.2s ease;
  user-select: none;
  position: relative;
}

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

summary::before {
  content: '▸';
  display: inline-block;
  margin-right: 0.75rem;
  transition: transform 0.2s ease;
  font-size: 1.2rem;
}

details[open] summary::before {
  transform: rotate(90deg);
}

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

summary:focus-visible {
  outline: 3px solid var(--color-primary);
  outline-offset: -3px;
}

details[open] summary {
  border-bottom: 2px solid var(--color-border);
  background: var(--color-primary);
  color: var(--color-bg);
}

details div {
  padding: 1.5rem;
  animation: slideDown 0.2s ease;
}

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

@media (min-width: 768px) {
  h1 {
    font-size: 3rem;
  }

  h2 {
    font-size: 2.25rem;
  }

  .site-header {
    padding: 3rem 2rem;
  }

  .site-header h1 {
    font-size: 2.75rem;
  }

  .site-nav ul {
    justify-content: center;
  }

  .site-nav li {
    flex: 0 1 auto;
  }

  .site-nav a {
    padding: 1.25rem 2rem;
  }

  .site-main {
    padding: 4rem 2rem;
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .container {
    padding: 0 2rem;
  }

  .card {
    padding: 2.5rem;
  }

  blockquote {
    margin-left: 3rem;
  }

  table th, table td {
    padding: 1.25rem;
  }
}

@media (min-width: 1024px) {
  body {
    font-size: 17px;
  }

  h1 {
    font-size: 3.5rem;
  }

  h2 {
    font-size: 2.5rem;
    transform: translateX(-20px);
  }

  .site-header {
    padding: 4rem 2rem;
  }

  .site-header::after {
    width: 300px;
    height: 300px;
    top: -80px;
    right: -80px;
  }

  .site-main {
    padding: 5rem 2rem;
  }

  .card {
    padding: 3rem;
  }

  .card::before {
    top: -12px;
    right: -12px;
  }

  blockquote {
    margin-left: 4rem;
    padding-left: 3rem;
    transform: translateX(16px);
  }
}

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

  details div {
    animation: none;
  }
}

@media print {
  .site-nav,
  .breadcrumbs {
    display: none;
  }

  .site-header {
    background: none;
    color: var(--color-text);
    box-shadow: none;
    padding: 1rem 0;
  }

  .site-header h1 {
    color: var(--color-text);
  }

  .site-header::after {
    display: none;
  }

  .site-main {
    padding: 1rem 0;
  }

  .site-footer {
    margin-top: 2rem;
    padding: 1rem 0;
    background: none;
    color: var(--color-text);
    border-top: 1px solid var(--color-border);
  }

  .site-footer::before {
    display: none;
  }

  .container {
    max-width: 100%;
    padding: 0;
  }

  .card {
    box-shadow: none;
    border: 1px solid var(--color-border);
    page-break-inside: avoid;
  }

  .card::before {
    display: none;
  }

  a {
    color: var(--color-text);
    text-decoration: underline;
  }

  details[open] summary {
    background: none;
    color: var(--color-text);
    border-bottom: 1px solid var(--color-border);
  }

  table {
    box-shadow: none;
  }
}