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

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

:root {
  --color-primary: #65742e;
  --color-secondary: #3f4a1c;
  --color-accent: #e2e88c;
  --color-bg: #fdfef6;
  --color-surface: #f5f6ea;
  --color-text: #2b3212;
  --color-text-muted: #7a7f5e;
  --color-border: #d4d7be;
  --font-main: 'Courier New', 'Lucida Console', Monaco, monospace;
  --max-width: 1100px;
  --radius: 0px;
  --radius-sm: 2px;
  --radius-md: 4px;
  --radius-lg: 8px;
  --shadow-sm: 2px 2px 0 rgba(43, 50, 18, 0.1);
  --shadow-md: 4px 4px 0 rgba(43, 50, 18, 0.15);
  --shadow-lg: 6px 6px 0 rgba(43, 50, 18, 0.2);
  --shadow-layered: 3px 3px 0 rgba(63, 74, 28, 0.2), 6px 6px 0 rgba(63, 74, 28, 0.1);
}

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

body {
  font-family: var(--font-main);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--color-text);
  background: linear-gradient(135deg, var(--color-bg) 0%, #f9fae8 100%);
  background-attachment: fixed;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

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

h1 {
  font-size: 2.25rem;
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

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

h3 {
  font-size: 1.5rem;
  margin-top: 1.5rem;
  position: relative;
  padding-left: 1rem;
}

h3::before {
  content: '▶';
  position: absolute;
  left: 0;
  color: var(--color-primary);
  font-size: 0.75rem;
}

h4 {
  font-size: 1.25rem;
  margin-top: 1.25rem;
  color: var(--color-primary);
}

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

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

p {
  margin-bottom: 1rem;
}

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);
  background-color: var(--color-accent);
}

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

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

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

blockquote {
  margin: 1.5rem 0;
  padding: 1.25rem 1.5rem;
  background: var(--color-surface);
  border-left: 6px solid var(--color-primary);
  box-shadow: var(--shadow-md);
  position: relative;
}

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

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

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

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

.site-header {
  background: linear-gradient(180deg, var(--color-surface) 0%, var(--color-bg) 100%);
  border-bottom: 4px solid var(--color-primary);
  box-shadow: var(--shadow-layered);
  position: sticky;
  top: 0;
  z-index: 1000;
  padding: 1.5rem 0;
}

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

.site-header h1 {
  margin: 0;
  font-size: 1.75rem;
}

.site-nav {
  width: 100%;
}

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

.site-nav li {
  margin: 0;
}

.site-nav a {
  display: block;
  padding: 0.625rem 1.25rem;
  background: var(--color-primary);
  color: var(--color-bg);
  text-decoration: none;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border: 2px solid var(--color-secondary);
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
}

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

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

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

.site-footer {
  background: linear-gradient(180deg, var(--color-bg) 0%, var(--color-surface) 100%);
  border-top: 4px solid var(--color-primary);
  padding: 2rem 0;
  margin-top: 3rem;
  box-shadow: 0 -6px 0 rgba(43, 50, 18, 0.1);
}

.site-footer .container {
  text-align: center;
  color: var(--color-text-muted);
  font-size: 0.875rem;
}

.site-footer p {
  margin-bottom: 0.5rem;
}

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

.breadcrumbs a {
  text-decoration: none;
  padding: 0.25rem 0.5rem;
}

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

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

.card:hover {
  box-shadow: 4px 4px 0 rgba(63, 74, 28, 0.3), 8px 8px 0 rgba(63, 74, 28, 0.15);
  transform: translate(-2px, -2px);
  border-color: var(--color-primary);
}

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

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

thead {
  background: linear-gradient(180deg, var(--color-primary) 0%, var(--color-secondary) 100%);
  color: var(--color-bg);
}

th {
  padding: 1rem;
  text-align: left;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 3px solid var(--color-secondary);
}

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

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

tbody tr:nth-child(odd) {
  background: var(--color-bg);
}

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

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

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

details {
  margin: 1.5rem 0;
  border: 3px solid var(--color-border);
  background: var(--color-surface);
  box-shadow: var(--shadow-md);
}

summary {
  padding: 1rem 1.25rem;
  cursor: pointer;
  font-weight: 700;
  background: linear-gradient(135deg, var(--color-primary) 0%, #6f7f38 100%);
  color: var(--color-bg);
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background 0.2s ease, box-shadow 0.2s ease;
  user-select: none;
}

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

summary::after {
  content: '▼';
  font-size: 0.75rem;
  transition: transform 0.2s ease;
}

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

summary:hover {
  background: var(--color-secondary);
  box-shadow: inset 0 0 0 2px var(--color-accent);
}

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

details[open] {
  border-color: var(--color-primary);
}

details > *:not(summary) {
  padding: 1.25rem;
  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;
  }

  h3 {
    font-size: 1.75rem;
  }

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

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

  .site-nav {
    width: auto;
  }

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

  .site-nav a {
    padding: 0.75rem 1.5rem;
  }

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

  .card {
    padding: 2rem;
  }

  table {
    font-size: 1rem;
  }

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

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

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

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

  .card {
    padding: 2.5rem;
  }

  .breadcrumbs {
    font-size: 1rem;
    padding: 1rem 1.5rem;
  }

  details > *:not(summary) {
    padding: 1.5rem 2rem;
  }
}

@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;
  }

  html {
    scroll-behavior: auto;
  }

  summary::after {
    transition: none;
  }

  details > *:not(summary) {
    animation: none;
  }
}

@media print {
  body {
    background: white;
    color: black;
  }

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

  .site-main {
    padding: 0;
  }

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

  .card {
    box-shadow: none;
    border: 1px solid black;
    break-inside: avoid;
  }

  a {
    text-decoration: underline;
    color: black;
  }

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

  table {
    box-shadow: none;
    border: 2px solid black;
  }

  thead {
    background: #e0e0e0;
    color: black;
  }

  tbody tr {
    break-inside: avoid;
  }

  blockquote {
    box-shadow: none;
    border-left: 4px solid black;
  }

  details {
    box-shadow: none;
    border: 2px solid black;
  }

  summary {
    background: #e0e0e0;
    color: black;
  }

  details[open] summary::after {
    content: '';
  }
}