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

:root {
  --color-primary: #a8884a;
  --color-secondary: #6e5a2e;
  --color-accent: #f0e0b8;
  --color-bg: #fefdf8;
  --color-surface: #faf6ec;
  --color-text: #3a2f18;
  --color-text-muted: #8a7d62;
  --color-border: #ddd4be;
  --font-main: 'Courier New', 'Lucida Console', Monaco, monospace;
  --max-width: 1100px;
  --radius: 0;
}

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

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

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

h1::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 80px;
  height: 4px;
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
  clip-path: polygon(0 0, 100% 0, 90% 100%, 0% 100%);
}

h2 {
  font-size: 2rem;
  margin-top: 3rem;
  padding-left: 1.5rem;
  border-left: 6px solid var(--color-primary);
  clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%, 0.5rem 50%);
}

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

h3::before {
  content: '';
  position: absolute;
  left: -1.5rem;
  top: 50%;
  transform: translateY(-50%) rotate(45deg);
  width: 10px;
  height: 10px;
  background-color: var(--color-primary);
}

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

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

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

p {
  margin-bottom: 1.5rem;
}

a {
  color: var(--color-primary);
  text-decoration: none;
  position: relative;
  transition: color 0.2s ease, background-color 0.2s ease;
  padding: 0 2px;
}

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

a:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 4px;
}

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

em {
  font-style: italic;
}

blockquote {
  margin: 2.5rem 0;
  padding: 2rem 2rem 2rem 3rem;
  background: linear-gradient(135deg, var(--color-surface) 0%, var(--color-accent) 100%);
  border-left: 8px solid var(--color-primary);
  position: relative;
  clip-path: polygon(0 0, 100% 0, 99% 100%, 0 100%);
}

blockquote::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: repeating-linear-gradient(
    45deg,
    transparent,
    transparent 10px,
    rgba(168, 136, 74, 0.03) 10px,
    rgba(168, 136, 74, 0.03) 20px
  );
  pointer-events: none;
}

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

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

.site-header {
  background: linear-gradient(135deg, var(--color-surface) 0%, var(--color-accent) 100%);
  border-bottom: 3px solid var(--color-border);
  padding: 2rem 0;
  position: relative;
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 20px), 0 100%);
  margin-bottom: 20px;
}

.site-header::after {
  content: '';
  position: absolute;
  bottom: -3px;
  left: 0;
  width: 100%;
  height: 20px;
  background: linear-gradient(to right, var(--color-primary) 0%, var(--color-secondary) 100%);
  clip-path: polygon(0 0, 100% 100%, 100% 100%, 0 100%);
  z-index: -1;
}

.site-nav {
  display: flex;
  gap: 2rem;
  flex-wrap: wrap;
  align-items: center;
}

.site-nav a {
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.5rem 1rem;
  position: relative;
  clip-path: polygon(5% 0, 100% 0, 95% 100%, 0% 100%);
  background-color: transparent;
  transition: background-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.site-nav a:hover {
  background-color: var(--color-primary);
  color: var(--color-bg);
  box-shadow: 4px 4px 0 rgba(58, 47, 24, 0.2);
}

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

.site-footer {
  background-color: var(--color-secondary);
  color: var(--color-accent);
  padding: 3rem 0 2rem;
  margin-top: 5rem;
  position: relative;
}

.site-footer::before {
  content: '';
  position: absolute;
  top: -30px;
  left: 0;
  width: 100%;
  height: 30px;
  background: linear-gradient(135deg, var(--color-bg) 0%, var(--color-surface) 100%);
  clip-path: polygon(0 0, 100% 100%, 100% 100%, 0 100%);
}

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

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

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

.breadcrumbs {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 2rem;
  padding: 1rem;
  background-color: var(--color-surface);
  font-size: 0.9rem;
  clip-path: polygon(0 0, 99% 0, 100% 100%, 0 100%);
}

.breadcrumbs a {
  color: var(--color-text-muted);
  padding: 0;
}

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

.breadcrumbs::before {
  content: '▶';
  color: var(--color-primary);
  font-size: 0.7rem;
  margin-right: 0.5rem;
}

.card {
  background-color: var(--color-surface);
  border: 2px solid var(--color-border);
  padding: 2rem;
  margin-bottom: 2rem;
  position: relative;
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 15px), calc(100% - 15px) 100%, 0 100%);
}

.card::after {
  content: '';
  position: absolute;
  bottom: 0;
  right: 0;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 0 0 15px 15px;
  border-color: transparent transparent var(--color-border) transparent;
}

.card:hover {
  border-color: var(--color-primary);
  box-shadow: 8px 8px 0 rgba(168, 136, 74, 0.15);
}

.card h2 {
  margin-top: 0;
  border-left: none;
  clip-path: none;
  padding-left: 0;
}

.card h2::after {
  content: '';
  display: block;
  width: 60px;
  height: 3px;
  background-color: var(--color-primary);
  margin-top: 1rem;
  clip-path: polygon(0 0, 100% 0, 90% 100%, 0% 100%);
}

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin: 2rem 0;
  background-color: var(--color-surface);
  border: 2px solid var(--color-border);
}

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

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

table th::after {
  content: '';
  position: absolute;
  bottom: -3px;
  left: 0;
  width: 100%;
  height: 3px;
  background: repeating-linear-gradient(
    45deg,
    var(--color-accent),
    var(--color-accent) 5px,
    transparent 5px,
    transparent 10px
  );
}

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

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

table tbody tr:hover td {
  border-bottom-color: var(--color-secondary);
}

details {
  margin: 2rem 0;
  border: 2px solid var(--color-border);
  background-color: var(--color-surface);
  clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%, 0.3rem 50%);
}

summary {
  padding: 1.5rem;
  cursor: pointer;
  font-weight: bold;
  background-color: var(--color-accent);
  border-bottom: 2px solid var(--color-border);
  position: relative;
  transition: background-color 0.2s ease, color 0.2s ease;
  list-style: none;
}

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

summary::before {
  content: '▶';
  position: absolute;
  left: 1.5rem;
  transition: transform 0.2s ease;
  color: var(--color-primary);
}

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

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

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

details[open] summary {
  border-bottom-color: var(--color-primary);
  padding-left: 3.5rem;
}

details summary {
  padding-left: 3.5rem;
}

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

  h3 {
    font-size: 1.75rem;
  }

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

  .site-nav {
    gap: 3rem;
  }

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

  .container {
    padding: 0 2rem;
  }

  .card {
    padding: 2.5rem;
  }

  blockquote {
    padding: 2.5rem 2.5rem 2.5rem 4rem;
  }
}

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

  h1 {
    font-size: 3.5rem;
  }

  h2 {
    font-size: 2.5rem;
  }

  h3 {
    font-size: 2rem;
  }

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

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

  .card {
    padding: 3rem;
  }

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

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

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

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

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

  .site-header {
    border-bottom: 2px solid var(--color-text);
    clip-path: none;
  }

  .site-footer {
    margin-top: 2rem;
    padding: 1rem 0;
  }

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

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

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

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

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

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