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

:root {
  --color-primary: #b45309;
  --color-secondary: #78350f;
  --color-accent: #fde68a;
  --color-bg: #fffef7;
  --color-surface: #fefce8;
  --color-text: #422006;
  --color-text-muted: #92743d;
  --color-border: #e5dbb8;
  --font-main: 'Georgia', 'Times New Roman', 'Palatino', serif;
  --max-width: 1100px;
  --radius: 16px;
}

body {
  font-family: var(--font-main);
  font-size: 18px;
  line-height: 1.7;
  color: var(--color-text);
  background-color: var(--color-bg);
  background-image: radial-gradient(circle, var(--color-border) 1px, transparent 1px);
  background-size: 20px 20px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

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

h1 {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

h2 {
  font-size: 2rem;
  padding-bottom: 0.5rem;
  border-bottom: 3px dashed var(--color-border);
}

h3 {
  font-size: 1.6rem;
}

h4 {
  font-size: 1.3rem;
}

h5 {
  font-size: 1.1rem;
}

h6 {
  font-size: 1rem;
}

p {
  margin-bottom: 1.25rem;
}

a {
  color: var(--color-primary);
  text-decoration: none;
  border-bottom: 2px dotted var(--color-primary);
  transition: color 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
  padding: 0 2px;
  border-radius: 4px;
}

a:hover {
  color: var(--color-secondary);
  border-bottom-style: solid;
  background-color: var(--color-accent);
}

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

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

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

blockquote {
  margin: 2rem 0;
  padding: 1.5rem;
  background: linear-gradient(135deg, var(--color-surface), var(--color-bg));
  border-left: 6px solid var(--color-primary);
  border-radius: var(--radius);
  font-style: italic;
  color: var(--color-text-muted);
  box-shadow: 0 2px 8px rgba(180, 83, 9, 0.1);
}

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

::selection {
  background-color: var(--color-accent);
  color: var(--color-secondary);
}

.site-header {
  background: linear-gradient(135deg, var(--color-surface), var(--color-bg));
  border-bottom: 4px dotted var(--color-border);
  padding: 2rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 4px 12px rgba(66, 32, 6, 0.05);
}

.site-header .container {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  align-items: center;
}

.site-nav {
  width: 100%;
}

.site-nav ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
}

.site-nav a {
  display: block;
  padding: 0.75rem 1.5rem;
  background-color: var(--color-surface);
  border: 2px dotted var(--color-border);
  border-radius: var(--radius);
  color: var(--color-text);
  font-weight: 600;
  transition: background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.site-nav a:hover {
  background-color: var(--color-accent);
  border-color: var(--color-primary);
  border-style: solid;
  box-shadow: 0 4px 12px rgba(180, 83, 9, 0.15);
  transform: translateY(-2px);
}

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

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 2rem;
  padding: 0.75rem 1rem;
  background-color: var(--color-surface);
  border-radius: var(--radius);
  border: 2px dashed var(--color-border);
  font-size: 0.9rem;
}

.breadcrumbs a {
  color: var(--color-text-muted);
  border-bottom-width: 1px;
}

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

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

.card {
  background: linear-gradient(135deg, var(--color-surface), var(--color-bg));
  border: 3px dotted var(--color-border);
  border-radius: var(--radius);
  padding: 2rem;
  margin-bottom: 2rem;
  transition: box-shadow 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
  box-shadow: 0 2px 8px rgba(66, 32, 6, 0.05);
}

.card:hover {
  box-shadow: 0 8px 24px rgba(180, 83, 9, 0.15);
  border-color: var(--color-primary);
  transform: translateY(-4px);
}

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

table {
  width: 100%;
  border-collapse: collapse;
  margin: 2rem 0;
  background-color: var(--color-surface);
  border-radius: var(--radius);
  overflow: hidden;
  border: 3px solid var(--color-border);
}

table th {
  background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
  color: var(--color-accent);
  padding: 1rem;
  text-align: left;
  font-weight: 700;
  border-bottom: 3px dashed var(--color-accent);
}

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

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

table tr:hover {
  background-color: var(--color-accent);
  transition: background-color 0.2s ease;
}

table tr:last-child td {
  border-bottom: none;
}

details {
  margin: 1.5rem 0;
  border: 3px dotted var(--color-border);
  border-radius: var(--radius);
  background-color: var(--color-surface);
  overflow: hidden;
  transition: box-shadow 0.2s ease;
}

details[open] {
  box-shadow: 0 4px 16px rgba(180, 83, 9, 0.12);
  border-style: solid;
}

summary {
  padding: 1.25rem 1.5rem;
  cursor: pointer;
  font-weight: 700;
  color: var(--color-secondary);
  background: linear-gradient(135deg, var(--color-surface), var(--color-bg));
  border-bottom: 2px dashed transparent;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

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

summary::before {
  content: '▸';
  font-size: 1.2rem;
  transition: transform 0.2s ease;
  color: var(--color-primary);
}

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

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

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

details div {
  padding: 1.5rem;
  animation: slideDown 0.2s ease;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.site-footer {
  background: linear-gradient(135deg, var(--color-secondary), var(--color-primary));
  color: var(--color-accent);
  padding: 3rem 0 2rem;
  margin-top: 4rem;
  border-top: 4px dashed var(--color-accent);
}

.site-footer a {
  color: var(--color-accent);
  border-bottom-color: var(--color-accent);
  font-weight: 600;
}

.site-footer a:hover {
  color: var(--color-surface);
  border-bottom-color: var(--color-surface);
  background-color: rgba(253, 230, 138, 0.2);
}

.site-footer .container {
  display: grid;
  gap: 2rem;
  text-align: center;
}

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

button, input[type="submit"], input[type="button"] {
  font-family: var(--font-main);
  font-size: 1rem;
  padding: 0.75rem 1.5rem;
  background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
  color: var(--color-accent);
  border: 3px solid var(--color-border);
  border-radius: var(--radius);
  cursor: pointer;
  font-weight: 700;
  transition: box-shadow 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}

button:hover, input[type="submit"]:hover, input[type="button"]:hover {
  box-shadow: 0 6px 20px rgba(180, 83, 9, 0.25);
  transform: translateY(-2px);
  border-color: var(--color-accent);
}

button:focus-visible, input[type="submit"]:focus-visible, input[type="button"]:focus-visible {
  outline: 3px solid var(--color-accent);
  outline-offset: 2px;
}

input[type="text"], input[type="email"], input[type="search"], textarea, select {
  font-family: var(--font-main);
  font-size: 1rem;
  padding: 0.75rem;
  border: 3px dotted var(--color-border);
  border-radius: var(--radius);
  background-color: var(--color-surface);
  color: var(--color-text);
  width: 100%;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input[type="text"]:focus, input[type="email"]:focus, input[type="search"]:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--color-primary);
  border-style: solid;
  box-shadow: 0 0 0 3px rgba(180, 83, 9, 0.15);
}

ul:not(.site-nav ul) {
  margin: 1.5rem 0;
  padding-left: 2rem;
}

ul:not(.site-nav ul) li {
  margin-bottom: 0.5rem;
  position: relative;
}

ul:not(.site-nav ul) li::marker {
  color: var(--color-primary);
}

ol {
  margin: 1.5rem 0;
  padding-left: 2rem;
}

ol li {
  margin-bottom: 0.5rem;
  position: relative;
}

ol li::marker {
  color: var(--color-primary);
  font-weight: 700;
}

code {
  font-family: 'Courier New', monospace;
  background-color: var(--color-surface);
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  font-size: 0.9em;
  color: var(--color-secondary);
  border: 1px dotted var(--color-border);
}

pre {
  background-color: var(--color-surface);
  padding: 1.5rem;
  border-radius: var(--radius);
  overflow-x: auto;
  margin: 2rem 0;
  border: 3px dotted var(--color-border);
}

pre code {
  background: none;
  padding: 0;
  border: none;
}

hr {
  border: none;
  border-top: 3px dashed var(--color-border);
  margin: 3rem 0;
}

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

  h1 {
    font-size: 3rem;
  }

  h2 {
    font-size: 2.25rem;
  }

  h3 {
    font-size: 1.75rem;
  }

  .site-header .container {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }

  .site-nav {
    width: auto;
  }

  .site-nav ul {
    justify-content: flex-end;
  }

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

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

  .card {
    padding: 2.5rem;
  }
}

@media (min-width: 1024px) {
  body {
    font-size: 20px;
  }

  h1 {
    font-size: 3.5rem;
  }

  h2 {
    font-size: 2.5rem;
  }

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

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

  .container {
    padding: 0 2rem;
  }

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

  .card:hover {
    transform: translateY(-6px);
  }
}

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

  details div {
    animation: none;
  }

  .card:hover, .site-nav a:hover, button:hover {
    transform: none;
  }
}

@media print {
  body {
    background: white;
    background-image: none;
    color: black;
    font-size: 12pt;
  }

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

  .site-main {
    padding: 0;
  }

  .container {
    max-width: 100%;
    padding: 0;
  }

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

  .card {
    border: 1px solid black;
    page-break-inside: avoid;
    box-shadow: none;
  }

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

  table {
    border: 1px solid black;
  }

  table th {
    background: #eee;
    color: black;
  }
}