/* Reset */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
ul { list-style: none; }
a { text-decoration: none; color: inherit; }
img, svg { max-width: 100%; display: block; }
button { background: none; border: none; cursor: pointer; font: inherit; color: inherit; }

/* Variables */
:root {
  --primary-deep-purple: #2B0F4C;
  --primary-gold: #F0C040;
  --accent-neon: #00D4AA;
  --mineral-gray: #7A7A7A;
  --mineral-moss: #5A7D3A;
  --mineral-terra: #C07A5A;
  --mineral-cream: #F5F0E8;
  --bg-dark: #1A0A2E;
  --text-light: #FFFFFF;
  --text-dark: #1A1A1A;
  --font-heading: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Consolas', 'Courier New', monospace;
  --radius: 16px;
  --radius-btn: 9999px;
  --transition: 0.3s cubic-bezier(0.25, 0.1, 0.25, 1);
  --shadow: 0 8px 24px rgba(0,0,0,0.4);
  --sidebar-width: 260px;
}

/* Global layout */
body {
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr;
  grid-template-rows: 1fr auto;
  min-height: 100vh;
  background: var(--bg-dark);
  color: var(--text-light);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
}

.skip-link {
  position: absolute;
  top: -100%;
  left: 8px;
  z-index: 9999;
  padding: 8px 16px;
  background: var(--primary-gold);
  color: var(--text-dark);
  font-weight: bold;
  border-radius: var(--radius-btn);
}
.skip-link:focus {
  top: 8px;
}

/* Header (sidebar) */
.site-header {
  grid-column: 1 / 2;
  grid-row: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 32px 16px;
  background: linear-gradient(180deg, var(--primary-deep-purple) 0%, #1a0a2e 100%);
  border-right: 1px solid rgba(240, 192, 64, 0.3);
  gap: 32px;
  height: 100vh;
  position: sticky;
  top: 0;
  z-index: 100;
  overflow-y: auto;
}

.site-header__brand {
  width: 100%;
  display: flex;
  justify-content: center;
}
.site-header__logo {
  display: inline-block;
}
.logo-svg text {
  font-family: var(--font-heading);
  fill: var(--primary-gold);
}

/* Mobile toggle button */
.site-header__nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 8px;
  cursor: pointer;
}
.site-header__nav-toggle-icon,
.site-header__nav-toggle-icon::before,
.site-header__nav-toggle-icon::after {
  content: '';
  display: block;
  width: 24px;
  height: 2px;
  background: var(--primary-gold);
  transition: var(--transition);
}
.site-header__nav-toggle-icon {
  position: relative;
}
.site-header__nav-toggle[aria-expanded="true"] .site-header__nav-toggle-icon {
  transform: rotate(45deg);
}
.site-header__nav-toggle[aria-expanded="true"] .site-header__nav-toggle-icon::before {
  transform: translateY(-7px) rotate(0deg);
  opacity: 0;
}
.site-header__nav-toggle[aria-expanded="true"] .site-header__nav-toggle-icon::after {
  transform: translateY(7px) rotate(-90deg);
}

/* Navigation */
.site-header__nav {
  width: 100%;
  flex: 1;
}
.site-header__nav-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.site-header__nav-item {
  width: 100%;
}
.site-header__nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  border-radius: var(--radius);
  color: var(--mineral-cream);
  font-family: var(--font-body);
  font-size: 14px;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}
.site-header__nav-link:hover,
.site-header__nav-link:focus-visible {
  background: rgba(240, 192, 64, 0.12);
  color: var(--primary-gold);
}
.site-header__nav-link[aria-current="page"] {
  background: rgba(240, 192, 64, 0.2);
  color: var(--primary-gold);
  font-weight: 600;
}
.site-header__nav-link[aria-current="page"]::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--primary-gold);
  border-radius: 0 3px 3px 0;
}
.nav-icon {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  stroke: currentColor;
  fill: none;
  transition: var(--transition);
}
.site-header__nav-link:hover .nav-icon,
.site-header__nav-link:focus-visible .nav-icon {
  stroke: var(--primary-gold);
}

/* CTA button */
.site-header__cta {
  width: 100%;
  display: flex;
  justify-content: center;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 24px;
  border-radius: var(--radius-btn);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 14px;
  line-height: 1;
  transition: var(--transition);
  cursor: pointer;
  white-space: nowrap;
}
.btn--primary {
  background: linear-gradient(135deg, var(--primary-gold), #d4a843);
  color: var(--text-dark);
  border: none;
}
.btn--primary:hover,
.btn--primary:focus-visible {
  transform: scale(1.05);
  box-shadow: 0 0 20px rgba(240, 192, 64, 0.4);
}
.btn--outline {
  background: transparent;
  color: var(--primary-gold);
  border: 1px solid var(--primary-gold);
}
.btn--outline:hover,
.btn--outline:focus-visible {
  background: var(--primary-gold);
  color: var(--text-dark);
}

/* Main content area */
#main-content {
  grid-column: 2 / -1;
  grid-row: 1 / 2;
  padding: 40px 48px;
  min-height: calc(100vh - 60px);
}

/* Footer */
.site-footer {
  grid-column: 2 / -1;
  grid-row: 2 / 3;
  background: var(--primary-deep-purple);
  border-top: 1px solid rgba(240, 192, 64, 0.2);
  padding: 32px 48px;
}
.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  gap: 40px;
  justify-content: space-between;
  max-width: 1200px;
  margin: 0 auto;
}
.site-footer__brand,
.site-footer__links,
.site-footer__contact,
.site-footer__icp {
  flex: 1 1 200px;
}
.site-footer__logo-text {
  font-family: var(--font-heading);
  font-size: 24px;
  color: var(--primary-gold);
  margin-bottom: 8px;
}
.site-footer__copyright {
  font-size: 14px;
  color: var(--mineral-gray);
}
.site-footer__links {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.site-footer__link {
  color: var(--mineral-cream);
  font-size: 14px;
  transition: var(--transition);
}
.site-footer__link:hover,
.site-footer__link:focus-visible {
  color: var(--primary-gold);
}
.site-footer__contact-item {
  font-size: 14px;
  color: var(--mineral-cream);
  margin-bottom: 4px;
}
.site-footer__contact-item a {
  color: var(--primary-gold);
}
.site-footer__contact-item a:hover {
  text-decoration: underline;
}
.site-footer__trust {
  margin-top: 12px;
  font-size: 13px;
  color: var(--mineral-gray);
  font-style: italic;
}
.site-footer__icp-text {
  color: var(--mineral-gray);
  font-size: 13px;
}

/* Scroll progress bar */
.progress-bar {
  position: fixed;
  top: 0;
  left: var(--sidebar-width);
  right: 0;
  height: 3px;
  background: rgba(240, 192, 64, 0.15);
  z-index: 999;
}
.progress-bar__fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--primary-gold), var(--accent-neon));
  transition: width 0.1s linear;
}

/* Utility: content container */
.content {
  max-width: 900px;
  margin: 0 auto;
}

/* Card base */
.card {
  background: rgba(43, 15, 76, 0.6);
  border: 1px solid rgba(240, 192, 64, 0.2);
  border-radius: var(--radius);
  padding: 24px;
  transition: var(--transition);
}
.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
  border-color: var(--primary-gold);
}

/* Breadcrumb */
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  font-size: 14px;
  font-family: var(--font-mono);
  color: var(--mineral-gray);
  margin-bottom: 24px;
}
.breadcrumb a {
  color: var(--primary-gold);
}
.breadcrumb a:hover {
  text-decoration: underline;
}
.breadcrumb span {
  color: var(--mineral-cream);
}

/* Responsive */
@media (max-width: 1024px) {
  :root {
    --sidebar-width: 220px;
  }
  #main-content {
    padding: 24px;
  }
  .site-footer {
    padding: 24px;
  }
}

@media (max-width: 768px) {
  body {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr auto;
  }
  .site-header {
    grid-column: 1 / -1;
    grid-row: 1 / 2;
    flex-direction: row;
    height: auto;
    position: relative;
    padding: 16px 24px;
    border-right: none;
    border-bottom: 1px solid rgba(240, 192, 64, 0.3);
    gap: 12px;
  }
  .site-header__brand {
    flex: 1;
    justify-content: flex-start;
  }
  .site-header__nav-toggle {
    display: flex;
  }
  .site-header__nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--primary-deep-purple);
    padding: 16px;
    border-bottom: 1px solid rgba(240, 192, 64, 0.3);
    display: none;
    z-index: 200;
  }
  .site-header__nav[data-open] {
    display: block;
  }
  .site-header__nav-list {
    flex-direction: column;
    gap: 8px;
  }
  .site-header__cta {
    display: none;
  }
  #main-content {
    grid-column: 1 / -1;
    grid-row: 2 / 3;
    padding: 24px 16px;
  }
  .site-footer {
    grid-column: 1 / -1;
    grid-row: 3 / 4;
    padding: 24px 16px;
  }
  .site-footer__inner {
    flex-direction: column;
    gap: 24px;
  }
  .progress-bar {
    left: 0;
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: 0s !important;
    animation-duration: 0s !important;
  }
  .progress-bar__fill {
    transition: none;
  }
  .card:hover {
    transform: none;
  }
  .btn--primary:hover {
    transform: none;
    box-shadow: none;
  }
}

/* Focus visible */
:focus-visible {
  outline: 2px solid var(--primary-gold);
  outline-offset: 2px;
}
