/* HajoSign — home page sections.
   Tokens, the nav and shared blocks are in site.css, which must load first. */

/* Extends the dark hero below its original edge. The full photograph remains
   untouched; this separate wedge creates the same descending oblique handoff
   used by the catalogue header. */
.sv-hero-oblique {
  position: relative;
  z-index: 2;
  height: clamp(1.5rem, 2.5vw, 3rem);
  margin-top: -1px;
  background: #030304;
  clip-path: polygon(0 0, 100% 0, 100% 100%, 0 0);
  pointer-events: none;
}

/* ---------- roadmap ---------- */

.sv-road {
  padding: clamp(3.5rem, 8vw, 6.5rem) 0 clamp(4rem, 9vw, 7rem);
}

/* Extends .sv-title in site.css; only the measure differs. */
.sv-road__title {
  max-width: 16ch;
}

.sv-road__lede {
  margin: 0 0 clamp(2.5rem, 6vw, 5rem);
  max-width: 34ch;
  font-size: clamp(1.05rem, 1.5vw, 1.35rem);
  line-height: 1.5;
  color: var(--sv-ink-soft);
}

/* The map is a fixed-ratio box so the SVG's user units and the cards'
   percentage positions describe the same grid. Node at 456,125 in the path
   is the node at 38%,10% in the markup — change one, change the other.
   The switchback is kept narrow, between 38% and 62%, so the cards can sit
   clear of it on either side instead of crossing it.

   The box is deliberately taller than the content needs: its height is the
   scroll distance one pass of the line costs, so this is half of the pacing.
   The other half is the window in home.js. */
.sv-map {
  position: relative;
  aspect-ratio: 1200 / 1600;

  /* The finished state is the default, so with no JS the roadmap is simply a
     drawn line with all five steps up — readable, just not animated. The
     inline script in the head flips it back to 0 before first paint, so the
     enhanced path never flashes its end state. A --sv-len of 0 means no dash
     pattern at all, which is a solid line. */
  --sv-len: 0;
  --sv-progress: 1;
}

.sv-js .sv-map {
  --sv-progress: 0;
}

.sv-map__svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.sv-map__track {
  fill: none;
  stroke: var(--sv-line);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* One number draws the line: dasharray is the whole length, and the offset
   walks it back to zero as --sv-progress runs 0 -> 1. */
.sv-map__line {
  fill: none;
  stroke: var(--sv-orange);
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: var(--sv-len, 4000);
  stroke-dashoffset: calc(var(--sv-len, 4000) * (1 - var(--sv-progress, 0)));
}

/* The print head, moved along the path by services.js sampling it. */
.sv-map__head {
  opacity: clamp(0, calc(var(--sv-progress, 0) * 24), 1);
}

.sv-map__head-glow {
  fill: var(--sv-orange);
  opacity: 0.18;
}

.sv-map__head-body {
  fill: var(--sv-orange);
}

/* Each step carries the progress value it wants to appear at, and derives its
   own state from the shared number by arithmetic. No per-node observers. */
.sv-step {
  position: absolute;
  top: var(--y);
  width: min(22rem, 30%);
  opacity: clamp(0, calc((var(--sv-progress, 0) - var(--sv-at)) * 9), 1);
  translate: 0 -50%;
  transform: translateY(
    clamp(0px, calc((var(--sv-at) - var(--sv-progress, 0)) * 90px), 18px)
  );
  will-change: opacity, transform;
}

/* Cards live outside the switchback: left nodes hang their card off to the
   left, right nodes to the right. Nothing crosses the line. */
.sv-step--left {
  right: 66%;
  text-align: right;
}

.sv-step--right {
  left: 66%;
}

.sv-step__num {
  display: block;
  font-family: var(--sv-mono);
  font-size: 0.78rem;
  letter-spacing: 0.2em;
  color: var(--sv-orange);
  margin-bottom: 0.55rem;
}

.sv-step__title {
  margin: 0 0 0.5rem;
  font-family: var(--sv-display);
  font-weight: 700;
  font-size: clamp(1.6rem, 2.9vw, 2.6rem);
  line-height: 1;
  letter-spacing: -0.01em;
  text-transform: uppercase;
}

.sv-step__body {
  margin: 0;
  font-size: clamp(0.95rem, 1.15vw, 1.05rem);
  line-height: 1.5;
  color: var(--sv-ink-soft);
  max-width: 26ch;
}

.sv-step--left .sv-step__body {
  margin-left: auto;
}

/* Each node and the step it belongs to share a wrapper, so the pair can be an
   absolutely-placed node plus an offset card here, and a simple flex row when
   the switchback collapses. `display: contents` keeps the wrapper out of the
   way entirely while the map is doing the positioning. */
.sv-point {
  display: contents;
}

/* The station on the line: a white disc that interrupts the stroke, carrying
   the icon for its step. */
.sv-node {
  position: absolute;
  left: var(--x);
  top: var(--y);
  display: grid;
  place-items: center;
  width: 4rem;
  height: 4rem;
  margin: -2rem 0 0 -2rem;
  border-radius: 50%;
  background: var(--sv-paper);
  border: 2px solid var(--sv-line);
}

/* The orange ring arrives with the line, over the grey one. */
.sv-node::before {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: 50%;
  border: 2px solid var(--sv-orange);
  opacity: clamp(0, calc((var(--sv-progress, 0) - var(--sv-at)) * 14), 1);
}

/* 4.95:1 on white even at rest, so the icon is legible before its step is
   reached rather than a grey smudge. */
.sv-node__icon {
  width: 2rem;
  height: 2rem;
  color: var(--sv-orange-deep);
  opacity: clamp(0.34, calc((var(--sv-progress, 0) - var(--sv-at)) * 14), 1);
  transform: scale(clamp(0.86, calc(0.86 + (var(--sv-progress, 0) - var(--sv-at)) * 2), 1));
}

/* ---------- narrow ---------- */

/* A zigzag needs width. Below this the map becomes a straight spine with the
   steps stacked down it — same progress number, no SVG, no measuring. */
@media (max-width: 860px) {
  .sv-map {
    aspect-ratio: auto;
  }

  .sv-map__svg {
    display: none;
  }

  /* Badge, then card. The spine runs behind the badges, which interrupt it
     exactly as they interrupt the drawn line on a wide screen. */
  .sv-point {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: flex-start;
    gap: clamp(0.85rem, 3vw, 1.25rem);
    margin-bottom: clamp(2.5rem, 8vw, 3.5rem);
  }

  .sv-point:last-child {
    margin-bottom: 0;
  }

  /* `relative`, not `static`: the orange ring is an absolutely-positioned
     ::before, and a static badge would hand it .sv-map as its containing
     block — which draws one ellipse the size of the whole roadmap. */
  .sv-node {
    position: relative;
    left: auto;
    top: auto;
    margin: 0;
    flex: none;
    width: 2.6rem;
    height: 2.6rem;
  }

  .sv-node__icon {
    width: 1.3rem;
    height: 1.3rem;
  }

  /* The spine and its fill, in place of the drawn path. */
  .sv-map::before,
  .sv-map::after {
    content: '';
    position: absolute;
    /* Centred on the 2.6rem badges. */
    left: calc(1.3rem - 1px);
    top: 1.3rem;
    bottom: 1.3rem;
    width: 2px;
    border-radius: 2px;
    z-index: 0;
  }

  .sv-map::before {
    background: var(--sv-line);
  }

  .sv-map::after {
    bottom: auto;
    height: calc((100% - 2.6rem) * var(--sv-progress, 0));
    background: var(--sv-orange);
  }

  .sv-step {
    position: static;
    top: auto;
    width: auto;
    max-width: 34rem;
    margin: 0;
    text-align: left;
    translate: none;
  }

  .sv-step--left,
  .sv-step--right {
    right: auto;
    left: auto;
    text-align: left;
  }

  .sv-step--left .sv-step__body {
    margin-left: 0;
  }
}

/* ---------- reduced motion ---------- */

/* Nothing animates and nothing is hidden: the line is fully drawn, every step
   is up, the head is parked at the end. */
@media (prefers-reduced-motion: reduce) {
  .sv-step {
    opacity: 1;
    transform: none;
  }

  .sv-node::before {
    opacity: 1;
  }

  .sv-node__icon {
    opacity: 1;
    transform: none;
  }

  .sv-map__line {
    stroke-dashoffset: 0;
  }

  .sv-cta {
    transition: none;
  }
}

/* ---------- who we are ---------- */

.sv-who {
  padding: clamp(4rem, 9vw, 7rem) 0 clamp(3rem, 7vw, 5rem);
}

.sv-who__copy {
  max-width: 58ch;
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
}

.sv-who__copy p {
  margin: 0;
  font-size: clamp(1rem, 1.2vw, 1.1rem);
  line-height: 1.65;
  color: var(--sv-ink-soft);
}

.sv-who__copy p:first-child {
  font-size: clamp(1.15rem, 1.7vw, 1.45rem);
  line-height: 1.5;
  color: var(--sv-ink);
}

/* ---------- stats ---------- */

.sv-stats {
  background: var(--sv-paper-warm);
  border-block: 1px solid var(--sv-orange-wash);
  padding: clamp(3rem, 7vw, 5rem) 0;
}

.sv-stats__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
  gap: clamp(2rem, 5vw, 3.5rem);
}

/* A rule over each figure gives the row structure, and stops the numerals from
   floating unanchored on the warm ground. */
.sv-stat {
  padding-top: clamp(1rem, 2vw, 1.4rem);
  border-top: 1px solid rgba(11, 11, 12, 0.16);
}

.sv-stat__num {
  /* It is a <p>: without this the browser's 1em block margins add ~48px above
     and below every figure. */
  margin: 0;
  display: flex;
  align-items: baseline;
  gap: 0.1em;
  font-family: var(--sv-display);
  font-weight: 700;
  font-size: clamp(3rem, 7vw, 5rem);
  line-height: 0.9;
  letter-spacing: -0.02em;
  color: var(--sv-orange);
  /* The figure is set in tabular digits so the width does not jitter while it
     counts up. */
  font-variant-numeric: tabular-nums;
}

.sv-stat__suffix {
  font-size: 0.5em;
}

/* Set in the body face, not the mono one. Mono at 11px with 0.16em tracking is
   the site's language for tags and eyebrows — three or four words of plain
   English under a 5rem numeral is copy, and wants reading, not spacing out. */
.sv-stat__label {
  margin: clamp(0.75rem, 1.5vw, 1rem) 0 0;
  font-family: var(--sv-body);
  font-size: clamp(0.95rem, 1.15vw, 1.0625rem);
  font-weight: 500;
  line-height: 1.35;
  letter-spacing: 0;
  text-transform: none;
  color: var(--sv-ink-soft);
  max-width: 14ch;
}

/* ---------- featured machines ---------- */

.sv-featured {
  position: relative;
  padding: clamp(4rem, 9vw, 7rem) 0 clamp(3rem, 7vw, 5rem);
  background:
    radial-gradient(circle at 90% 18%, rgba(255, 90, 10, 0.09), transparent 26rem),
    linear-gradient(180deg, #fff 0%, #fff8f3 50%, #fff 100%);
  overflow: hidden;
}

.sv-featured::before {
  content: '';
  position: absolute;
  top: clamp(3rem, 8vw, 6rem);
  right: -4rem;
  width: 15rem;
  height: 15rem;
  border: 1px solid rgba(255, 90, 10, 0.12);
  border-radius: 50%;
  box-shadow: 0 0 0 3rem rgba(255, 90, 10, 0.025),
    0 0 0 6rem rgba(255, 90, 10, 0.018);
  pointer-events: none;
}

.sv-featured .sv-wrap {
  position: relative;
  z-index: 1;
}

.sv-featured__head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: clamp(2rem, 5vw, 3rem);
}

.sv-featured__head .sv-title {
  margin-bottom: 0;
  max-width: 19ch;
}

.sv-featured__head .sv-cta {
  min-height: 3.5rem;
  padding: 0.4rem 0.45rem 0.4rem 1.45rem;
  border-radius: 999px;
  background: var(--sv-ink);
  color: #fff;
}

.sv-featured__head .sv-cta::after {
  content: '↗';
  display: grid;
  place-items: center;
  width: 2.65rem;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--sv-orange);
  color: var(--sv-ink);
  font-family: var(--sv-body);
  font-size: 1.15rem;
  transition: transform 220ms var(--sv-ease), background-color 220ms var(--sv-ease);
}

.sv-featured__head .sv-cta:hover {
  background: #24211f;
  transform: translateY(-2px);
}

.sv-featured__head .sv-cta:hover::after {
  transform: rotate(45deg);
  background: #ff7128;
}

@media (min-width: 900px) {
  .sv-featured .sv-grid {
    grid-template-columns: 1.16fr 0.92fr 0.92fr;
  }
}

@media (max-width: 640px) {
  .sv-featured__head {
    align-items: flex-start;
  }

  .sv-featured__head .sv-cta {
    width: 100%;
    justify-content: space-between;
  }
}

/* ---------- clients ---------- */

.sv-clients {
  padding: clamp(3rem, 7vw, 5rem) 0;
}

/* Full width of the section rather than the text column, so the names run off
   both edges instead of stopping at a margin. */
.sv-marquee {
  position: relative;
  margin-top: clamp(1.75rem, 4vw, 2.75rem);
  overflow: hidden;
  /* Softens both ends, so items arrive and leave rather than being clipped. */
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
}

.sv-marquee__track {
  display: flex;
  width: max-content;
  animation: sv-marquee-scroll 42s linear infinite;
}

/* One row's width is exactly half the track, so -50% lands the copy where the
   original started and the seam never shows. */
@keyframes sv-marquee-scroll {
  to {
    transform: translateX(-50%);
  }
}

/* Long enough to read a name that catches your eye. */
.sv-marquee:hover .sv-marquee__track,
.sv-marquee:focus-within .sv-marquee__track {
  animation-play-state: paused;
}

.sv-marquee__row {
  display: flex;
  align-items: center;
  gap: clamp(2.5rem, 6vw, 4.5rem);
  /* Matches the gap, so the join between the two copies is evenly spaced. */
  padding-right: clamp(2.5rem, 6vw, 4.5rem);
  margin: 0;
  list-style: none;
}

.sv-marquee__item {
  display: flex;
  align-items: center;
  gap: clamp(2.5rem, 6vw, 4.5rem);
  white-space: nowrap;
  font-family: var(--sv-display);
  font-weight: 700;
  font-size: clamp(1.15rem, 2vw, 1.6rem);
  line-height: 1;
  letter-spacing: 0.005em;
  text-transform: uppercase;
  /* 7.3:1 on white — quiet enough to read as a logo wall, still legible. */
  color: var(--sv-ink-soft);
}

.sv-marquee__item::after {
  content: '';
  width: 0.375rem;
  height: 0.375rem;
  border-radius: 50%;
  background: var(--sv-orange);
  flex: none;
}

/* The marquee is defined below the roadmap's reduced-motion block, so its own
   override has to come after it — a media query adds no specificity, and the
   later rule would otherwise win. */
@media (prefers-reduced-motion: reduce) {
  /* No travel: the second copy goes, and the first wraps as an ordinary row. */
  .sv-marquee {
    -webkit-mask-image: none;
    mask-image: none;
  }

  .sv-marquee__track {
    animation: none;
    width: 100%;
  }

  .sv-marquee__row[aria-hidden='true'] {
    display: none;
  }

  .sv-marquee__row {
    flex-wrap: wrap;
    gap: clamp(1rem, 3vw, 2rem);
    padding-right: 0;
  }
}
