* {
  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: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --max-width: 1100px;
  --radius: 12px;
}

body {
  font-family: var(--font-main);
  background-color: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  font-size: 16px;
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr auto;
}

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

h1 {
  font-size: 2.5rem;
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 8px), 0 100%);
  padding-bottom: 8px;
}

h2 {
  font-size: 2rem;
  position: relative;
  padding-left: 16px;
}

h2::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: linear-gradient(180deg, var(--color-primary), var(--color-secondary));
  clip-path: polygon(0 0, 100% 0, 100% 100%, 0 calc(100% - 6px));
}

h3 {
  font-size: 1.5rem;
}

h4 {
  font-size: 1.25rem;
}

h5 {
  font-size: 1.1rem;
}

h6 {
  font-size: 1rem;
}

p {
  margin-bottom: 1rem;
}

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

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

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

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

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

blockquote {
  background-color: var(--color-surface);
  border-left: 4px solid var(--color-primary);
  padding: 1.5rem;
  margin: 2rem 0;
  font-style: italic;
  color: var(--color-text-muted);
  box-shadow: 2px 2px 8px rgba(168, 136, 74, 0.1);
  clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%, 0 0);
  position: relative;
}

blockquote::after {
  content: '';
  position: absolute;
  bottom: 0;
  right: 0;
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, transparent 50%, var(--color-accent) 50%);
}

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

.site-header {
  background: linear-gradient(135deg, var(--color-surface) 0%, var(--color-accent) 100%);
  box-shadow: 0 4px 12px rgba(58, 47, 24, 0.08);
  position: sticky;
  top: 0;
  z-index: 100;
  clip-path: polygon(0 0, 100% 0, 100% 100%, 0 calc(100% - 12px));
}

.site-header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 1rem;
  max-width: var(--max-width);
  margin: 0 auto;
}

.site-header h1 {
  font-size: 1.75rem;
  margin: 0;
  color: var(--color-secondary);
  clip-path: none;
  padding-bottom: 0;
}

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

.site-nav a {
  color: var(--color-secondary);
  font-weight: 600;
  padding: 0.5rem 1rem;
  display: block;
  border-radius: var(--radius);
  transition: background-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
  clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px);
}

.site-nav a:hover {
  background-color: var(--color-primary);
  color: var(--color-bg);
  box-shadow: 2px 2px 8px rgba(168, 136, 74, 0.2);
}

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

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

.breadcrumbs {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 2rem;
  font-size: 0.875rem;
  color: var(--color-text-muted);
  flex-wrap: wrap;
}

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

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

.breadcrumbs::before {
  content: '';
  display: inline-block;
  width: 0;
  height: 0;
  border-left: 6px solid var(--color-primary);
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
  margin-right: 0.5rem;
}

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

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

.site-footer a {
  color: var(--color-accent);
  transition: color 0.2s ease;
}

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

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

.card {
  background-color: var(--color-surface);
  border-radius: var(--radius);
  padding: 2rem;
  margin-bottom: 2rem;
  box-shadow: 4px 4px 16px rgba(58, 47, 24, 0.08);
  border: 1px solid var(--color-border);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
  clip-path: polygon(0 0, calc(100% - 16px) 0, 100% 16px, 100% 100%, 16px 100%, 0 calc(100% - 16px));
  position: relative;
}

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

.card:hover {
  box-shadow: 6px 6px 20px rgba(58, 47, 24, 0.12);
  transform: translateY(-2px);
}

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

table {
  width: 100%;
  border-collapse: collapse;
  margin: 2rem 0;
  background-color: var(--color-surface);
  box-shadow: 2px 2px 12px rgba(58, 47, 24, 0.06);
  border-radius: var(--radius);
  overflow: hidden;
}

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: 700;
  border-bottom: 2px solid var(--color-secondary);
  position: relative;
}

table th::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--color-accent), transparent);
}

table td {
  padding: 1rem;
  border-bottom: 1px solid var(--color-border);
  transition: background-color 0.2s ease;
}

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 {
  background-color: var(--color-surface);
  border: 2px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1rem;
  margin-bottom: 1rem;
  box-shadow: 2px 2px 8px rgba(58, 47, 24, 0.06);
  clip-path: polygon(12px 0, 100% 0, 100% calc(100% - 12px), calc(100% - 12px) 100%, 0 100%, 0 12px);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

details:hover {
  border-color: var(--color-primary);
}

details[open] {
  border-color: var(--color-primary);
  box-shadow: 4px 4px 16px rgba(168, 136, 74, 0.15);
}

summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--color-secondary);
  padding: 0.5rem;
  margin: -1rem -1rem 0 -1rem;
  border-radius: var(--radius) var(--radius) 0 0;
  transition: background-color 0.2s ease, color 0.2s ease;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

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

summary::before {
  content: '';
  display: inline-block;
  width: 0;
  height: 0;
  border-left: 8px solid var(--color-primary);
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  transition: transform 0.2s ease;
}

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

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

details[open] summary {
  margin-bottom: 1rem;
  background-color: var(--color-primary);
  color: var(--color-bg);
}

details[open] summary::before {
  border-left-color: var(--color-bg);
}

details p {
  padding: 0.5rem;
}

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

  h2 {
    font-size: 2.25rem;
  }

  h3 {
    font-size: 1.75rem;
  }

  .site-header .container {
    padding: 1.5rem 2rem;
  }

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

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

  .card {
    padding: 2.5rem;
  }

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

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

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

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

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

  .container {
    display: grid;
    gap: 2rem;
  }
}

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

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

  .site-header {
    position: static;
    box-shadow: none;
    clip-path: none;
  }

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

  .site-footer {
    margin-top: 2rem;
    clip-path: none;
  }

  .card {
    box-shadow: none;
    border: 1px solid var(--color-border);
    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.8rem;
  }
}