/* ---------------------------------------------------------------------------
   The brewed method + ink wipe.

   Plain CSS on the tokens in css/tokens.css.
   The offsets here use the `translate` property, not `transform`, so GSAP's transform
   tweens (y, scale, x) never clobber them.
   --------------------------------------------------------------------------- */

/* ---- Ink wipe ------------------------- */

.ink-filter-defs {
  position: absolute;
  pointer-events: none;
}

/* The wrapper around the hero that the ink layer is positioned against. */
.ink-hero-wrap {
  position: relative;
}

.ink-layer {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 100vh;
  z-index: 40;
  overflow: hidden;
  pointer-events: none;
}

/* Oversized by 300px on every side so the displacement never samples the clip edge. */
.ink-layer__filter {
  position: absolute;
  inset: -300px;
  filter: url(#ink-edge);
  will-change: transform;
}

.ink-layer__fill {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--color-bg-light); /* inkColor "#FFFFFF" (MC:2100), palette off-white - hands off to --method-bg's start */
  transform-origin: bottom;
  transform: scaleY(0);
  will-change: transform;
}

/* ---- Section root ------------------------------------------------------- */

.method {
  --method-bg: var(--color-bg-light);
  --method-fg: var(--color-fg-light);
  --method-border: rgba(15, 15, 16, 0.14);
  --method-c: 0;
  position: relative;
  width: 100%;
  background-color: var(--method-bg);
  color: var(--method-fg);
  transition: none;
}

.method-accent {
  color: var(--color-accent);
}

/* ---- Rail (pinned) ------------------------------------------------------ */

.method-rail {
  position: relative;
  height: 100vh;
  height: 100svh;
  width: 100vw;
  overflow: hidden;
}

.method-sweep {
  pointer-events: none;
  position: absolute;
  inset: 0;
  z-index: 10;
}

.particle-sweep {
  pointer-events: none;
  position: absolute;
  inset: 0;
}

/* ---- Intro card --------------------------------------- */

.method-intro {
  pointer-events: none;
  position: relative;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding-inline: 2rem;
  text-align: center;
  will-change: transform;
  opacity: 0;
}

.method-intro__eyebrow {
  font-family: var(--font-mono);
  font-size: var(--text-label);
  line-height: 1.4;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--method-fg);
}

.method-intro__title {
  margin: 1.25rem 0 0;
  font-family: var(--font-display);
  font-size: var(--text-display-xl);
  line-height: 1;
  letter-spacing: var(--tracking-display);
  font-weight: 700;
  color: var(--method-fg);
}

.method-intro__lead {
  margin: 1.75rem 0 0;
  max-width: 640px;
  font-family: var(--font-mono);
  text-wrap: balance;
  font-size: var(--text-body-lead);
  line-height: 1.6;
  color: var(--method-fg);
}

.method-intro__phases {
  margin: 1.75rem 0 0;
  font-family: var(--font-mono);
  font-size: var(--text-label-l);
  line-height: 1.2;
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--method-fg);
}

/* ---- DotBlob ------------------------------ */

.dot-blob {
  display: inline-block;
  width: 0.18em;
  height: 0.18em;
  vertical-align: baseline;
  margin-left: 0.02em;
  overflow: visible;
}

.dot-blob path {
  fill: currentColor;
}

.dot-blob--accent path {
  fill: var(--color-accent);
}

/* ---- Pipeline: three nodes on a line, blue lead travels through them -- */

.method-pipe {
  position: absolute;
  top: 22vh;
  left: 50%;
  z-index: 12;
  width: min(72vw, 880px);
  height: 3.5rem;
  margin-left: calc(min(72vw, 880px) / -2);
  container-type: inline-size;
  pointer-events: none;
  opacity: 0;
  will-change: transform, opacity;
}

.method-pipe__line {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 1px;
  background-color: var(--method-border);
}

.method-pipe__fill {
  position: absolute;
  inset: 0;
  background-color: var(--method-fg);
  transform-origin: left center;
  transform: scaleX(calc(var(--method-c) / 2));
}

.method-pipe__node {
  position: absolute;
  top: 0;
  width: 22px;
  height: 22px;
  translate: -50% -50%;
  border-radius: 50%;
  border: 1.5px solid var(--method-fg);
  background-color: var(--method-bg);
  transition:
    background-color 0.35s var(--ease-out),
    border-color 0.35s var(--ease-out),
    scale 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.method-pipe__node.is-reached {
  background-color: var(--method-fg);
  scale: 1.1;
}

.method-pipe__node--accent.is-reached {
  background-color: var(--color-accent);
  border-color: var(--color-accent);
}

.method-pipe__label {
  position: absolute;
  top: 1.5rem;
  translate: -50% 0;
  white-space: nowrap;
  font-family: var(--font-mono);
  font-size: var(--text-label);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--method-fg);
}

.method-pipe__puck {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 2;
  width: 10px;
  height: 10px;
  translate: -50% -50%;
  border-radius: 50%;
  background-color: var(--color-accent);
  transform: translateX(calc(var(--method-c) * 50cqw));
}

/* ---- Track: intro + 3 step panels, moved left to right by -- */

.method-track {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 11;
  display: flex;
  width: 400vw;
  height: 100vh;
  height: 100svh;
  pointer-events: none;
  will-change: transform;
}

.method-panel {
  flex: 0 0 100vw;
  height: 100vh;
  height: 100svh;
}

.method-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: calc(22vh + 5.5rem) 1.5rem 0;
  text-align: center;
}

.method-step__num {
  font-family: var(--font-mono);
  font-size: var(--text-label);
  letter-spacing: 0.2em;
  color: var(--method-fg);
  opacity: 0.6;
}

.method-step__name {
  margin: 0.5rem 0 0;
  font-family: var(--font-display);
  font-size: clamp(64px, 13vw, 190px);
  font-weight: 700;
  line-height: 0.95;
  letter-spacing: var(--tracking-display);
  color: var(--method-fg);
  white-space: nowrap;
}

.method-step__tagline {
  margin: 1.5rem 0 0;
  max-width: 520px;
  font-family: var(--font-mono);
  font-size: var(--text-body-lead);
  line-height: 1.5;
  text-wrap: balance;
  color: var(--method-fg);
  opacity: 0.85;
}

/* SplitText wordsClass */
.method-word {
  will-change: filter, opacity;
}

.method-step__bullets {
  margin: 2rem 0 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem clamp(1.25rem, 3vw, 2.25rem);
}

/* Each tool: icon tile above, label below */
.method-step__bullet {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  min-width: 64px;
}

.method-step__icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 16px;
  border: 1px solid var(--method-border);
  color: var(--method-fg);
}

.method-step__icon svg {
  width: 24px;
  height: 24px;
}

.method-step__label {
  font-family: var(--font-mono);
  font-size: var(--text-label-l);
  line-height: 1.2;
  color: var(--method-fg);
}

@media (max-width: 639px) {
  .method-pipe {
    top: 18vh;
    width: 76vw;
    margin-left: -38vw;
  }

  .method-step {
    padding-top: calc(18vh + 5rem);
  }
}

/* ---- Reduced motion branch ---------------------------------------------- */

.method-reduced-header {
  display: none;
}

.method-rail[data-reduced-motion='true'] {
  display: flex;
  flex-direction: column;
  height: auto;
  width: 100%;
  overflow: visible;
}

.method-rail[data-reduced-motion='true'] .method-reduced-header {
  display: block;
  padding: 6rem 2rem 3rem;
}

.method-reduced-header__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: var(--text-display-l);
  line-height: 1.05;
  letter-spacing: var(--tracking-display);
  font-weight: 700;
  color: var(--method-fg);
}

.method-reduced-header__sub {
  margin: 0.75rem 0 0;
  font-family: var(--font-mono);
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--method-fg);
  opacity: 0.35;
}

.method-rail[data-reduced-motion='true'] .method-intro,
.method-rail[data-reduced-motion='true'] .method-sweep,
.method-rail[data-reduced-motion='true'] .method-pipe {
  display: none;
}

.method-rail[data-reduced-motion='true'] .method-track {
  position: static;
  flex-direction: column;
  gap: 5rem;
  width: 100%;
  height: auto;
  padding: 2rem 0 6rem;
}

.method-rail[data-reduced-motion='true'] .method-step {
  height: auto;
  padding-top: 0;
}
