:root {
  --color-nav-purple: #8037f5;
  --color-nav-rail: #dddddd;
  --color-nav-text-active: #1b1f27;
  --color-nav-text: #808080;
  --color-faq-heading: #0d0f12;
  --color-faq-header-open: #f3f1f8;
  --color-faq-header-closed: #ffffff;
  --color-info-bg: #e8f3fc;
  --color-info-text: #1d82e3;
  --color-site-bg: #f7f7f7;
  --radius-sm: 8px;
}

/* ------------------------------------------------------------------ */
/* Base                                                               */
/* ------------------------------------------------------------------ */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
    Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: #1b1f27;
  background: var(--color-site-bg);
}

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

a {
  color: inherit;
}

/* ------------------------------------------------------------------ */
/* Page layout                                                        */
/* ------------------------------------------------------------------ */

.page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 24px 64px;
}

.page-header {
  margin-bottom: 32px;
}

.logo {
  margin-inline: auto;
  margin-bottom: 24px;
}

.page-title {
  margin: 0;
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--color-faq-heading);
  text-align: center;
  text-transform: uppercase;
}

.layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 0 48px;
  align-items: start;
}

/* ------------------------------------------------------------------ */
/* Left navigation panel                                              */
/* ------------------------------------------------------------------ */

.nav-panel {
  position: sticky;
  top: 24px;
  padding-right: 24px;
}

.info-box {
  background: var(--color-info-bg);
  border-radius: var(--radius-sm);
  padding: 16px;
  margin-bottom: 28px;
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--color-info-text);
}

.info-box__header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.info-box__icon {
  display: flex;
  flex-shrink: 0;
  color: var(--color-info-text);
}

.info-box__icon-svg {
  width: 16px;
  height: 16px;
}

.info-box p {
  margin: 0;
}

.toc {
  position: relative;
}

.toc::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--color-nav-rail);
  border-radius: 2px;
}

.toc__list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.toc__list li {
  margin: 0;
}

.toc__link {
  display: block;
  position: relative;
  padding: 10px 0 10px 16px;
  font-size: 0.9375rem;
  font-weight: 400;
  color: var(--color-nav-text);
  text-decoration: none;
  transition: color 0.15s ease, font-weight 0.15s ease;
}

.toc__link:hover {
  color: var(--color-nav-text-active);
  text-decoration: none;
}

.toc__link.is-active {
  font-weight: 700;
  color: var(--color-nav-text-active);
}

.toc__link.is-active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--color-nav-purple);
  border-radius: 2px;
  z-index: 1;
}

/* Mobile nav dropdown (hidden on desktop) */
.mobile-nav__toggle {
  display: none;
}

.sticky-sentinel,
.sticky-placeholder {
  display: none;
}

/* ------------------------------------------------------------------ */
/* FAQ content                                                        */
/* ------------------------------------------------------------------ */

.faq-content {
  min-width: 0;
}

.faq-section {
  scroll-margin-top: 24px;
  margin-bottom: 48px;
}

.faq-section:last-child {
  margin-bottom: 0;
}

.faq-section__title {
  margin: 0 0 16px;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--color-faq-heading);
}

/* ------------------------------------------------------------------ */
/* Accordion (native <details>)                                       */
/* ------------------------------------------------------------------ */

.faq-item {
  margin-bottom: 12px;
  background: transparent;
  interpolate-size: allow-keywords;
}

.faq-item::details-content {
  block-size: 0;
  overflow: hidden;
  content-visibility: hidden;
  transition:
    block-size 0.3s ease,
    content-visibility 0.3s ease allow-discrete;
}

.faq-item[open]::details-content {
  block-size: auto;
  content-visibility: visible;
}

@starting-style {
  .faq-item[open]::details-content {
    block-size: 0;
  }
}

.faq-item:last-child {
  margin-bottom: 0;
}

.faq-item__question {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--color-faq-heading);
  background: var(--color-faq-header-closed);
  border-radius: var(--radius-sm);
  cursor: pointer;
  list-style: none;
  user-select: none;
  transition: background-color 0.15s ease, border-radius 0.15s ease;
}

.faq-item[open] > .faq-item__question {
  background: var(--color-faq-header-open);
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}

.faq-item__question::-webkit-details-marker {
  display: none;
}

.faq-item__question::after {
  content: "";
  flex-shrink: 0;
  width: 10px;
  height: 10px;
  border-right: 2px solid #808080;
  border-bottom: 2px solid #808080;
  transform: rotate(45deg);
  transition: transform 0.2s ease;
  margin-top: -4px;
}

.faq-item[open] > .faq-item__question::after {
  transform: rotate(-135deg);
  margin-top: 4px;
}

.faq-item__answer {
  padding: 16px 16px 20px;
  font-size: 0.9375rem;
  line-height: 1.65;
  color: #3f3f46;
  background: var(--color-faq-header-closed);
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
}

.faq-item__answer p {
  margin: 0 0 12px;
}

.faq-item__answer p:last-child {
  margin-bottom: 0;
}

.faq-item__answer ul,
.faq-item__answer ol {
  margin: 0 0 12px;
  padding-left: 1.5rem;
}

.faq-item__answer li {
  margin-bottom: 4px;
}

.faq-item__answer li:last-child {
  margin-bottom: 0;
}

.faq-item__answer strong {
  font-weight: 600;
  color: var(--color-faq-heading);
}

.faq-item__answer em {
  font-style: italic;
}

.faq-item__answer a,
.faq-item__answer a:visited {
  color: var(--color-faq-heading);
  text-decoration: underline;
  transition: color 0.15s ease;
}

.faq-item__answer a:hover {
  color: var(--color-nav-purple);
  text-decoration: underline;
}

@media (max-width: 768px) {
  .page {
    padding: 24px 16px 48px;
  }

  .sticky-placeholder {
    display: block;
    height: 0;
  }

  .mobile-sticky-header {
    margin-bottom: 16px;
    background: var(--color-site-bg);
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
  }

  .mobile-sticky-header.is-pinned {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    width: 100%;
    margin-bottom: 0;
    padding-top: 0;
    background: #ffffff;
    box-shadow: 0 1px 4px rgba(13, 15, 18, 0.08);
  }

  .mobile-sticky-header.is-pinned .page-header {
    background: #ffffff;
    padding: 8px 16px 0;
    margin-bottom: 0px;
  }

  .mobile-sticky-header.is-pinned .page-title {
    display: none;
  }

  .mobile-sticky-header.is-pinned .logo {
    width: 62px;
    height: 24px;
    margin-inline: auto;
    margin-bottom: 4px;
    transition: width 0.3s ease, height 0.3s ease, margin 0.3s ease;
  }

  .page-title {
    font-size: 1.625rem;
  }

  .layout {
    grid-template-columns: 1fr;
    gap: 24px 0;
  }

  .nav-panel {
    position: static;
    display: block;
    padding-right: 0;
  }

  .info-box {
    margin-bottom: 24px;
  }

  .toc-wrapper {
    background: #ffffff;
    border-radius: var(--radius-sm);
    box-shadow: 0 1px 4px rgba(13, 15, 18, 0.08);
  }

  .mobile-sticky-header.is-pinned .toc-wrapper {
    width: 100%;
    border-radius: 0;
    box-shadow: none;
  }

  .mobile-sticky-header.is-pinned .toc-wrapper button{
    padding-top: 0px;
  }

  .toc-wrapper.is-open .toc__link.is-active {
    display: none;
  }

  .faq-section {
    scroll-margin-top: 120px;
  }

  .mobile-nav__toggle {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 14px 16px;
    border: none;
    background: transparent;
    font: inherit;
    font-size: 0.9375rem;
    font-weight: 700;
    color: var(--color-nav-text-active);
    text-align: left;
    cursor: pointer;
  }

  .mobile-nav__dot {
    flex-shrink: 0;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--color-nav-purple);
  }

  .mobile-nav__label {
    flex: 1;
    min-width: 0;
  }

  .mobile-nav__chevron {
    flex-shrink: 0;
    width: 10px;
    height: 10px;
    border-right: 2px solid #808080;
    border-bottom: 2px solid #808080;
    transform: rotate(45deg);
    transition: transform 0.2s ease;
    margin-top: -4px;
  }

  .toc-wrapper.is-open .mobile-nav__chevron {
    transform: rotate(-135deg);
    margin-top: 4px;
  }

  .toc::before {
    display: none;
  }

  .toc__list {
    display: none;
    padding-bottom: 8px;
  }

  .toc-wrapper.is-open .toc__list {
    display: block;
    animation: mobile-nav-expand 0.25s ease;
  }

  @keyframes mobile-nav-expand {
    from {
      opacity: 0;
      transform: translateY(-4px);
    }

    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  .toc__link {
    padding: 12px 16px 12px 36px;
    font-size: 0.9375rem;
  }

  .toc__link.is-active::before {
    left: 16px;
    top: 50%;
    bottom: auto;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    transform: translateY(-50%);
  }
}
