/*
 * Insights — analytics dashboard mock-up (sample data only).
 */
@layer sections {
  .insights {
    padding-block: 72px 120px;
  }

  .insights__title {
    margin-bottom: 12px;
  }

  .insights__lead {
    margin-bottom: 40px;
    max-width: 520px;
  }

  .insights__note {
    margin: 14px 0 0;
    font-size: calc(14rem / 16);
    color: var(--color-ink-muted);
  }

  .dashboard {
    background: var(--color-white);
    border: 1px solid var(--color-line);
    border-radius: 36px;
    padding: 32px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    box-shadow: var(--shadow-soft);
  }

  .dashboard__panel {
    border: 1px solid var(--color-line-soft);
    border-radius: 24px;
    padding: 24px;
  }

  .dashboard__head {
    display: flex;
    justify-content: space-between;
    font-size: calc(15rem / 16);
    font-weight: 700;
  }

  .dashboard__period {
    color: var(--color-ink-muted);
    font-weight: 500;
  }

  /* ---------- Bar chart: enquiries per channel ---------- */
  .bar-chart {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    height: 180px;
    margin-top: 20px;
  }

  .bar-chart__column {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    height: 100%;
    justify-content: flex-end;
  }

  .bar-chart__bar {
    width: 100%;
    border-radius: 10px;
  }

  .bar-chart__bar--whatsapp { height: 88%; background: var(--color-violet); }
  .bar-chart__bar--instagram { height: 64%; background: #8E79FF; }
  .bar-chart__bar--facebook { height: 46%; background: #B7A9FF; }
  .bar-chart__bar--website { height: 34%; background: #D8CFFF; }

  .bar-chart__label {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    font-size: calc(12rem / 16);
    color: var(--color-ink-muted);
  }

  /* ---------- Line chart: conversions per week ---------- */
  .line-chart {
    width: 100%;
    height: 180px;
    margin-top: 20px;
  }

  /* ---------- KPI tiles ---------- */
  .kpis {
    display: grid;
    grid-template-rows: repeat(3, minmax(0, 1fr));
    gap: 12px;
  }

  .kpi {
    background: var(--color-cream);
    border-radius: 20px;
    padding: 18px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  .kpi--dark {
    background: var(--color-ink);
    color: var(--color-cream);
  }

  .kpi__label {
    font-size: calc(15rem / 16);
    font-weight: 600;
  }

  .kpi__value {
    font-family: var(--font-display);
    font-size: calc(30rem / 16);
    font-weight: 600;
  }

  @supports (animation-timeline: scroll()) {
    .bar-chart__bar {
      transform-origin: bottom;
      animation: bar-grow linear both;
      animation-timeline: view();
      animation-range: entry 30% cover 50%;
    }

    @keyframes bar-grow {
      from {
        scale: 1 0.05;
      }
    }

    .line-chart__path {
      stroke-dasharray: 1;
      animation: line-draw linear both;
      animation-timeline: view();
      animation-range: entry 30% cover 55%;
    }

    @keyframes line-draw {
      from {
        stroke-dashoffset: 1;
      }

      to {
        stroke-dashoffset: 0;
      }
    }
  }
}
