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

/* CSS Custom Properties - Neumorphism Color Palette */
:root {
  /* Primary Background - Soft UI base */
  --bg-primary: #E0E5EC;
  --bg-secondary: #ECEFF4;
  --bg-elevated: #F0F4F8;

  /* Text Colors */
  --text-primary: #2C3E50;
  --text-secondary: #546E7A;
  --text-muted: #78909C;
  --text-accent: #5C6BC0;

  /* Shadow Colors for Neumorphism */
  --shadow-light: #FFFFFF;
  --shadow-dark: #A3B1C6;

  /* Accent Colors */
  --accent-primary: #5C6BC0;
  --accent-hover: #7986CB;
  --accent-gradient-start: #5C6BC0;
  --accent-gradient-end: #7986CB;

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

  /* Border Radius */
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-xl: 32px;
  --radius-round: 50%;

  /* Typography Scale */
  --font-body: 'Quicksand', 'Nunito', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', sans-serif;
  --font-heading: 'Quicksand', 'Nunito', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', sans-serif;

  --font-size-xs: 0.875rem;
  --font-size-sm: 1rem;
  --font-size-base: 1.125rem;
  --font-size-lg: 1.25rem;
  --font-size-xl: 1.5rem;
  --font-size-2xl: 2rem;
  --font-size-3xl: 2.5rem;
  --font-size-4xl: 3rem;

  /* Line Heights */
  --line-height-tight: 1.25;
  --line-height-normal: 1.5;
  --line-height-relaxed: 1.7;

  /* Neumorphic Shadow Definitions */
  --neu-shadow-sm:
    4px 4px 8px var(--shadow-dark),
    -4px -4px 8px var(--shadow-light);

  --neu-shadow-md:
    8px 8px 16px var(--shadow-dark),
    -8px -8px 16px var(--shadow-light);

  --neu-shadow-lg:
    12px 12px 24px var(--shadow-dark),
    -12px -12px 24px var(--shadow-light);

  --neu-shadow-inset:
    inset 4px 4px 8px var(--shadow-dark),
    inset -4px -4px 8px var(--shadow-light);

  --neu-shadow-inset-soft:
    inset 2px 2px 4px var(--shadow-dark),
    inset -2px -2px 4px var(--shadow-light);
}

/* Base HTML and Body */
html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-body);
  font-size: var(--font-size-base);
  line-height: var(--line-height-relaxed);
  color: var(--text-primary);
  background-color: var(--bg-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Container */
.container {
  max-width: 900px;
  margin: 0 auto;
  padding: var(--spacing-lg);
}

/* Hero Section */
.hero {
  padding: var(--spacing-xxl) var(--spacing-lg);
  margin-bottom: var(--spacing-xxl);
  background: var(--bg-primary);
  border-radius: var(--radius-xl);
  box-shadow: var(--neu-shadow-lg);
  text-align: center;
}

.hero-content {
  max-width: 800px;
  margin: 0 auto;
}

.hero-title {
  font-family: var(--font-heading);
  font-size: var(--font-size-3xl);
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: var(--spacing-md);
  line-height: var(--line-height-tight);
}

.hero-subtitle {
  font-size: var(--font-size-lg);
  color: var(--text-secondary);
  font-weight: 400;
  line-height: var(--line-height-normal);
}

/* Article Content */
.content {
  margin-bottom: var(--spacing-xxl);
}

.section {
  background: var(--bg-primary);
  padding: var(--spacing-xl);
  margin-bottom: var(--spacing-xl);
  border-radius: var(--radius-lg);
  box-shadow: var(--neu-shadow-md);
}

.intro {
  background: var(--bg-elevated);
  padding: var(--spacing-xl);
  margin-bottom: var(--spacing-xl);
  border-radius: var(--radius-lg);
  box-shadow: var(--neu-shadow-sm);
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: var(--line-height-tight);
  margin-bottom: var(--spacing-md);
  color: var(--text-primary);
}

h2 {
  font-size: var(--font-size-2xl);
  margin-top: 0;
  padding-bottom: var(--spacing-sm);
  border-bottom: 2px solid var(--bg-secondary);
}

h3 {
  font-size: var(--font-size-xl);
  margin-top: var(--spacing-lg);
  margin-bottom: var(--spacing-sm);
  color: var(--text-secondary);
}

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

strong {
  font-weight: 700;
  color: var(--text-primary);
}

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

ul li, ol li {
  margin-bottom: var(--spacing-sm);
  color: var(--text-primary);
}

ul {
  list-style-type: none;
}

ul li::before {
  content: "•";
  color: var(--accent-primary);
  font-weight: bold;
  display: inline-block;
  width: 1em;
  margin-left: -1em;
}

/* Blockquotes */
blockquote {
  background: var(--bg-primary);
  border-left: 4px solid var(--accent-primary);
  padding: var(--spacing-md) var(--spacing-lg);
  margin: var(--spacing-lg) 0;
  border-radius: var(--radius-md);
  box-shadow: var(--neu-shadow-inset-soft);
  font-style: italic;
}

blockquote p {
  margin-bottom: var(--spacing-sm);
  color: var(--text-secondary);
}

blockquote p:last-child {
  margin-bottom: 0;
}

/* Code Blocks */
code {
  font-family: 'Fira Code', 'Consolas', 'Monaco', monospace;
  background: var(--bg-secondary);
  padding: 0.2em 0.4em;
  border-radius: var(--radius-sm);
  font-size: 0.9em;
  color: var(--text-primary);
  box-shadow: var(--neu-shadow-inset-soft);
}

pre {
  background: var(--bg-secondary);
  padding: var(--spacing-md);
  border-radius: var(--radius-md);
  overflow-x: auto;
  margin-bottom: var(--spacing-md);
  box-shadow: var(--neu-shadow-inset);
}

pre code {
  background: transparent;
  padding: 0;
  box-shadow: none;
}

/* Checklist Styles */
.checklist-group {
  margin-bottom: var(--spacing-lg);
}

.checklist-group h3 {
  margin-top: 0;
  margin-bottom: var(--spacing-md);
  font-size: var(--font-size-lg);
  color: var(--text-primary);
}

.checklist {
  background: var(--bg-elevated);
  padding: var(--spacing-md);
  border-radius: var(--radius-md);
  box-shadow: var(--neu-shadow-inset-soft);
}

.checklist li {
  position: relative;
  padding-left: var(--spacing-lg);
  margin-bottom: var(--spacing-sm);
}

.checklist li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--accent-primary);
  font-weight: bold;
  font-size: 1.2em;
}

/* Bookmark Section */
.bookmark-section {
  background: linear-gradient(135deg, var(--accent-gradient-start), var(--accent-gradient-end));
  color: white;
  text-align: center;
  padding: var(--spacing-xl);
}

.bookmark-box {
  background: rgba(255, 255, 255, 0.1);
  padding: var(--spacing-lg);
  border-radius: var(--radius-lg);
  box-shadow:
    8px 8px 16px rgba(0, 0, 0, 0.1),
    -8px -8px 16px rgba(255, 255, 255, 0.05);
}

.bookmark-box p {
  color: white;
  margin-bottom: var(--spacing-sm);
}

.bookmark-emphasis {
  font-size: var(--font-size-xl);
  font-weight: 700;
  margin-bottom: 0;
}

/* Call-to-Action Section */
.cta {
  background: var(--bg-primary);
  padding: var(--spacing-xxl) var(--spacing-xl);
  border-radius: var(--radius-xl);
  box-shadow: var(--neu-shadow-lg);
  margin-bottom: var(--spacing-xxl);
}

.cta-content {
  max-width: 700px;
  margin: 0 auto;
}

.cta-header {
  display: flex;
  align-items: center;
  gap: var(--spacing-lg);
  margin-bottom: var(--spacing-lg);
}

.cta-image {
  width: 120px;
  height: 120px;
  border-radius: var(--radius-round);
  box-shadow: var(--neu-shadow-md);
  object-fit: cover;
}

.cta-text h2 {
  font-size: var(--font-size-2xl);
  margin-bottom: var(--spacing-xs);
  border-bottom: none;
  padding-bottom: 0;
}

.cta-subtitle {
  font-size: var(--font-size-lg);
  color: var(--text-secondary);
  font-weight: 600;
  margin-bottom: 0;
}

.cta-body {
  margin-bottom: var(--spacing-xl);
}

.cta-body p {
  margin-bottom: var(--spacing-md);
  color: var(--text-primary);
}

.cta-button {
  display: inline-block;
  background: var(--bg-primary);
  color: var(--accent-primary);
  padding: var(--spacing-md) var(--spacing-xl);
  border-radius: var(--radius-lg);
  font-size: var(--font-size-lg);
  font-weight: 700;
  text-decoration: none;
  transition: all 0.3s ease;
  box-shadow: var(--neu-shadow-md);
  border: none;
  cursor: pointer;
}

.cta-button:hover {
  color: var(--accent-hover);
  box-shadow: var(--neu-shadow-lg);
  transform: translateY(-2px);
}

.cta-button:active {
  box-shadow: var(--neu-shadow-inset);
  transform: translateY(0);
}

/* Footer */
.footer {
  text-align: center;
  padding: var(--spacing-xl) var(--spacing-lg);
  color: var(--text-muted);
  font-size: var(--font-size-sm);
}

/* Responsive Design */
@media (max-width: 768px) {
  :root {
    --font-size-3xl: 2rem;
    --font-size-2xl: 1.75rem;
    --font-size-xl: 1.375rem;
    --spacing-xxl: 2.5rem;
  }

  .container {
    padding: var(--spacing-md);
  }

  .hero {
    padding: var(--spacing-xl) var(--spacing-md);
  }

  .hero-title {
    font-size: var(--font-size-2xl);
  }

  .section, .intro {
    padding: var(--spacing-lg);
  }

  .cta {
    padding: var(--spacing-xl) var(--spacing-md);
  }

  .cta-header {
    flex-direction: column;
    text-align: center;
  }

  .cta-image {
    width: 100px;
    height: 100px;
  }

  .cta-text h2 {
    font-size: var(--font-size-xl);
  }

  .cta-button {
    display: block;
    width: 100%;
    text-align: center;
  }
}

@media (max-width: 480px) {
  :root {
    --font-size-3xl: 1.75rem;
    --font-size-2xl: 1.5rem;
    --spacing-xxl: 2rem;
  }

  .hero-title {
    font-size: var(--font-size-xl);
  }

  .section, .intro {
    padding: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
  }

  .cta-image {
    width: 80px;
    height: 80px;
  }
}

/* Print Styles */
@media print {
  body {
    background: white;
    color: black;
  }

  .hero, .section, .cta, .intro {
    box-shadow: none;
    border: 1px solid #ddd;
  }

  .cta-button {
    border: 2px solid var(--accent-primary);
  }

  .footer {
    border-top: 1px solid #ddd;
  }

  a {
    text-decoration: underline;
  }

  a[href^="http"]:after {
    content: " (" attr(href) ")";
    font-size: 0.8em;
    color: #666;
  }
}

/* Smooth Transitions */
a, button, .cta-button {
  transition: all 0.3s ease;
}

/* Focus Styles for Accessibility */
a:focus, button:focus, .cta-button:focus {
  outline: 3px solid var(--accent-primary);
  outline-offset: 2px;
}

/* Selection Styles */
::selection {
  background-color: var(--accent-primary);
  color: white;
}

::-moz-selection {
  background-color: var(--accent-primary);
  color: white;
}
