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

* {
  margin: 0;
  padding: 0;
}

:root {
  --color-primary: #525252;
  --color-secondary: #262626;
  --color-accent: #a3e635;
  --color-bg: #fafafa;
  --color-surface: #f5f5f5;
  --color-text: #171717;
  --color-text-muted: #737373;
  --color-border: #d4d4d4;
  --font-main: 'Courier New', 'Lucida Console', Monaco, monospace;
  --max-width: 1100px;
  --radius: 4px;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 20px rgba(0, 0, 0, 0.12);
  --shadow-xl: 0 20px 40px rgba(0, 0, 0, 0.15);
}

body {
  font-family: var(--font-main);
  font-size: 16px;
  line-height: 1.6;
  color: var(--color-text);
  background-color: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
  font-family: Georgia, 'Times New Roman', Times, serif;
  line-height: 1.2;
  margin-bottom: 1rem;
  font-weight: 700;
  color: var(--color-secondary);
  letter-spacing: -0.02em;
}

h1 {
  font-size: 2.5rem;
  margin-bottom: 1.5rem;
  border-bottom: 3px solid var(--color-accent);
  padding-bottom: 0.5rem;
}

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

h3 {
  font-size: 1.5rem;
  margin-top: 1.5rem;
}

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

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

h6 {
  font-size: 1rem;
  margin-top: 1rem;
  color: var(--color-primary);
}

p {
  margin-bottom: 1rem;
}

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

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

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

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

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

blockquote {
  margin: 1.5rem 0;
  padding: 1.25rem 1.5rem;
  background-color: var(--color-surface);
  border-left: 5px solid var(--color-accent);
  font-style: italic;
  color: var(--color-text-muted);
  box-shadow: var(--shadow-sm);
  position: relative;
}

blockquote::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 5px;
  background: linear-gradient(to bottom, var(--color-accent), var(--color-primary));
}

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

.site-header {
  background-color: var(--color-surface);
  border-bottom: 3px solid var(--color-border);
  box-shadow: var(--shadow-md);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.site-header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 1rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.site-nav {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.site-nav a {
  padding: 0.5rem 1rem;
  background-color: var(--color-bg);
  border: 2px solid var(--color-border);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--color-text);
  font-weight: 600;
  transition: background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
  box-shadow: var(--shadow-sm);
}

.site-nav a:hover {
  background-color: var(--color-accent);
  border-color: var(--color-accent);
  color: var(--color-secondary);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

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

.site-main {
  min-height: calc(100vh - 300px);
  padding: 2rem 0;
}

.site-footer {
  background-color: var(--color-secondary);
  color: var(--color-surface);
  padding: 2rem 1rem;
  margin-top: 4rem;
  border-top: 4px solid var(--color-accent);
  box-shadow: 0 -4px 6px rgba(0, 0, 0, 0.1);
}

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

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

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

.breadcrumbs {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  padding: 1rem 0;
  font-size: 0.875rem;
  color: var(--color-text-muted);
  border-bottom: 1px solid var(--color-border);
  margin-bottom: 1.5rem;
}

.breadcrumbs a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color 0.2s ease;
}

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

.breadcrumbs::before {
  content: '→';
  margin-right: 0.25rem;
  color: var(--color-accent);
}

.card {
  background-color: white;
  border: 2px 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, border-color 0.2s ease;
  position: relative;
}

.card::before {
  content: '';
  position: absolute;
  top: 4px;
  left: 4px;
  right: -4px;
  bottom: -4px;
  background-color: var(--color-surface);
  border-radius: var(--radius);
  z-index: -1;
  transition: all 0.2s ease;
}

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

.card:hover::before {
  top: 8px;
  left: 8px;
}

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

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

table thead {
  background-color: var(--color-secondary);
  color: var(--color-surface);
}

table th {
  padding: 0.875rem 1rem;
  text-align: left;
  font-weight: 700;
  border-bottom: 3px solid var(--color-accent);
  font-family: Georgia, 'Times New Roman', Times, serif;
}

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

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

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

table tbody tr:hover {
  background-color: #e8ffa8;
}

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

details {
  margin: 1.5rem 0;
  border: 2px solid var(--color-border);
  border-radius: var(--radius);
  background-color: white;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: box-shadow 0.2s ease;
}

details:hover {
  box-shadow: var(--shadow-md);
}

details[open] {
  border-color: var(--color-accent);
  box-shadow: var(--shadow-lg);
}

summary {
  padding: 1rem 1.25rem;
  cursor: pointer;
  font-weight: 700;
  background-color: var(--color-surface);
  border-bottom: 2px solid transparent;
  transition: background-color 0.2s ease, border-color 0.2s ease;
  font-family: Georgia, 'Times New Roman', Times, serif;
  font-size: 1.125rem;
  user-select: none;
  list-style: none;
}

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

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

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

summary:hover {
  background-color: var(--color-bg);
  border-bottom-color: var(--color-border);
}

details[open] summary {
  border-bottom-color: var(--color-accent);
  background-color: var(--color-accent);
  color: var(--color-secondary);
}

details[open] summary::before {
  color: var(--color-secondary);
}

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

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

.grid-2 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  margin: 1.5rem 0;
}

.grid-3 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  margin: 1.5rem 0;
}

button, .button {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  background-color: var(--color-primary);
  color: white;
  border: 2px solid var(--color-primary);
  border-radius: var(--radius);
  font-family: var(--font-main);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
  box-shadow: var(--shadow-sm);
  position: relative;
}

button::after, .button::after {
  content: '';
  position: absolute;
  top: 4px;
  left: 4px;
  right: -4px;
  bottom: -4px;
  background-color: var(--color-border);
  border-radius: var(--radius);
  z-index: -1;
  transition: all 0.2s ease;
}

button:hover, .button:hover {
  background-color: var(--color-accent);
  border-color: var(--color-accent);
  color: var(--color-secondary);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

button:hover::after, .button:hover::after {
  top: 6px;
  left: 6px;
}

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

button:active, .button:active {
  transform: translateY(0);
}

input, textarea, select {
  width: 100%;
  padding: 0.75rem;
  border: 2px solid var(--color-border);
  border-radius: var(--radius);
  font-family: var(--font-main);
  font-size: 1rem;
  background-color: white;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(163, 230, 53, 0.2);
}

ul, ol {
  margin-left: 1.5rem;
  margin-bottom: 1rem;
}

li {
  margin-bottom: 0.5rem;
}

code {
  background-color: var(--color-surface);
  padding: 0.2rem 0.4rem;
  border-radius: var(--radius);
  font-family: var(--font-main);
  border: 1px solid var(--color-border);
  font-size: 0.9em;
}

pre {
  background-color: var(--color-secondary);
  color: var(--color-surface);
  padding: 1rem;
  border-radius: var(--radius);
  overflow-x: auto;
  margin: 1.5rem 0;
  border: 2px solid var(--color-border);
  box-shadow: var(--shadow-md);
}

pre code {
  background: none;
  border: none;
  padding: 0;
  color: var(--color-accent);
}

hr {
  border: none;
  border-top: 2px solid var(--color-border);
  margin: 2rem 0;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
}

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

  h2 {
    font-size: 2.25rem;
  }

  h3 {
    font-size: 1.75rem;
  }

  .grid-2 {
    grid-template-columns: repeat(2, 1fr);
  }

  .grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }

  .site-header .container {
    flex-wrap: nowrap;
  }

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

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

  h2 {
    font-size: 2.5rem;
  }

  .grid-3 {
    grid-template-columns: repeat(3, 1fr);
  }

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

  .card {
    padding: 2rem;
  }
}

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

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

  .site-main {
    min-height: auto;
    padding: 0;
  }

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

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

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

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

  table {
    page-break-inside: avoid;
  }
}