/* Examples page. Load after tokens.css and site.css. Token values only; breakpoints 768px and 1024px. */

/* Hero */
.ex-sample-note {
  max-width: 60ch;
  margin-top: var(--space-4);
  font-size: var(--text-small);
  line-height: 1.45;
  color: var(--color-text-muted);
}

.hero-copy .ex-sample-note {
  animation-delay: 200ms;
}

/* One section-pad between examples, not two. */
.ex-example + .ex-example {
  padding-top: 0;
}

/* Intro: heading, the task as typed and the departments the lead picked. */
.ex-intro {
  display: grid;
  gap: var(--space-6);
}

.ex-heading h2 {
  margin-top: var(--space-4);
}

.ex-label {
  display: block;
  font-size: var(--text-eyebrow);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

.ex-task {
  padding: var(--space-5);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  background: var(--color-surface);
  box-shadow: var(--shadow-card);
}

.ex-task-text {
  display: block;
  margin-top: var(--space-3);
  font-size: var(--text-lead);
  line-height: 1.45;
  text-wrap: pretty;
}

.ex-brief > .ex-label {
  margin-top: var(--space-6);
}

.ex-depts {
  display: grid;
  gap: var(--space-4);
  margin-top: var(--space-4);
}

.ex-depts li {
  display: grid;
  grid-template-columns: 12px 1fr;
  column-gap: var(--space-4);
  align-items: baseline;
  color: var(--color-text-muted);
}

.ex-depts strong {
  font-weight: 600;
  color: var(--color-text);
}

/* A department light: a solid disc with one halo ring in its tint. */
.ex-dept-light {
  --light: var(--dept-engineering);
  --halo: var(--dept-engineering-tint);
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--light);
  box-shadow: 0 0 0 5px var(--halo);
  transform: translateY(1px);
}

.ex-dept-light--creative {
  --light: var(--dept-creative);
  --halo: var(--dept-creative-tint);
}

.ex-dept-light--marketing {
  --light: var(--dept-marketing);
  --halo: var(--dept-marketing-tint);
}

.ex-dept-light--finance {
  --light: var(--dept-finance);
  --halo: var(--dept-finance-tint);
}

/* Steps: text, then its picture. */
.example-steps {
  position: relative;
  display: grid;
  gap: var(--space-9);
  margin-top: var(--space-9);
}

.example-step {
  position: relative;
  display: grid;
  gap: var(--space-6);
  align-items: center;
}

.ex-step-text h3 {
  margin-top: var(--space-4);
}

.ex-step-text p {
  max-width: 38ch;
  margin-top: var(--space-3);
  color: var(--color-text-muted);
}

.ex-example picture {
  display: block;
}

/* Report: what the delivery report contained, beside its illustration. */
.ex-report {
  display: grid;
  gap: var(--space-7);
  align-items: center;
  margin-top: var(--space-9);
  padding-top: var(--space-8);
  border-top: 1px solid var(--color-border);
}

.example-report {
  display: grid;
  gap: var(--space-4);
  margin-top: var(--space-5);
}

.example-report li {
  position: relative;
  padding-left: var(--space-6);
  color: var(--color-text-muted);
}

/* A small tick in the accent tint, like a passed line in the report. */
.example-report li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.35em;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--color-accent-soft);
}

.example-report li::after {
  content: "";
  position: absolute;
  left: 6px;
  top: calc(0.35em + 4px);
  width: 5px;
  height: 9px;
  border: solid var(--color-link);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.example-report strong {
  font-weight: 600;
  color: var(--color-text);
}

.ex-report-figure {
  margin-inline: auto;
}

.ex-report-art {
  width: 100%;
  height: auto;
}

/* Closing: two links side by side. */
.ex-closing .btn-row {
  margin-top: var(--space-6);
}

.ex-closing .btn-row .btn {
  margin-top: 0;
}

/* Phone: one column, every picture and illustration spans the content width. */
@media (max-width: 767.98px) {
  .ex-example .scene,
  .ex-report-figure {
    width: 100%;
  }

  .ex-example .scene img {
    width: 100%;
    height: auto;
  }

  .ex-task {
    padding: var(--space-4) var(--space-5) var(--space-5);
  }
}

@media (min-width: 768px) {
  .ex-task {
    padding: var(--space-5) var(--space-6) var(--space-6);
  }
}

/* Desktop: steps alternate text and picture along a thin rail. */
@media (min-width: 1024px) {
  .ex-heading h2 {
    max-width: 18ch;
  }

  /* The task as typed beside the departments the lead picked. */
  .ex-brief {
    display: grid;
    grid-template-columns: 7fr 5fr;
    grid-template-rows: auto 1fr;
    column-gap: var(--space-8);
    align-items: start;
  }

  .ex-brief .ex-task {
    grid-row: 1 / 3;
  }

  .ex-brief > .ex-label {
    grid-column: 2;
    margin-top: var(--space-5);
  }

  .ex-brief .ex-depts {
    grid-column: 2;
  }

  .example-steps {
    padding-left: var(--space-7);
  }

  .example-steps::before {
    content: "";
    position: absolute;
    top: var(--space-4);
    bottom: var(--space-4);
    left: 5px;
    width: 2px;
    background: var(--color-border);
    transform-origin: top;
  }

  /* A dot on the rail beside each step. */
  .example-step::before {
    content: "";
    position: absolute;
    top: calc(50% - 6px);
    left: calc(-1 * var(--space-7));
    width: 12px;
    height: 12px;
    border: 2px solid var(--color-link);
    border-radius: 50%;
    background: var(--color-bg);
  }

  .example-step {
    grid-template-columns: 4fr 8fr;
    gap: var(--space-8);
  }

  .example-step:nth-child(even) {
    grid-template-columns: 8fr 4fr;
  }

  .example-step:nth-child(even) .ex-step-text {
    order: 2;
  }

  .ex-scene-art,
  .ex-report-figure {
    max-width: 480px;
  }

  .ex-report {
    grid-template-columns: minmax(0, 1fr) minmax(0, 480px);
    gap: var(--space-9);
    align-items: start;
  }

  .example-report li {
    max-width: 48ch;
  }

  .ex-report-figure {
    width: 100%;
  }
}

/* Motion: the rail draws down, steps rise and the report lifts as they scroll into view.
   Without scroll timelines everything shows at once. */
@media (prefers-reduced-motion: no-preference) {
  @supports (animation-timeline: view()) {
    .example-steps {
      view-timeline: --ex-steps block;
    }

    .example-steps::before {
      animation: draw-y linear both;
      animation-timeline: --ex-steps;
      animation-range: cover 10% cover 70%;
    }

    .ex-step-text,
    .ex-intro {
      animation: rise linear both;
      animation-timeline: view();
      animation-range: entry 0% cover 30%;
    }

    .ex-report-figure {
      animation: detail-lift linear both;
      animation-timeline: view();
      animation-range: entry 10% cover 35%;
    }
  }
}
