/*
  How It Works 08 — standalone HTML/CSS/JS implementation.
  No build step, no framework, no external dependency: copy these three
  files into any project and open index.html as-is.
*/

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

:root {
  --white: #ffffff;
  --slate-900: #0f172a;
  --slate-600: #475569;
  --slate-200: #e2e8f0;
  --slate-100: #f1f5f9;
  --slate-50: #f8fafc;
  --blue-100: #dbeafe;
  --emerald-100: #d1fae5;
  --emerald-700: #047857;
  --font-sans:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji",
    "Segoe UI Emoji";
}

body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--slate-900);
  background-color: var(--slate-50);
  line-height: 1.5;
}

.hiw {
  padding: clamp(3rem, 2.5rem + 2vw, 5rem) clamp(1rem, 0.3rem + 3vw, 2rem);
}

.hiw__inner {
  width: 100%;
  max-width: 64rem;
  margin: 0 auto;
}

.hiw__intro {
  margin: 0 auto;
  max-width: 32rem;
  text-align: center;
}

.hiw__heading {
  margin: 0;
  font-weight: 600;
  font-size: clamp(1.875rem, 1.5rem + 1.9vw, 2.5rem);
  line-height: 1.15;
  letter-spacing: -0.01em;
}

.hiw__description {
  margin: 0.75rem 0 0;
  font-size: 1rem;
  line-height: 1.65;
  color: var(--slate-600);
}

.layout {
  margin-top: 3rem;
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  align-items: center;
}

.panel {
  overflow: hidden;
  border-radius: 1rem;
  border: 1px solid var(--slate-200);
  background-color: var(--white);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}

.panel__chrome {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  border-bottom: 1px solid var(--slate-100);
  padding: 0.75rem 1rem;
}

.dot {
  width: 0.625rem;
  height: 0.625rem;
  border-radius: 999px;
}

.dot--rose {
  background-color: #fda4af;
}
.dot--amber {
  background-color: #fcd34d;
}
.dot--emerald {
  background-color: #6ee7b7;
}

.panel__body {
  display: grid;
  grid-template-columns: 7rem 1fr;
  gap: 1rem;
  padding: 1rem;
}

.panel__nav {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.bar {
  height: 0.5rem;
  border-radius: 999px;
}

.bar--muted {
  background-color: var(--slate-100);
}

.bar--accent {
  background-color: var(--blue-100);
}

.bar--wide {
  width: 75%;
}
.bar--full {
  width: 100%;
}
.bar--mid {
  width: 66%;
}
.bar--short {
  width: 50%;
}

.panel__tiles {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}

.tile {
  height: 3.5rem;
  border-radius: 0.5rem;
  background-color: var(--slate-50);
}

.tile--chart {
  grid-column: span 2;
  height: 5rem;
  background-image: linear-gradient(to top, var(--blue-100), transparent);
}

.checklist {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.check {
  margin-top: 0.125rem;
  display: flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 999px;
  background-color: var(--emerald-100);
  color: var(--emerald-700);
}

.check svg {
  width: 0.875rem;
  height: 0.875rem;
}

.item__title {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 600;
}

.item__text {
  margin: 0.125rem 0 0;
  font-size: 0.875rem;
  line-height: 1.6;
  color: var(--slate-600);
}

@media (min-width: 1024px) {
  .layout {
    grid-template-columns: 1.2fr 1fr;
    gap: 2.5rem;
  }
}

/* Motion — disabled entirely under reduced motion; the panel and every
   checkmark already render at their final, fully visible state outside
   this media query. */
@media (prefers-reduced-motion: no-preference) {
  @keyframes al-howitworks08-panel {
    from {
      opacity: 0;
      transform: scale(0.97);
    }
    to {
      opacity: 1;
      transform: scale(1);
    }
  }

  @keyframes al-howitworks08-item {
    from {
      opacity: 0;
      transform: translateY(10px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  @keyframes al-howitworks08-check {
    from {
      stroke-dashoffset: 20;
    }
    to {
      stroke-dashoffset: 0;
    }
  }

  .panel {
    animation: al-howitworks08-panel 600ms cubic-bezier(0.16, 1, 0.3, 1) both;
  }

  .item {
    animation: al-howitworks08-item 500ms cubic-bezier(0.16, 1, 0.3, 1) both;
  }

  .draw {
    stroke-dasharray: 20;
    animation: al-howitworks08-check 400ms ease-out both;
  }
}
