:root {
  --color-primary: #2B3A67;
  --color-secondary: #7A4E2D;
  --color-accent: #C24D2C;
  --color-background: #F6F1E7;
  --color-surface: #FFFFFF;
  --color-text: #1A1B1F;
  --color-text-muted: #5B5F6A;
  --color-border: #D8D0C4;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(26, 27, 31, 0.10);
  --maxw: 1120px;
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.6;
  color: var(--color-text);
  background-color: var(--color-background);
  font-size: 1rem;
  overflow-x: hidden;
}

main {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 2rem 1.25rem;
}

h1 {
  font-size: clamp(1.875rem, 4vw + 1rem, 3rem);
  line-height: 1.2;
  color: var(--color-primary);
  font-weight: 700;
  margin-bottom: 1rem;
  max-width: 32ch;
}

h2 {
  font-size: clamp(1.5rem, 3vw + 0.5rem, 2.25rem);
  line-height: 1.3;
  color: var(--color-primary);
  font-weight: 600;
  margin-top: 2.5rem;
  margin-bottom: 1rem;
}

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

p {
  max-width: 70ch;
  margin-bottom: 1.25rem;
}

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

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

a:focus-visible {
  outline: 3px solid var(--color-accent);
  outline-offset: 3px;
  border-radius: 2px;
}

header {
  background-color: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 100;
}

header > div {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 1rem 1.25rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

header .site-name {
  font-size: clamp(1.25rem, 2vw + 0.5rem, 1.5rem);
  font-weight: 700;
  color: var(--color-primary);
}

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

nav ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  align-items: center;
}

nav a {
  color: var(--color-text);
  text-decoration: none;
  font-weight: 500;
  padding: 0.5rem 0;
  position: relative;
  transition: color 0.2s ease;
}

nav a::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background-color: var(--color-accent);
  transition: width 0.3s ease;
}

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

nav a:hover::after {
  width: 100%;
}

nav a:focus-visible {
  outline: 3px solid var(--color-accent);
  outline-offset: 3px;
  border-radius: 2px;
}

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

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

.breadcrumbs a:hover {
  color: var(--color-accent);
  text-decoration: underline;
}

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

section {
  background-color: var(--color-surface);
  padding: 2rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 2rem;
}

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

table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
  font-size: 0.9375rem;
}

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

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

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

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

table tbody tr:hover {
  background-color: rgba(43, 58, 103, 0.05);
  transition: background-color 0.2s ease;
}

@media (max-width: 767px) {
  table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  table th,
  table td {
    white-space: nowrap;
  }
}

@media (min-width: 768px) {
  table thead {
    position: sticky;
    top: 0;
    z-index: 10;
  }
}

details {
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-bottom: 1rem;
  transition: box-shadow 0.2s ease;
}

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

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

summary {
  font-weight: 600;
  color: var(--color-primary);
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0;
  transition: color 0.2s ease;
}

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

summary::after {
  content: "+";
  font-size: 1.5rem;
  color: var(--color-accent);
  font-weight: 700;
  transition: transform 0.3s ease;
  flex-shrink: 0;
  margin-left: 1rem;
}

details[open] summary::after {
  transform: rotate(45deg);
}

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

summary:focus-visible {
  outline: 3px solid var(--color-accent);
  outline-offset: 3px;
  border-radius: 2px;
}

details div {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--color-border);
  color: var(--color-text);
}

blockquote {
  background-color: var(--color-surface);
  border-left: 4px solid var(--color-accent);
  padding: 1.25rem 1.5rem;
  margin: 1.5rem 0;
  font-style: italic;
  color: var(--color-text-muted);
  border-radius: 0 var(--radius) var(--radius) 0;
}

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

ul, ol {
  margin-left: 1.5rem;
  margin-bottom: 1.25rem;
  max-width: 70ch;
}

li {
  margin-bottom: 0.5rem;
}

footer {
  background-color: var(--color-surface);
  border-top: 1px solid var(--color-border);
  margin-top: 4rem;
  padding: 2rem 1.25rem;
}

footer > div {
  max-width: var(--maxw);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1.5rem;
  color: var(--color-text-muted);
  font-size: 0.9375rem;
}

footer a {
  color: var(--color-text-muted);
  text-decoration: none;
}

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

footer nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  list-style: none;
  margin: 0;
}

button,
input,
textarea,
select {
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
}

button {
  background-color: var(--color-accent);
  color: var(--color-surface);
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius);
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s ease, box-shadow 0.2s ease;
}

button:hover {
  background-color: var(--color-primary);
  box-shadow: var(--shadow);
}

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

img {
  max-width: 100%;
  height: auto;
  display: block;
}

code {
  background-color: var(--color-background);
  padding: 0.125rem 0.375rem;
  border-radius: 4px;
  font-family: "Courier New", Courier, monospace;
  font-size: 0.9em;
  color: var(--color-secondary);
}

pre {
  background-color: var(--color-background);
  padding: 1rem;
  border-radius: var(--radius);
  overflow-x: auto;
  margin: 1.5rem 0;
}

pre code {
  background-color: transparent;
  padding: 0;
}

hr {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: 2.5rem 0;
}

@media (min-width: 768px) {
  main {
    padding: 3rem 2rem;
    gap: 3rem;
  }

  section {
    padding: 2.5rem;
  }

  header > div {
    padding: 1.25rem 2rem;
  }

  footer {
    padding: 2.5rem 2rem;
  }
}

@media (min-width: 1024px) {
  main {
    padding: 4rem 2rem;
  }

  section {
    padding: 3rem;
  }
}

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

  summary::after {
    transition: none;
  }

  details {
    transition: none;
  }

  a {
    transition: none;
  }

  nav a::after {
    transition: none;
  }

  button {
    transition: none;
  }
}

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

  header,
  footer,
  nav,
  .breadcrumbs {
    display: none;
  }

  main {
    max-width: 100%;
    padding: 0;
  }

  section {
    box-shadow: none;
    page-break-inside: avoid;
  }

  a {
    color: black;
    text-decoration: underline;
  }

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

  table {
    page-break-inside: avoid;
  }

  h1, h2, h3 {
    page-break-after: avoid;
  }
}