@font-face {
  font-family: "Cal Sans";
  src: url("assets/fonts/CalSans.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("assets/fonts/Inter.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --red: #f51111;
  --ink: #141313;
  --ink-soft: #3a3a3a;
  --grey: #e4e4e4;
  --grey-text: #c9c9c9;
  --white: #ffffff;
  --font-display: "Cal Sans", "Inter", system-ui, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --gutter: clamp(20px, 6vw, 90px);
}

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

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--white);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: inherit; }
img { display: block; max-width: 100%; height: auto; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- Logo (inline SVG) ---------- */

.logo { display: inline-block; color: var(--ink); text-decoration: none; }
.logo svg { display: block; width: clamp(150px, 16vw, 230px); height: auto; overflow: visible; }
.logo .logo__word { fill: currentColor; }
.logo .logo__tag { fill: currentColor; opacity: 0.6; }
.logo .logo__mark { fill: var(--red); }
.logo--light { color: var(--white); }

/* ---------- Hero ---------- */

.hero {
  position: relative;
  z-index: 1; /* the scroll button straddles the bottom edge and must paint over the next section */
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  place-items: center;
  color: var(--white);
  background: var(--ink);
}
.hero__media {
  position: absolute;
  inset: 0;
  overflow: hidden; /* clips the parallax photo without clipping the scroll button */
}
.hero__bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 35%;
  filter: saturate(0.7) contrast(1.05);
  /* parallax: the photo scrolls at a third of the page speed */
  transform: translate3d(0, calc(var(--sy, 0) * 0.33px), 0);
  will-change: transform;
}
.hero__inner {
  /* the text drifts slightly faster than the photo and fades out */
  transform: translate3d(0, calc(var(--sy, 0) * 0.16px), 0);
  opacity: calc(1 - var(--sy, 0) / 520);
}
.hero::before {
  /* darkening overlay; it must sit above the photo (z-index) or it paints underneath it */
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(ellipse 70% 55% at 50% 55%, rgba(20, 19, 19, 0.35), transparent 70%),
    linear-gradient(180deg, rgba(20, 19, 19, 0.55) 0%, rgba(20, 19, 19, 0.4) 50%, rgba(20, 19, 19, 0.65) 100%);
}
.hero__inner {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 48px var(--gutter) 96px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(28px, 5vh, 56px);
}
.hero__title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(34px, 5.2vw, 74px);
  line-height: 1.04;
  letter-spacing: -0.01em;
  text-wrap: balance;
  text-shadow: 0 2px 24px rgba(0, 0, 0, 0.35);
}
.btn {
  display: inline-block;
  padding: 16px 30px;
  border-radius: 999px;
  background: var(--white);
  color: var(--red);
  font-family: var(--font-display);
  font-size: 16px;
  letter-spacing: 0.01em;
  text-decoration: none;
  text-transform: uppercase;
  transition: transform 220ms ease, box-shadow 220ms ease;
}
.btn:hover, .btn:focus-visible { transform: translateY(-2px); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25); outline: none; }

.hero__scroll {
  position: absolute;
  left: 50%;
  bottom: -40px;
  z-index: 2;
  width: 80px;
  height: 80px;
  margin-left: -40px;
  border-radius: 50%;
  background: var(--red);
  color: var(--white);
  display: grid;
  place-items: center;
  transition: transform 220ms ease;
}
.hero__scroll svg { width: 22px; height: 22px; }
.hero__scroll:hover svg { animation: nudge 900ms ease-in-out infinite; }
@keyframes nudge { 50% { transform: translateY(4px); } }

/* ---------- Services: sticky stage driven by scroll ---------- */

.services { position: relative; }

.services__track {
  /* one viewport of scroll per service, plus the stage itself */
  height: calc(var(--count) * 100vh + 100vh);
  height: calc(var(--count) * 100svh + 100svh);
}

.stage {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100svh;
  display: grid;
  grid-template-columns: minmax(280px, 1.15fr) minmax(300px, 1fr) minmax(280px, 1fr);
  grid-template-rows: auto minmax(0, 1fr);
  gap: 0 clamp(24px, 4vw, 64px);
  padding: clamp(70px, 10vh, 110px) var(--gutter) clamp(32px, 6vh, 64px);
  overflow: hidden;
}

/* services list, top-left */
.stage__list {
  grid-column: 1;
  grid-row: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}
.stage__item {
  appearance: none;
  background: none;
  border: 0;
  padding: 0;
  margin: 0;
  text-align: left;
  font-family: var(--font-display);
  font-size: clamp(20px, 2.1vw, 32px);
  line-height: 1.08;
  letter-spacing: -0.01em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--grey-text);
  cursor: pointer;
  transition: color 320ms ease;
}
.stage__item:hover { color: var(--ink-soft); }
.stage__item.is-active { color: var(--ink); }
.stage__item:focus-visible { outline: 2px solid var(--red); outline-offset: 4px; }
.arrow { font-family: var(--font-body); font-weight: 600; }

/* photo, bottom-left */
.stage__photo {
  grid-column: 1;
  grid-row: 2;
  align-self: end;
  position: relative;
  height: min(100%, 46vh);
  width: auto;
  aspect-ratio: 360 / 553;
  margin-top: 20px;
}
.stage__photo img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transform: scale(1.03);
  transition: opacity 600ms ease, transform 900ms ease;
}
.stage__photo img.is-active { opacity: 1; transform: none; }

/* asterisk, centre */
.stage__mark {
  grid-column: 2;
  grid-row: 1 / 3;
  align-self: center;
  justify-self: center;
  width: min(100%, 44vh, 420px);
}
.asterisk { display: block; width: 100%; height: auto; overflow: visible; }
.asterisk .petal { fill: var(--grey); transition: opacity 300ms ease; }
.asterisk .petal.is-hidden { opacity: 0; }
.asterisk__hub { fill: var(--grey); }
.asterisk__needle {
  fill: var(--red);
  transform: rotate(var(--angle, 0deg));
  transform-origin: 0 0;
  transition: transform 800ms cubic-bezier(0.65, 0, 0.2, 1);
}

/* copy, right */
.stage__text {
  grid-column: 3;
  grid-row: 1 / 3;
  align-self: stretch; /* take the whole stage height so long copy can scroll instead of being clipped */
  position: relative;
  min-height: 0;
}
.stage__copy {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: safe center; /* centred when it fits, top-aligned and scrollable when it does not */
  gap: 1.1em;
  overflow-y: auto;
  scrollbar-width: thin;
  font-size: clamp(13.5px, 1.05vw, 16px);
  line-height: 1.5;
  color: var(--ink);
  opacity: 0;
  transform: translateY(12px);
  visibility: hidden;
  transition: opacity 500ms ease, transform 500ms ease, visibility 0s linear 500ms;
}
.stage__copy.is-active {
  opacity: 1;
  transform: none;
  visibility: visible;
  transition: opacity 500ms ease 150ms, transform 500ms ease 150ms, visibility 0s;
}
.stage__copy p { margin: 0; }
.stage__copy strong { font-weight: 500; }
.stage__mobile-title { display: none; }

/* mobile pager (shown under 900px) */
.stage__pager { display: none; }

/* progress bar at the bottom of the stage */
.stage__progress {
  position: absolute;
  left: var(--gutter);
  right: var(--gutter);
  bottom: clamp(16px, 3vh, 28px);
  height: 2px;
  background: var(--grey);
}
.stage__progress span {
  display: block;
  height: 100%;
  width: calc(var(--progress, 0) * 100%);
  background: var(--red);
  transition: width 120ms linear;
}

/* ---------- Band ---------- */

.band {
  background: var(--ink);
  color: var(--white);
  padding: clamp(40px, 7vh, 80px) var(--gutter);
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: clamp(32px, 8vw, 140px);
}
.band__item {
  display: flex;
  align-items: center;
  gap: 18px;
  font-family: var(--font-display);
  font-size: clamp(22px, 2.6vw, 36px);
  text-transform: uppercase;
}
.band__mark { width: clamp(54px, 6vw, 84px); height: auto; }

/* ---------- Contact ---------- */

.contact {
  background: var(--ink);
  color: var(--white);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.contact__inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: clamp(80px, 14vh, 150px) var(--gutter) clamp(48px, 8vh, 80px);
}
.contact__title {
  margin: 0 0 32px;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(40px, 5.5vw, 76px);
  line-height: 1;
}
.contact__line {
  margin: 0 0 14px;
  font-size: clamp(20px, 2.4vw, 32px);
  font-weight: 300;
}
.contact__line a { text-decoration: none; }
.contact__line a:hover { text-decoration: underline; text-underline-offset: 6px; }
.contact__based { margin: 56px 0 0; font-size: 17px; font-weight: 300; }
.contact__logo { display: flex; justify-content: center; margin-top: clamp(64px, 12vh, 140px); }

/* ---------- Motion ---------- */

@media (prefers-reduced-motion: reduce) {
  .asterisk__needle, .stage__photo img, .stage__copy, .stage__item, .btn, .hero__scroll { transition: none; }
  .hero__scroll:hover svg { animation: none; }
}

/* ======================================================================
   Mobile / tablet: the stage becomes a vertical story, one service per
   block, each with its own asterisk. The sticky track is disabled.
   ====================================================================== */

@media (max-width: 899px) {
  .hero__inner { padding-top: 64px; }
  .hero__title br { display: none; }
  .hero__scroll { width: 64px; height: 64px; margin-left: -32px; bottom: -32px; }

  .services__track { height: auto; }
  .stage {
    position: static;
    height: auto;
    display: block;
    padding: 80px var(--gutter) 48px;
    overflow: visible;
  }
  .stage__list {
    position: sticky;
    top: 0;
    z-index: 3;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    margin: 0 calc(-1 * var(--gutter)) 24px;
    padding: 14px var(--gutter);
    flex-direction: row;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 18px;
    scrollbar-width: none;
  }
  .stage__list::-webkit-scrollbar { display: none; }
  .stage__item { font-size: 18px; white-space: nowrap; }

  .stage__mark {
    width: min(60vw, 260px);
    margin: 0 auto 24px;
  }
  .stage__photo {
    width: min(100%, 300px);
    height: auto;
    margin: 0 auto 28px;
  }
  .stage__text { min-height: 0; }
  .stage__copy {
    position: static;
    display: none;
    transform: none;
    font-size: 15px;
  }
  .stage__copy.is-active { display: flex; }
  .stage__mobile-title {
    display: block;
    margin: 0 0 4px;
    font-family: var(--font-display);
    font-weight: 400;
    font-size: 30px;
    line-height: 1.05;
    text-transform: uppercase;
  }
  .stage__progress { display: none; }
  .stage__pager {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    margin-top: 32px;
  }
  .stage__pager button {
    appearance: none;
    border: 1px solid var(--ink);
    background: none;
    border-radius: 999px;
    padding: 12px 22px;
    font-family: var(--font-display);
    font-size: 14px;
    text-transform: uppercase;
    cursor: pointer;
  }
  .stage__pager button:disabled { opacity: 0.3; }

  .band { flex-direction: column; align-items: center; gap: 28px; }
  .contact__based { margin-top: 40px; }
}

/* ---------- Hero logo: intro motion (one shot) ----------
   Story taken from the brand deck: the hub, then the North Star petal, then the
   other petals unfold clockwise (you ask, we guide), and the wordmark rises
   into place. No flicker afterwards: the mark simply stays. */

.hero .mk-hub,
.hero .mk-petal path,
.hero .logo__word,
.hero .logo__tag { transform-box: fill-box; }

.hero .mk-hub {
  transform-origin: 50% 50%;
  animation: mk-hub 520ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
.hero .mk-petal path {
  transform-origin: 50% 100%;
  animation: mk-grow 640ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
  animation-delay: calc(600ms + var(--k) * 75ms);
}
.hero .mk-petal path[style*="--k:0"] { animation-delay: 240ms; } /* the North Star comes first */
.hero .logo__word,
.hero .logo__tag {
  transform-origin: 50% 50%;
  animation: mk-rise 720ms cubic-bezier(0.2, 0.8, 0.2, 1) 1150ms both;
}
.hero .logo__tag { animation-delay: 1300ms; }

@keyframes mk-hub   { from { transform: scale(0); } to { transform: scale(1); } }
@keyframes mk-grow  { from { transform: scaleY(0); opacity: 0; } 40% { opacity: 1; } to { transform: scaleY(1); opacity: 1; } }
@keyframes mk-rise  { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* idle / hover: a quarter turn, echoing the services needle */
.hero .logo__mark--live {
  transform-box: fill-box;
  transform-origin: 50% 50%;
  transition: transform 900ms cubic-bezier(0.2, 0.8, 0.2, 1);
}
.hero .logo:hover .logo__mark--live,
.hero .logo:focus-visible .logo__mark--live { transform: rotate(90deg); }

@media (prefers-reduced-motion: reduce) {
  .hero .mk-hub, .hero .mk-petal path, .hero .logo__word, .hero .logo__tag { animation: none; }
  .hero .logo__mark--live { transition: none; }
}

/* short desktop windows: tighter stage so the longest service copy still fits */
@media (min-width: 900px) and (max-height: 760px) {
  .stage { padding-top: 56px; padding-bottom: 40px; }
  .stage__copy { font-size: 13px; line-height: 1.42; gap: 0.75em; }
  .stage__item { font-size: clamp(18px, 1.8vw, 24px); }
  .stage__mark { width: min(100%, 40vh, 360px); }
}

/* ---------- Scroll parallax & reveals ---------- */

/* band and contact: elements rise into place when they enter the viewport */
.reveal {
  opacity: 0;
  transform: translate3d(0, 22px, 0);
  transition: opacity 700ms ease, transform 800ms cubic-bezier(0.2, 0.8, 0.2, 1);
}
.reveal.is-in { opacity: 1; transform: none; }
.band__item.reveal:nth-child(2) { transition-delay: 140ms; }
.contact__line.reveal { transition-delay: 120ms; }
.contact__based.reveal { transition-delay: 220ms; }
.contact__logo.reveal { transition-delay: 300ms; }

@media (prefers-reduced-motion: reduce) {
  .hero__bg, .hero__inner { transform: none; opacity: 1; }
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* ---------- Band: one mark that turns from "on time" into "on point" ----------
   The static pair is only shown when the user prefers reduced motion. */

.band__item--static { display: none; }
.band__word { display: grid; }
.band__w { grid-area: 1 / 1; white-space: nowrap; transition: opacity 600ms ease, transform 700ms cubic-bezier(0.2, 0.8, 0.2, 1); }
.band__w--point { opacity: 0; transform: translateY(0.5em); }
.band__item.is-point .band__w--time { opacity: 0; transform: translateY(-0.5em); }
.band__item.is-point .band__w--point { opacity: 1; transform: none; }

.band__mark .m-petal { fill: #3d3d3d; }
.band__mark .m-tip, .band__mark .m-ew, .band__mark .m-n, .band__mark .m-hand, .band__mark .m-dot { fill: var(--red); }
.band__mark .m-hub { fill: var(--red); transition: fill 700ms ease; }
.band__mark .m-tip { transition: opacity 500ms ease; }
.band__mark .m-ew { opacity: 0; transition: opacity 600ms ease 300ms; }
.band__mark .m-hand { transform-box: fill-box; transform-origin: 50% 100%; transform: rotate(135deg); transition: transform 1100ms cubic-bezier(0.3, 0.7, 0.2, 1); }
.band__mark .m-dot { transform-box: fill-box; transform-origin: 50% 50%; transform: scale(0); transition: transform 500ms cubic-bezier(0.2, 0.8, 0.2, 1) 500ms; }
/* "on point": the clock hand sweeps on to south, the side branches light up, the tips go out, the hub swaps for the dot */
.band__item.is-point .m-hand { transform: rotate(180deg); }
.band__item.is-point .m-ew { opacity: 1; }
.band__item.is-point .m-tip { opacity: 0; }
.band__item.is-point .m-hub { fill: #3d3d3d; }
.band__item.is-point .m-dot { transform: scale(1); }

@media (prefers-reduced-motion: reduce) {
  .band__item--morph { display: none; }
  .band__item--static { display: flex; }
}
