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

:root {
  --color-primary: #475569;
  --color-secondary: #1e293b;
  --color-accent: #38bdf8;
  --color-bg: #ffffff;
  --color-surface: #f8fafc;
  --color-text: #0f172a;
  --color-text-muted: #64748b;
  --color-border: #e2e8f0;
  --font-main: 'Georgia', 'Times New Roman', 'Palatino', serif;
  --max-width: 1100px;
  --radius: 6px;
  --shadow-sm: inset 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.1);
  --gradient-subtle: linear-gradient(to bottom, #ffffff, #f8fafc);
  --gradient-surface: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-main);
  line-height: 1.7;
  color: var(--color-text);
  background-color: var(--color-bg);
  background-image: var(--gradient-subtle);
  background-attachment: fixed;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-main);
  font-weight: 700;
  line-height: 1.3;
  color: var(--color-secondary);
  margin-bottom: 0.75rem;
  letter-spacing: -0.01em;
}

h1 {
  font-size: 2.25rem;
  margin-bottom: 1rem;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

h2 {
  font-size: 1.875rem;
  margin-top: 2rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--color-border);
}

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

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

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

h6 {
  font-size: 1rem;
  margin-top: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
}

p {
  margin-bottom: 1rem;
  max-width: 70ch;
}

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

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

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

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

em {
  font-style: italic;
}

blockquote {
  margin: 1.5rem 0;
  padding: 1.25rem 1.5rem;
  background: var(--gradient-surface);
  border-left: 4px solid var(--color-accent);
  border-radius: 0 var(--radius) var(--radius) 0;
  box-shadow: var(--shadow-sm);
  font-style: italic;
  color: var(--color-primary);
}

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

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

.site-header {
  background: linear-gradient(135deg, var(--color-secondary) 0%, var(--color-primary) 100%);
  color: var(--color-bg);
  padding: 1.5rem 1rem;
  box-shadow: var(--shadow-md);
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.site-header .container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: center;
}

.site-header h1 {
  color: var(--color-bg);
  margin: 0;
  font-size: 1.75rem;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.site-nav {
  width: 100%;
}

.site-nav ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
}

.site-nav a {
  display: block;
  padding: 0.625rem 1.25rem;
  color: var(--color-bg);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.1);
  transition: background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  font-size: 0.95rem;
}

.site-nav a:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: var(--color-accent);
  box-shadow: inset 0 1px 3px rgba(255, 255, 255, 0.2);
  color: var(--color-bg);
}

.site-main {
  flex: 1;
  padding: 2rem 1rem;
}

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

.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  padding: 0.75rem 1rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  font-size: 0.875rem;
  box-shadow: var(--shadow-sm);
}

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

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

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

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

.breadcrumbs li:last-child {
  color: var(--color-text-muted);
}

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

.card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

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

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

thead {
  background: linear-gradient(to bottom, var(--color-primary), var(--color-secondary));
  color: var(--color-bg);
}

th {
  padding: 1rem;
  text-align: left;
  font-weight: 700;
  border-bottom: 2px solid var(--color-border);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

td {
  padding: 0.875rem 1rem;
  border-bottom: 1px solid var(--color-border);
  transition: background-color 0.2s ease;
}

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

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

tbody tr:hover {
  background: linear-gradient(to right, #f1f5f9, var(--color-surface));
  box-shadow: inset 0 0 0 1px var(--color-accent);
}

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

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

summary {
  padding: 1rem 1.25rem;
  cursor: pointer;
  background: var(--gradient-surface);
  font-weight: 700;
  color: var(--color-secondary);
  list-style: none;
  user-select: none;
  transition: background-color 0.2s ease, color 0.2s ease;
  border-left: 4px solid transparent;
}

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

summary::before {
  content: '▸';
  display: inline-block;
  margin-right: 0.5rem;
  transition: transform 0.2s ease;
  color: var(--color-accent);
}

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

summary:hover {
  background: linear-gradient(to right, var(--color-surface), #f1f5f9);
  border-left-color: var(--color-accent);
}

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

details[open] summary {
  border-bottom: 1px solid var(--color-border);
  margin-bottom: 1rem;
}

details > *:not(summary) {
  padding: 0 1.25rem 1rem;
}

.site-footer {
  background: linear-gradient(to bottom, var(--color-surface), #e2e8f0);
  border-top: 2px solid var(--color-border);
  padding: 2rem 1rem;
  margin-top: 3rem;
  color: var(--color-text-muted);
  box-shadow: inset 0 4px 8px rgba(0, 0, 0, 0.03);
}

.site-footer .container {
  text-align: center;
}

.site-footer p {
  margin: 0.5rem auto;
  font-size: 0.9rem;
}

.site-footer a {
  color: var(--color-primary);
  font-weight: 600;
}

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

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

  h2 {
    font-size: 2.25rem;
  }

  h3 {
    font-size: 1.75rem;
  }

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

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

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

  .site-nav {
    width: auto;
  }

  .site-nav ul {
    gap: 1rem;
  }

  .site-main {
    padding: 3rem 1.5rem;
  }

  .card {
    padding: 2rem;
  }

  table {
    font-size: 1rem;
  }

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

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

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

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

  .card {
    padding: 2.5rem;
  }

  .breadcrumbs {
    font-size: 0.9375rem;
  }
}

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

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

  .site-header {
    position: static;
    box-shadow: none;
    border-bottom: 2px solid var(--color-border);
    background: var(--color-bg);
    color: var(--color-text);
  }

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

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

  .container {
    max-width: 100%;
  }

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

  table {
    break-inside: avoid;
  }

  a {
    color: var(--color-text);
    border-bottom: none;
  }

  a::after {
    content: " (" attr(href) ")";
    font-size: 0.8em;
    color: var(--color-text-muted);
  }

  body {
    background: var(--color-bg);
  }
}