:root {
  --color-primary: #1F3A5F;
  --color-secondary: #2E6F95;
  --color-accent: #E07A5F;
  --color-background: #F7F5F2;
  --color-surface: #FFFFFF;
  --color-text: #121826;
  --color-text-muted: #4B5563;
  --color-border: #D6D3D1;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(18, 24, 38, 0.08);
  --maxw: 1100px;
  --spacing-unit: 1.5rem;
  --transition-speed: 0.2s;
}

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

html {
  font-size: 100%;
  -webkit-text-size-adjust: 100%;
  -moz-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 1.125rem;
  line-height: 1.75;
  color: var(--color-text);
  background-color: var(--color-background);
  text-align: left;
}

body {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: auto 1fr auto;
  grid-template-areas:
    "header"
    "main"
    "footer";
  min-height: 100vh;
}

header {
  grid-area: header;
  background-color: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  box-shadow: var(--shadow);
}

main {
  grid-area: main;
  max-width: var(--maxw);
  width: 100%;
  margin: 0 auto;
  padding: calc(var(--spacing-unit) * 2) var(--spacing-unit);
}

footer {
  grid-area: footer;
  background-color: var(--color-surface);
  border-top: 1px solid var(--color-border);
  padding: calc(var(--spacing-unit) * 1.5) var(--spacing-unit);
  text-align: center;
  font-size: 0.9375rem;
  color: var(--color-text-muted);
}

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

header h1,
header .site-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-primary);
  letter-spacing: -0.02em;
}

header a.site-title {
  text-decoration: none;
  transition: color var(--transition-speed) ease;
}

header a.site-title:hover {
  color: var(--color-secondary);
}

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;
  transition: color var(--transition-speed) ease;
  position: relative;
}

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

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

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

h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.2;
  margin-top: calc(var(--spacing-unit) * 2);
  margin-bottom: var(--spacing-unit);
  letter-spacing: -0.02em;
  color: var(--color-primary);
}

h1 {
  font-size: 2.5rem;
  margin-top: 0;
}

h2 {
  font-size: 2rem;
  margin-top: calc(var(--spacing-unit) * 2.5);
}

h3 {
  font-size: 1.5rem;
}

h4 {
  font-size: 1.25rem;
}

h5, h6 {
  font-size: 1.125rem;
}

p {
  margin-bottom: var(--spacing-unit);
  max-width: 70ch;
}

a {
  color: var(--color-secondary);
  text-decoration: underline;
  transition: color var(--transition-speed) ease;
}

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

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

button:focus-visible,
summary:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
}

nav[aria-label="Breadcrumb"] {
  margin-bottom: calc(var(--spacing-unit) * 1.5);
}

nav[aria-label="Breadcrumb"] ol {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-size: 0.9375rem;
  color: var(--color-text-muted);
}

nav[aria-label="Breadcrumb"] li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

nav[aria-label="Breadcrumb"] li:not(:last-child)::after {
  content: '›';
  color: var(--color-border);
  font-size: 1.125rem;
}

nav[aria-label="Breadcrumb"] a {
  text-decoration: none;
  color: var(--color-secondary);
}

nav[aria-label="Breadcrumb"] a:hover {
  text-decoration: underline;
  color: var(--color-accent);
}

details {
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: var(--spacing-unit);
  margin-bottom: var(--spacing-unit);
  transition: background-color var(--transition-speed) ease, border-color var(--transition-speed) ease;
}

details[open] {
  background-color: var(--color-background);
  border-color: var(--color-primary);
}

summary {
  font-weight: 600;
  color: var(--color-primary);
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: color var(--transition-speed) ease;
  user-select: none;
}

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

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

details[open] summary::after {
  content: '−';
  transform: rotate(0deg);
}

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

details > *:not(summary) {
  margin-top: var(--spacing-unit);
}

.table-wrapper {
  overflow-x: auto;
  margin: calc(var(--spacing-unit) * 1.5) 0;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

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

caption {
  font-weight: 600;
  text-align: left;
  padding: var(--spacing-unit);
  background-color: var(--color-primary);
  color: var(--color-surface);
  font-size: 1.125rem;
  caption-side: top;
}

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

th {
  padding: 1rem;
  text-align: left;
  font-weight: 600;
  border-bottom: 2px solid var(--color-border);
}

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

tbody tr {
  transition: background-color var(--transition-speed) ease;
}

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

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

blockquote {
  margin: calc(var(--spacing-unit) * 1.5) 0;
  padding: var(--spacing-unit) calc(var(--spacing-unit) * 1.5);
  background-color: var(--color-surface);
  border-left: 4px solid var(--color-accent);
  font-style: italic;
  color: var(--color-text-muted);
  box-shadow: var(--shadow);
}

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

ul, ol {
  margin-bottom: var(--spacing-unit);
  padding-left: calc(var(--spacing-unit) * 1.5);
}

li {
  margin-bottom: 0.5rem;
}

section {
  margin-bottom: calc(var(--spacing-unit) * 3);
}

section:last-child {
  margin-bottom: 0;
}

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

  h1 {
    font-size: 3rem;
  }

  h2 {
    font-size: 2.25rem;
  }

  h3 {
    font-size: 1.75rem;
  }

  main {
    padding: calc(var(--spacing-unit) * 3) var(--spacing-unit);
  }

  header > div {
    flex-wrap: nowrap;
  }

  nav ul {
    gap: 2rem;
  }

  table {
    font-size: 1rem;
  }
}

@media (min-width: 1024px) {
  body {
    grid-template-columns: 1fr minmax(auto, var(--maxw)) 1fr;
    grid-template-areas:
      "header header header"
      ". main ."
      "footer footer footer";
  }

  main {
    padding: calc(var(--spacing-unit) * 4) var(--spacing-unit);
  }

  thead {
    position: sticky;
    top: 0;
    z-index: 10;
  }

  .table-wrapper {
    overflow-x: visible;
  }
}

@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 {
  body {
    background-color: white;
    color: black;
    font-size: 12pt;
    line-height: 1.5;
  }

  header,
  footer,
  nav {
    display: none;
  }

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

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

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

  details {
    border: 1px solid #ccc;
  }

  details summary::after {
    display: none;
  }

  table {
    page-break-inside: avoid;
  }

  thead {
    display: table-header-group;
  }

  tr {
    page-break-inside: avoid;
  }

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