:root {
  --md-sys-color-primary: #a8c7fa;
  --md-sys-color-on-primary: #000000;
  --md-sys-color-primary-container: #224488;
  --md-sys-color-on-primary-container: #d6e3ff;
  --md-sys-color-secondary: #bdc7dc;
  --md-sys-color-on-secondary: #273141;
  --md-sys-color-secondary-container: #3d4758;
  --md-sys-color-on-secondary-container: #d9e3f9;
  --md-sys-color-tertiary: #dfbbde;
  --md-sys-color-on-tertiary: #402843;
  --md-sys-color-tertiary-container: #583e5a;
  --md-sys-color-on-tertiary-container: #fcd7fa;
  --md-sys-color-error: #ffb4ab;
  --md-sys-color-on-error: #690005;
  --md-sys-color-error-container: #93000a;
  --md-sys-color-on-error-container: #ffdad6;
  --md-sys-color-background: #111318;
  --md-sys-color-on-background: #e2e2e9;
  --md-sys-color-surface: #111318;
  --md-sys-color-on-surface: #e2e2e9;
  --md-sys-color-surface-variant: #44474f;
  --md-sys-color-on-surface-variant: #c4c6d0;
  --md-sys-color-outline: #8e9099;
  --md-sys-color-outline-variant: #44474f;

  --font-family: 'Inter', 'Roboto', sans-serif;
  
  /* Custom glass tokens */
  --glass-bg: rgba(17, 19, 24, 0.6);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
  --glass-blur: blur(12px);
}

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

html, body {
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--md-sys-color-background);
  color: var(--md-sys-color-on-background);
  font-family: var(--font-family);
  line-height: 1.6;
  overflow-x: hidden;
  background-image: 
    radial-gradient(circle at 15% 50%, rgba(34, 68, 136, 0.2), transparent 25%),
    radial-gradient(circle at 85% 30%, rgba(88, 62, 90, 0.2), transparent 25%);
  background-attachment: fixed;
}

h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 1rem;
}

a {
  color: var(--md-sys-color-primary);
  text-decoration: none;
  transition: opacity 0.2s ease;
}

a:hover {
  opacity: 0.8;
}

.glass-panel {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
  border-radius: 24px;
}

/* Header */
header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(17, 19, 24, 0.8);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--glass-border);
}

.logo-container {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.logo-icon {
  font-size: 2rem;
  color: var(--md-sys-color-primary);
}

.logo-text {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  background: linear-gradient(90deg, var(--md-sys-color-primary), var(--md-sys-color-tertiary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

nav.nav-links {
  display: flex;
  gap: 1.5rem;
  align-items: center;
}

/* Fix for Material buttons padding */
.button-wrapper, .header-button {
  display: flex;
  align-items: center;
  justify-content: center;
}

md-filled-button, md-outlined-button {
  margin: 0;
  --md-sys-typescale-label-large-font: var(--font-family);
  font-family: var(--font-family);
  /* Ensure the button does not get squished by flexbox */
  flex-shrink: 0;
}

/* Hero Section */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 8rem 2rem 4rem;
  position: relative;
}

.hero h1 {
  font-size: 4rem;
  max-width: 900px;
  margin-bottom: 1.5rem;
  background: linear-gradient(to right, #ffffff, var(--md-sys-color-primary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero p {
  font-size: 1.25rem;
  color: var(--md-sys-color-secondary);
  max-width: 700px;
  margin-bottom: 3rem;
}

.hero-actions {
  display: flex;
  gap: 1rem;
}

/* Themes and Colors */
.theme-blue { background: rgba(34, 68, 136, 0.2); color: #a8c7fa; }
.theme-red { background: rgba(147, 0, 10, 0.2); color: #ffb4ab; }
.theme-green { background: rgba(0, 100, 50, 0.2); color: #6be092; }
.theme-yellow { background: rgba(120, 100, 0, 0.2); color: #ffe066; }
.theme-purple { background: rgba(88, 62, 90, 0.2); color: #dfbbde; }

.theme-border-blue { border-color: rgba(168, 199, 250, 0.3) !important; box-shadow: 0 0 20px rgba(168, 199, 250, 0.1); }
.theme-border-red { border-color: rgba(255, 180, 171, 0.3) !important; box-shadow: 0 0 20px rgba(255, 180, 171, 0.1); }
.theme-border-green { border-color: rgba(107, 224, 146, 0.3) !important; box-shadow: 0 0 20px rgba(107, 224, 146, 0.1); }
.theme-border-yellow { border-color: rgba(255, 224, 102, 0.3) !important; box-shadow: 0 0 20px rgba(255, 224, 102, 0.1); }
.theme-border-purple { border-color: rgba(223, 187, 222, 0.3) !important; box-shadow: 0 0 20px rgba(223, 187, 222, 0.1); }

.badges {
  margin-top: 3rem;
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: center;
}

.badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1.25rem;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 600;
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(4px);
}

/* Spotlights */
.spotlight {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1200px;
  margin: 6rem auto;
  padding: 0 2rem;
  gap: 4rem;
}

.spotlight.reverse {
  flex-direction: row-reverse;
}

.spotlight-content {
  flex: 1;
}

.spotlight-image-container {
  flex: 1.2;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--glass-border);
  background: var(--glass-bg);
  padding: 1rem;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.spotlight-image-container:hover {
  transform: scale(1.02);
}

.spotlight-image {
  width: 100%;
  border-radius: 8px;
  display: block;
}

.feature-icon {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  margin-bottom: 1.5rem;
  border: 1px solid var(--glass-border);
}

.feature-bullets {
  list-style: none;
  margin-top: 1.5rem;
}

.feature-bullets li {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
  color: var(--md-sys-color-on-surface-variant);
}

.feature-bullets .check {
  color: var(--md-sys-color-primary);
  font-size: 1.25rem;
}

/* Architecture Section */
.architecture-section {
  padding: 6rem 2rem;
  background: rgba(17, 19, 24, 0.4);
}

.arch-container {
  max-width: 1000px;
  margin: 0 auto;
}

.arch-visual {
  margin-top: 3rem;
  padding: 3rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 2rem;
}

.arch-block {
  flex: 1;
  min-width: 200px;
  padding: 2rem;
  background: var(--md-sys-color-surface-variant);
  border-radius: 16px;
  position: relative;
}

.arch-block h3 {
  color: var(--md-sys-color-primary);
  margin-bottom: 0.5rem;
}

.arch-arrow {
  color: var(--md-sys-color-outline);
  font-size: 2rem;
}

.text-center {
  text-align: center;
}

/* Docs Layout */
.docs-layout {
  display: flex;
  min-height: 100vh;
  padding-top: 80px; /* Header offset */
}

.docs-sidebar {
  width: 280px;
  position: fixed;
  top: 80px;
  bottom: 0;
  left: 0;
  overflow-y: auto;
  padding: 2rem;
  border-right: 1px solid var(--glass-border);
  background: var(--md-sys-color-background);
}

.docs-sidebar ul {
  list-style: none;
}

.docs-sidebar li {
  margin-bottom: 0.5rem;
}

.docs-sidebar a {
  display: block;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  color: var(--md-sys-color-on-surface-variant);
  transition: all 0.2s ease;
}

.docs-sidebar a:hover, .docs-sidebar a.active {
  background: var(--md-sys-color-secondary-container);
  color: var(--md-sys-color-on-secondary-container);
}

.docs-content {
  margin-left: 280px;
  flex: 1;
  padding: 3rem 4rem;
  max-width: 1000px;
}

.docs-content .lead {
  font-size: 1.25rem;
  color: var(--md-sys-color-secondary);
  margin-bottom: 2rem;
}

.docs-content h1 {
  font-size: 3rem;
  margin-bottom: 1rem;
  color: var(--md-sys-color-primary);
}

.docs-content h2 {
  font-size: 2rem;
  margin-top: 3.5rem;
  margin-bottom: 1.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--glass-border);
}

.docs-content h3 {
  font-size: 1.5rem;
  margin-top: 2rem;
  margin-bottom: 1rem;
}

.docs-content p, .docs-content li {
  color: var(--md-sys-color-on-surface);
  font-size: 1.1rem;
  margin-bottom: 1rem;
}

.docs-content ul, .docs-content ol {
  padding-left: 2rem;
  margin-bottom: 1.5rem;
}

.docs-content pre {
  background: var(--md-sys-color-surface-variant);
  padding: 1.5rem;
  border-radius: 12px;
  overflow-x: auto;
  margin-bottom: 1.5rem;
  border: 1px solid var(--glass-border);
}

.docs-content code {
  font-family: 'Fira Code', monospace;
  font-size: 0.9rem;
}

.docs-image {
  width: 100%;
  border-radius: 12px;
  margin: 1.5rem 0;
  border: 1px solid var(--glass-border);
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

/* Animations (Intersection Observer Targets) */
.fade-up {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.slide-in-left {
  opacity: 0;
  transform: translateX(-50px);
  transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.slide-in-right {
  opacity: 0;
  transform: translateX(50px);
  transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.visible {
  opacity: 1;
  transform: translate(0, 0);
}

/* Material Icons */
.material-icons {
  font-family: 'Material Icons';
  font-weight: normal;
  font-style: normal;
  font-size: 24px;
  display: inline-block;
  line-height: 1;
  text-transform: none;
  letter-spacing: normal;
  word-wrap: normal;
  white-space: nowrap;
  direction: ltr;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: 'liga';
}

@media (max-width: 992px) {
  .spotlight, .spotlight.reverse {
    flex-direction: column;
    gap: 2rem;
  }
}

@media (max-width: 768px) {
  .hero h1 { font-size: 2.5rem; }
  .arch-visual { flex-direction: column; }
  .arch-arrow { transform: rotate(90deg); }
  .docs-layout { flex-direction: column; }
  .docs-sidebar {
    position: static;
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--glass-border);
  }
  .docs-content {
    margin-left: 0;
    padding: 2rem;
  }
}
