:root{
  --fb-accent: #1877f2;
}
@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@200;300;400;500;600;700;800&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:ital,wght@0,200;0,300;0,400;0,500;0,600;0,700;0,800;1,300;1,400;1,500&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Inter:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap');
:root{
  --base-clr: #ffffff;
  --line-clr: #e6e9ef;
  --hover-clr: #c7ced5; /* slightly darker hover for improved contrast */
  --text-clr: #0f1724;
  --accent-clr: var(--fb-accent);
  --secondary-text-clr: #475569;
}
*{
  margin: 0;
  padding: 0;
}
html{
  font-family: 'Manrope', 'Plus Jakarta Sans', Inter, system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial;
  line-height: 1.5rem;
  font-weight: 500;
}
body{
  min-height: 100vh;
  min-height: 100dvh;
  background-color: var(--base-clr);
  color: var(--text-clr);
  display: grid;
  grid-template-columns: auto 1fr;
}
#sidebar{
  box-sizing: border-box;
  height: 100vh;
  width: 325px;
  padding: 5px 1em;
  background-color: #f2f5f9; /* light neutral, Facebook-like sidebar */
  border-right: 1px solid var(--line-clr);

  position: sticky;
  top: 0;
  align-self: start;
  transition: 300ms ease-in-out;
  overflow: hidden;
  text-wrap: nowrap;
}
#sidebar.close{
  padding: 5px;
  width: 60px;
}
#sidebar ul{
  list-style: none;
}
#sidebar > ul > li:first-child{
  display: flex;
  justify-content: flex-end;
  margin-bottom: 16px;
  .logo{
    font-weight: 600;
  }
}
#sidebar ul li.active a{
  color: var(--accent-clr);

  svg{
    fill: var(--accent-clr);
  }
}

#sidebar a, #sidebar .dropdown-btn, #sidebar .logo{
  border-radius: .5em;
  padding: .85em;
  text-decoration: none;
  color: var(--text-clr);
  display: flex;
  align-items: center;
  gap: 1em;
  transition: background-color 180ms ease, transform 180ms ease;
  will-change: transform;
}
.dropdown-btn{
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  font: inherit;
  cursor: pointer;
}
#sidebar svg{
  flex-shrink: 0;
  fill: var(--text-clr);
}
#sidebar a span, #sidebar .dropdown-btn span{
  flex-grow: 1;
}
#sidebar a:hover, #sidebar .dropdown-btn:hover{
  background-color: var(--hover-clr);
  transform: translateY(-2px) scale(1.01);
}
#sidebar .sub-menu{
  display: grid;
  grid-template-rows: 0fr;
  transition: 300ms ease-in-out;

  > div{
    overflow: hidden;
  }
}
#sidebar .sub-menu.show{
  grid-template-rows: 1fr;
}
.dropdown-btn svg{
  transition: 200ms ease;
}
.rotate svg:last-child{
  rotate: 180deg;
}
#sidebar .sub-menu a{
  padding-left: 2em;
}
#toggle-btn{
  margin-left: auto;
  padding: 1em;
  border: none;
  border-radius: .5em;
  background: none;
  cursor: pointer;

  svg{
    transition: rotate 150ms ease;
  }
}
#toggle-btn:hover{
  background-color: var(--hover-clr);
}

main{
  padding: min(30px, 7%);
}
main p{
  color: var(--secondary-text-clr);
  margin-top: 5px;
  margin-bottom: 15px;
}
.container{
  border: 1px solid var(--line-clr);
  border-radius: 1em;
  margin-bottom: 20px;
  padding: min(3em, 15%);
  max-width: 1100px;
  margin-left: auto;
  margin-right: auto;

  h2, p { margin-top: 1em }
}

@media(max-width: 800px){
  body{
    grid-template-columns: 1fr;
  }
  main{
    padding: 2em 1em 60px 1em;
  }
  .container{
    border: none;
    padding: 0;
  }
  #sidebar{
    height: 60px;
    width: 100%;
    border-right: none;
    border-top: 1px solid var(--line-clr);
    padding: 0;
    position: fixed;
    top: unset;
    bottom: 0;

    > ul{
      padding: 0;
      display: grid;
      grid-auto-columns: 60px;
      grid-auto-flow: column;
      align-items: center;
      overflow-x: scroll;
    }
    ul li{
      height: 100%;
    }
    ul a, ul .dropdown-btn{
      width: 60px;
      height: 60px;
      padding: 0;
      border-radius: 0;
      justify-content: center;
    }

    ul li span, ul li:first-child, .dropdown-btn svg:last-child{
      display: none;
    }

    ul li .sub-menu.show{
      position: fixed;
      bottom: 60px;
      left: 0;
      box-sizing: border-box;
      height: 60px;
      width: 100%;
      background-color: var(--hover-clr);
      border-top: 1px solid var(--line-clr);
      display: flex;
      justify-content: center;

      > div{
        overflow-x: auto;
      }
      li{
        display: inline-flex;
      }
      a{
        box-sizing: border-box;
        padding: 1em;
        width: auto;
        justify-content: center;
      }
    }
  }
}

/* On-this-page submenu styles */
.on-this-page > span{
  display: block;
  padding: .65em .85em;
  color: var(--secondary-text-clr);
  font-size: .95rem;
}
.on-this-page ul{
  margin-top: .25em;
}
.on-this-page ul li a{
  padding-left: 1.25em;
  padding-right: .85em;
  display: block;
  color: var(--secondary-text-clr);
  font-size: .95rem;
}
.on-this-page ul li.indented a{ padding-left: 2.4em }
.on-this-page ul li a:hover,
.on-this-page ul li a.active{
  color: var(--accent-clr);
  background: transparent;
}

/* Active link focus and visibility */
#sidebar a[aria-current="true"]{
  font-weight: 700;
}

/* Page content section spacing and anchors (wrappers) */
.section-block{
  padding-top: 1.5em;
  margin-top: 1.5em;
  border-top: 1px dashed rgba(15,23,42,0.06);
}
.section-block:first-of-type{
  padding-top: 0;
  margin-top: 0;
  border-top: none;
}

/* Add a clearer gap / line break between sections */
/* Extra gap between section blocks */
.section-block + .section-block{
  margin-top: 2.5rem; /* extra space between adjacent sections */
  padding-top: 0;
}

/* Optional visual separator between blocks */
.section-block + .section-block::before{
  content: '';
  display: block;
  height: 1px;
  background-color: rgba(15,23,42,0.06);
  margin-bottom: 1rem;
  width: 100%;
}

/* Provide visible focus for keyboard navigation */
#sidebar a:focus{
  outline: 2px dashed rgba(37,99,235,0.20);
  outline-offset: 2px;
}

/* Slightly reduce jump when anchors navigate by accounting for sticky sidebar */
html{
  scroll-padding-top: 120px;
}

/* Content typography: make headings and lists inside the container match site styles */
main .container h3{
  font-size: 1.4rem;
  font-weight: 700;
  margin: 0 0 .5rem 0;
  color: var(--text-clr);
}

/* Intro grid: put intro text and figure side-by-side on wide screens */
.intro-grid{
  display: grid;
  grid-template-columns: 1fr 420px;
  gap: 1.5rem;
  align-items: start;
}

@media (max-width: 1000px){
  .intro-grid{ grid-template-columns: 1fr; }
}
main .container h4{
  font-size: 1.05rem;
  font-weight: 700;
  margin: .6rem 0 .45rem 0;
  color: var(--text-clr);
}
main .container h5{
  font-size: .98rem;
  font-weight: 700;
  margin: .5rem 0 .35rem 0;
  color: var(--secondary-text-clr);
}

main .container p{
  margin-bottom: .85rem;
  color: var(--secondary-text-clr);
}

main .container ul{
  margin: .35rem 0 1rem 1.25rem;
  color: var(--secondary-text-clr);
  line-height: 1.45;
}
main .container ul ul{
  margin-top: .25rem;
  margin-left: 1rem;
}
main .container li{
  margin-bottom: .45rem;
}

.section-block section p{ margin-bottom: .85rem }

/* Keep emoji headings aligned */
main .container h5 span.emoji{ margin-right: .35rem }

/* Vertical structure figure styles */
.vs-figure{ margin: .6rem 0 1rem; }
.vs-figure img.vs-image{ max-width: 100%; height: auto; display: block; margin: 0 auto; border-radius: .6rem; box-shadow: 0 10px 24px rgba(15,23,42,0.06); border: 1px solid rgba(15,23,42,0.06); transition: box-shadow 180ms ease, border-color 180ms ease, transform 180ms ease; will-change: transform; }
.vs-figure figcaption{ text-align: center; color: rgba(15,23,36,0.7); font-size: .95rem; margin-top: .45rem; font-weight: 500 }

.vs-figure:hover img.vs-image{ box-shadow: 0 18px 36px rgba(15,23,42,0.10); border-color: rgba(15,23,42,0.08); transform: translateY(-3px) scale(1.02); }
.vs-figure:hover figcaption{ color: var(--text-clr); }

@media(min-width: 1100px){
  .vs-figure img.vs-image{ max-width: 380px; }
}

/* --- Index page specific styles --- */
.hero{
  background: linear-gradient(180deg, rgba(37,99,235,0.06), transparent 40%);
  padding: 2.5rem 1.5rem;
  border-radius: 1em;
}
.hero-content{ max-width: 980px; margin: 0 auto; text-align: left }
.hero-content h1{ font-size: 2.25rem; margin-bottom: .25rem; color: var(--text-clr) }
.hero-content .lead{ font-size: 1.05rem; color: var(--secondary-text-clr); margin-bottom: 1rem }
.hero-ctas{ display:flex; gap: .75rem; flex-wrap:wrap }
.btn{
  display: inline-block;
  padding: .6rem 1rem;
  background: var(--accent-clr);
  color: white;
  border-radius: .65rem;
  text-decoration: none;
  font-weight: 700;
  box-shadow: 0 6px 18px rgba(37,99,235,0.08);
  transition: transform 160ms ease, filter 160ms ease, box-shadow 160ms ease;
  will-change: transform;
}
.btn:hover{ filter: brightness(.95); transform: translateY(-1px) scale(1.01); }

.card-grid{ display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin-top: 1rem }
.card{ background: rgba(15,23,42,0.02); padding: 1.1rem; border-radius: .8rem; border: 1px solid rgba(15,23,42,0.06); transition: transform 180ms ease, box-shadow 180ms ease; will-change: transform; }
.card:hover{ transform: translateY(-4px) scale(1.01); box-shadow: 0 12px 28px rgba(15,23,42,0.08); }
.card h3{ font-size: 1.05rem; margin-bottom: .45rem }
.card p{ color: var(--secondary-text-clr); font-size: .95rem }

.quick-links ul{ list-style: none; padding-left: 0 }
.quick-links li{ margin-bottom: .5rem }
.quick-links a{ color: var(--text-clr); text-decoration: none; padding: .45rem .6rem; border-radius: .5rem; display: inline-block; transition: background-color 160ms ease, transform 160ms ease; }
.quick-links a:hover{ color: var(--accent-clr); background-color: var(--hover-clr); transform: translateY(-1px) scale(1.01); }

.quick-links a.active{ color: var(--accent-clr); background-color: var(--hover-clr); }

.site-footer{ margin-top: 2rem; padding: 1rem; border-top: 1px solid rgba(15,23,42,0.06); display:flex; justify-content:space-between; gap: 1rem }
.site-footer p{ color: var(--secondary-text-clr); margin: 0 }

@media (max-width: 1000px){
  .card-grid{ grid-template-columns: repeat(2, 1fr) }
}
@media (max-width: 600px){
  .hero-content h1{ font-size: 1.6rem }
  .card-grid{ grid-template-columns: 1fr }
  .hero-ctas{ justify-content: flex-start }
  .site-footer{ flex-direction: column; align-items: flex-start }
}