/* CSS Reset & Base */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  /* Color Palette - Neutral Bento Grid Theme */
  --color-background: #f5f5f5;
  --color-card: #ffffff;
  --color-text: #1a1a1a;
  --color-text-muted: #666666;
  --color-border: #e0e0e0;
  --color-accent: #2563eb;
  --color-accent-hover: #1d4ed8;
  --color-code-bg: #f8f9fa;
  --color-requirement-bg: #f0f4f8;
  --color-pitfall-bg: #fef3f2;

  /* Typography */
  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-mono: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;

  /* Spacing */
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 1.5rem;
  --space-lg: 2rem;
  --space-xl: 3rem;
  --space-2xl: 4rem;

  /* Layout */
  --container-max: 1400px;
  --border-radius: 12px;
  --border-width: 1px;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-sans);
  color: var(--color-text);
  background-color: var(--color-background);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Bento Grid Container */
.bento-container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: var(--space-lg);
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: var(--space-md);
  grid-auto-rows: minmax(100px, auto);
}

/* Bento Grid Items - Asymmetric Sizes */
.bento-hero {
  grid-column: 1 / -1;
  grid-row: span 3;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: var(--space-2xl);
  border-radius: var(--border-radius);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.bento-intro {
  grid-column: 1 / -1;
  grid-row: span 2;
  background: var(--color-card);
  padding: var(--space-xl);
  border-radius: var(--border-radius);
  border: var(--border-width) solid var(--color-border);
}

.bento-card {
  background: var(--color-card);
  padding: var(--space-xl);
  border-radius: var(--border-radius);
  border: var(--border-width) solid var(--color-border);
  grid-column: span 12;
}

/* Bento Size Variations */
.bento-wide {
  grid-column: span 12;
  grid-row: span 4;
}

.bento-tall {
  grid-column: span 12;
  grid-row: span 5;
}

.bento-medium {
  grid-column: span 12;
  grid-row: span 2;
}

.bento-cta {
  grid-column: 1 / -1;
  grid-row: span 3;
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  padding: var(--space-2xl);
  border-radius: var(--border-radius);
  color: white;
}

/* Tablet Layout */
@media (min-width: 768px) {
  .bento-card {
    grid-column: span 6;
  }

  .bento-wide {
    grid-column: span 12;
  }

  .bento-tall {
    grid-column: span 6;
  }

  .bento-medium {
    grid-column: span 8;
  }
}

/* Desktop Layout */
@media (min-width: 1024px) {
  .bento-container {
    padding: var(--space-2xl);
    gap: var(--space-lg);
  }

  .bento-card {
    grid-column: span 4;
  }

  .bento-wide {
    grid-column: span 8;
  }

  .bento-tall {
    grid-column: span 4;
  }

  .bento-medium {
    grid-column: span 6;
  }
}

/* Typography */
h1 {
  font-size: 3rem;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: var(--space-md);
}

h2 {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: var(--space-md);
  color: var(--color-text);
}

h3 {
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1.4;
  margin-top: var(--space-lg);
  margin-bottom: var(--space-sm);
  color: var(--color-text);
}

p {
  margin-bottom: var(--space-md);
  color: var(--color-text);
}

.hero-subtitle {
  font-size: 1.5rem;
  font-weight: 400;
  margin-bottom: var(--space-md);
  opacity: 0.95;
}

.hero-hook {
  font-size: 1.125rem;
  line-height: 1.6;
  max-width: 900px;
  margin: 0 auto;
  opacity: 0.9;
}

/* Code Blocks */
pre {
  background-color: var(--color-code-bg);
  border: var(--border-width) solid var(--color-border);
  border-radius: 8px;
  padding: var(--space-md);
  overflow-x: auto;
  margin: var(--space-md) 0;
  line-height: 1.5;
}

code {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  color: var(--color-text);
}

p code {
  background-color: var(--color-code-bg);
  padding: 0.125rem 0.375rem;
  border-radius: 4px;
  font-size: 0.9em;
}

/* Requirement Boxes */
.requirement-box {
  background-color: var(--color-requirement-bg);
  border-left: 4px solid var(--color-accent);
  padding: var(--space-md);
  margin: var(--space-md) 0;
  border-radius: 4px;
}

.requirement-box h3 {
  margin-top: 0;
  color: var(--color-accent);
  font-size: 1.25rem;
}

.requirement-box p {
  margin-bottom: 0;
}

/* Pitfall Boxes */
.pitfall-box {
  background-color: var(--color-pitfall-bg);
  border-left: 4px solid #dc2626;
  padding: var(--space-md);
  margin: var(--space-md) 0;
  border-radius: 4px;
}

.pitfall-box h3 {
  margin-top: 0;
  color: #dc2626;
  font-size: 1.25rem;
}

.pitfall-box p {
  margin-bottom: 0;
}

/* CTA Section */
.cta-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-xl);
  max-width: 1000px;
  margin: 0 auto;
}

.cta-image {
  flex-shrink: 0;
}

.cta-image img {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  border: 4px solid white;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.cta-text h2 {
  color: white;
  font-size: 2.5rem;
  margin-bottom: var(--space-sm);
}

.cta-subtitle {
  font-size: 1.25rem;
  margin-bottom: var(--space-lg);
  opacity: 0.95;
}

.cta-text p {
  color: white;
  font-size: 1.125rem;
  line-height: 1.7;
  margin-bottom: var(--space-md);
}

.cta-button {
  display: inline-block;
  background-color: white;
  color: #f5576c;
  padding: var(--space-md) var(--space-xl);
  border-radius: 50px;
  font-size: 1.125rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  margin-top: var(--space-md);
}

.cta-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
  background-color: #fff;
}

@media (min-width: 768px) {
  .cta-content {
    flex-direction: row;
    text-align: left;
  }

  .cta-image img {
    width: 220px;
    height: 220px;
  }
}

/* Lists */
ul, ol {
  margin: var(--space-md) 0;
  padding-left: var(--space-xl);
}

li {
  margin-bottom: var(--space-sm);
  line-height: 1.7;
}

/* Links */
a {
  color: var(--color-accent);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--color-accent-hover);
  text-decoration: underline;
}

/* Responsive Typography */
@media (max-width: 768px) {
  h1 {
    font-size: 2rem;
  }

  h2 {
    font-size: 1.5rem;
  }

  h3 {
    font-size: 1.25rem;
  }

  .hero-subtitle {
    font-size: 1.25rem;
  }

  .hero-hook {
    font-size: 1rem;
  }

  .cta-text h2 {
    font-size: 2rem;
  }
}

/* Print Styles */
@media print {
  .bento-container {
    display: block;
  }

  .bento-card, .bento-intro, .bento-hero, .bento-cta {
    break-inside: avoid;
    page-break-inside: avoid;
    margin-bottom: var(--space-md);
  }

  .bento-hero {
    background: white;
    color: black;
    border: 2px solid black;
  }

  .bento-cta {
    background: white;
    color: black;
    border: 2px solid black;
  }

  .cta-button {
    border: 2px solid black;
  }

  pre {
    border: 1px solid #ccc;
    white-space: pre-wrap;
    word-wrap: break-word;
  }
}

/* Smooth Animations */
.bento-card, .bento-intro, .bento-hero, .bento-cta {
  animation: fadeInUp 0.6s ease-out;
}

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

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }

  html {
    scroll-behavior: auto;
  }
}

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