:root {
  --color-bg: #F6F7FB;
  --color-surface: #FFFFFF;
  --color-text: #111827;
  --color-text-muted: #4B5563;
  --color-border: #D1D5DB;
  --color-primary: #2E3A8C;
  --color-secondary: #0F766E;
  --color-accent: #D97706;
  --radius: 0.375rem;
  --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
  --space: 1rem;
  --maxw: 1200px;
}

* {
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  line-height: 1.6;
  color: var(--color-text);
  background-color: var(--color-bg);
  margin: 0;
  padding: 0;
}

/* Swiss typography scale */
h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  line-height: 1.2;
  margin: 0 0 var(--space) 0;
}

h1 {
  font-size: 2.25rem;
  margin-bottom: 1.5rem;
}

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

h3 {
  font-size: 1.5rem;
}

p {
  margin: 0 0 var(--space) 0;
  line-height: 1.7;
}

/* Grid layout scaffolding */
body {
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-height: 100vh;
}

header {
  background-color: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  box-shadow: var(--shadow);
}

nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: var(--space);
}

.nav-brand a {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-primary);
  text-decoration: none;
}

.nav-links {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 1.5rem;
}

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

.nav-links a:hover,
.nav-links a:focus {
  color: var(--color-primary);
}

/* Focus-visible outlines */
a:focus-visible,
button:focus-visible,
details summary:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

/* Main content */
main {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: var(--space);
  background-color: var(--color-surface);
  box-shadow: var(--shadow);
}

article {
  max-width: 800px;
}

section {
  margin-bottom: 2rem;
}

/* Breadcrumbs */
.breadcrumbs {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  margin-bottom: 1.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--color-border);
}

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

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

/* Links */
a {
  color: var(--color-primary);
  transition: color 0.2s ease;
}

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

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

/* Tables with zebra rows and responsive design */
table {
  width: 100%;
  border-collapse: collapse;
  margin: var(--space) 0;
  background-color: var(--color-surface);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.table-container {
  overflow-x: auto;
  margin: var(--space) 0;
}

th, td {
  padding: 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--color-border);
}

th {
  background-color: var(--color-primary);
  color: white;
  font-weight: 600;
  position: sticky;
  top: 0;
  z-index: 1;
}

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

tbody tr:hover {
  background-color: rgba(46, 58, 140, 0.05);
}

/* Details/summary accordion styling */
details {
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  margin-bottom: var(--space);
  background-color: var(--color-surface);
  transition: box-shadow 0.2s ease;
}

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

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

summary {
  padding: var(--space);
  cursor: pointer;
  font-weight: 600;
  color: var(--color-primary);
  border-radius: var(--radius);
  transition: background-color 0.2s ease;
  position: relative;
}

summary:hover,
summary:focus {
  background-color: var(--color-bg);
}

summary::marker {
  content: none;
}

summary::before {
  content: "▶";
  position: absolute;
  right: var(--space);
  transition: transform 0.2s ease;
  color: var(--color-accent);
}

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

.faq-answer {
  padding: 0 var(--space) var(--space) var(--space);
  border-top: 1px solid var(--color-border);
}

/* Blockquotes */
blockquote {
  border-left: 4px solid var(--color-accent);
  padding-left: var(--space);
  margin: var(--space) 0;
  font-style: italic;
  color: var(--color-text-muted);
}

/* Footer */
footer {
  background-color: var(--color-primary);
  color: white;
  text-align: center;
  padding: var(--space);
  margin-top: 2rem;
}

/* Transitions */
a, button, details, summary {
  transition: all 0.2s ease;
}

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

/* Mobile-first responsive breakpoints */
@media (max-width: 767px) {
  :root {
    --space: 0.75rem;
  }
  
  h1 {
    font-size: 1.875rem;
  }
  
  h2 {
    font-size: 1.5rem;
  }
  
  nav {
    flex-direction: column;
    gap: var(--space);
  }
  
  .nav-links {
    gap: var(--space);
  }
  
  table {
    font-size: 0.875rem;
  }
  
  th, td {
    padding: 0.5rem;
  }
}

@media (min-width: 768px) {
  main {
    padding: 2rem;
    margin: 2rem auto;
    border-radius: var(--radius);
  }
  
  .table-container {
    overflow-x: visible;
  }
}

@media (min-width: 1024px) {
  :root {
    --space: 1.25rem;
  }
  
  main {
    padding: 3rem;
  }
  
  article {
    max-width: 900px;
  }
}

/* Surface elevation for cards and sections */
.faq-section details,
table,
main {
  box-shadow: var(--shadow);
}

/* High contrast for accessibility */
@media (prefers-contrast: high) {
  :root {
    --color-border: #000000;
    --color-text-muted: #000000;
  }
}