:root {
  --color-primary: #2E7D5B;
  --color-secondary: #2B3A67;
  --color-accent: #C97B2A;
  --color-background: #F6F2EA;
  --color-surface: #FFFFFF;
  --color-text: #1B1F24;
  --color-text-muted: #5B6672;
  --color-border: #D8D1C6;
  --radius: 14px;
  --shadow: 0 10px 28px rgba(27, 31, 36, 0.10);
  --measure: 68ch;
  --font-system: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-serif: Georgia, "Times New Roman", serif;
}

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

html {
  font-size: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-system);
  font-size: 1.125rem;
  line-height: 1.7;
  color: var(--color-text);
  background-color: var(--color-background);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body > * {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-areas:
    "header"
    "main"
    "aside"
    "footer";
  gap: 1.5rem;
  max-width: 1400px;
  margin: 0 auto;
  padding: 1rem;
}

header {
  grid-area: header;
  background-color: var(--color-surface);
  padding: 1.5rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

header h1,
header .site-name {
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: 1rem;
  line-height: 1.2;
}

nav ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

nav a {
  color: var(--color-secondary);
  text-decoration: none;
  font-weight: 500;
  padding: 0.5rem 1rem;
  border-radius: calc(var(--radius) / 2);
  transition: background-color 0.2s ease, color 0.2s ease;
}

nav a:hover {
  background-color: var(--color-primary);
  color: var(--color-surface);
}

nav a:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
  box-shadow: 0 0 0 4px rgba(201, 123, 42, 0.2);
}

main {
  grid-area: main;
  background-color: var(--color-surface);
  padding: 2rem 1.5rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  max-width: var(--measure);
}

aside {
  grid-area: aside;
  background-color: var(--color-surface);
  padding: 1.5rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border-left: 4px solid var(--color-accent);
}

footer {
  grid-area: footer;
  background-color: var(--color-secondary);
  color: var(--color-surface);
  padding: 2rem 1.5rem;
  border-radius: var(--radius);
  text-align: center;
}

footer nav ul {
  justify-content: center;
  margin-bottom: 1rem;
}

footer nav a {
  color: var(--color-surface);
}

footer nav a:hover {
  background-color: var(--color-primary);
}

footer p {
  font-size: 0.9rem;
  color: rgba(246, 242, 234, 0.8);
}

h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  line-height: 1.1;
  font-weight: 700;
  color: var(--color-secondary);
  margin-bottom: 1rem;
}

h2 {
  font-size: clamp(1.5rem, 4vw, 2.25rem);
  line-height: 1.2;
  font-weight: 700;
  color: var(--color-primary);
  margin-top: 2.5rem;
  margin-bottom: 1rem;
}

h3 {
  font-size: clamp(1.25rem, 3vw, 1.75rem);
  line-height: 1.3;
  font-weight: 600;
  color: var(--color-secondary);
  margin-top: 2rem;
  margin-bottom: 0.75rem;
}

p {
  margin-bottom: 1.25rem;
  max-width: var(--measure);
}

a {
  color: var(--color-primary);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
  transition: text-decoration-thickness 0.2s ease, color 0.2s ease;
}

a:hover {
  color: var(--color-accent);
  text-decoration-thickness: 2px;
}

a:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
  box-shadow: 0 0 0 4px rgba(201, 123, 42, 0.2);
  border-radius: 2px;
}

.breadcrumbs {
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
  color: var(--color-text-muted);
}

.breadcrumbs nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

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

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

blockquote {
  margin: 2rem 0;
  padding: 1.5rem;
  background-color: var(--color-background);
  border-left: 4px solid var(--color-primary);
  border-radius: calc(var(--radius) / 2);
  font-style: italic;
  color: var(--color-secondary);
}

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

.table-wrapper {
  overflow-x: auto;
  margin: 2rem 0;
  border-radius: var(--radius);
  box-shadow: 0 2px 8px rgba(27, 31, 36, 0.08);
}

table {
  width: 100%;
  border-collapse: collapse;
  background-color: var(--color-surface);
  font-size: 1rem;
}

caption {
  caption-side: top;
  text-align: left;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--color-secondary);
  padding: 1rem;
  background-color: var(--color-background);
  position: sticky;
  top: 0;
  z-index: 1;
}

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

th {
  text-align: left;
  padding: 1rem;
  font-weight: 600;
}

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

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

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

tbody tr:hover {
  background-color: rgba(46, 125, 91, 0.08);
}

details {
  margin: 1.5rem 0;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background-color: var(--color-surface);
  overflow: hidden;
}

summary {
  padding: 1.25rem;
  font-weight: 600;
  color: var(--color-secondary);
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  transition: background-color 0.2s ease;
  user-select: none;
}

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

summary::before {
  content: "▶";
  color: var(--color-primary);
  font-size: 0.8rem;
  transition: transform 0.3s ease;
  flex-shrink: 0;
}

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

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

summary:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: -2px;
  box-shadow: inset 0 0 0 4px rgba(201, 123, 42, 0.2);
}

details[open] {
  border-left: 4px solid var(--color-accent);
}

details > *:not(summary) {
  padding: 0 1.25rem 1.25rem 1.25rem;
}

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

ul, ol {
  margin: 1rem 0 1.5rem 1.5rem;
}

li {
  margin-bottom: 0.5rem;
}

aside ul {
  margin-left: 1.25rem;
}

aside h3 {
  margin-top: 0;
  font-size: 1.25rem;
}

section {
  margin-bottom: 3rem;
}

section:last-of-type {
  margin-bottom: 0;
}

.note {
  padding: 1rem;
  background-color: rgba(201, 123, 42, 0.1);
  border-left: 3px solid var(--color-accent);
  border-radius: calc(var(--radius) / 2);
  margin: 1.5rem 0;
  font-size: 0.95rem;
}

@media (min-width: 768px) {
  body > * {
    padding: 1.5rem;
    gap: 2rem;
  }

  header {
    padding: 2rem;
  }

  main {
    padding: 3rem 2.5rem;
  }

  aside {
    padding: 2rem;
  }

  nav ul {
    gap: 1.5rem;
  }
}

@media (min-width: 1024px) {
  body > * {
    grid-template-columns: 1fr 320px;
    grid-template-areas:
      "header header"
      "main aside"
      "footer footer";
    gap: 2.5rem;
    padding: 2rem;
  }

  main {
    max-width: none;
  }

  aside {
    position: sticky;
    top: 2rem;
    align-self: start;
  }
}

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

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

  header,
  main,
  aside,
  footer {
    box-shadow: none;
    border-radius: 0;
  }

  a::after {
    content: " (" attr(href) ")";
    font-size: 0.8em;
    color: #666;
  }

  nav a::after {
    content: "";
  }

  details {
    border: 1px solid #ccc;
  }

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

  summary::before {
    content: "";
  }

  thead {
    background-color: #f0f0f0;
    color: black;
  }

  tbody tr:nth-child(even) {
    background-color: #f9f9f9;
  }

  @page {
    margin: 2cm;
  }
}