:root {
  --graphite: oklch(0.34 0.022 185);
  --registration-red: oklch(0.64 0.19 29);
  --workbench: oklch(0.965 0.012 105);
}

.hero h1 {
  width: fit-content;
  max-width: 100%;
  display: grid;
  gap: 6px;
  font-size: clamp(76px, 10.6vw, 156px);
}

.hero-we {
  padding-left: 0.1em;
  font-size: 0.13em;
  font-weight: 750;
  line-height: 1;
}

.hero-primus {
  line-height: 0.92;
}

.hero-plane-paper {
  background:
    linear-gradient(78deg, transparent 0 47%, oklch(0.64 0.19 29 / 0.34) 47% 47.5%, transparent 47.5%),
    linear-gradient(to right, var(--line) 1px, transparent 1px),
    linear-gradient(to bottom, var(--line) 1px, transparent 1px),
    var(--paper);
  background-size: auto, 42px 42px, 42px 42px, auto;
}

.hero-plane-paper i:first-of-type {
  background:
    linear-gradient(112deg, transparent 0 52%, var(--registration-red) 52% 54%, transparent 54%),
    var(--paper-warm);
}

.hero-plane-interface {
  border-top-color: var(--registration-red);
}

.hero-plane-acrylic {
  background: oklch(0.82 0.14 132 / 0.78);
}

.evolution {
  position: relative;
  padding: clamp(108px, 12vw, 176px) 0 clamp(92px, 10vw, 148px);
  overflow: clip;
  background:
    linear-gradient(to right, var(--line) 1px, transparent 1px),
    var(--workbench);
  background-size: calc(100vw / 12) 100%;
  border-bottom: 1px solid var(--line-strong);
}

.evolution::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: calc(50% - min(660px, calc(50vw - 48px)));
  width: 1px;
  background: var(--registration-red);
  opacity: 0.48;
}

.evolution-heading {
  display: grid;
  grid-template-columns: 0.48fr minmax(0, 1.22fr) minmax(250px, 0.55fr);
  gap: 34px;
  align-items: end;
}

.evolution-heading h2 {
  max-width: 13ch;
  margin: 0;
  font-size: clamp(48px, 5.7vw, 82px);
  line-height: var(--heading-leading);
}

.evolution-heading > p:last-child {
  max-width: 27ch;
  margin: 0 0 7px;
  color: var(--ink-soft);
  font-size: 16px;
  line-height: 1.55;
}

.evolution-composer {
  position: relative;
  margin-top: clamp(64px, 7vw, 104px);
  display: grid;
  grid-template-columns: minmax(230px, 0.58fr) minmax(0, 1.78fr);
  border-top: 1px solid var(--line-strong);
  border-bottom: 1px solid var(--line-strong);
}

@media (min-width: 821px) and (prefers-reduced-motion: no-preference) {
  .evolution {
    --evolution-scroll-travel: clamp(1040px, 136vh, 1440px);
    overflow: visible;
  }

  .evolution-scroll-track {
    height: calc(
      var(--evolution-composer-height, 504px) +
      var(--evolution-scroll-travel)
    );
    margin-top: clamp(64px, 7vw, 104px);
  }

  .js .evolution-composer.reveal,
  .js .evolution-composer.reveal.is-visible {
    position: sticky;
    top: clamp(78px, 9vh, 104px);
    margin-top: 0;
    z-index: 1;
    transform: none;
  }
}

.origin-archive {
  min-width: 0;
  padding: 26px 28px 28px 0;
  border-right: 1px solid var(--line-strong);
}

.origin-portrait {
  position: relative;
  aspect-ratio: 1 / 1.04;
  overflow: hidden;
  background:
    linear-gradient(to right, oklch(0.975 0.008 120 / 0.07) 1px, transparent 1px),
    linear-gradient(to bottom, oklch(0.975 0.008 120 / 0.07) 1px, transparent 1px),
    var(--ink);
  background-size: 34px 34px;
}

.origin-portrait::after {
  content: "";
  position: absolute;
  inset: 14px;
  border: 1px solid oklch(0.975 0.008 120 / 0.22);
  pointer-events: none;
}

.origin-portrait img {
  width: 100%;
  height: 122%;
  object-fit: cover;
  object-position: center top;
  filter: saturate(0.58) contrast(1.06);
  transform: scale(1.04) translateY(-2%);
  transform-origin: top center;
  transition:
    filter 520ms cubic-bezier(0.16, 1, 0.3, 1),
    transform 720ms cubic-bezier(0.16, 1, 0.3, 1);
}

.evolution-composer.is-complete .origin-portrait img {
  filter: saturate(0.18) contrast(1.08);
  transform: scale(1.01) translateY(-2%);
}

.origin-archive figcaption {
  padding-top: 18px;
  display: grid;
  gap: 6px;
}

.origin-archive figcaption span,
.origin-archive figcaption strong,
.evolution-resolution > span,
.evolution-state > span,
.evolution-state small {
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  letter-spacing: 0;
  text-transform: uppercase;
}

.origin-archive figcaption span,
.evolution-state > span,
.evolution-state small {
  color: var(--muted);
  font-size: 9px;
  line-height: 1.45;
}

.origin-archive figcaption strong {
  color: var(--ink);
  font-size: 10px;
}

.evolution-sequence {
  position: relative;
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.evolution-sequence::before,
.evolution-sequence::after {
  content: "";
  position: absolute;
  z-index: 0;
  top: 50%;
  left: 0;
  height: 1px;
  transform: translateY(-50%);
}

.evolution-sequence::before {
  width: 100%;
  background: var(--line-strong);
}

.evolution-sequence::after {
  width: 100%;
  background: var(--registration-red);
  transform: translateY(-50%) scaleX(var(--evolution-progress, 0.04));
  transform-origin: left center;
  transition: transform 760ms cubic-bezier(0.16, 1, 0.3, 1);
}

.evolution-state {
  position: relative;
  z-index: 1;
  min-width: 0;
  min-height: 410px;
  padding: 24px 15px 26px;
  display: grid;
  grid-template-rows: auto 1fr auto auto;
  background: oklch(0.965 0.012 105 / 0.88);
  border-right: 1px solid var(--line);
  transition:
    background-color 420ms cubic-bezier(0.16, 1, 0.3, 1),
    color 420ms cubic-bezier(0.16, 1, 0.3, 1);
}

.evolution-state:last-child {
  border-right: 0;
}

.evolution-state::before {
  content: "";
  position: absolute;
  top: calc(50% - 4px);
  left: calc(50% - 4px);
  width: 8px;
  height: 8px;
  background: var(--workbench);
  border: 1px solid var(--ink);
  transition:
    background-color 280ms cubic-bezier(0.16, 1, 0.3, 1),
    transform 280ms cubic-bezier(0.16, 1, 0.3, 1);
}

.evolution-state.is-active {
  background: var(--paper);
}

.evolution-state.is-active::before {
  background: var(--registration-red);
  border-color: var(--registration-red);
  transform: rotate(45deg) scale(1.15);
}

.evolution-state strong {
  margin-top: 17px;
  font-size: clamp(15px, 1.4vw, 20px);
}

.evolution-state small {
  min-height: 42px;
  margin-top: 8px;
}

.state-glyph {
  position: relative;
  width: min(92px, 78%);
  aspect-ratio: 1;
  align-self: center;
  justify-self: center;
  color: var(--ink);
  transform: translateY(-9px);
}

.state-glyph i {
  position: absolute;
  display: block;
  background: currentColor;
  transition: transform 720ms cubic-bezier(0.16, 1, 0.3, 1);
}

.state-glyph-craft i:nth-child(1) {
  top: 12%;
  left: 15%;
  width: 5px;
  height: 78%;
  transform: rotate(27deg);
}

.state-glyph-craft i:nth-child(2) {
  top: 24%;
  right: 14%;
  width: 5px;
  height: 67%;
  background: var(--registration-red);
  transform: rotate(-18deg);
}

.state-glyph-craft i:nth-child(3) {
  top: 45%;
  left: 18%;
  width: 70%;
  height: 1px;
  background: var(--line-strong);
}

.state-glyph-structure {
  border: 1px solid var(--line-strong);
  background:
    linear-gradient(to right, var(--line) 1px, transparent 1px),
    linear-gradient(to bottom, var(--line) 1px, transparent 1px);
  background-size: 25% 25%;
}

.state-glyph-structure i {
  width: 10px;
  height: 10px;
  background: var(--blue);
}

.state-glyph-structure i:nth-child(1) { top: 12%; left: 12%; }
.state-glyph-structure i:nth-child(2) { top: 12%; right: 12%; }
.state-glyph-structure i:nth-child(3) { right: 12%; bottom: 12%; }
.state-glyph-structure i:nth-child(4) { bottom: 12%; left: 12%; }

.state-glyph-interface {
  border: 1px solid var(--ink);
  box-shadow: 9px 9px 0 var(--surface-sage);
}

.state-glyph-interface i:nth-child(1) {
  top: 12%;
  left: 10%;
  width: 80%;
  height: 2px;
}

.state-glyph-interface i:nth-child(2) {
  top: 30%;
  left: 10%;
  width: 32%;
  height: 50%;
  background: var(--coral);
}

.state-glyph-interface i:nth-child(3) {
  top: 30%;
  right: 10%;
  width: 40%;
  height: 50%;
  background: var(--ink);
}

.state-glyph-system i {
  width: 25%;
  aspect-ratio: 1;
  border: 1px solid var(--ink);
  background: var(--paper);
}

.state-glyph-system i::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 100%;
  width: 100%;
  height: 1px;
  background: var(--ink);
}

.state-glyph-system i:nth-child(1) { top: 8%; left: 8%; }
.state-glyph-system i:nth-child(2) { top: 8%; right: 8%; background: var(--blue); }
.state-glyph-system i:nth-child(3) { right: 8%; bottom: 8%; }
.state-glyph-system i:nth-child(4) { bottom: 8%; left: 8%; background: var(--lime); }
.state-glyph-system i:nth-child(2)::after,
.state-glyph-system i:nth-child(3)::after { display: none; }

.state-glyph-intelligence {
  border: 1px solid var(--line-strong);
  border-radius: 50%;
}

.state-glyph-intelligence::before,
.state-glyph-intelligence::after {
  content: "";
  position: absolute;
  inset: 18%;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
}

.state-glyph-intelligence::after {
  inset: 37%;
  background: var(--lime);
  border-color: var(--ink);
}

.state-glyph-intelligence i {
  top: 48%;
  left: 48%;
  width: 5px;
  height: 5px;
  background: var(--registration-red);
}

.state-glyph-intelligence i:nth-child(1) { transform: translate(-36px, -22px); }
.state-glyph-intelligence i:nth-child(2) { transform: translate(30px, -30px); }
.state-glyph-intelligence i:nth-child(3) { transform: translate(34px, 27px); }
.state-glyph-intelligence i:nth-child(4) { transform: translate(-30px, 31px); }
.state-glyph-intelligence i:nth-child(5) { transform: translate(-2px, -2px); }

.evolution-resolution {
  grid-column: 1 / -1;
  min-height: 92px;
  padding: 18px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  border-top: 1px solid var(--line-strong);
}

.evolution-resolution > span {
  color: var(--muted);
  font-size: 9px;
}

.evolution-resolution picture,
.evolution-resolution img {
  display: block;
}

.evolution-resolution img {
  width: clamp(210px, 19vw, 280px);
}

.canvas-intro {
  background:
    linear-gradient(135deg, oklch(0.64 0.19 29 / 0.045), transparent 42%),
    var(--canvas);
}

@media (max-width: 1100px) {
  .evolution-heading {
    grid-template-columns: 0.42fr 1.58fr;
  }

  .evolution-heading > p:last-child {
    grid-column: 2;
  }

  .evolution-composer {
    grid-template-columns: 240px minmax(0, 1fr);
  }

  .evolution-state {
    min-height: 360px;
    padding-inline: 10px;
  }
}

@media (max-width: 820px) {
  .evolution-composer {
    display: block;
  }

  .origin-archive {
    display: grid;
    grid-template-columns: minmax(180px, 0.58fr) 1fr;
    gap: 24px;
    align-items: end;
    padding: 0 0 28px;
    border-right: 0;
  }

  .origin-portrait {
    max-width: 280px;
  }

  .evolution-sequence {
    border-top: 1px solid var(--line-strong);
  }

  .evolution-resolution {
    border-top: 1px solid var(--line-strong);
  }
}

@media (max-width: 720px) {
  .hero h1 {
    gap: 4px;
    font-size: clamp(54px, 17.5vw, 72px);
  }

  .hero-we {
    font-size: 0.15em;
  }

  .evolution {
    padding: 84px 0 76px;
    background-size: calc(100vw / 4) 100%;
  }

  .evolution::before {
    left: 16px;
  }

  .evolution-heading {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .evolution-heading > p:last-child {
    grid-column: auto;
  }

  .evolution-heading h2 {
    font-size: 42px;
  }

  .evolution-composer {
    margin-top: 48px;
  }

  .origin-archive {
    grid-template-columns: 140px 1fr;
    gap: 18px;
  }

  .evolution-sequence {
    display: block;
  }

  .evolution-sequence::before,
  .evolution-sequence::after {
    top: 0;
    bottom: 0;
    left: 24px;
    width: 1px;
    height: auto;
    transform: none;
  }

  .evolution-sequence::after {
    transform: scaleY(var(--evolution-progress, 0.04));
    transform-origin: center top;
  }

  .evolution-state {
    min-height: 176px;
    padding: 22px 8px 22px 54px;
    grid-template-columns: 34px 92px minmax(0, 1fr);
    grid-template-rows: auto auto;
    column-gap: 14px;
    align-items: center;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .evolution-state::before {
    top: calc(50% - 4px);
    left: 20px;
  }

  .evolution-state > span {
    grid-column: 1;
    grid-row: 1 / -1;
  }

  .state-glyph {
    grid-column: 2;
    grid-row: 1 / -1;
    width: 76px;
    transform: none;
  }

  .evolution-state strong {
    grid-column: 3;
    margin-top: 0;
    font-size: 18px;
  }

  .evolution-state small {
    grid-column: 3;
    min-height: 0;
    margin-top: 3px;
  }

  .evolution-resolution {
    min-height: 112px;
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  .evolution-sequence::after {
    transform: translateY(-50%) scaleX(1);
  }

  .evolution-state {
    background: var(--paper);
  }

  .evolution-state::before {
    background: var(--registration-red);
    border-color: var(--registration-red);
  }

  .origin-portrait img {
    filter: saturate(0.18) contrast(1.08);
    transform: scale(1.01) translateY(-2%);
  }
}

@media (max-width: 720px) and (prefers-reduced-motion: reduce) {
  .evolution-sequence::after {
    transform: scaleY(1);
  }
}
