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

:root {
  --color-primary: #57713b;
  --color-secondary: #3a4d25;
  --color-accent: #c8daa8;
  --color-bg: #fcfdf8;
  --color-surface: #f4f7ee;
  --color-text: #252e18;
  --color-text-muted: #6e7d5a;
  --color-border: #d0d8c2;
  --font-main: 'Courier New', 'Lucida Console', Monaco, monospace;
  --max-width: 1100px;
  --radius: 16px;
  --shadow-sm: 0 2px 8px rgba(87, 113, 59, 0.08);
  --shadow-md: 0 4px 16px rgba(87, 113, 59, 0.12);
  --shadow-lg: 0 8px 24px rgba(87, 113, 59, 0.16);
}

body {
  font-family: var(--font-main);
  font-size: 16px;
  line-height: 1.7;
  color: var(--color-text);
  background-color: var(--color-bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

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

h1 {
  font-size: 2.5rem;
  letter-spacing: -0.02em;
  position: relative;
  padding-bottom: 0.5rem;
}

h2 {
  font-size: 2rem;
  margin-top: 2rem;
}

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

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

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

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

p {
  margin-bottom: 1.25em;
}

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;
  padding: 1.5rem 1.75rem;
  background-color: var(--color-surface);
  border-left: 6px solid var(--color-primary);
  border-radius: 0 var(--radius) var(--radius) 0;
  box-shadow: var(--shadow-sm);
  position: relative;
  left: -8px;
  font-style: italic;
  color: var(--color-text-muted);
}

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

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

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

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

.site-header h1 {
  font-size: 1.75rem;
  margin: 0;
  padding: 0;
  color: var(--color-primary);
}

.site-header a {
  text-decoration: none;
  color: inherit;
}

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

.site-nav {
  width: 100%;
}

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

.site-nav li {
  position: relative;
}

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

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

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

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

.breadcrumbs {
  margin-bottom: 2rem;
  padding: 0.75rem 1.25rem;
  background-color: var(--color-surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  display: inline-flex;
  gap: 0.5rem;
  align-items: center;
  position: relative;
  left: 12px;
  transform: rotate(-0.5deg);
}

.breadcrumbs a {
  color: var(--color-primary);
  text-decoration: none;
  font-weight: bold;
}

.breadcrumbs a:hover {
  text-decoration: underline;
}

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

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

.card:nth-child(odd) {
  transform: rotate(0.5deg);
  margin-left: 8px;
}

.card:nth-child(even) {
  transform: rotate(-0.5deg);
  margin-right: 8px;
}

.card:hover {
  box-shadow: var(--shadow-lg);
  transform: rotate(0deg) translateY(-4px);
}

.card h2 {
  margin-top: 0;
  color: var(--color-primary);
}

.card h3 {
  margin-top: 0;
  color: var(--color-primary);
}

table {
  width: 100%;
  border-collapse: collapse;
  margin: 2rem 0;
  background-color: var(--color-surface);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  position: relative;
  left: -4px;
}

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

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

table td {
  padding: 0.875rem 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: rgba(200, 218, 168, 0.15);
}

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

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

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

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

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

summary {
  padding: 1.25rem 1.5rem;
  cursor: pointer;
  font-weight: bold;
  color: var(--color-primary);
  background-color: var(--color-bg);
  transition: background-color 0.2s ease, color 0.2s ease;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

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

summary::after {
  content: '+';
  font-size: 1.5rem;
  font-weight: bold;
  transition: transform 0.2s ease;
}

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

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

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

details div {
  padding: 1.5rem;
  border-top: 2px solid var(--color-border);
}

.site-footer {
  background-color: var(--color-secondary);
  color: var(--color-accent);
  padding: 2.5rem 1rem;
  margin-top: 4rem;
  box-shadow: 0 -4px 16px rgba(87, 113, 59, 0.12);
  position: relative;
}

.site-footer::before {
  content: '';
  position: absolute;
  top: -20px;
  left: 0;
  right: 0;
  height: 20px;
  background: linear-gradient(to bottom, transparent, var(--color-secondary));
}

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

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

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

@media (min-width: 768px) {
  body {
    font-size: 18px;
  }

  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: 2.25rem;
  }

  .site-nav {
    width: auto;
  }

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

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

  .container {
    padding: 0 2rem;
  }

  .card {
    padding: 2.5rem;
  }

  .card:nth-child(odd) {
    margin-left: 24px;
  }

  .card:nth-child(even) {
    margin-right: 24px;
  }

  blockquote {
    margin: 2.5rem 0;
    padding: 2rem 2.5rem;
    left: -16px;
  }

  table {
    left: -8px;
  }

  details {
    right: -12px;
  }
}

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

  h2 {
    font-size: 2.5rem;
  }

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

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

  .card {
    padding: 3rem;
  }

  .card:nth-child(3n+1) {
    transform: rotate(0.75deg);
    margin-left: 32px;
  }

  .card:nth-child(3n+2) {
    transform: rotate(-0.75deg);
    margin-right: 32px;
  }

  .card:nth-child(3n+3) {
    transform: rotate(0.25deg);
    margin-left: 16px;
  }

  blockquote {
    padding: 2.25rem 3rem;
    left: -24px;
  }

  table th {
    padding: 1.25rem;
  }

  table td {
    padding: 1rem 1.25rem;
  }

  details div {
    padding: 2rem;
  }

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

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

  .card:nth-child(odd),
  .card:nth-child(even),
  .card:nth-child(3n+1),
  .card:nth-child(3n+2),
  .card:nth-child(3n+3) {
    transform: none;
  }

  .card:hover {
    transform: none;
  }

  .breadcrumbs {
    transform: none;
  }

  summary::after {
    transition: none;
  }

  details[open] summary::after {
    transform: none;
  }
}

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

  .site-nav {
    display: none;
  }

  .site-footer {
    box-shadow: none;
    border-top: 2px solid var(--color-text);
  }

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

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

  .card {
    page-break-inside: avoid;
    box-shadow: none;
    transform: none !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }

  table {
    page-break-inside: avoid;
    box-shadow: none;
    transform: none;
    left: 0;
  }

  details {
    page-break-inside: avoid;
    box-shadow: none;
    transform: none;
    right: 0;
  }

  details summary::after {
    display: none;
  }

  blockquote {
    page-break-inside: avoid;
    box-shadow: none;
    left: 0;
  }

  a {
    text-decoration: underline;
  }

  a[href^="http"]::after {
    content: " (" attr(href) ")";
    font-size: 0.875em;
    color: var(--color-text-muted);
  }
}