/* ==========================================================================
   Spicule Technology page (/spicule-technology/): sections used only here.
   Linked after main.css on that page only. Tokens come from variables.css.

   Motion: the diagram, steps and timeline animate once their section gets
   .is-visible from Site.reveal. Site.reveal never runs under
   prefers-reduced-motion, so those users see every element in its final,
   static state.
   ========================================================================== */

.hero-panel__lead {
  font-size: var(--text-lg);
}

/* Three hero features (product pages have four) */
@media (min-width: 64em) {
  .mini-features {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* ---- At a glance: four figures ---- */
.stats-panel {
  padding-block: var(--space-12);
}

.stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-8) var(--space-6);
}

/* dt comes first in the source (term, then value) but the value reads first */
.stats__item {
  display: flex;
  flex-direction: column-reverse;
  justify-content: flex-end;
  gap: var(--space-2);
  padding-top: var(--space-5);
  border-top: var(--border-width) solid var(--color-border-strong);
}

.stats__value {
  font-family: var(--font-heading);
  font-size: var(--text-4xl);
  font-weight: var(--weight-medium);
  line-height: 1;
  color: var(--color-primary);
  /* The display serif defaults to old-style figures; lining ones read as data */
  font-variant-numeric: lining-nums;
  white-space: nowrap;
}

.stats__unit,
.stats__prefix {
  font-size: 0.45em;
  color: var(--color-text-muted);
}

.stats__unit {
  margin-left: 0.2em;
}

.stats__prefix {
  margin-right: 0.05em;
  font-size: 0.75em;
}

.stats__label {
  max-width: 26ch;
  font-size: var(--text-sm);
  line-height: var(--leading-snug);
  color: var(--color-text-muted);
}

@media (min-width: 64em) {
  .stats {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .stats--3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* ---- What spicules are made of ---- */
.trait-chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  padding: 0;
  list-style: none;
}

.trait-chips li {
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-sm);
  color: var(--color-ink);
  background-color: var(--color-panel);
  border: var(--border-width) solid var(--color-border-strong);
  border-radius: var(--radius-full);
}

.spicule-figure {
  margin: 0;
  padding: var(--space-6);
  background-color: var(--color-panel);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
}

.spicule-figure__art {
  display: block;
  width: 100%;
  height: auto;
}

.spicule-figure__caption {
  margin-top: var(--space-3);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

.spicule-figure__glow {
  fill: var(--color-lilac-soft);
}

.spicule-figure__spine {
  fill: var(--color-surface-periwinkle);
  stroke: var(--color-primary);
  stroke-width: 1.5;
}

.spicule-figure__peptides circle {
  fill: var(--color-primary);
  opacity: 0.6;
  transform-box: fill-box;
  transform-origin: center;
}

.spicule-figure__leader {
  fill: none;
  stroke: var(--color-border-strong);
  stroke-width: 1.5;
  stroke-dasharray: 4 4;
}

.spicule-figure__core {
  fill: none;
  stroke: var(--color-primary);
  stroke-width: 1;
  stroke-dasharray: 2 6;
  opacity: 0.5;
}

.spicule-figure__scale {
  fill: none;
  stroke: var(--color-primary);
  stroke-width: 1.5;
}

.spicule-figure__label,
.spicule-figure__note {
  font-family: var(--font-body);
  font-size: 16px; /* SVG user units: scales with the drawing */
  fill: var(--color-text-muted);
}

.spicule-figure__label {
  font-weight: var(--weight-medium);
  fill: var(--color-ink);
}

/* The drawings shrink on phones, so their labels are drawn larger there */
@media (max-width: 47.99em) {
  .spicule-figure {
    padding: var(--space-4);
  }

  .spicule-figure__label,
  .spicule-figure__note {
    font-size: 24px;
  }
}

/* ---- How they work: three steps on a connecting line ---- */
.work-steps {
  position: relative;
  display: grid;
  gap: var(--space-10);
  padding: 0;
  list-style: none;
  counter-reset: work-step;
}

.work-steps__item {
  position: relative;
  display: grid;
  align-content: start;
  justify-items: center;
  gap: var(--space-3);
  text-align: center;
  counter-increment: work-step;
}

.work-steps__item::before {
  content: counter(work-step, decimal-leading-zero);
  order: 1;
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  letter-spacing: var(--tracking-wider);
  color: var(--color-primary);
}

.work-steps__icon {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 4.5rem;
  height: 4.5rem;
  font-size: 1.75rem;
  color: var(--color-primary);
  background-color: var(--color-panel);
  border: var(--border-width) solid var(--color-border-strong);
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-sm);
}

.work-steps__item h3 {
  order: 2;
}

.work-steps__item p {
  order: 3;
  max-width: 30ch;
  color: var(--color-text-muted);
}

.work-steps__close {
  max-width: 44ch;
  margin: var(--space-12) auto 0;
  font-family: var(--font-heading);
  font-size: var(--text-2xl);
  line-height: var(--leading-snug);
  text-align: center;
  color: var(--color-ink);
}

@media (min-width: 48em) {
  .work-steps {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--space-8);
  }

  /* The line runs through the centres of the three icons */
  .work-steps::before,
  .work-steps::after {
    content: "";
    position: absolute;
    top: 2.25rem;
    left: calc(100% / 6);
    right: calc(100% / 6);
    height: 2px;
    background-color: var(--color-border-strong);
  }

  .work-steps::after {
    background-color: var(--color-primary);
    transform-origin: left;
  }
}

/* ---- How they work: physical vs chemical exfoliation note ---- */
.work-steps__note {
  max-width: 52ch;
  margin: var(--space-4) auto 0;
  text-align: center;
  color: var(--color-text-muted);
}

/* ---- How to use: numbered steps | how often + who it suits ---- */
.use-grid {
  display: grid;
  gap: var(--space-10);
  align-items: start;
}

.use-steps {
  padding: 0;
  list-style: none;
  border-top: var(--border-width) solid var(--color-border-strong);
}

.use-steps__item {
  display: grid;
  grid-template-columns: 3rem minmax(0, 1fr);
  column-gap: var(--space-4);
  padding-block: var(--space-6);
  border-bottom: var(--border-width) solid var(--color-border-strong);
}

.use-steps__num {
  grid-row: span 2;
  font-family: var(--font-heading);
  font-size: var(--text-2xl);
  line-height: 1;
  color: var(--color-primary);
}

.use-steps__title {
  font-size: var(--text-xl);
}

.use-steps__item p {
  margin-top: var(--space-2);
  color: var(--color-text-muted);
}

.use-side {
  display: grid;
  gap: var(--space-4);
}

.use-card {
  padding: var(--space-6);
  background-color: var(--color-panel);
  border: var(--border-width) solid var(--color-border);
  border-radius: var(--radius-xl);
}

.use-card > * + * {
  margin-top: var(--space-3);
}

.use-card__title {
  font-size: var(--text-xl);
}

.use-card p,
.use-card__list {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

.use-card__list {
  padding: 0;
  list-style: none;
}

.use-card__list li {
  position: relative;
  padding-left: var(--space-5);
}

.use-card__list li + li {
  margin-top: var(--space-2);
}

.use-card__list li::before {
  content: "";
  position: absolute;
  top: 0.6em;
  left: 0;
  width: 0.45rem;
  height: 0.45rem;
  background-color: var(--color-primary);
  border-radius: var(--radius-full);
}

.use-card__note {
  padding-top: var(--space-3);
  border-top: var(--border-width) solid var(--color-border);
}

@media (min-width: 64em) {
  .use-grid {
    grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
    gap: var(--space-16);
  }
}

/* ---- How long each application works: timeline ---- */
.app-timeline {
  position: relative;
  display: grid;
  gap: var(--space-8);
  padding: 0 0 0 var(--space-8);
  list-style: none;
}

/* Track and its progress fill: vertical on phones, horizontal from 48em */
.app-timeline::before,
.app-timeline::after {
  content: "";
  position: absolute;
  top: 0.5rem;
  bottom: 0.5rem;
  left: 0.4375rem;
  width: 2px;
  background-color: var(--color-border-strong);
}

.app-timeline::after {
  background-color: var(--color-primary);
  transform-origin: top;
}

.app-timeline__step {
  position: relative;
}

.app-timeline__step::before {
  content: "";
  position: absolute;
  top: 0.3rem;
  left: calc(-1 * var(--space-8));
  z-index: 1;
  width: 1rem;
  height: 1rem;
  background-color: var(--color-panel);
  border: 2px solid var(--color-primary);
  border-radius: var(--radius-full);
}

.app-timeline__when {
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
  color: var(--color-primary);
}

.app-timeline__what {
  margin-top: var(--space-2);
  font-family: var(--font-heading);
  font-size: var(--text-2xl);
  line-height: var(--leading-snug);
  color: var(--color-ink);
}

.app-timeline__note {
  margin-top: var(--space-12);
  font-size: var(--text-lg);
  color: var(--color-text-muted);
}

@media (min-width: 48em) {
  .app-timeline {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    padding: var(--space-10) 0 0;
  }

  .app-timeline::before,
  .app-timeline::after {
    top: 0.4375rem;
    bottom: auto;
    left: 0;
    right: 0;
    width: auto;
    height: 2px;
  }

  .app-timeline::after {
    transform-origin: left;
  }

  .app-timeline__step {
    padding-right: var(--space-8);
  }

  .app-timeline__step::before {
    top: calc(-1 * var(--space-10));
    left: 0;
  }
}

/* ---- Safety: intro + care checklist ---- */
.safety {
  display: grid;
  gap: var(--space-10);
  align-items: start;
}

.safety__intro > * + * {
  margin-top: var(--space-4);
}

.safety__card {
  padding: var(--space-6);
  background-color: var(--color-surface-lilac);
  border-radius: var(--radius-xl);
}

.safety__title {
  font-size: var(--text-2xl);
}

.care-list {
  margin-top: var(--space-4);
  padding: 0;
  list-style: none;
}

.care-list li {
  display: flex;
  align-items: flex-start;
  gap: var(--space-4);
  padding-block: var(--space-4);
  border-top: var(--border-width) solid var(--color-border-strong);
}

.care-list li:first-child {
  border-top: 0;
}

.care-list__icon {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 2rem;
  height: 2rem;
  font-size: 1rem;
  color: var(--color-primary);
  background-color: var(--color-panel);
  border-radius: var(--radius-full);
}

@media (min-width: 48em) {
  .safety__card {
    padding: var(--space-10);
  }
}

@media (min-width: 64em) {
  .safety {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
    gap: var(--space-16);
  }
}

/* ---- Common questions ---- */
.spicule-faq {
  display: grid;
  gap: var(--space-8);
  align-items: start;
}

.spicule-faq > * {
  min-width: 0;
}

.spicule-faq__intro > * + * {
  margin-top: var(--space-4);
}

@media (min-width: 64em) {
  .spicule-faq {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr);
    gap: var(--space-16);
  }

  .spicule-faq__intro {
    position: sticky;
    top: 6.5rem;
  }
}

/* ---- Motion (only when the user hasn't asked for less) ---- */
@keyframes spicule-peptide-pulse {
  0%, 100% { transform: scale(1); opacity: 0.6; }
  50% { transform: scale(1.35); opacity: 0.9; }
}

@media (prefers-reduced-motion: no-preference) {
  /* Spicule figure: the peptide coating breathes gently */
  .spicule-figure.is-visible .spicule-figure__peptides circle {
    animation: spicule-peptide-pulse 3s ease-in-out infinite;
  }

  .spicule-figure.is-visible .spicule-figure__peptides circle:nth-child(even) {
    animation-delay: 1.5s;
  }

  /* Steps: the connecting line draws across, then each step rises in turn */
  .has-reveal .work-steps::after {
    transform: scaleX(0);
    transition: transform 1600ms var(--ease-out) 200ms;
  }

  .has-reveal .work-steps.is-visible::after {
    transform: scaleX(1);
  }

  .has-reveal .work-steps__item {
    opacity: 0;
    transform: translateY(1.5rem);
    transition: opacity 800ms var(--ease-out), transform 800ms var(--ease-out);
  }

  .has-reveal .work-steps.is-visible .work-steps__item {
    opacity: 1;
    transform: none;
  }

  .has-reveal .work-steps.is-visible .work-steps__item:nth-child(2) { transition-delay: 450ms; }
  .has-reveal .work-steps.is-visible .work-steps__item:nth-child(3) { transition-delay: 900ms; }

  .work-steps__icon {
    transition: transform var(--duration-base) var(--ease-out), background-color var(--duration-base) var(--ease-standard);
  }

  .work-steps__item:hover .work-steps__icon {
    transform: translateY(-4px);
    background-color: var(--color-lilac-soft);
  }

  /* Timeline: the progress line fills, then the dots fill in turn */
  .has-reveal .app-timeline::after {
    transform: scale(1, 0);
    transition: transform 2200ms var(--ease-out) 200ms;
  }

  .has-reveal .app-timeline.is-visible::after {
    transform: none;
  }

  .has-reveal .app-timeline__step::before {
    transition: background-color 400ms var(--ease-standard);
  }

  .has-reveal .app-timeline.is-visible .app-timeline__step::before {
    background-color: var(--color-primary);
  }

  .has-reveal .app-timeline.is-visible .app-timeline__step:nth-child(1)::before { transition-delay: 300ms; }
  .has-reveal .app-timeline.is-visible .app-timeline__step:nth-child(2)::before { transition-delay: 1100ms; }
  .has-reveal .app-timeline.is-visible .app-timeline__step:nth-child(3)::before { transition-delay: 1900ms; }

  .trait-chips li {
    transition: background-color var(--duration-base) var(--ease-standard), border-color var(--duration-base) var(--ease-standard);
  }

  .trait-chips li:hover {
    background-color: var(--color-lilac-soft);
    border-color: var(--color-primary);
  }
}

@media (min-width: 48em) and (prefers-reduced-motion: no-preference) {
  .has-reveal .app-timeline::after {
    transform: scale(0, 1);
  }
}
