:root {
  --bg: #F6F2EA;
  --surface: #FFFFFF;
  --text: #15161A;
  --muted: #5B616B;
  --border: #D7D0C6;
  --primary: #2E3A8C;
  --secondary: #1F6F78;
  --accent: #C46A3B;
  --shadow: rgba(21, 22, 26, 0.08);
  --radius: 2px;
  --measure: 70ch;
}

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

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

body {
  font-family: "Iowan Old Style", "Palatino Linotype", "URW Palladio L", P052, serif;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  background-image: linear-gradient(135deg, rgba(255,255,255,0.03) 0%, transparent 50%), linear-gradient(to bottom, var(--bg) 0%, #EDE8DC 100%);
  background-attachment: fixed;
}

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

header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  max-width: 1200px;
  margin: 0 auto;
}

.site-name {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.site-name a {
  color: var(--primary);
  text-decoration: none;
}

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

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

nav a {
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s ease;
}

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

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

.breadcrumbs {
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
}

.breadcrumbs ol {
  list-style: none;
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.breadcrumbs li:not(:last-child)::after {
  content: "/";
  margin-left: 0.5rem;
  color: var(--muted);
}

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

.breadcrumbs a:hover {
  text-decoration: underline;
}

main {
  min-height: 60vh;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem;
}

article {
  background: var(--surface);
  padding: 2rem;
  margin: 2rem auto;
  border-radius: var(--radius);
  box-shadow: 0 2px 8px var(--shadow);
  max-width: var(--measure);
}

h1 {
  font-size: 2rem;
  line-height: 1.2;
  margin-bottom: 1.5rem;
  color: var(--primary);
  font-weight: 700;
  letter-spacing: -0.01em;
}

h2 {
  font-size: 1.5rem;
  line-height: 1.3;
  margin-top: 2rem;
  margin-bottom: 1rem;
  color: var(--secondary);
  font-weight: 600;
}

h3 {
  font-size: 1.25rem;
  line-height: 1.4;
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
  color: var(--text);
  font-weight: 600;
}

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

a {
  color: var(--secondary);
  transition: color 0.2s ease;
}

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

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

a[rel~="external"]::after {
  content: " ↗";
  font-size: 0.85em;
  color: var(--muted);
}

blockquote {
  margin: 1.5rem 0;
  padding: 1rem 1.5rem;
  border-left: 4px solid var(--accent);
  background: rgba(196, 106, 59, 0.05);
  font-style: italic;
  color: var(--text);
}

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

aside {
  margin: 2rem 0;
  padding: 1.5rem;
  background: rgba(31, 111, 120, 0.05);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

aside h3 {
  margin-top: 0;
  color: var(--secondary);
}

dl {
  margin-top: 1rem;
}

dt {
  font-weight: 600;
  color: var(--text);
  margin-top: 0.75rem;
}

dd {
  margin-left: 1rem;
  margin-top: 0.25rem;
  color: var(--muted);
}

table {
  width: 100%;
  border-collapse: collapse;
  margin: 2rem 0;
  font-size: 0.9375rem;
  background: var(--surface);
  border: 1px solid var(--border);
  overflow-x: auto;
  display: block;
}

@media (min-width: 768px) {
  table {
    display: table;
  }
}

caption {
  font-weight: 600;
  text-align: left;
  padding: 0.75rem;
  background: rgba(46, 58, 140, 0.05);
  color: var(--primary);
  border-bottom: 2px solid var(--primary);
}

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

@media (min-width: 1024px) {
  thead {
    position: sticky;
    top: 0;
  }
}

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

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

tbody tr:nth-child(even) {
  background: rgba(246, 242, 234, 0.3);
}

tbody tr:hover {
  background: rgba(31, 111, 120, 0.08);
}

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

summary {
  padding: 1rem 1.5rem;
  font-weight: 600;
  cursor: pointer;
  background: rgba(46, 58, 140, 0.03);
  color: var(--primary);
  transition: background 0.2s ease;
  list-style: none;
  display: flex;
  align-items: center;
}

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

summary::before {
  content: "▸";
  margin-right: 0.75rem;
  transition: transform 0.2s ease;
  display: inline-block;
}

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

summary:hover {
  background: rgba(46, 58, 140, 0.08);
}

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

details p {
  padding: 1rem 1.5rem;
}

details p:last-child {
  padding-bottom: 1.5rem;
}

footer {
  margin-top: 4rem;
  padding: 2rem 1rem;
  background: var(--surface);
  border-top: 1px solid var(--border);
  text-align: center;
  color: var(--muted);
  font-size: 0.875rem;
}

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

  h1 {
    font-size: 2.5rem;
  }

  h2 {
    font-size: 1.75rem;
  }

  h3 {
    font-size: 1.375rem;
  }

  article {
    padding: 3rem;
  }

  .container {
    padding: 1.5rem;
  }
}

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

  h2 {
    font-size: 2rem;
  }
}

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

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

  header,
  nav,
  footer {
    display: none;
  }

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

  a[href^="http"]::after {
    content: " (" attr(href) ")";
  }
}