:root {
  /* Brand Colors - Paismo Purple Identity */
  --primary-color: #7C6AED; /* Soft but saturated Purple */
  --primary-hover: #6D28D9; /* Darker Purple for interaction */
  --primary-light: #DDD6FE; /* Light Purple for outlines/accents */
  
  /* Surfaces */
  --bg-color: #FFFFFF; /* Main background white */
  --surface-color: #F9FAFB; /* Secondary background */
  --card-bg: #FFFFFF;
  --card-highlight: #F5F3FF; /* Very light lavender for active cards/panels */
  
  /* Text */
  --text-main: #111827; /* Near black */
  --text-muted: #6B7280; /* Muted gray */
  --text-on-primary: #FFFFFF;

  /* Borders & Dividers */
  --border-color: #E5E7EB;
  --border-accent: #C4B5FD; /* Soft purple border */

  /* Code Blocks */
  --code-bg: #1F1B2E; /* Deep Purple-Black */
  --code-text: #F3F4F6;

  /* Spacing & Layout */
  --container-width: 1200px;
  --header-height: 80px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
}

/* Global Guardrails */
* {
  box-sizing: border-box;
}

html, body {
  max-width: 100vw;
  overflow-x: hidden;
  margin: 0;
  padding: 0;
  width: 100%;
}

img, svg {
  max-width: 100%;
  height: auto;
  display: block;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--bg-color);
  color: var(--text-main);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
  color: var(--text-main);
  font-weight: 700;
  margin-top: 0;
  margin-bottom: 1rem;
  letter-spacing: -0.02em;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

h1 { font-size: 3rem; line-height: 1.1; }
h2 { font-size: 2.25rem; }
h3 { font-size: 1.5rem; }

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

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

/* Header */
header {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 100;
  width: 100%;
}

.header-container {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 2rem;
  min-height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.logo {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

.logo img {
  height: 32px;
  width: auto;
}

.logo span {
  color: var(--primary-color);
}

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

.nav-links a {
  color: var(--text-muted);
  font-size: 0.95rem;
  font-weight: 500;
  white-space: nowrap;
}

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

.header-cta {
  display: flex;
  gap: 1rem;
  flex-shrink: 0;
}

/* Buttons */
.btn-primary {
  background-color: var(--primary-color);
  color: var(--text-on-primary);
  padding: 0.75rem 1.5rem;
  border-radius: 50px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.1s, background-color 0.2s;
  border: 1px solid transparent;
  white-space: nowrap;
}

.btn-primary:hover {
  background-color: var(--primary-hover);
  color: white;
  transform: translateY(-1px);
}

.btn-secondary {
  background-color: transparent;
  color: var(--text-main);
  padding: 0.75rem 1.5rem;
  border-radius: 50px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-color);
  transition: all 0.2s;
  white-space: nowrap;
}

/* Hero Section */
.hero {
  background: radial-gradient(circle at top right, #F5F3FF 0%, #FFFFFF 40%);
  padding: 6rem 0 7rem;
  text-align: center;
}

.hero p {
  font-size: 1.35rem;
  color: var(--text-muted);
  max-width: 700px;
  margin: 0 auto 3rem;
  line-height: 1.6;
}

.hero-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* Sections & Layout */
.container {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 2rem;
  width: 100%;
}

section {
  padding: 5rem 0;
}

.section-title-group {
  margin-bottom: 3rem;
  position: relative;
  padding-left: 1.5rem;
}

.section-title-group::before {
  content: '';
  position: absolute;
  left: 0;
  top: 5px;
  bottom: 5px;
  width: 4px;
  background-color: var(--primary-color);
  border-radius: 4px;
}

/* Cards */
.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2.5rem;
}

.card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  min-width: 0;
}

.card-icon {
  background: var(--card-highlight);
  color: var(--primary-color);
  width: 56px;
  height: 56px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.5rem;
}

/* Feature Panel */
.feature-panel {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
  background: var(--surface-color);
  border-radius: var(--radius-lg);
  padding: 4rem;
  border: 1px solid var(--border-color);
}

.feature-panel > div {
  min-width: 0;
}

.feature-list li {
  margin-bottom: 1rem;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  font-weight: 500;
}

/* Code Blocks */
pre {
  background: var(--code-bg);
  color: var(--code-text);
  padding: 2rem;
  border-radius: var(--radius-md);
  overflow-x: auto;
  font-size: 0.9rem;
  margin: 2rem 0;
  border: 1px solid #374151;
  white-space: pre;
}

/* Quick Start Section */
.quick-start-section {
  background-color: var(--surface-color);
  margin: 0 -2rem;
  padding: 5rem 2rem;
}

/* Docs Layout */
.docs-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 4rem;
  padding-top: 4rem;
  padding-bottom: 6rem;
  align-items: start;
}

.sidebar {
  position: sticky;
  top: 90px; /* Header height + buffer */
  align-self: start;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
}

.content {
  min-width: 0; /* Prevents grid blowout */
}

.sidebar-title {
  text-transform: uppercase;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 1rem;
  margin-top: 2rem;
  letter-spacing: 0.08em;
}

.sidebar-title:first-child {
  margin-top: 0;
}

.sidebar-nav a {
  display: block;
  padding: 0.6rem 0 0.6rem 1rem;
  color: var(--text-muted);
  border-left: 2px solid var(--border-color);
  font-size: 0.95rem;
  transition: all 0.2s;
}

.sidebar-nav a:hover {
  color: var(--primary-color);
  border-left-color: var(--primary-light);
  background: linear-gradient(90deg, var(--surface-color) 0%, transparent 100%);
}

.sidebar-nav a.active {
  color: var(--primary-color);
  font-weight: 600;
  border-left-color: var(--primary-color);
}

/* Docs Responsive */
@media (max-width: 1024px) {
  .docs-layout {
    grid-template-columns: 1fr;
    gap: 3rem;
    padding-top: 2rem;
  }

  .sidebar {
    position: static;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 2rem;
    height: auto;
    max-height: none;
  }
}

/* Footer */
footer {
  background: var(--surface-color);
  border-top: 1px solid var(--border-color);
  padding: 4rem 0;
  color: var(--text-muted);
  width: 100%;
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 2rem;
}

.footer-brand {
  flex-shrink: 0;
}

.footer-links {
  display: flex;
  gap: 2rem;
  flex-wrap: wrap;
}

.footer-links a {
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.2s;
}

.footer-links a:hover {
  color: var(--primary-color);
}

/* ============================================
   RESPONSIVE STYLES
   ============================================ */

@media (max-width: 1024px) {
  .feature-panel {
    gap: 2rem;
    padding: 3rem;
  }
}

@media (max-width: 768px) {
  h1 { font-size: 2.5rem; }
  h2 { font-size: 2rem; }
  
  .header-container {
    flex-direction: column;
    padding: 1.5rem;
    height: auto;
    gap: 1.5rem;
  }

  .logo {
    width: 100%;
    justify-content: center;
  }

  .nav-links {
    width: 100%;
    justify-content: center;
    padding: 0.5rem 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    gap: 1.25rem;
    scrollbar-width: none;
  }
  
  .nav-links::-webkit-scrollbar {
    display: none;
  }

  .header-cta {
    width: 100%;
    justify-content: center;
  }

  .header-cta .btn-primary {
    width: 100%;
    max-width: 300px;
  }

  .hero {
    padding: 4rem 1.5rem;
  }

  .hero p {
    font-size: 1.1rem;
  }

  .grid-3 {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .feature-panel {
    grid-template-columns: 1fr;
    padding: 2rem;
    gap: 2.5rem;
  }

  .card {
    padding: 2rem;
  }

  .quick-start-section {
    margin: 0 -1.5rem;
    padding: 3rem 1.5rem;
  }
  
  .footer-content {
    flex-direction: column;
    text-align: center;
    gap: 2.5rem;
  }

  .footer-links {
    justify-content: center;
    gap: 1.5rem;
  }
}

@media (max-width: 480px) {
  h1 { font-size: 2rem; }
  
  .container {
    padding: 0 1.25rem;
  }

  .section-title-group {
    padding-left: 1rem;
    margin-bottom: 2rem;
  }

  .hero-buttons {
    flex-direction: column;
    align-items: stretch;
  }

  .hero-buttons .btn-primary,
  .hero-buttons .btn-secondary {
    width: 100%;
  }

  pre {
    padding: 1rem;
    font-size: 0.8rem;
  }

  .feature-panel {
    padding: 1.5rem;
  }

  .card {
    padding: 1.5rem;
  }
}