* {
  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: 24px;
}

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;
  letter-spacing: -0.02em;
}

h2 {
  font-size: 2rem;
  margin-top: 1.5em;
}

h3 {
  font-size: 1.5rem;
  margin-top: 1.25em;
}

h4 {
  font-size: 1.25rem;
  margin-top: 1em;
}

h5 {
  font-size: 1.125rem;
}

h6 {
  font-size: 1rem;
  color: var(--color-primary);
}

p {
  margin-bottom: 1.25em;
}

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

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

a:focus-visible {
  outline: 3px dotted var(--color-primary);
  outline-offset: 4px;
  border-radius: 4px;
}

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

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

blockquote {
  margin: 2em 0;
  padding: 1.5em 2em;
  background-color: var(--color-surface);
  border-left: 6px solid var(--color-primary);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-style: italic;
  color: var(--color-text-muted);
  box-shadow: 0 2px 8px rgba(120, 53, 15, 0.08);
}

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

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

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

.site-header {
  background: linear-gradient(135deg, var(--color-surface) 0%, var(--color-bg) 100%);
  border-bottom: 3px dotted var(--color-border);
  padding: 2rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 4px 12px rgba(120, 53, 15, 0.06);
}

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

.site-header h1 {
  margin: 0;
  font-size: 2rem;
  color: var(--color-primary);
  text-align: center;
}

.site-nav {
  width: 100%;
}

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

.site-nav a {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  background-color: var(--color-surface);
  color: var(--color-secondary);
  text-decoration: none;
  border-radius: calc(var(--radius) / 2);
  border: 2px dashed var(--color-border);
  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);
  box-shadow: 0 4px 12px rgba(180, 83, 9, 0.2);
  transform: translateY(-2px);
}

.site-nav a:focus-visible {
  outline: 3px dotted var(--color-primary);
  outline-offset: 4px;
}

.breadcrumbs {
  padding: 1rem 0;
  font-size: 0.9rem;
  color: var(--color-text-muted);
}

.breadcrumbs ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.breadcrumbs li:not(:last-child)::after {
  content: '→';
  margin-left: 0.5rem;
  color: var(--color-primary);
}

.breadcrumbs a {
  color: var(--color-text-muted);
  text-decoration: none;
  border-bottom: 1px dotted var(--color-border);
  transition: color 0.2s ease, border-color 0.2s ease;
}

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

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

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

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

.site-footer a {
  color: var(--color-accent);
  text-decoration-color: var(--color-primary);
}

.site-footer a:hover {
  color: var(--color-surface);
  text-decoration-color: var(--color-accent);
}

.site-footer p {
  margin-bottom: 0.5em;
}

.card {
  background-color: var(--color-surface);
  border: 3px dotted var(--color-border);
  border-radius: var(--radius);
  padding: 2rem;
  margin-bottom: 2rem;
  box-shadow: 0 4px 16px rgba(120, 53, 15, 0.1);
  transition: box-shadow 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}

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

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

table {
  width: 100%;
  border-collapse: collapse;
  margin: 2rem 0;
  background-color: var(--color-surface);
  border: 2px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(120, 53, 15, 0.08);
}

thead {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
  color: var(--color-accent);
}

th {
  padding: 1rem;
  text-align: left;
  font-weight: 700;
  border-bottom: 3px dashed var(--color-accent);
}

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

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

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

tbody tr:hover {
  background-color: var(--color-accent);
}

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

details {
  margin: 1.5rem 0;
  border: 2px dashed var(--color-border);
  border-radius: calc(var(--radius) / 2);
  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);
}

summary {
  padding: 1.25rem 1.5rem;
  cursor: pointer;
  font-weight: 700;
  color: var(--color-primary);
  background: linear-gradient(135deg, var(--color-surface) 0%, var(--color-bg) 100%);
  border-bottom: 2px dotted var(--color-border);
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: background-color 0.2s ease, color 0.2s ease;
}

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

summary::after {
  content: '⊕';
  font-size: 1.5rem;
  color: var(--color-primary);
  transition: transform 0.2s ease, color 0.2s ease;
}

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

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

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

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

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

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

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--color-primary);
  background-color: var(--color-bg);
  box-shadow: 0 0 0 4px rgba(180, 83, 9, 0.1);
}

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

button:hover,
input[type="submit"]:hover,
input[type="button"]:hover {
  background: linear-gradient(135deg, var(--color-secondary) 0%, var(--color-primary) 100%);
  box-shadow: 0 6px 20px rgba(120, 53, 15, 0.3);
  transform: translateY(-2px);
  border-color: var(--color-primary);
}

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

button:active,
input[type="submit"]:active,
input[type="button"]:active {
  transform: translateY(0);
}

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

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

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

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

ul, ol {
  margin-bottom: 1.25em;
  padding-left: 2rem;
}

li {
  margin-bottom: 0.5em;
}

img {
  max-width: 100%;
  height: auto;
  border-radius: calc(var(--radius) / 2);
  border: 3px dotted var(--color-border);
}

@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-header h1 {
    font-size: 2.5rem;
  }

  .site-nav {
    width: auto;
  }

  .site-nav ul {
    gap: 1.5rem;
  }

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

  .container {
    padding: 0 2rem;
  }

  .card {
    padding: 2.5rem;
  }
}

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

  h1 {
    font-size: 3.5rem;
  }

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

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

  .card {
    padding: 3rem;
  }

  details > *:not(summary) {
    padding: 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;
    background-image: none;
    color: black;
    font-size: 12pt;
    line-height: 1.5;
  }

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

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

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

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

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

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

  img {
    max-width: 100%;
    page-break-inside: avoid;
  }

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

  table {
    border: 1px solid #ccc;
  }

  thead {
    background: #eee;
    color: black;
  }
}