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

:root {
  --color-primary: #db2777;
  --color-secondary: #9d174d;
  --color-accent: #fbcfe8;
  --color-bg: #fffbfd;
  --color-surface: #fef1f7;
  --color-text: #500724;
  --color-text-muted: #9b6b80;
  --color-border: #e8c8d8;
  --font-main: 'Courier New', 'Lucida Console', Monaco, monospace;
  --max-width: 1100px;
  --radius: 4px;
  --shadow-sm: 0 2px 4px rgba(80, 7, 36, 0.08);
  --shadow-md: 0 4px 8px rgba(80, 7, 36, 0.12), 0 2px 4px rgba(80, 7, 36, 0.08);
  --shadow-lg: 0 8px 16px rgba(80, 7, 36, 0.16), 0 4px 8px rgba(80, 7, 36, 0.12), 0 2px 4px rgba(80, 7, 36, 0.08);
  --shadow-xl: 0 12px 24px rgba(80, 7, 36, 0.2), 0 8px 16px rgba(80, 7, 36, 0.16), 0 4px 8px rgba(80, 7, 36, 0.12);
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-main);
  font-size: 1rem;
  line-height: 1.7;
  color: var(--color-text);
  background-color: var(--color-bg);
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  grid-template-columns: 100%;
}

h1, h2, h3, h4, h5, h6 {
  font-family: Georgia, 'Times New Roman', Times, serif;
  font-weight: 700;
  line-height: 1.3;
  color: var(--color-secondary);
  margin-bottom: 1rem;
}

h1 {
  font-size: 2.5rem;
  border-bottom: 3px solid var(--color-primary);
  padding-bottom: 0.75rem;
  margin-bottom: 1.5rem;
  text-shadow: 2px 2px 0 var(--color-accent);
}

h2 {
  font-size: 2rem;
  border-bottom: 2px solid var(--color-border);
  padding-bottom: 0.5rem;
  margin-top: 2rem;
}

h3 {
  font-size: 1.5rem;
  margin-top: 1.5rem;
  position: relative;
  padding-left: 1rem;
}

h3::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: linear-gradient(to bottom, var(--color-primary), var(--color-secondary));
}

h4 {
  font-size: 1.25rem;
  margin-top: 1.25rem;
  color: var(--color-primary);
}

h5 {
  font-size: 1.125rem;
  margin-top: 1rem;
}

h6 {
  font-size: 1rem;
  margin-top: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

p {
  margin-bottom: 1rem;
}

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

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

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

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

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

blockquote {
  margin: 1.5rem 0;
  padding: 1.25rem 1.5rem;
  background: var(--color-surface);
  border-left: 5px solid var(--color-primary);
  font-style: italic;
  color: var(--color-text);
  box-shadow: var(--shadow-sm);
  position: relative;
}

blockquote::before {
  content: '';
  position: absolute;
  top: 4px;
  left: 4px;
  right: -4px;
  bottom: -4px;
  background: var(--color-accent);
  z-index: -1;
  border-radius: var(--radius);
}

::selection {
  background-color: var(--color-primary);
  color: white;
}

.site-header {
  background: linear-gradient(135deg, var(--color-secondary) 0%, var(--color-primary) 100%);
  color: white;
  padding: 1.5rem 1rem;
  box-shadow: var(--shadow-lg);
  position: relative;
}

.site-header::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 0;
  right: 0;
  height: 6px;
  background: repeating-linear-gradient(90deg, var(--color-accent) 0px, var(--color-accent) 20px, transparent 20px, transparent 40px);
}

.site-header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.site-header h1 {
  font-size: 1.75rem;
  color: white;
  border: none;
  margin: 0;
  padding: 0;
  text-shadow: 3px 3px 0 rgba(0, 0, 0, 0.2);
}

.site-nav {
  background: var(--color-surface);
  border-bottom: 2px solid var(--color-border);
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 100;
}

.site-nav ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
}

.site-nav li {
  margin: 0;
}

.site-nav a {
  display: block;
  padding: 0.5rem 1rem;
  color: var(--color-text);
  text-decoration: none;
  border: 2px solid var(--color-border);
  border-radius: var(--radius);
  background: white;
  box-shadow: var(--shadow-sm);
  transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
  position: relative;
}

.site-nav a::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  right: -2px;
  bottom: -2px;
  background: var(--color-accent);
  z-index: -1;
  border-radius: var(--radius);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.site-nav a:hover {
  background: var(--color-primary);
  color: white;
  border-color: var(--color-secondary);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.site-nav a:hover::after {
  opacity: 1;
}

.site-main {
  padding: 2rem 1rem;
}

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

.breadcrumbs {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  margin-bottom: 1.5rem;
  padding: 0.75rem 1rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.breadcrumbs a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color 0.2s ease, background-color 0.2s ease;
  padding: 0.125rem 0.25rem;
  border-radius: 2px;
}

.breadcrumbs a:hover {
  color: var(--color-secondary);
  background: var(--color-accent);
}

.breadcrumbs span {
  margin: 0 0.5rem;
  color: var(--color-border);
}

.card {
  background: white;
  border: 2px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-md);
  transition: box-shadow 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
  position: relative;
}

.card::before {
  content: '';
  position: absolute;
  top: 6px;
  left: 6px;
  right: -6px;
  bottom: -6px;
  background: var(--color-surface);
  z-index: -1;
  border-radius: var(--radius);
  border: 2px solid var(--color-border);
}

.card::after {
  content: '';
  position: absolute;
  top: 12px;
  left: 12px;
  right: -12px;
  bottom: -12px;
  background: var(--color-accent);
  z-index: -2;
  border-radius: var(--radius);
  opacity: 0.5;
}

.card:hover {
  box-shadow: var(--shadow-xl);
  transform: translateY(-4px);
  border-color: var(--color-primary);
}

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

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin: 1.5rem 0;
  background: white;
  border: 2px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

thead {
  background: linear-gradient(135deg, var(--color-secondary), var(--color-primary));
  color: white;
}

th {
  padding: 1rem;
  text-align: left;
  font-weight: 700;
  border-bottom: 3px solid var(--color-secondary);
  font-family: Georgia, 'Times New Roman', Times, serif;
}

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

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

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

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

tbody tr:hover {
  background-color: var(--color-accent);
  box-shadow: inset 0 0 0 2px var(--color-primary);
}

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

details {
  margin: 1.5rem 0;
  border: 2px solid var(--color-border);
  border-radius: var(--radius);
  background: white;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: box-shadow 0.2s ease;
}

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

summary {
  padding: 1rem 1.25rem;
  cursor: pointer;
  background: var(--color-surface);
  font-weight: 700;
  color: var(--color-secondary);
  border-bottom: 2px solid transparent;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: Georgia, 'Times New Roman', Times, serif;
}

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

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

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

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

details[open] summary {
  border-bottom-color: var(--color-border);
}

details div {
  padding: 1.25rem;
  animation: fadeIn 0.2s ease;
}

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

.site-footer {
  background: var(--color-secondary);
  color: var(--color-accent);
  padding: 2rem 1rem;
  margin-top: 3rem;
  border-top: 4px solid var(--color-primary);
  box-shadow: 0 -4px 12px rgba(80, 7, 36, 0.15);
  position: relative;
}

.site-footer::before {
  content: '';
  position: absolute;
  top: -8px;
  left: 0;
  right: 0;
  height: 4px;
  background: repeating-linear-gradient(90deg, var(--color-accent) 0px, var(--color-accent) 15px, transparent 15px, transparent 30px);
}

.site-footer a {
  color: var(--color-accent);
  text-decoration: underline;
  transition: color 0.2s ease, background-color 0.2s ease;
}

.site-footer a:hover {
  color: white;
  background-color: var(--color-primary);
}

.site-footer p {
  margin: 0.5rem 0;
}

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

ol {
  margin: 1rem 0 1rem 2rem;
}

li {
  margin: 0.5rem 0;
}

code {
  background: var(--color-surface);
  padding: 0.125rem 0.375rem;
  border: 1px solid var(--color-border);
  border-radius: 3px;
  font-family: var(--font-main);
  font-size: 0.9em;
  color: var(--color-secondary);
}

pre {
  background: var(--color-surface);
  padding: 1rem;
  border: 2px solid var(--color-border);
  border-radius: var(--radius);
  overflow-x: auto;
  margin: 1.5rem 0;
  box-shadow: var(--shadow-sm);
}

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

button, .button {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  background: var(--color-primary);
  color: white;
  border: 2px solid var(--color-secondary);
  border-radius: var(--radius);
  font-family: var(--font-main);
  font-size: 1rem;
  cursor: pointer;
  text-decoration: none;
  transition: background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
  box-shadow: var(--shadow-md);
  position: relative;
}

button::before, .button::before {
  content: '';
  position: absolute;
  top: 4px;
  left: 4px;
  right: -4px;
  bottom: -4px;
  background: var(--color-accent);
  z-index: -1;
  border-radius: var(--radius);
}

button:hover, .button:hover {
  background: var(--color-secondary);
  border-color: var(--color-primary);
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

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

input, textarea, select {
  font-family: var(--font-main);
  font-size: 1rem;
  padding: 0.625rem 0.875rem;
  border: 2px solid var(--color-border);
  border-radius: var(--radius);
  background: white;
  color: var(--color-text);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  width: 100%;
  max-width: 100%;
}

input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-accent);
}

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

  h1 {
    font-size: 3rem;
  }

  h2 {
    font-size: 2.25rem;
  }

  h3 {
    font-size: 1.75rem;
  }

  .site-header {
    padding: 2rem 1.5rem;
  }

  .site-header h1 {
    font-size: 2.25rem;
  }

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

  .site-main {
    padding: 3rem 1.5rem;
  }

  .card {
    padding: 2rem;
  }

  .container {
    display: grid;
    gap: 2rem;
  }
}

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

  .site-header {
    padding: 2.5rem 2rem;
  }

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

  .site-footer {
    padding: 3rem 2rem;
  }

  .card {
    padding: 2.5rem;
  }
}

@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 {
  .site-nav, .site-footer {
    display: none;
  }

  .site-header {
    background: white;
    color: var(--color-text);
    box-shadow: none;
    border-bottom: 2px solid var(--color-text);
  }

  .site-header h1 {
    color: var(--color-text);
    text-shadow: none;
  }

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

  .card, table, details {
    box-shadow: none;
    page-break-inside: avoid;
  }

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

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