@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@200;300;400;500;600;700;800&display=swap');

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

:root {
  /* Material 3 Color Tokens */
  --md-sys-color-primary: #6750A4;
  --md-sys-color-primary-container: #EADDFF;
  --md-sys-color-on-primary: #FFFFFF;
  --md-sys-color-on-primary-container: #21005D;
  --md-sys-color-secondary: #625B71;
  --md-sys-color-secondary-container: #E8DEF8;
  --md-sys-color-on-secondary-container: #1D192B;
  --md-sys-color-tertiary: #7D5260;
  --md-sys-color-tertiary-container: #FFD8E4;
  --md-sys-color-surface: #FEF7FF;
  --md-sys-color-surface-variant: #F7F2FA;
  --md-sys-color-surface-container: #F3EDF7;
  --md-sys-color-surface-container-high: #ECE6F0;
  --md-sys-color-surface-container-highest: #E6E0E9;
  --md-sys-color-on-surface: #1D1B20;
  --md-sys-color-on-surface-variant: #49454F;
  --md-sys-color-outline: #79747E;
  --md-sys-color-outline-variant: #CAC4D0;
  --md-sys-color-error: #BA1A1A;
  --md-sys-color-error-container: #FFDAD6;
  
  /* Material 3 Elevation */
  --md-sys-elevation-1: 0px 1px 2px 0px rgba(0, 0, 0, 0.3), 0px 1px 3px 1px rgba(0, 0, 0, 0.15);
  --md-sys-elevation-2: 0px 1px 2px 0px rgba(0, 0, 0, 0.3), 0px 2px 6px 2px rgba(0, 0, 0, 0.15);
  --md-sys-elevation-3: 0px 1px 3px 0px rgba(0, 0, 0, 0.3), 0px 4px 8px 3px rgba(0, 0, 0, 0.15);
  --md-sys-elevation-4: 0px 2px 3px 0px rgba(0, 0, 0, 0.3), 0px 6px 10px 4px rgba(0, 0, 0, 0.15);
  
  /* Shape */
  --md-sys-shape-corner-none: 0px;
  --md-sys-shape-corner-extra-small: 4px;
  --md-sys-shape-corner-small: 8px;
  --md-sys-shape-corner-medium: 12px;
  --md-sys-shape-corner-large: 16px;
  --md-sys-shape-corner-extra-large: 28px;
}

body {
  font-family: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--md-sys-color-surface);
  color: var(--md-sys-color-on-surface);
  line-height: 1.5;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Minimal particles */
.particle {
  position: fixed;
  width: 4px;
  height: 4px;
  background: var(--md-sys-color-primary);
  border-radius: 50%;
  opacity: 0.1;
  pointer-events: none;
  animation: float 8s ease-in-out infinite;
}

.particle:nth-child(1) { top: 10%; left: 10%; animation-delay: 0s; }
.particle:nth-child(2) { top: 20%; left: 80%; animation-delay: 2s; }
.particle:nth-child(3) { top: 60%; left: 15%; animation-delay: 4s; }
.particle:nth-child(4) { top: 80%; left: 70%; animation-delay: 1s; }
.particle:nth-child(5) { top: 40%; left: 90%; animation-delay: 3s; }

@keyframes float {
  0%, 100% { 
    transform: translateY(0px) scale(1); 
    opacity: 0.1; 
  }
  50% { 
    transform: translateY(-20px) scale(1.2); 
    opacity: 0.3; 
  }
}

/* Header - Material 3 Surface */
header {
  background: var(--md-sys-color-surface-container);
  border: 1px solid var(--md-sys-color-outline-variant);
  margin: 24px;
  border-radius: var(--md-sys-shape-corner-extra-large);
  padding: 40px 32px;
  text-align: center;
  box-shadow: var(--md-sys-elevation-1);
  position: relative;
  animation: slideInDown 0.6s cubic-bezier(0.2, 0, 0, 1);
}

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

.logo-container {
  margin-bottom: 8px;
}

header h1 {
  font-size: clamp(2.5rem, 5vw, 3.5rem);
  font-weight: 700;
  color: var(--md-sys-color-primary);
  letter-spacing: -0.02em;
  margin: 0;
}

.tagline {
  font-size: 14px;
  color: var(--md-sys-color-on-surface-variant);
  font-weight: 400;
  margin-bottom: 32px;
  letter-spacing: 0.1px;
}

/* Material 3 Navigation Pills */
nav {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
}

nav a {
  color: var(--md-sys-color-on-surface-variant);
  text-decoration: none;
  font-weight: 500;
  font-size: 14px;
  padding: 10px 24px;
  border-radius: var(--md-sys-shape-corner-large);
  background: transparent;
  border: 1px solid var(--md-sys-color-outline-variant);
  transition: all 0.2s cubic-bezier(0.2, 0, 0, 1);
  position: relative;
  letter-spacing: 0.1px;
}

nav a:hover {
  background: var(--md-sys-color-secondary-container);
  color: var(--md-sys-color-on-secondary-container);
  border-color: var(--md-sys-color-outline);
  box-shadow: var(--md-sys-elevation-1);
}

nav a.active {
  background: var(--md-sys-color-primary-container);
  color: var(--md-sys-color-on-primary-container);
  border-color: var(--md-sys-color-primary);
}

/* Main Content */
main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px;
}

/* Welcome Section - Material 3 Card */
.welcome-section {
  background: var(--md-sys-color-surface-container);
  border: 1px solid var(--md-sys-color-outline-variant);
  border-radius: var(--md-sys-shape-corner-large);
  padding: 40px;
  margin-bottom: 40px;
  text-align: center;
  box-shadow: var(--md-sys-elevation-1);
  animation: fadeInUp 0.6s cubic-bezier(0.2, 0, 0, 1) 0.2s both;
}

@keyframes fadeInUp {
  from { 
    opacity: 0; 
    transform: translateY(24px); 
  }
  to { 
    opacity: 1; 
    transform: translateY(0); 
  }
}

.welcome-section h2 {
  font-size: clamp(1.75rem, 3.5vw, 2.25rem);
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--md-sys-color-on-surface);
  letter-spacing: -0.01em;
}

.welcome-section p {
  font-size: 16px;
  color: var(--md-sys-color-on-surface-variant);
  line-height: 1.6;
  max-width: 720px;
  margin: 0 auto;
  font-weight: 400;
}

/* Material 3 Cards Grid */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 24px;
  margin-top: 40px;
}

.card {
  background: var(--md-sys-color-surface-container);
  border: 1px solid var(--md-sys-color-outline-variant);
  border-radius: var(--md-sys-shape-corner-large);
  padding: 24px;
  transition: all 0.3s cubic-bezier(0.2, 0, 0, 1);
  position: relative;
  box-shadow: var(--md-sys-elevation-1);
  animation: fadeInUp 0.6s cubic-bezier(0.2, 0, 0, 1) both;
}

.card:nth-child(1) { animation-delay: 0.1s; }
.card:nth-child(2) { animation-delay: 0.15s; }
.card:nth-child(3) { animation-delay: 0.2s; }
.card:nth-child(4) { animation-delay: 0.25s; }
.card:nth-child(5) { animation-delay: 0.3s; }

.card:hover {
  box-shadow: var(--md-sys-elevation-3);
  transform: translateY(-2px);
  border-color: var(--md-sys-color-outline);
}

.card-icon {
  font-size: 40px;
  margin-bottom: 16px;
  display: block;
  opacity: 0.9;
}

.card h3 {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--md-sys-color-on-surface);
  letter-spacing: -0.01em;
}

.card h3 a {
  text-decoration: none;
  color: inherit;
  transition: color 0.2s cubic-bezier(0.2, 0, 0, 1);
}

.card:hover h3 a {
  color: var(--md-sys-color-primary);
}

.card p {
  color: var(--md-sys-color-on-surface-variant);
  line-height: 1.5;
  font-size: 14px;
  font-weight: 400;
}

/* Footer - Material 3 Surface */
footer {
  text-align: center;
  margin: 40px 24px 24px;
  padding: 24px;
  background: var(--md-sys-color-surface-container);
  border: 1px solid var(--md-sys-color-outline-variant);
  border-radius: var(--md-sys-shape-corner-large);
  color: var(--md-sys-color-on-surface-variant);
  font-size: 14px;
  font-weight: 400;
  box-shadow: var(--md-sys-elevation-1);
  animation: fadeInUp 0.6s cubic-bezier(0.2, 0, 0, 1) 0.4s both;
}

/* Content Pages Styling */
.content-page {
  max-width: 800px;
  margin: 0 auto;
  padding: 24px;
}

.content-page h1 {
  font-size: clamp(2rem, 4vw, 2.5rem);
  font-weight: 700;
  color: var(--md-sys-color-on-surface);
  margin-bottom: 8px;
  letter-spacing: -0.02em;
}

.content-page h2 {
  font-size: 24px;
  font-weight: 600;
  color: var(--md-sys-color-on-surface);
  margin: 32px 0 16px;
  letter-spacing: -0.01em;
}

.content-page h3 {
  font-size: 20px;
  font-weight: 600;
  color: var(--md-sys-color-on-surface);
  margin: 24px 0 12px;
}

.content-page p {
  font-size: 16px;
  line-height: 1.6;
  color: var(--md-sys-color-on-surface-variant);
  margin-bottom: 16px;
  font-weight: 400;
}

.content-page ul, .content-page ol {
  margin: 16px 0;
  padding-left: 24px;
  color: var(--md-sys-color-on-surface-variant);
}

.content-page li {
  margin-bottom: 8px;
  line-height: 1.5;
}

.content-page a {
  color: var(--md-sys-color-primary);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s cubic-bezier(0.2, 0, 0, 1);
}

.content-page a:hover {
  color: var(--md-sys-color-on-primary-container);
  text-decoration: underline;
}

/* Content Cards for structured content */
.content-card {
  background: var(--md-sys-color-surface-container);
  border: 1px solid var(--md-sys-color-outline-variant);
  border-radius: var(--md-sys-shape-corner-large);
  padding: 24px;
  margin: 24px 0;
  box-shadow: var(--md-sys-elevation-1);
}

.content-card h3 {
  color: var(--md-sys-color-primary);
  margin-top: 0;
}

/* FAQ Specific Styling */
.faq-item {
  background: var(--md-sys-color-surface-container);
  border: 1px solid var(--md-sys-color-outline-variant);
  border-radius: var(--md-sys-shape-corner-medium);
  margin-bottom: 16px;
  overflow: hidden;
  transition: all 0.2s cubic-bezier(0.2, 0, 0, 1);
}

.faq-question {
  background: transparent;
  border: none;
  width: 100%;
  padding: 20px 24px;
  text-align: left;
  font-size: 16px;
  font-weight: 500;
  color: var(--md-sys-color-on-surface);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background-color 0.2s cubic-bezier(0.2, 0, 0, 1);
  font-family: 'Manrope', sans-serif;
}

.faq-question:hover {
  background: var(--md-sys-color-surface-container-high);
}

.faq-answer {
  padding: 0 24px;
  max-height: 0;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.2, 0, 0, 1);
  color: var(--md-sys-color-on-surface-variant);
}

.faq-item.open .faq-answer {
  padding: 24px;
  max-height: 200px;
}

.faq-icon {
  transition: transform 0.3s cubic-bezier(0.2, 0, 0, 1);
  font-size: 20px;
}

.faq-item.open .faq-icon {
  transform: rotate(180deg);
}

/* Code blocks */
.content-page pre {
  background: var(--md-sys-color-surface-container-high);
  border: 1px solid var(--md-sys-color-outline-variant);
  border-radius: var(--md-sys-shape-corner-small);
  padding: 16px;
  margin: 16px 0;
  overflow-x: auto;
  font-family: 'SF Mono', Monaco, 'Cascadia Code', monospace;
  font-size: 14px;
  color: var(--md-sys-color-on-surface);
}

.content-page code {
  background: var(--md-sys-color-surface-container-high);
  padding: 2px 6px;
  border-radius: var(--md-sys-shape-corner-extra-small);
  font-family: 'SF Mono', Monaco, 'Cascadia Code', monospace;
  font-size: 13px;
  color: var(--md-sys-color-on-surface);
}

/* Tables */
.content-page table {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0;
  background: var(--md-sys-color-surface-container);
  border-radius: var(--md-sys-shape-corner-medium);
  overflow: hidden;
  box-shadow: var(--md-sys-elevation-1);
}

.content-page th {
  background: var(--md-sys-color-surface-container-high);
  color: var(--md-sys-color-on-surface);
  font-weight: 600;
  padding: 16px;
  text-align: left;
  font-size: 14px;
}

.content-page td {
  padding: 16px;
  border-top: 1px solid var(--md-sys-color-outline-variant);
  font-size: 14px;
  color: var(--md-sys-color-on-surface-variant);
}

/* Buttons and Interactive Elements */
.btn-primary {
  background: var(--md-sys-color-primary);
  color: var(--md-sys-color-on-primary);
  border: none;
  padding: 12px 24px;
  border-radius: var(--md-sys-shape-corner-large);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.2, 0, 0, 1);
  font-family: 'Manrope', sans-serif;
  letter-spacing: 0.1px;
}

.btn-primary:hover {
  box-shadow: var(--md-sys-elevation-2);
  transform: translateY(-1px);
}

.btn-secondary {
  background: transparent;
  color: var(--md-sys-color-primary);
  border: 1px solid var(--md-sys-color-outline);
  padding: 12px 24px;
  border-radius: var(--md-sys-shape-corner-large);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.2, 0, 0, 1);
  font-family: 'Manrope', sans-serif;
  letter-spacing: 0.1px;
}

.btn-secondary:hover {
  background: var(--md-sys-color-primary-container);
  border-color: var(--md-sys-color-primary);
}

/* Alert/Notice components */
.notice {
  background: var(--md-sys-color-tertiary-container);
  color: var(--md-sys-color-on-surface);
  border-radius: var(--md-sys-shape-corner-medium);
  padding: 16px 20px;
  margin: 20px 0;
  border-left: 4px solid var(--md-sys-color-tertiary);
}

.notice-warning {
  background: var(--md-sys-color-error-container);
  border-left-color: var(--md-sys-color-error);
}

/* Back to top button */
.back-to-top {
  position: fixed;
  bottom: 48px;
  right: 48px;
  width: 56px;
  height: 56px;
  background: var(--md-sys-color-primary);
  color: var(--md-sys-color-on-primary);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: var(--md-sys-elevation-3);
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s cubic-bezier(0.2, 0, 0, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  z-index: 100;
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
}

.back-to-top:hover {
  transform: translateY(-2px);
  box-shadow: var(--md-sys-elevation-4);
}

/* Responsive Design */
@media (max-width: 768px) {
  header, main, footer {
    margin: 16px;
    padding: 24px;
  }
  
  .cards {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  
  nav {
    gap: 6px;
  }
  
  nav a {
    padding: 8px 16px;
    font-size: 13px;
  }

  .welcome-section {
    padding: 32px 24px;
  }

  .content-page {
    padding: 16px;
  }

  .back-to-top {
    bottom: 16px;
    right: 16px;
    width: 48px;
    height: 48px;
    font-size: 20px;
  }
}

@media (max-width: 480px) {
  header, main, footer {
    margin: 12px;
    padding: 20px;
  }

  .welcome-section {
    padding: 24px 20px;
  }

  nav a {
    padding: 6px 12px;
    font-size: 12px;
  }

  .card {
    padding: 20px;
  }

  .card-icon {
    font-size: 32px;
  }
}

/* Dark mode support (auto-detects system preference) */
@media (prefers-color-scheme: dark) {
  :root {
    --md-sys-color-primary: #D0BCFF;
    --md-sys-color-primary-container: #4F378B;
    --md-sys-color-on-primary: #371E73;
    --md-sys-color-on-primary-container: #EADDFF;
    --md-sys-color-secondary: #CCC2DC;
    --md-sys-color-secondary-container: #4A4458;
    --md-sys-color-on-secondary-container: #E8DEF8;
    --md-sys-color-tertiary: #EFB8C8;
    --md-sys-color-tertiary-container: #633B48;
    --md-sys-color-surface: #141218;
    --md-sys-color-surface-variant: #1D1B20;
    --md-sys-color-surface-container: #211F26;
    --md-sys-color-surface-container-high: #2B2930;
    --md-sys-color-surface-container-highest: #36343B;
    --md-sys-color-on-surface: #E6E0E9;
    --md-sys-color-on-surface-variant: #CAC4D0;
    --md-sys-color-outline: #938F99;
    --md-sys-color-outline-variant: #49454F;
    --md-sys-color-error: #F2B8B5;
    --md-sys-color-error-container: #8C1D18;
  }
}

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