* {
  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;
}

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

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

h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 1.5rem;
  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, 90% 0, 100% 100%, 0% 100%);
}

h2 {
  font-size: 2rem;
  margin-top: 3rem;
  position: relative;
  padding-left: 1.5rem;
}

h2::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.3rem;
  width: 6px;
  height: calc(100% - 0.6rem);
  background-color: var(--color-primary);
  clip-path: polygon(0 0, 100% 15%, 100% 85%, 0 100%);
}

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

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

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

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

p {
  margin-bottom: 1.5rem;
}

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

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

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

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

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

blockquote {
  margin: 2.5rem 0;
  padding: 2rem 2rem 2rem 2.5rem;
  background-color: var(--color-surface);
  border-left: 6px solid var(--color-primary);
  position: relative;
  clip-path: polygon(0 0, 100% 2%, 100% 98%, 0 100%);
}

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

blockquote::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 40px;
  height: 40px;
  background-color: var(--color-accent);
  clip-path: polygon(100% 0, 100% 100%, 0 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);
  position: relative;
  padding: 2rem 1.5rem;
}

.site-header::after {
  content: '';
  position: absolute;
  bottom: -12px;
  left: 0;
  width: 100%;
  height: 12px;
  background: repeating-linear-gradient(
    45deg,
    transparent,
    transparent 10px,
    var(--color-border) 10px,
    var(--color-border) 20px
  );
}

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

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

.site-header h1::after {
  display: none;
}

.site-nav {
  width: 100%;
}

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

.site-nav li {
  display: inline-block;
}

.site-nav a {
  display: block;
  padding: 0.75rem 1.5rem;
  background-color: var(--color-bg);
  border: 2px solid var(--color-border);
  border-bottom: none;
  color: var(--color-text);
  font-weight: 700;
  clip-path: polygon(5% 0, 100% 0, 95% 100%, 0 100%);
  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: 0 4px 0 var(--color-secondary);
  border-bottom: none;
}

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

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

.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 2.5rem;
  padding: 1rem 1.5rem;
  background-color: var(--color-surface);
  font-size: 0.9rem;
  clip-path: polygon(0 0, 99% 0, 100% 100%, 1% 100%);
}

.breadcrumbs a {
  color: var(--color-text-muted);
  border: none;
}

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

.breadcrumbs::before {
  content: '⟩';
  color: var(--color-text-muted);
}

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

.card:hover {
  box-shadow: 8px 8px 0 var(--color-accent);
  border-color: var(--color-primary);
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 0 40px 40px 0;
  border-color: transparent var(--color-accent) transparent transparent;
}

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

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

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

table th::after {
  content: '';
  position: absolute;
  bottom: -3px;
  left: 0;
  width: 30%;
  height: 3px;
  background-color: var(--color-accent);
}

table td {
  padding: 1rem 1.25rem;
  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-bg);
}

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

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

summary {
  padding: 1.25rem 1.5rem;
  cursor: pointer;
  font-weight: 700;
  background-color: var(--color-surface);
  position: relative;
  list-style: none;
  transition: background-color 0.2s ease, color 0.2s ease;
  user-select: none;
}

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

summary::before {
  content: '▸';
  position: absolute;
  left: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.2rem;
  color: var(--color-primary);
  transition: transform 0.2s ease;
}

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

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

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

details[open] summary {
  border-bottom: 2px solid var(--color-border);
  background: linear-gradient(135deg, var(--color-accent) 0%, var(--color-surface) 100%);
}

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

.site-footer {
  background: linear-gradient(135deg, var(--color-secondary) 0%, var(--color-primary) 100%);
  color: var(--color-bg);
  padding: 3rem 1.5rem 2rem;
  margin-top: 4rem;
  position: relative;
  clip-path: polygon(0 30px, 100% 0, 100% 100%, 0 100%);
}

.site-footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 30px;
  background: repeating-linear-gradient(
    -45deg,
    transparent,
    transparent 15px,
    var(--color-bg) 15px,
    var(--color-bg) 30px
  );
}

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

.site-footer a:hover {
  color: var(--color-bg);
  border-bottom-color: var(--color-bg);
}

.site-footer p {
  margin-bottom: 0.75rem;
  text-align: center;
}

@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.5rem;
  }

  .site-nav {
    width: auto;
  }

  .site-nav ul {
    justify-content: flex-end;
    gap: 1rem;
  }

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

  .card {
    padding: 2.5rem;
  }

  .breadcrumbs {
    padding: 1.25rem 2rem;
  }

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

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

  h2 {
    font-size: 2.5rem;
  }

  .site-main {
    padding: 6rem 2.5rem;
  }

  .card {
    padding: 3rem;
  }

  .site-nav a {
    padding: 0.875rem 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;
  }
}

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

  .site-header {
    border-bottom: 2px solid #000;
    background: #fff;
    clip-path: none;
  }

  .site-header::after {
    display: none;
  }

  .site-main {
    padding: 1rem;
  }

  .container {
    max-width: 100%;
  }

  a {
    color: #000;
    text-decoration: underline;
  }

  .card {
    border: 1px solid #000;
    box-shadow: none;
    page-break-inside: avoid;
    clip-path: none;
  }

  table {
    border: 1px solid #000;
  }

  table thead {
    background: #eee;
    color: #000;
  }

  blockquote {
    border-left: 3px solid #000;
    background: #f5f5f5;
    clip-path: none;
  }
}