/* CSS Reset */
*, *::before, *::after {
  box-sizing: border-box;
}

* {
  margin: 0;
  padding: 0;
}

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  line-height: 1.6;
  min-height: 100vh;
}

img, picture, video, canvas, svg {
  display: block;
  max-width: 100%;
}

input, button, textarea, select {
  font: inherit;
}

p, h1, h2, h3, h4, h5, h6 {
  overflow-wrap: break-word;
}

/* CSS Variables */
:root {
  --color-primary: #7c3aed;
  --color-secondary: #5b21b6;
  --color-accent: #ddd6fe;
  --color-bg: #fefeff;
  --color-surface: #f5f3ff;
  --color-text: #2e1065;
  --color-text-muted: #7c6f9b;
  --color-border: #d8d0e8;
  --font-main: 'Verdana', 'Geneva', 'Tahoma', sans-serif;
  --max-width: 1100px;
  --radius: 8px;
  --radius-sm: 4px;
  --radius-lg: 12px;
  --shadow-sm: inset 0 1px 2px rgba(46, 16, 101, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(124, 58, 237, 0.1), 0 2px 4px -1px rgba(124, 58, 237, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(124, 58, 237, 0.15), 0 4px 6px -2px rgba(124, 58, 237, 0.08);
  --shadow-inner: inset 0 2px 4px rgba(46, 16, 101, 0.08);
  --gradient-subtle: linear-gradient(135deg, #fefeff 0%, #f5f3ff 100%);
  --gradient-primary: linear-gradient(135deg, #7c3aed 0%, #5b21b6 100%);
  --gradient-accent: linear-gradient(135deg, #ddd6fe 0%, #e9d5ff 100%);
}

/* Base Typography */
body {
  font-family: var(--font-main);
  font-size: 16px;
  color: var(--color-text);
  background: var(--gradient-subtle);
  background-attachment: fixed;
}

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

h1 {
  font-size: 2.25rem;
  margin-bottom: 1rem;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

h2 {
  font-size: 1.875rem;
  border-bottom: 3px solid var(--color-accent);
  padding-bottom: 0.5rem;
  margin-top: 1.5em;
}

h3 {
  font-size: 1.5rem;
  color: var(--color-primary);
}

h4 {
  font-size: 1.25rem;
}

h5 {
  font-size: 1.125rem;
}

h6 {
  font-size: 1rem;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

p {
  margin-bottom: 1.25em;
  font-size: 1rem;
  line-height: 1.75;
}

a {
  color: var(--color-primary);
  text-decoration: none;
  font-weight: 600;
  border-bottom: 2px solid transparent;
  transition: color 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
}

a:hover {
  color: var(--color-secondary);
  border-bottom-color: var(--color-secondary);
}

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

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

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

blockquote {
  margin: 2rem 0;
  padding: 1.5rem 1.5rem 1.5rem 2rem;
  background: var(--color-surface);
  border-left: 5px solid var(--color-primary);
  border-radius: var(--radius);
  box-shadow: var(--shadow-inner);
  font-size: 1.125rem;
  font-style: italic;
  color: var(--color-text-muted);
  position: relative;
}

blockquote::before {
  content: '"';
  font-size: 4rem;
  color: var(--color-accent);
  position: absolute;
  top: -10px;
  left: 10px;
  line-height: 1;
  font-family: Georgia, serif;
}

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

/* Site Header */
.site-header {
  background: var(--gradient-primary);
  color: white;
  padding: 2rem 0;
  box-shadow: var(--shadow-lg);
  position: sticky;
  top: 0;
  z-index: 1000;
  border-bottom: 4px solid var(--color-secondary);
}

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

.site-header h1 {
  font-size: 1.75rem;
  margin: 0;
  color: white;
  background: none;
  -webkit-text-fill-color: white;
  letter-spacing: 0.02em;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Site Navigation */
.site-nav {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.site-nav a {
  color: white;
  padding: 0.625rem 1.25rem;
  border-radius: var(--radius);
  border-bottom: none;
  background: rgba(255, 255, 255, 0.1);
  box-shadow: var(--shadow-inner);
  font-weight: 600;
  font-size: 0.9375rem;
  transition: background-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.site-nav a:hover {
  background: rgba(255, 255, 255, 0.2);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.15);
  transform: translateY(-1px);
  color: white;
}

.site-nav a:focus-visible {
  outline: 2px solid white;
  outline-offset: 2px;
}

/* Breadcrumbs */
.breadcrumbs {
  padding: 1rem 0;
  font-size: 0.875rem;
  color: var(--color-text-muted);
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
}

.breadcrumbs a {
  color: var(--color-primary);
  font-weight: 500;
  border-bottom: 1px solid transparent;
}

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

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

/* Site Main */
.site-main {
  min-height: 60vh;
  padding: 3rem 0;
}

/* Card Component */
.card {
  background: white;
  border-radius: var(--radius-lg);
  padding: 2rem;
  margin-bottom: 2rem;
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-md);
  transition: box-shadow 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--gradient-primary);
}

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

.card h2 {
  margin-top: 0;
}

.card h3 {
  margin-top: 0;
}

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

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

thead th {
  padding: 1rem;
  text-align: left;
  font-weight: 700;
  font-size: 0.9375rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 2px solid var(--color-secondary);
}

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

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

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

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

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

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

/* Details/Summary (Accordion) */
details {
  background: white;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s ease;
}

details:hover {
  box-shadow: var(--shadow-md);
}

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

summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--color-primary);
  padding: 0.5rem;
  border-radius: var(--radius-sm);
  transition: background-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: '▶';
  display: inline-block;
  transition: transform 0.2s ease;
  font-size: 0.75rem;
  color: var(--color-primary);
}

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

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

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

details div {
  padding: 1rem 0.5rem 0.5rem 2rem;
  color: var(--color-text);
  animation: slideDown 0.2s ease;
}

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

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

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

/* Site Footer */
.site-footer {
  background: var(--color-secondary);
  color: white;
  padding: 3rem 0 2rem;
  margin-top: 4rem;
  border-top: 4px solid var(--color-primary);
  box-shadow: 0 -4px 6px -1px rgba(124, 58, 237, 0.1);
}

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

.site-footer a:hover {
  color: white;
  border-bottom-color: white;
}

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

/* Responsive - Mobile First Base (already applied above) */

/* Tablet - 768px */
@media (min-width: 768px) {
  h1 {
    font-size: 3rem;
  }
  
  h2 {
    font-size: 2.25rem;
  }
  
  h3 {
    font-size: 1.75rem;
  }
  
  .site-header h1 {
    font-size: 2.25rem;
  }
  
  .site-nav {
    gap: 1rem;
  }
  
  .site-nav a {
    padding: 0.75rem 1.5rem;
  }
  
  .card {
    padding: 2.5rem;
  }
  
  table {
    font-size: 1rem;
  }
  
  .container {
    padding: 0 2rem;
  }
  
  .site-main {
    padding: 4rem 0;
  }
}

/* Desktop - 1024px */
@media (min-width: 1024px) {
  body {
    font-size: 18px;
  }
  
  h1 {
    font-size: 3.5rem;
  }
  
  h2 {
    font-size: 2.5rem;
  }
  
  .site-header {
    padding: 2.5rem 0;
  }
  
  .site-header h1 {
    font-size: 2.5rem;
  }
  
  .site-nav a {
    font-size: 1rem;
  }
  
  .card {
    padding: 3rem;
  }
  
  blockquote {
    margin: 2.5rem 0;
    padding: 2rem 2rem 2rem 2.5rem;
  }
  
  .site-main {
    padding: 5rem 0;
  }
}

/* Reduced Motion */
@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;
  }
  
  summary::before {
    transition: none;
  }
  
  details div {
    animation: none;
  }
  
  .card:hover {
    transform: none;
  }
  
  .site-nav a:hover {
    transform: none;
  }
}

/* Print Styles */
@media print {
  .site-header,
  .site-nav,
  .site-footer,
  .breadcrumbs {
    display: none;
  }
  
  .site-main {
    max-width: 100%;
    padding: 0;
  }
  
  .container {
    max-width: 100%;
    padding: 0;
  }
  
  .card {
    box-shadow: none;
    border: 1px solid #000;
    page-break-inside: avoid;
  }
  
  a {
    color: #000;
    text-decoration: underline;
  }
  
  body {
    background: white;
    color: #000;
  }
  
  h1, h2, h3, h4, h5, h6 {
    color: #000;
    page-break-after: avoid;
  }
  
  table {
    page-break-inside: avoid;
  }
}