/* ── Reset & base ── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --purple:       #8246AF;
  --purple-dark:  #6a389a;
  --purple-light: #f3edf9;
  --purple-mid:   #e4d3f5;
  --text:         #2d2d2d;
  --text-muted:   #666;
  --white:        #ffffff;
  --sidebar-w:    260px;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Raleway', sans-serif;
  font-size: 1rem;
  color: var(--text);
  background: #faf7fd;
  display: flex;
  min-height: 100vh;
}

/* ── Sidebar ── */
#sidebar {
  width: var(--sidebar-w);
  background: var(--purple);
  color: white;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  overflow-y: auto;
  padding: 2rem 0;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.sidebar-logo {
  font-family: 'Montserrat', sans-serif;
  font-weight: 900;
  font-size: 1.1rem;
  padding: 0 1.5rem;
  letter-spacing: 0.01em;
}

#sidebar ul {
  list-style: none;
  display: flex;
  flex-direction: column;
}

#sidebar ul li a {
  display: block;
  padding: 0.6rem 1.5rem;
  color: rgba(255,255,255,0.85);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
  border-left: 3px solid transparent;
}

#sidebar ul li a:hover,
#sidebar ul li a.active {
  background: rgba(255,255,255,0.12);
  color: white;
  border-left-color: white;
}

/* ── Main content ── */
main {
  margin-left: var(--sidebar-w);
  flex: 1;
  min-width: 0;
  padding: 3rem 3.5rem 6rem;
}

main > * {
  max-width: 740px;
}

/* ── Sections ── */
.section {
  padding: 3rem 0;
  border-bottom: 1px solid var(--purple-mid);
}

.section:last-child {
  border-bottom: none;
}

/* ── Intro section ── */
.section--intro {
  text-align: center;
  padding-bottom: 3.5rem;
}

.intro-emoji {
  font-size: 5rem;
  margin-bottom: 1rem;
  line-height: 1;
}

.intro-sub {
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--purple);
  font-weight: 600;
  margin-bottom: 1.5rem !important;
}

/* ── Step label ── */
.step-label {
  display: inline-block;
  background: var(--purple);
  color: white;
  font-family: 'Montserrat', sans-serif;
  font-weight: 700;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  margin-bottom: 0.75rem;
}

/* ── Headings ── */
h1 {
  font-family: 'Montserrat', sans-serif;
  font-weight: 900;
  font-size: 2.5rem;
  color: var(--purple);
  margin-bottom: 0.5rem;
}

h2 {
  font-family: 'Montserrat', sans-serif;
  font-weight: 900;
  font-size: 1.75rem;
  color: var(--purple);
  margin-bottom: 1rem;
}

h3 {
  font-family: 'Montserrat', sans-serif;
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--purple);
  margin-bottom: 0.5rem;
}

/* ── Body text ── */
p {
  line-height: 1.8;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}

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

code {
  font-family: 'Fira Code', 'Courier New', monospace;
  background: var(--purple-mid);
  color: var(--purple-dark);
  padding: 0.15em 0.4em;
  border-radius: 4px;
  font-size: 0.88em;
}

/* ── Code blocks ── */
pre {
  margin: 1.5rem 0;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(130, 70, 175, 0.12);
}

pre code {
  background: none;
  color: inherit;
  padding: 0;
  border-radius: 0;
  font-size: 0.9rem;
  line-height: 1.7;
}

/* Override highlight.js padding */
pre code.hljs {
  padding: 1.5rem;
  border-radius: 12px;
}

/* ── Info box ── */
.info-box {
  background: var(--purple-light);
  border-left: 4px solid var(--purple);
  border-radius: 0 12px 12px 0;
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
}

.info-box strong {
  display: block;
  font-family: 'Montserrat', sans-serif;
  font-size: 0.95rem;
  color: var(--purple);
  margin-bottom: 0.4rem;
}

.info-box p {
  margin-bottom: 0;
  font-size: 0.95rem;
}

/* ── Try it box ── */
.try-it {
  background: #edfaf3;
  border-left: 4px solid #2ecc71;
  border-radius: 0 12px 12px 0;
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
  font-size: 0.95rem;
  color: #2d6a4f;
  line-height: 1.7;
}

.try-it span {
  font-family: 'Montserrat', sans-serif;
  font-weight: 700;
  display: block;
  margin-bottom: 0.25rem;
}

/* ── Check your code accordion ── */
.check-code {
  border: 2px solid var(--purple-mid);
  border-radius: 12px;
  overflow: hidden;
  margin: 1.5rem 0;
}

.check-code__header {
  background: var(--purple-light);
  padding: 0.9rem 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  font-family: 'Montserrat', sans-serif;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--purple);
  user-select: none;
  transition: background 0.15s;
}

.check-code__header:hover {
  background: var(--purple-mid);
}

.toggle-icon {
  transition: transform 0.2s;
}

.check-code__header.open .toggle-icon {
  transform: rotate(180deg);
}

.check-code__body {
  display: none;
}

.check-code__body.open {
  display: block;
}

.check-code__body pre {
  margin: 0;
  border-radius: 0;
  box-shadow: none;
}

.check-code__body pre code.hljs {
  border-radius: 0;
}

/* ── Button ── */
.btn {
  display: inline-block;
  font-family: 'Montserrat', sans-serif;
  font-weight: 700;
  font-size: 1rem;
  padding: 0.75rem 2rem;
  border-radius: 50px;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  margin: 1rem 0 1.5rem;
}

.btn--outline {
  border: 2px solid var(--purple);
  color: var(--purple);
  background: transparent;
}

.btn--outline:hover {
  background: var(--purple);
  color: white;
}

/* ── Mobile menu toggle button ── */
#menu-toggle {
  display: none;
  position: fixed;
  top: 1rem;
  left: 1rem;
  z-index: 200;
  background: var(--purple);
  color: white;
  border: none;
  border-radius: 8px;
  width: 42px;
  height: 42px;
  font-size: 1.3rem;
  cursor: pointer;
  align-items: center;
  justify-content: center;
}

/* ── Overlay behind open sidebar on mobile ── */
#sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 99;
}

#sidebar-overlay.open {
  display: block;
}

/* ── Responsive ── */
@media (max-width: 768px) {
  body {
    display: block;
  }

  #menu-toggle {
    display: flex;
  }

  #sidebar {
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    z-index: 100;
  }

  #sidebar.open {
    transform: translateX(0);
  }

  main {
    margin-left: 0;
    padding: 5rem 1.25rem 4rem;
  }

  main > * {
    max-width: 100%;
  }

  h1 {
    font-size: 2rem;
  }

  h2 {
    font-size: 1.4rem;
  }

  .intro-emoji {
    font-size: 3.5rem;
  }

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

@media (max-width: 480px) {
  main {
    padding: 5rem 1rem 4rem;
  }
}

/* ── Final banner ── */
.final-banner {
  background: var(--purple);
  color: white;
  border-radius: 16px;
  padding: 2.5rem;
  text-align: center;
  margin-top: 2rem;
}

.final-banner .final-banner__emoji {
  font-size: 3.5rem;
  margin-bottom: 0.75rem;
}

.final-banner h3 {
  color: white;
  font-size: 1.5rem;
  margin-bottom: 0.75rem;
}

.final-banner p {
  color: rgba(255,255,255,0.85);
  max-width: 480px;
  margin: 0 auto;
}
