:root {
  --black: #000;
  --white: #fff;
  --morph-track: 360vh;
  --morph-outro: 120vh;
  --label-size: clamp(1rem, 1.3vw, 1.3rem);
  /* Figtree stands in for Cera Basic (TypeMates, licensed). With a license,
     add its @font-face rules and put "Cera Basic" first here. */
  --font: "Figtree", "Helvetica Neue", Helvetica, Arial, sans-serif;
  /* Frame inset + inner padding; must match inset + pad in hero-morph.js. */
  --frame-edge: 68px;
  --content-left: clamp(280px, 26vw, 460px);
  /* Keeps the section content clear of the call to action in the frame's corner. */
  --content-right: clamp(260px, 15vw, 320px);
  /* Mask shapes inlined from hexagoned-logo.svg and cta-mark.svg: Chrome will
     not load mask images from separate files on file:// pages, and inline
     shapes need no asset URLs in Webflow. */
  --mask-logo: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 462.5 133.9'%3E%3Cpolygon points='39.9,5.3 3.7,5.3 3.7,18.4 32.3,18.4 61,68 32.3,117.6 3.7,117.6 3.7,130.7 39.9,130.7 76.1,68 '/%3E%3Cg%3E%3Cpath d='M93.7,5.3h17.6v20.5H125V5.3h17.6v57H125V41.4h-13.8v20.8H93.7V5.3z'/%3E%3Cpath d='M148,5.3h41.7v15h-24.3v6.5h22.5v13.7h-22.5v6.8h24.7v15H148V5.3z'/%3E%3Cpath d='M243.2,5.3L227.6,33l16.2,29.2h-19.4l-7.2-15.6l-7.2,15.6h-19l16.3-29l-15.5-28h19.4l6.4,14.4l6.7-14.4H243.2z'/%3E%3Cpath d='M260.8,4.9h18.5l19.7,57.3h-18.6l-2.4-8.1h-16.1l-2.4,8.1h-18.3L260.8,4.9z M274.1,41.1l-4.3-14.8l-4.2,14.8H274.1z'/%3E%3Cpath d='M296.7,34.5V33c0-17.3,12.2-28.9,28.2-28.9c8.2,0,14.6,2.5,20.5,7.2l-9.3,12.9c-2.9-2.6-6.3-4.5-10.5-4.5 c-6.4,0-11.2,5.2-11.2,13.7v1c0,9.1,4.8,14,11.1,14c2.4,0,3.7-0.4,4.7-1v-6.8h-7.8V28.3h24.1v27.9c-5.5,4.1-12.9,7.2-21.6,7.2 C309.2,63.4,296.7,52.4,296.7,34.5z'/%3E%3Cpath d='M350.2,34.5v-1.5c0-17.1,11.4-29.1,27-29.1c15.7,0,27,11.8,27,28.9v1.5c0,17.1-11.5,29.1-27.1,29.1S350.2,51.6,350.2,34.5z M386.4,34.4v-1.2c0-8.5-3.6-13.4-9.3-13.4c-5.6,0-9.2,4.9-9.2,13.3v1.2c0,8.5,3.6,13.4,9.3,13.4C382.9,47.7,386.4,42.8,386.4,34.4 z'/%3E%3Cpath d='M408.5,5.3h16.7l16.2,24.1V5.3h17.2v57h-15.8l-17-25.3v25.3h-17.3V5.3z'/%3E%3C/g%3E%3Cg%3E%3Cpath d='M93.7,73.8h41.7v15h-24.3v6.5h22.5v13.7h-22.5v6.8h24.7v15H93.7V73.8z'/%3E%3Cpath d='M140.2,73.8h19.1c20.2,0,30.3,10.7,30.3,27.6v1.2c0,16.9-10.3,28.2-30.7,28.2h-18.7V73.8z M157.7,89.3v25.9h2 c7.2,0,12-3.4,12-12.4v-1.1c0-9-4.7-12.4-12-12.4H157.7z'/%3E%3C/g%3E%3C/svg%3E");
  --mask-cta: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='3.7 5.3 72.4 125.4'%3E%3Cpolygon points='39.9,5.3 76.1,5.3 76.1,18.4 47.5,18.4 18.8,68 47.5,117.6 76.1,117.6 76.1,130.7 39.9,130.7 3.7,68'/%3E%3C/svg%3E");
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  background: var(--black);
}

body {
  margin: 0;
  background: var(--black);
  color: var(--white);
  font-family: var(--font);
}

/* Temporary hold on the opening hexagon. See HOLD_FIRST_SCREEN in hero-morph.js. */
html.scroll-held,
html.scroll-held body {
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
}

html.scroll-held body {
  position: fixed;
  inset: 0;
  width: 100%;
  touch-action: none;
}

html.scroll-held .hero-morph-cue {
  display: none;
}

/* Frame colors. Registered so they can transition: the Start a project section
   inverts the frame (hero-morph.js toggles .is-inverted), and everything drawn
   in the frame's colors follows. The outline keeps a black frame readable
   against the black page. */
@property --paper {
  syntax: "<color>";
  inherits: true;
  initial-value: #fff;
}

@property --ink {
  syntax: "<color>";
  inherits: true;
  initial-value: #000;
}

@property --frame-line {
  syntax: "<number>";
  inherits: true;
  initial-value: 0;
}

.hero-morph {
  --paper: var(--white);
  --ink: var(--black);
  --frame-line: 0;
  position: relative;
  transition:
    --paper 0.6s ease,
    --ink 0.6s ease,
    --frame-line 0.6s ease;
}

.hero-morph.is-inverted {
  --paper: var(--black);
  --ink: var(--white);
  --frame-line: 0.28;
}

@media (prefers-reduced-motion: reduce) {
  .hero-morph {
    transition: none;
  }
}

.hero-morph-track {
  height: 0;
}

[data-morph-ready] .hero-morph-track {
  height: calc(var(--morph-track) - 100vh);
}

/* Scroll room after the content, where the frame closes back into the hexagon.
   The last screen of it sits under the footer. */
.hero-morph-outro {
  height: 0;
}

[data-morph-ready] .hero-morph-outro {
  height: calc(var(--morph-outro) + 100vh);
  height: calc(var(--morph-outro) + 100svh);
}

.hero-morph-stage {
  position: relative;
  top: 0;
  display: grid;
  grid-template: 1fr / 1fr;
  place-items: center;
  height: 100vh;
  height: 100svh;
  overflow: hidden;
  background: var(--black);
}

.hero-morph-canvas {
  grid-area: 1 / 1;
  display: block;
  width: min(58vw, 70vh);
  height: auto;
}

.hero-morph-canvas path {
  fill: var(--paper);
  stroke: rgb(255 255 255 / var(--frame-line));
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}

.hero-morph-logo {
  position: relative;
  grid-area: 1 / 1;
  width: min(30vw, 36vh);
  margin: 0;
  color: inherit;
  line-height: 0;
  text-decoration: none;
}

.hero-morph-logo img {
  display: block;
  width: 100%;
  height: auto;
}

/* Mesh gradient clipped to the logo shape, crossfading between a warm and a
   cool palette. */
.hero-morph-logo-fill {
  display: none;
}

@supports ((mask-image: none) or (-webkit-mask-image: none)) {
  .hero-morph-logo img {
    opacity: 0;
  }

  .hero-morph-logo-fill {
    position: absolute;
    inset: 0;
    display: block;
    overflow: hidden;
    -webkit-mask: var(--mask-logo) center / 100% 100% no-repeat;
    mask: var(--mask-logo) center / 100% 100% no-repeat;
  }

  .hero-morph-logo-mesh {
    position: absolute;
    inset: 0;
    background: #f2542d;
  }

  .hero-morph-logo-mesh::before,
  .hero-morph-logo-mesh::after {
    content: "";
    position: absolute;
    inset: -40% -12%;
    will-change: transform;
  }

  .hero-morph-logo-mesh::before {
    background:
      radial-gradient(30% 60% at 18% 40%, #ffc53d, transparent),
      radial-gradient(28% 60% at 62% 30%, #e5173f, transparent),
      radial-gradient(30% 55% at 88% 70%, #ff9f1c, transparent);
    animation: logo-mesh-a 4.5s ease-in-out infinite alternate;
  }

  .hero-morph-logo-mesh::after {
    background:
      radial-gradient(26% 55% at 78% 25%, #ffd166, transparent),
      radial-gradient(28% 60% at 36% 72%, #c2185b, transparent),
      radial-gradient(24% 50% at 50% 50%, #ff6b35, transparent);
    opacity: 0.8;
    animation: logo-mesh-b 6.5s ease-in-out infinite alternate;
  }

  .hero-morph-logo-mesh--cool {
    background: #1db9a8;
    opacity: 0;
    will-change: opacity;
    animation: logo-palette 7s ease-in-out infinite alternate;
  }

  .hero-morph-logo-mesh--cool::before {
    background:
      radial-gradient(30% 60% at 18% 40%, #3fe0d0, transparent),
      radial-gradient(28% 60% at 62% 30%, #107c10, transparent),
      radial-gradient(30% 55% at 88% 70%, #4fb3f0, transparent);
  }

  .hero-morph-logo-mesh--cool::after {
    background:
      radial-gradient(26% 55% at 78% 25%, #6cc4f5, transparent),
      radial-gradient(28% 60% at 36% 72%, #52b043, transparent),
      radial-gradient(24% 50% at 50% 50%, #1fc7c1, transparent);
  }

  .hero-morph-logo-glitch {
    position: absolute;
    inset: 0;
    display: block;
    opacity: 0;
    pointer-events: none;
    -webkit-mask: var(--mask-logo) center / 100% 100% no-repeat;
    mask: var(--mask-logo) center / 100% 100% no-repeat;
  }

  .hero-morph-logo-glitch--a { background: #ffc53d; }
  .hero-morph-logo-glitch--b { background: #f2542d; }
  .hero-morph-logo-glitch--c { background: #e5173f; }
  .hero-morph-logo-glitch--d { background: #1db9a8; }
  .hero-morph-logo-glitch--e { background: #4fb3f0; }
  .hero-morph-logo-glitch--f { background: #52b043; }
}

@keyframes logo-palette {
  0%,
  25% {
    opacity: 0;
  }
  75%,
  100% {
    opacity: 1;
  }
}

@keyframes logo-mesh-a {
  from {
    transform: translate(-12%, -8%) rotate(0deg) scale(1);
  }
  to {
    transform: translate(12%, 10%) rotate(25deg) scale(1.15);
  }
}

@keyframes logo-mesh-b {
  from {
    transform: translate(10%, 8%) rotate(0deg) scale(1.1);
  }
  to {
    transform: translate(-14%, -6%) rotate(-30deg) scale(0.95);
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-morph-logo-mesh,
  .hero-morph-logo-mesh::before,
  .hero-morph-logo-mesh::after {
    animation: none;
  }
}

.hero-morph-services {
  position: absolute;
  right: 0;
  bottom: 8vh;
  left: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem 1.5rem;
  margin: 0;
  padding: 0 1rem;
  list-style: none;
}

.hero-morph-service {
  font-family: var(--font);
  font-size: var(--label-size);
  font-weight: 500;
  line-height: 1.2;
  color: var(--white);
  white-space: nowrap;
}

.js .hero-morph:not([data-morph-layout]) .hero-morph-services {
  visibility: hidden;
}

.hero-morph-service a {
  color: inherit;
  text-decoration: none;
  transition: opacity 0.3s ease;
}

.hero-morph-service a:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 4px;
}

[data-menu-active] .hero-morph-service a {
  opacity: 0.4;
}

[data-menu-active] .hero-morph-service a:hover,
[data-menu-active] .hero-morph-service a:focus-visible,
[data-menu-active] .hero-morph-service a[aria-current] {
  opacity: 1;
}

[data-morph-layout] .hero-morph-stage {
  position: sticky;
}

[data-morph-layout] .hero-morph-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

[data-morph-ready] .hero-morph-logo {
  pointer-events: none;
}

[data-morph-ready] .hero-morph-logo.is-home {
  pointer-events: auto;
  cursor: pointer;
}

[data-morph-layout] .hero-morph-logo {
  position: absolute;
  top: 0;
  left: 0;
  transform-origin: 0 0;
  will-change: transform;
}

[data-morph-layout] .hero-morph-services {
  position: static;
  display: block;
  padding: 0;
}

[data-morph-layout] .hero-morph-service {
  position: absolute;
  top: 0;
  left: 0;
  opacity: 0;
  mix-blend-mode: difference;
  will-change: transform, opacity;
}

.hero-morph-cue {
  display: none;
}

[data-morph-ready] .hero-morph-cue {
  position: absolute;
  left: 50%;
  bottom: clamp(16px, 3.5vh, 40px);
  display: block;
  margin: 0;
  font-family: var(--font);
  font-size: var(--label-size);
  font-weight: 500;
  line-height: 1.2;
  color: var(--white);
  transform: translateX(-50%);
  pointer-events: none;
}

[data-morph-ready] .hero-morph-cue .hero-cta-mark {
  width: 1.6rem;
  height: 2.8rem;
  animation: hero-cue 1.8s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

@keyframes hero-cue {
  0% {
    opacity: 0;
    transform: translateY(0) rotate(-90deg);
  }

  20% {
    opacity: 0.5;
  }

  65% {
    opacity: 0.5;
  }

  100% {
    opacity: 0;
    transform: translateY(16px) rotate(-90deg);
  }
}

/* Service sections. Without the script they read as a plain white page; with it
   they scroll through the open side of the frame, under the frame's edge. */
.hero-morph-content {
  position: relative;
  z-index: 1;
  padding: 1.5rem;
  background: var(--white);
  color: var(--ink);
}

[data-morph-layout] .hero-morph-content {
  margin: 0 var(--content-right) 0 var(--content-left);
  padding: 0;
  background: none;
}

/* With the morph running, the content starts one screen earlier so the intro
   is already in place when the frame finishes forming; hero-morph.js fades it
   in over the last step. */
[data-morph-ready] .hero-morph-content {
  margin-top: -100vh;
  margin-top: -100svh;
}

/* A white band pinned just above the content's top edge, so text dissolves into
   the frame instead of being cut. It takes no space in the flow. */
.hero-morph-fade {
  display: none;
}

[data-morph-layout] .hero-morph-fade {
  position: sticky;
  top: var(--content-fade-top, 0);
  z-index: 2;
  display: block;
  height: 0;
  pointer-events: none;
}

/* Overhangs the column enough to cover the quiz's hanging brackets, but stops
   short of the logo and the call to action. */
[data-morph-layout] .hero-morph-fade::after {
  --fade-solid: var(--content-fade-solid, 0px);
  --fade-size: var(--content-fade-size, 0px);
  content: "";
  position: absolute;
  top: 0;
  right: -1rem;
  left: -2.5rem;
  height: calc(var(--fade-solid) + var(--fade-size));
  background: linear-gradient(
    to bottom,
    var(--paper) var(--fade-solid),
    color-mix(in srgb, var(--paper) 82%, transparent) calc(var(--fade-solid) + var(--fade-size) * 0.35),
    color-mix(in srgb, var(--paper) 0%, transparent)
  );
}

/* The same fade, mirrored, just above the bottom clip line, so content also
   dissolves in as it arrives. Where the clip line sits inside the frame, the
   band runs a little past it to cover the clip's antialiased edge. */
[data-morph-layout] .hero-morph-fade::before {
  --fade-size: var(--content-fade-size, 0px);
  --fade-overlap: var(--content-fade-overlap, 0px);
  content: "";
  position: absolute;
  top: calc(var(--content-fade-bottom, 0px) - var(--fade-size));
  right: -1rem;
  left: -2.5rem;
  height: calc(var(--fade-size) + var(--fade-overlap));
  background: linear-gradient(
    to top,
    var(--paper) var(--fade-overlap),
    color-mix(in srgb, var(--paper) 82%, transparent) calc(var(--fade-overlap) + var(--fade-size) * 0.35),
    color-mix(in srgb, var(--paper) 0%, transparent)
  );
}

[data-scroll-exit] {
  transform-origin: 0 50%;
}

/* Type scale: title about 2.6x the lead, lead about 1.6x the body, body about
   1.3x the small labels. */
.service {
  min-height: 100vh;
  min-height: 100svh;
  padding: var(--frame-content-top, var(--frame-edge)) 0 clamp(4rem, 12vh, 8rem);
}

.service:focus {
  outline: none;
}

.service-title {
  max-width: 16ch;
  margin: 0;
  font-size: clamp(2.5rem, 5vw, 5rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.025em;
  text-wrap: balance;
}

.service-lede {
  max-width: 30ch;
  margin: 1.25rem 0 0;
  font-size: clamp(1.375rem, 1.9vw, 1.875rem);
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

.service-text {
  max-width: 62ch;
  margin: 1rem 0 0;
  font-size: clamp(1.0625rem, 1.1vw, 1.1875rem);
  line-height: 1.6;
  color: color-mix(in srgb, var(--ink) 80%, var(--paper));
}

.service-lede + .service-text {
  margin-top: 1.5rem;
}

/* Project rail: a horizontal, snapping row of portrait cards. Native scrolling
   works for touch and trackpads; the bracket buttons are for mouse users. */
.projects {
  margin-top: clamp(2.5rem, 7vh, 4.5rem);
}

.projects-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.projects-label {
  margin: 0;
  font-size: var(--label-size);
  font-weight: 500;
  color: #6b6b6b;
}

.projects-controls {
  display: flex;
  gap: 0.25rem;
}

.projects-controls[hidden] {
  display: none;
}

.projects-button {
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  border: 0;
  background: none;
  color: var(--black);
  cursor: pointer;
}

.projects-button:disabled {
  color: #c4c4c4;
  cursor: default;
}

.projects-button:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: -2px;
}

.projects-button-mark {
  display: block;
  width: 0.7rem;
  height: 1.2rem;
  background: currentColor;
  -webkit-mask: var(--mask-cta) center / 100% 100% no-repeat;
  mask: var(--mask-cta) center / 100% 100% no-repeat;
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

.projects-button--next .projects-button-mark {
  transform: scaleX(-1);
}

.projects-button--prev:not(:disabled):hover .projects-button-mark {
  transform: translateX(-0.2rem);
}

.projects-button--next:not(:disabled):hover .projects-button-mark {
  transform: scaleX(-1) translateX(-0.2rem);
}

.projects-track {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: clamp(15rem, 19vw, 20rem);
  gap: clamp(1rem, 1.6vw, 1.5rem);
  margin: 0;
  padding: 0 0 0.5rem;
  list-style: none;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}

.projects-track::-webkit-scrollbar {
  display: none;
}
.project {
  scroll-snap-align: start;
}

.project-card {
  position: relative;
}

.project-media {
  position: relative;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background: #efefef;
}

.project-media > * {
  transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.project-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.project-index {
  position: absolute;
  top: 1rem;
  left: 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  color: #8a8a8a;
}

.project-title {
  margin: 1.125rem 0 0;
  font-size: clamp(1.25rem, 1.5vw, 1.5rem);
  font-weight: 700;
  line-height: 1.2;
}

/* The title link covers the whole card, so the card is one tab stop. */
.project-link {
  color: inherit;
  text-decoration: none;
}

.project-link::after {
  content: "";
  position: absolute;
  inset: 0;
}

.project-link:focus-visible {
  outline: none;
}

.project-card:has(.project-link:focus-visible) {
  outline: 2px solid var(--black);
  outline-offset: 6px;
}

.project-tags {
  margin: 0.375rem 0 0;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.4;
  color: #6b6b6b;
}

.project-text {
  margin: 0.75rem 0 0;
  font-size: 1rem;
  line-height: 1.55;
  color: #333;
}

.project-more {
  display: inline-block;
  margin-top: 0.875rem;
  font-size: 0.9375rem;
  font-weight: 700;
}

.project-arrow {
  display: inline-block;
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

.project-card:hover .project-media > *,
.project-card:has(.project-link:focus-visible) .project-media > * {
  transform: scale(1.03);
}

.project-card:hover .project-arrow,
.project-card:has(.project-link:focus-visible) .project-arrow {
  transform: translateX(0.25rem);
}

@media (prefers-reduced-motion: reduce) {
  .project-media > *,
  .project-arrow,
  .projects-button-mark {
    transition: none;
  }
}

.service-lede a {
  color: inherit;
  text-underline-offset: 0.2em;
}

/* Call to action: the logo's half hexagon, flipped to open toward the text,
   in the text color. */
.hero-cta {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 0.45em;
  padding: 0.35em 0;
  font-family: var(--font);
  font-size: var(--label-size);
  font-weight: 700;
  line-height: 1.2;
  color: var(--white);
  text-decoration: none;
  white-space: nowrap;
}

.hero-cta-mark {
  display: none;
}

@supports ((mask-image: none) or (-webkit-mask-image: none)) {
  .hero-cta-mark {
    position: relative;
    display: block;
    flex: none;
    width: 0.98em;
    height: 1.7em;
    background: currentColor;
    -webkit-mask: var(--mask-cta) center / 100% 100% no-repeat;
    mask: var(--mask-cta) center / 100% 100% no-repeat;
    transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
  }
}

.hero-cta-label {
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.hero-cta:hover .hero-cta-mark,
.hero-cta:focus-visible .hero-cta-mark {
  transform: translateX(-0.3em);
}

.hero-cta:hover .hero-cta-label,
.hero-cta:focus-visible .hero-cta-label {
  transform: translateX(0.15em);
}

.hero-cta:focus-visible {
  outline: none;
}

.hero-cta:focus-visible .hero-cta-label {
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 0.2em;
}

@media (prefers-reduced-motion: reduce) {
  .hero-cta-mark,
  .hero-cta-label,
  .hero-morph-cue .hero-cta-mark {
    transition: none;
    animation: none;
  }
}

[data-morph-layout] .hero-cta {
  top: 0;
  right: auto;
  left: 0;
  opacity: 0;
  will-change: transform, opacity;
}

/* Mobile: native scroll snapping between the hero stages. Programmatic scrolls
   switch it off so the snap does not fight them. */
html.morph-snap {
  scroll-snap-type: y mandatory;
}

html.morph-snap.is-auto-scrolling {
  scroll-snap-type: none;
}

.hero-morph-snap {
  position: absolute;
  left: 0;
  width: 1px;
  height: 1px;
  pointer-events: none;
  scroll-snap-align: start;
  scroll-snap-stop: always;
}

/* Snap only the opening stages. Content and the closing morph scroll freely,
   so a tall quiz step is not pulled into the footer. */

@media (max-width: 767px) {
  :root {
    --morph-track: 280vh;
    --morph-outro: 90vh;
    --label-size: 0.875rem;
  }

  [data-morph-layout] .hero-morph-content {
    margin-right: 36px;
    margin-left: 36px;
  }

  /* Stays inside the frame's rounded corners. */
  [data-morph-layout] .hero-morph-fade::after,
  [data-morph-layout] .hero-morph-fade::before {
    right: -6px;
    left: -6px;
  }
}

@media (min-width: 768px) {
  [data-morph-layout] .hero-cta {
    color: var(--ink);
  }
}

/* Project quiz. Without the script every step is listed as one plain form;
   with it ([data-quiz-ready]) one step shows at a time and the hexagon draws
   an edge per step. */
.quiz {
  --quiz-muted: color-mix(in srgb, var(--ink) 58%, var(--paper));
  --quiz-idle: color-mix(in srgb, var(--ink) 35%, var(--paper));
  max-width: 60rem;
  margin-top: clamp(2.5rem, 7vh, 5rem);
}

.quiz-head {
  display: none;
}

[data-quiz-ready] .quiz-head {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  margin-bottom: clamp(1.5rem, 4vh, 2.5rem);
}

.quiz-hex {
  display: block;
  width: 2.25rem;
  height: auto;
  overflow: visible;
}

.quiz-hex polygon,
.quiz-hex path {
  fill: none;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.quiz-hex-base {
  stroke: color-mix(in srgb, var(--ink) 14%, var(--paper));
}

.quiz-hex-fill {
  fill: var(--ink) !important;
  stroke: var(--ink);
  opacity: 0;
  transform: scale(0.6);
  transform-origin: 24px 21px;
  transition:
    opacity 0.3s ease,
    transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.quiz-hex path {
  stroke: var(--ink);
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  transition: stroke-dashoffset 0.5s cubic-bezier(0.65, 0, 0.35, 1);
}

.quiz-hex path.is-done {
  stroke-dashoffset: 0;
}

.quiz-hex.is-complete .quiz-hex-fill {
  opacity: 1;
  transform: none;
}

.quiz-count {
  margin: 0;
  font-size: var(--label-size);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.quiz-form {
  margin: 0;
}

.quiz-step {
  min-width: 0;
  margin: 0 0 3.5rem;
  padding: 0;
  border: 0;
}

[data-quiz-ready] .quiz-step {
  margin: 0;
}

[data-quiz-ready] .quiz-step:not(.is-active) {
  display: none;
}

.quiz-question {
  float: none;
  width: 100%;
  margin: 0;
  padding: 0;
  font-size: clamp(1.75rem, 3.4vw, 3.25rem);
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: -0.015em;
}

.quiz-question:focus {
  outline: none;
}

.quiz-hint {
  margin: 0.75rem 0 0;
  font-size: clamp(1rem, 1.1vw, 1.125rem);
  line-height: 1.45;
  color: var(--quiz-muted);
}

.quiz-options {
  display: grid;
  justify-content: start;
  gap: 0.1rem 3rem;
  margin-top: clamp(1.5rem, 4vh, 2.5rem);
}

.quiz-options--grid {
  grid-template-columns: repeat(3, max-content);
}

/* The selected option gets the CTA's half-hexagon bracket. */
.quiz-option {
  position: relative;
  display: block;
  margin-left: -0.9em;
  padding: 0.3em 0 0.3em 0.9em;
  font-size: clamp(1.375rem, 2.3vw, 2.25rem);
  font-weight: 700;
  line-height: 1.2;
  color: var(--quiz-idle);
  cursor: pointer;
  transition: color 0.2s ease;
}

.quiz-option input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: 0;
  opacity: 0;
}

.quiz-option::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  width: 0.4em;
  height: 0.7em;
  margin-top: -0.35em;
  background: currentColor;
  opacity: 0;
  transform: translateX(-0.35em);
  transition:
    opacity 0.2s ease,
    transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

@supports ((mask-image: none) or (-webkit-mask-image: none)) {
  .quiz-option::before {
    -webkit-mask: var(--mask-cta) center / 100% 100% no-repeat;
    mask: var(--mask-cta) center / 100% 100% no-repeat;
  }
}

.quiz-option:hover,
.quiz-option:has(:checked) {
  color: var(--ink);
}

.quiz-option:has(:checked)::before {
  opacity: 1;
  transform: none;
}

.quiz-option:has(:focus-visible) span {
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 0.18em;
}

.quiz-fields {
  display: grid;
  gap: 1.75rem;
  max-width: 40rem;
  margin-top: clamp(1.5rem, 4vh, 2.5rem);
}

.quiz-field label {
  display: block;
  margin-bottom: 0.35rem;
  font-size: var(--label-size);
  font-weight: 500;
}

.quiz-optional {
  color: var(--quiz-muted);
}

.quiz-field input,
.quiz-field textarea {
  display: block;
  width: 100%;
  padding: 0.3em 0;
  border: 0;
  border-bottom: 2px solid var(--ink);
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  font-family: inherit;
  font-size: clamp(1.25rem, 1.8vw, 1.75rem);
  font-weight: 500;
  line-height: 1.35;
}

.quiz-field textarea {
  min-height: 5.5em;
  resize: vertical;
}

.quiz-field input::placeholder,
.quiz-field textarea::placeholder {
  color: var(--quiz-idle);
}

.quiz-field input:focus,
.quiz-field textarea:focus {
  outline: none;
  box-shadow: 0 2px 0 0 var(--ink);
}

.quiz-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2.5rem;
  margin-top: clamp(2rem, 6vh, 3.5rem);
}

/* Honeypot. Off screen, not display:none, so automated fills still land in it. */
.quiz-trap {
  position: absolute;
  left: -100vw;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* Turnstile stays empty unless Cloudflare needs the visitor to click. */
.quiz-turnstile {
  grid-column: 1 / -1;
  max-width: 36rem;
}

.quiz-turnstile:empty {
  display: none;
}

.quiz-error {
  flex-basis: 100%;
  max-width: 36rem;
  margin: 0 0 0.25rem;
  font-size: clamp(1rem, 1.1vw, 1.125rem);
  font-weight: 500;
  line-height: 1.45;
}

.quiz-error a {
  color: inherit;
}

.quiz-nav [hidden],
.quiz-nav [data-quiz-back],
.quiz-nav [data-quiz-next] {
  display: none;
}

[data-quiz-ready] .quiz-nav [data-quiz-back],
[data-quiz-ready] .quiz-nav [data-quiz-next] {
  display: flex;
}

[data-quiz-ready] .quiz-nav [hidden] {
  display: none;
}

.quiz-back,
.quiz-next {
  display: flex;
  align-items: center;
  gap: 0.45em;
  padding: 0.35em 0;
  border: 0;
  background: none;
  color: var(--ink);
  font-family: inherit;
  font-size: clamp(1.125rem, 1.4vw, 1.375rem);
  font-weight: 700;
  line-height: 1.2;
  cursor: pointer;
}

.quiz-back {
  font-weight: 500;
  color: var(--quiz-muted);
  transition: color 0.2s ease;
}

.quiz-back:hover {
  color: var(--ink);
}

/* After the label and flipped, the bracket reads as a forward arrow. */
.quiz-next .hero-cta-mark {
  transform: scaleX(-1);
}

.quiz-next:not(:disabled):hover .hero-cta-mark,
.quiz-next:focus-visible .hero-cta-mark {
  transform: scaleX(-1) translateX(-0.3em);
}

.quiz-next:disabled {
  color: var(--quiz-idle);
  cursor: default;
}

.quiz-back:focus-visible,
.quiz-next:focus-visible {
  outline: none;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 0.2em;
}

.quiz-done:focus {
  outline: none;
}

.quiz-summary {
  max-width: 40rem;
  margin: 2rem 0 0;
  padding-top: 1rem;
  border-top: 2px solid var(--ink);
  font-size: clamp(1rem, 1.2vw, 1.25rem);
  font-weight: 500;
  line-height: 1.5;
}

.quiz-summary:empty {
  display: none;
}

@media (max-width: 767px) {
  .quiz-options--grid {
    grid-template-columns: repeat(2, max-content);
    column-gap: 2rem;
  }

  .quiz-nav {
    gap: 2rem;
  }

  /* While the quiz is in the frame, Next stays at the bottom of the window. */
  #contact.is-quiz-open [data-quiz-ready] .quiz-form {
    padding-bottom: 4.75rem;
  }

  #contact.is-quiz-open [data-quiz-ready] .quiz-nav {
    position: fixed;
    z-index: 3;
    right: 36px;
    bottom: calc(100svh - var(--content-clip-bottom, 100svh) + 12px);
    left: 36px;
    margin-top: 0;
    padding-top: 1.25rem;
    background: linear-gradient(to top, var(--paper) 62%, color-mix(in srgb, var(--paper) 0%, transparent));
  }
}

@media (prefers-reduced-motion: reduce) {
  .quiz-option,
  .quiz-option::before,
  .quiz-hex path,
  .quiz-hex-fill {
    transition: none;
  }
}

/* Footer. Without scroll motion it is a plain strip after the page; with it
   ([data-footer-overlay]) it covers the last screen, around the closed hexagon,
   and hero-morph.js fades it in. */
.site-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1rem 2rem;
  padding: 3rem var(--frame-edge) clamp(24px, 4.5vh, 48px);
  font-family: var(--font);
  font-size: var(--label-size);
  font-weight: 500;
  line-height: 1.2;
  color: var(--white);
  background: var(--black);
}

.site-footer p {
  margin: 0;
}

.site-footer-legal {
  display: flex;
  justify-content: flex-end;
  gap: 1.75rem;
}

.site-footer a {
  color: inherit;
  text-decoration: none;
  text-underline-offset: 0.2em;
}

.site-footer a:hover,
.site-footer a:focus-visible {
  text-decoration: underline;
  text-decoration-thickness: 2px;
}

.site-footer a:focus-visible {
  outline: none;
}

.site-footer[data-footer-overlay] {
  position: relative;
  z-index: 2;
  height: 100vh;
  height: 100svh;
  margin-top: -100vh;
  margin-top: -100svh;
  padding-top: 0;
  background: none;
  opacity: 0;
  pointer-events: none;
  will-change: opacity;
}

.site-footer[data-footer-overlay] a {
  pointer-events: auto;
}

.site-footer[data-footer-overlay].is-hidden a {
  pointer-events: none;
}

@media (max-width: 767px) {
  .site-footer {
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    gap: 0.875rem;
    padding: 2.5rem 20px calc(28px + env(safe-area-inset-bottom, 0px));
    text-align: center;
  }

  .site-footer-legal {
    justify-content: center;
  }
}
