/* ==========================================================================
   SECTIONS — hero / about / skills / services / work / contact.
   ========================================================================== */

/* ---- PRELOADER ------------------------------------------------------------ */
.preloader {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: var(--color-bg);
  display: grid;
  place-items: center;
  will-change: transform;
}

html:not(.js) .preloader {
  display: none; /* never block content without JS */
}

/* Electric edge — sells the curtain's upward wipe against a same-color page */
.preloader::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent 4%,
    var(--color-accent) 40%,
    var(--color-accent) 60%,
    transparent 96%
  );
}

.preloader__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-4);
}

.preloader__brand {
  font-family: var(--font-mono);
  font-size: var(--fs-2xs);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: var(--track-caps);
  color: var(--color-text-muted);
}

.preloader__bar {
  width: 200px;
  height: 2px;
  background: var(--color-line);
  overflow: clip;
}

.preloader__bar-fill {
  display: block;
  width: 100%;
  height: 100%;
  background: var(--color-accent);
  transform: scaleX(0);
  transform-origin: left;
}

body.is-loading {
  overflow: hidden;
}

@media (prefers-reduced-motion: reduce) {
  .preloader {
    display: none;
  }
}

/* ---- HERO ----------------------------------------------------------------- */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  overflow: clip;
  padding-top: calc(var(--header-h) + var(--sp-6));
  padding-bottom: var(--sp-6);
}

.hero > .container {
  flex: 1;
  width: 100%; /* flex item + margin-inline:auto would otherwise shrink-wrap */
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 1;
}

/* Ambient gradient field behind everything */
.hero__backdrop {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(50rem 50rem at 76% 16%, rgba(var(--accent-rgb), 0.15), transparent 62%),
    radial-gradient(38rem 38rem at 8% 88%, rgba(var(--accent-rgb), 0.07), transparent 60%);
}

/* ---- The globe — Earth centred on Serbia -----------------------------------
   Sits fully inside the viewport. It used to bleed 51px off the right edge,
   which read as a cropped circle rather than a deliberate crop.
   -------------------------------------------------------------------------- */
.hero__orb {
  position: absolute;
  z-index: 0;
  top: 14%;
  /* Sits on the same editorial edge as the text. The orb is positioned
     against the hero, not the container, so once the container reaches its
     max-width and starts centring, plain padding no longer lines up — at
     1920px that left the globe 256px adrift of the column. This tracks the
     content edge at every width. */
  right: max(
    var(--container-pad),
    calc(50% - var(--container-max) / 2 + var(--container-pad))
  );
  width: min(62vw, 21rem);
  aspect-ratio: 1;
  perspective: 1400px;
  pointer-events: none;
  opacity: 0.85;
}

@media (min-width: 768px) {
  .hero__orb {
    top: 50%;
    translate: 0 -50%;
    width: clamp(17rem, 30vw, 26rem);
    opacity: 1;
  }
}

.orb {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
  will-change: transform;
  color: var(--color-text); /* the SVG draws itself in currentColor */
}

.orb svg {
  width: 100%;
  height: 100%;
}

/* The WebGL canvas, when a visitor qualifies for it */
.orb-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0; /* faded in by scene.js */
}

.hero__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3) var(--gutter);
  font-family: var(--font-mono);
  font-size: var(--fs-2xs);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: var(--track-caps);
  color: var(--color-text-muted);
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.7em;
  padding: 0.55em 1.1em;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-pill);
  white-space: nowrap;
}

.chip__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-accent);
  animation: pulse 2.4s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.35; transform: scale(0.8); }
}

.hero__title-wrap {
  margin-block: auto;
  padding-block: var(--sp-7);
  transform-origin: left center; /* the settle scale stays anchored */
}

/* The name is the monument */
.hero__name {
  font-size: var(--fs-hero);
  font-weight: 600;
  line-height: 0.92;
  letter-spacing: var(--track-tight);
  text-transform: uppercase;
}

.hero__name-line {
  padding-block: 0.04em; /* keep ascenders/diacritics inside the mask */
}

.hero__role {
  margin-top: var(--sp-5);
  font-family: var(--font-mono);
  font-size: clamp(0.85rem, 1.3vw, 1rem);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--color-text);
}

.hero__role .accent {
  margin-right: 0.6em;
}

.hero__tagline {
  margin-top: var(--sp-6);
  font-family: var(--font-display);
  font-size: var(--fs-tagline);
  font-weight: 500;
  line-height: 1.28;
  letter-spacing: -0.01em;
  color: var(--color-text-muted);
  max-width: none;
}

.hero__tagline .accent {
  color: var(--color-accent-ink);
}

@media (min-width: 768px) {
  .hero__tagline {
    margin-left: clamp(1.5rem, 6vw, 5.5rem);
  }
}

.hero__bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--sp-5) var(--gutter);
}

.hero__scroll {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  font-family: var(--font-mono);
  font-size: var(--fs-2xs);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: var(--track-caps);
  color: var(--color-text-muted);
}

.hero__scroll-line {
  position: relative;
  width: 64px;
  height: 1px;
  background: var(--color-line-strong);
  overflow: clip;
}

.hero__scroll-line::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--color-accent);
  transform: translateX(-100%);
  animation: scroll-hint 2.6s var(--ease-travel) infinite;
}

@keyframes scroll-hint {
  0% { transform: translateX(-101%); }
  55% { transform: translateX(0); }
  100% { transform: translateX(101%); }
}

@media (prefers-reduced-motion: reduce) {
  .hero__scroll-line::after {
    animation: none;
  }
}

.hero__cta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-3);
}

/* Short phones (iPhone SE and friends): the hero has to hold its whole
   lockup — name, role, tagline AND the calls to action — above the fold.
   Compress the rhythm rather than shrinking the type that carries it. */
@media (max-width: 767px) and (max-height: 700px) {
  .hero {
    padding-top: calc(var(--header-h) + var(--sp-4));
  }

  .hero__title-wrap {
    padding-block: var(--sp-4);
  }

  .hero__role {
    margin-top: var(--sp-3);
  }

  .hero__tagline {
    margin-top: var(--sp-4);
    font-size: 1.15rem;
  }

  .hero__bottom {
    gap: var(--sp-3) var(--gutter);
  }
}

/* Very short screens (the old 568px-tall phones): drop the decorative
   scroll cue so the calls to action clear the fold. The page continuing
   past the hero is invitation enough. */
@media (max-width: 767px) and (max-height: 620px) {
  .hero {
    padding-bottom: var(--sp-4);
  }

  .hero__scroll {
    display: none;
  }

  .hero__title-wrap {
    padding-block: var(--sp-3);
  }

  .hero__tagline {
    margin-top: var(--sp-3);
  }
}

/* ---- Hero intro initial states (released by html.intro-done) -------------- */
@media (prefers-reduced-motion: no-preference) {
  .js:not(.intro-done) .hero__meta,
  .js:not(.intro-done) .hero__backdrop,
  .js:not(.intro-done) .hero__orb,
  .js:not(.intro-done) .hero__bottom > * {
    opacity: 0;
  }

  /* Scoped to the hero: an unscoped .char rule promoted every character on
     the page — including all five project titles — to its own compositor
     layer for the duration of the intro. */
  .js:not(.intro-done) .hero .mask > *,
  .js:not(.intro-done) .hero .char {
    transform: translateY(112%);
    will-change: transform;
  }
}

/* ---- ABOUT ----------------------------------------------------------------- */

/* The statement — a manifesto, not a bio line */
.about__statement {
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 4.3vw, 3.8rem);
  font-weight: 500;
  line-height: 1.16;
  letter-spacing: -0.015em;
  color: var(--color-text-muted);
  max-width: 22ch;
  margin-bottom: clamp(3.5rem, 8vw, 6.5rem);
}

.about__statement .em {
  color: var(--color-text);
}

.about__statement .accent {
  color: var(--color-accent-ink);
}

@media (prefers-reduced-motion: no-preference) {
  .js .about__statement:not(.is-revealed) .word {
    transform: translateY(112%);
    will-change: transform;
  }
}

.about-grid {
  display: grid;
  gap: var(--sp-8) var(--sp-9);
}

@media (min-width: 1024px) {
  .about-grid {
    grid-template-columns: 5fr 7fr;
    align-items: start;
  }
}

.about__media-wrap {
  max-width: 26rem;
}

/* Promote the parallax layer only where parallax actually runs (tier.js
   switches it off below 768px), never on phones. */
@media (min-width: 768px) and (prefers-reduced-motion: no-preference) {
  .js .about__media-wrap {
    will-change: transform;
  }
}

.about__media {
  position: relative;
  aspect-ratio: 2 / 3; /* the photograph's own ratio — nothing is cropped */
  border: 1px solid var(--color-line);
  /* A dark mount in both themes: the portrait is near-black, so a light
     ground would flash white before it decodes. */
  background: #0d0e11;
  overflow: hidden;
}

.about__portrait {
  width: 100%;
  height: 100%;
  object-fit: cover; /* safety if a future portrait has another ratio */
  object-position: 50% 30%;
  transition: transform var(--dur-base) var(--ease-adjust);
}

/* The frame clips, so the portrait presses gently into it. Pointer devices
   only — a tap can leave :hover stuck on touch, and this is pure decoration
   that must never look like a broken interactive state. */
@media (hover: hover) {
  .about__media:hover .about__portrait {
    transform: scale(1.05);
  }
}

.about__media-caption {
  margin-top: var(--sp-3);
  font-family: var(--font-mono);
  font-size: var(--fs-2xs);
  text-transform: uppercase;
  letter-spacing: var(--track-caps);
  color: var(--color-text-muted);
  display: flex;
  justify-content: space-between;
  gap: var(--sp-4);
}

.about__copy {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
  color: var(--color-text-muted);
  max-width: 56ch;
  font-size: var(--fs-lead);
  line-height: 1.55;
}

.about__copy em {
  font-style: normal;
  color: var(--color-text);
}

.about__colophon {
  margin-top: var(--sp-7);
  border-top: 1px solid var(--color-line);
}

.about__colophon li {
  display: grid;
  grid-template-columns: 8rem 1fr;
  gap: var(--gutter);
  padding-block: var(--sp-3);
  border-bottom: 1px solid var(--color-line);
  font-size: var(--fs-sm);
}

.about__colophon li span:first-child {
  font-family: var(--font-mono);
  font-size: var(--fs-2xs);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: var(--track-caps);
  color: var(--color-text-muted);
  padding-top: 0.2em;
}

.about__stats {
  margin-top: clamp(4rem, 8vw, 6rem);
  padding-top: var(--sp-6);
  border-top: 1px solid var(--color-line);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-5) var(--gutter);
}

.stat__num {
  font-family: var(--font-display);
  font-size: var(--fs-stat);
  font-weight: 600;
  line-height: 1;
  letter-spacing: var(--track-tight);
}

.stat__num .accent {
  font-size: 0.7em;
}

.stat__label {
  margin-top: var(--sp-2);
  font-family: var(--font-mono);
  font-size: var(--fs-2xs);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-text-muted);
}

/* ---- SKILLS — typographic index ---------------------------------------------- */
.skills-index {
  border-top: 1px solid var(--color-line);
}

.skill-row {
  border-bottom: 1px solid var(--color-line);
  cursor: default;
}

.skill-row__mask {
  overflow: clip;
}

.skill-row__inner {
  display: flex;
  align-items: baseline;
  gap: clamp(1rem, 3vw, 2.5rem);
  padding-block: clamp(1rem, 2.4vw, 1.7rem);
}

.skill-row__idx {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  font-weight: 500;
  color: var(--color-text-muted);
  min-width: 2.5ch;
  transition: color var(--dur-micro) ease;
}

.skill-row__name {
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 4.3vw, 3.6rem);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: var(--track-tight);
  text-transform: uppercase;
  color: transparent;
  /* Outlined at rest, but readable on its own — these names are content */
  -webkit-text-stroke: 1px color-mix(in srgb, var(--color-text) 55%, transparent);
  transition: color var(--dur-fast) ease;
}

/* Touch devices never get :hover — show solid type instead of ghost outlines */
@media (hover: none) {
  .skill-row__name {
    color: var(--color-text-muted);
    -webkit-text-stroke-width: 0;
  }
}

.skill-row:hover .skill-row__name,
.skill-row.is-active .skill-row__name {
  color: var(--color-text);
}

.skill-row:hover .skill-row__idx,
.skill-row.is-active .skill-row__idx {
  color: var(--color-accent-ink);
}

.skill-row__tag {
  display: none;
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: var(--fs-2xs);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: var(--track-caps);
  color: var(--color-text-muted);
  opacity: 0;
  transform: translateX(-10px);
  transition:
    opacity var(--dur-fast) ease,
    transform 0.45s var(--ease-adjust);
}

/* Tags only where the longest names still fit on one line beside them */
@media (min-width: 1280px) {
  .skill-row__tag {
    display: block;
  }
}

.skill-row:hover .skill-row__tag,
.skill-row.is-active .skill-row__tag {
  opacity: 1;
  transform: none;
}

/* Per-row hidden state: the list is taller than the viewport, so rows
   reveal in batches as they enter rather than all at once. */
@media (prefers-reduced-motion: no-preference) {
  .js [data-skills]:not(.is-revealed) .skill-row:not(.is-revealed) .skill-row__inner {
    transform: translateY(112%);
    will-change: transform;
  }
}

@media (prefers-reduced-motion: reduce) {
  .chip__dot {
    animation: none;
  }
}

/* ---- SERVICES ------------------------------------------------------------------
   Two intentionally different presentations:
   · Mobile / reduced-motion / no-JS → stacked list, ALL copy permanently
     visible, spotlight follows the viewport centre.
   · Desktop (.js, >=1024px, motion allowed) → pinned stage: titles left,
     supporting panel right, scroll position drives the active service.
   Nothing animated here changes layout — fixed row heights plus absolutely
   positioned bodies mean transform/opacity only, so the scroll never fights
   a reflow.
   -------------------------------------------------------------------------- */
.services {
  --service-step: 46vh;
  --service-row-h: clamp(4.25rem, 10.5vh, 6rem);
  --panel-w: min(22rem, 31%);
}

.services-list {
  border-top: 1px solid var(--color-line);
}

.service {
  border-bottom: 1px solid var(--color-line);
  padding-block: var(--sp-6);
}

.service__head {
  display: flex;
  align-items: baseline;
  gap: clamp(0.9rem, 2.5vw, 1.6rem);
  transform-origin: left center;
}

.service__idx {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  font-weight: 500;
  color: var(--color-text-muted);
  transition: color var(--dur-base) ease;
}

.service__title {
  font-size: clamp(1.55rem, 6vw, 2.3rem);
  font-weight: 500;
  color: var(--color-text-muted);
  transition: color var(--dur-base) ease;
}

.service__body {
  margin-top: var(--sp-4);
  display: grid;
  gap: var(--sp-4);
}

.service__num {
  display: none;
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 4vw, 3.75rem);
  font-weight: 600;
  line-height: 1;
  color: transparent;
  -webkit-text-stroke: 1px var(--color-accent);
}

.service__desc {
  color: var(--color-text-muted);
  max-width: 48ch;
}

.service__tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
}

/* Spotlight — the only state change on touch */
.service.is-active .service__idx {
  color: var(--color-accent-ink);
}

.service.is-active .service__title {
  color: var(--color-text);
}

.services-cta {
  margin-top: var(--sp-7);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-4);
}

.services-cta__note {
  font-family: var(--font-mono);
  font-size: var(--fs-2xs);
  text-transform: uppercase;
  letter-spacing: var(--track-caps);
  color: var(--color-text-muted);
}

/* ---- Pinned editorial stage ------------------------------------------------ */
@media (min-width: 1024px) and (prefers-reduced-motion: no-preference) {
  .js .services-scroll {
    height: calc(100svh + 6 * var(--service-step));
  }

  .js .services-stage {
    position: sticky;
    top: 0;
    height: 100svh;
    display: flex;
    align-items: center;
    overflow: clip;
  }

  /* .container is margin-inline:auto — as a flex child it must be told to fill */
  .js .services-stage__inner {
    position: relative;
    width: 100%;
  }

  .js .services-list {
    border-top: 0;
    width: min(58%, 44rem);
  }

  .js .service {
    border-bottom: 0;
    padding-block: 0;
    height: var(--service-row-h);
    display: flex;
    align-items: center;
  }

  .js .service__title {
    font-size: clamp(1.9rem, 3.4vw, 3.2rem);
  }

  /* Resting state before JS takes over the transform (no first-paint flash) */
  .js .service:not(.is-active) .service__head {
    opacity: 0.32;
    transform: scale(0.78);
  }

  /* All six bodies stack in the same panel slot and cross-fade.
     Absolute offsets resolve against the padding box, so the container's
     gutter has to be re-applied by hand to keep the editorial edge. */
  .js .service__body {
    position: absolute;
    top: 0;
    right: var(--container-pad);
    width: var(--panel-w);
    margin-top: 0;
    opacity: 0;
  }

  .js .service.is-active .service__body {
    opacity: 1;
  }

  .js .service__num {
    display: block;
  }

  .js .service__desc {
    font-size: var(--fs-sm);
  }

  .js .services-cta {
    position: absolute;
    right: var(--container-pad);
    bottom: 0;
    width: var(--panel-w);
    margin-top: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--sp-3);
  }
}

/* ---- SELECTED WORK ----------------------------------------------------------------
   Stacked cinematic cards by default (mobile / reduced motion / no-JS);
   a pinned horizontal gallery from 1024px up. Panels come from
   js/data/projects.js — no project is hard-coded in CSS or HTML.
   ------------------------------------------------------------------------------- */
.work-scroll {
  margin-top: var(--head-gap);
}

.work-track {
  display: grid;
  gap: clamp(3.5rem, 9vw, 6rem);
  padding-inline: var(--container-pad);
  max-width: var(--container-max);
  margin-inline: auto;
}

.work-item__frame {
  position: relative;
  overflow: clip;
  background: var(--color-surface);
  border: 1px solid var(--color-line);
  aspect-ratio: 16 / 10;
}

.work-item__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.12);
}

/* Scrim so the overlaid title always has contrast, whatever the artwork */
.work-item__frame::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(
    to top,
    rgba(4, 5, 10, 0.88) 0%,
    rgba(4, 5, 10, 0.45) 26%,
    rgba(4, 5, 10, 0) 58%
  );
}

.work-item__badge {
  position: absolute;
  top: var(--sp-4);
  left: var(--sp-4);
  z-index: 2;
  font-family: var(--font-mono);
  font-size: var(--fs-2xs);
  font-weight: 500;
  letter-spacing: var(--track-caps);
  color: rgba(244, 244, 245, 0.75);
  mix-blend-mode: difference;
}

.work-item__title {
  position: absolute;
  z-index: 2;
  left: clamp(1rem, 3vw, 2.5rem);
  right: clamp(1rem, 3vw, 2.5rem);
  bottom: clamp(0.75rem, 2.5vw, 1.75rem);
  margin: 0;
  font-size: clamp(2rem, 7vw, 4.5rem);
  font-weight: 600;
  line-height: 1.02;
  letter-spacing: var(--track-tight);
  text-transform: uppercase;
  color: #f4f4f5; /* sits on artwork, not on the page background */
  overflow: clip;
  padding-bottom: 0.06em;
}

.work-item__info {
  margin-top: var(--sp-5);
  display: grid;
  gap: var(--sp-4);
}

.work-item__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75em;
  align-items: baseline;
  font-family: var(--font-mono);
  font-size: var(--fs-2xs);
  text-transform: uppercase;
  letter-spacing: var(--track-caps);
  color: var(--color-text-muted);
}

.work-item__year {
  color: var(--color-accent-ink);
}

.work-item__desc {
  color: var(--color-text-muted);
  max-width: 46ch;
}

.work-item__tech {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
}

.work-item__link {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.work-item__link.is-placeholder {
  color: var(--color-text-muted);
}

/* HUD is meaningful only for the horizontal gallery */
.work-hud {
  display: none;
}

/* Hidden state before reveal — only ever under .js, motion allowed */
@media (prefers-reduced-motion: no-preference) {
  .js .work-item:not(.is-revealed) .work-item__frame {
    clip-path: inset(0% 0% 100% 0%);
  }

  .js .work-item:not(.is-revealed) .work-item__title .char {
    transform: translateY(112%);
  }

  .js .work-item:not(.is-revealed) [data-work-bit] {
    opacity: 0;
  }
}

/* ---- Pinned horizontal gallery ---------------------------------------------- */
@media (min-width: 1024px) and (prefers-reduced-motion: no-preference) {
  .js .work-scroll {
    margin-top: 0;
    /* height is set by work.js to exactly the horizontal overflow */
  }

  .js .work-stage {
    position: sticky;
    top: 0;
    height: 100svh;
    display: flex;
    align-items: center;
    overflow: clip;
  }

  .js .work-track {
    display: flex;
    gap: clamp(2rem, 4vw, 4.5rem);
    max-width: none;
    margin-inline: 0;
    padding-inline: var(--container-pad);
    will-change: transform;
  }

  /* The panel is given a height budget and the image takes whatever the
     text does not — so a taller info block can never overflow the pinned
     stage (which clips) or collide with the HUD. */
  .js .work-item {
    flex: 0 0 auto;
    width: min(58vw, 52rem);
    height: min(74vh, 44rem);
    display: grid;
    grid-template-rows: minmax(0, 1fr) auto;
  }

  /* Only the pinned gallery drives these every frame, so this is the only
     place they earn a compositor layer. */
  .js .work-item__frame {
    height: auto;
    min-height: 0;
    max-height: 34rem;
    aspect-ratio: auto;
    transform-origin: center;
    will-change: transform;
  }

  .js .work-item__img {
    will-change: transform;
  }

  .js .work-item__info {
    margin-top: var(--sp-5);
    font-size: var(--fs-sm);
  }

  .js .work-item__desc {
    font-size: var(--fs-sm);
  }
}

/* Two-column info only where the panel is wide enough for it to stay short */
@media (min-width: 1280px) and (prefers-reduced-motion: no-preference) {
  .js .work-item__info {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "meta link"
      "desc tech";
    align-items: start;
    gap: var(--sp-3) var(--gutter);
  }

  .js .work-item__meta { grid-area: meta; }
  .js .work-item__desc { grid-area: desc; }
  .js .work-item__tech { grid-area: tech; justify-content: flex-end; align-content: start; }
  .js .work-item__info > :last-child { grid-area: link; text-align: right; }
}

/* Focus cue + HUD apply across the whole pinned range, not just wide screens */
@media (min-width: 1024px) and (prefers-reduced-motion: no-preference) {
  /* Dim everything except the panel the counter is reporting. The stage
     fills the viewport, so this can't be hover-gated — the cursor is
     almost always over the track and the cue would never show. */
  .js .work-item {
    transition: opacity var(--dur-base) ease;
  }

  .js .work-item:not(.is-current) {
    opacity: 0.52;
  }

  /* HUD — answers "where am I in the sequence" at all times */
  .js .work-hud {
    display: flex;
    align-items: center;
    gap: var(--sp-4);
    position: absolute;
    left: var(--container-pad);
    right: var(--container-pad);
    bottom: clamp(1.5rem, 4vh, 3rem);
  }

  .js .work-hud__counter {
    font-family: var(--font-mono);
    font-size: var(--fs-2xs);
    font-weight: 500;
    letter-spacing: var(--track-caps);
    white-space: nowrap;
  }

  .js .work-hud__now {
    color: var(--color-accent-ink);
  }

  .js .work-hud__total {
    color: var(--color-text-muted);
    margin-left: 0.5em;
  }

  .js .work-hud__rail {
    position: relative;
    flex: 1;
    height: 1px;
    background: var(--color-line);
    overflow: clip;
  }

  .js .work-hud__fill {
    position: absolute;
    inset: 0;
    background: var(--color-accent);
    transform: scaleX(0);
    transform-origin: left;
  }

  .js .work-hud__hint {
    font-family: var(--font-mono);
    font-size: var(--fs-2xs);
    text-transform: uppercase;
    letter-spacing: var(--track-caps);
    color: var(--color-text-muted);
    white-space: nowrap;
  }
}

.work-cta {
  margin-top: clamp(4rem, 8vw, 6rem);
  padding-top: var(--sp-7);
  border-top: 1px solid var(--color-line);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-5);
}

.work-cta__note {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: var(--track-caps);
  color: var(--color-text-muted);
}

/* ---- CONTACT ------------------------------------------------------------------------ */
/* ---- CONTACT — the climax ---------------------------------------------------- */
.contact__title {
  font-size: var(--fs-display);
  font-weight: 600;
  line-height: 0.98;
  letter-spacing: var(--track-tight);
  text-transform: uppercase;
  text-wrap: initial; /* the line breaks here are authored, not balanced */
}

.contact__line {
  padding-block: 0.045em; /* keeps descenders inside the mask */
}

.contact__line--accent {
  color: var(--color-accent-ink);
}

@media (prefers-reduced-motion: no-preference) {
  .js .contact__title:not(.is-revealed) .contact__line {
    transform: translateY(112%);
    will-change: transform;
  }
}

.contact__grid {
  margin-top: clamp(3.5rem, 8vw, 6rem);
  display: grid;
  gap: clamp(3rem, 7vw, 5rem) var(--sp-9);
  align-items: start;
}

@media (min-width: 900px) {
  .contact__grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
}

.contact__lead {
  font-size: var(--fs-lead);
  line-height: 1.5;
  color: var(--color-text-muted);
  max-width: 42ch;
}

.contact__channel {
  margin-top: var(--sp-7);
}

.contact-col__title {
  font-family: var(--font-mono);
  font-size: var(--fs-2xs);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: var(--track-caps);
  color: var(--color-text-muted);
  margin-bottom: var(--sp-4);
}

.contact__mail-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-4);
}

.contact__mail {
  font-family: var(--font-display);
  font-size: clamp(1.3rem, 2.6vw, 2rem);
  font-weight: 500;
  letter-spacing: -0.01em;
  border-bottom: 2px solid var(--color-line-strong);
  padding-bottom: 0.1em;
  overflow-wrap: anywhere;
  transition:
    color var(--dur-micro) ease,
    border-color var(--dur-micro) ease;
}

.contact__mail:hover {
  color: var(--color-accent-ink);
  border-color: var(--color-accent);
}

.btn--sm {
  padding: 0.7em 1.2em;
  font-size: var(--fs-2xs);
}

.contact__links,
.contact__facts {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  font-size: var(--fs-sm);
}

.contact__facts {
  color: var(--color-text-muted);
  margin-bottom: var(--sp-4);
}

.contact .chip {
  font-family: var(--font-mono);
  font-size: var(--fs-2xs);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-muted);
}

/* ---- Form ---------------------------------------------------------------- */
.contact-form {
  display: grid;
  gap: var(--sp-5);
}

.field {
  position: relative;
  display: grid;
  gap: var(--sp-2);
}

.field__label {
  font-family: var(--font-mono);
  font-size: var(--fs-2xs);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: var(--track-caps);
  color: var(--color-text-muted);
  transition: color var(--dur-micro) ease;
}

.field:focus-within .field__label {
  color: var(--color-accent-ink);
}

.field__input {
  width: 100%;
  padding: 0.35em 0 0.7em;
  background: none;
  border: 0;
  border-bottom: 1px solid var(--color-line-strong);
  border-radius: 0;
  font-family: var(--font-body);
  font-size: 1.0625rem;
  color: var(--color-text);
  outline: none;
}

.field__input::placeholder {
  color: var(--color-text-muted);
  opacity: 0.55;
}

.field__input--area {
  resize: vertical;
  min-height: 6.5rem;
  line-height: 1.55;
}

/* Anime.js scales this rule in on focus and away on blur */
.field__rule {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: var(--color-accent);
  transform: scaleX(0);
  transform-origin: left;
  pointer-events: none;
}

.field__error {
  font-family: var(--font-mono);
  font-size: var(--fs-2xs);
  letter-spacing: 0.04em;
  color: var(--color-error);
}

.field.has-error .field__input {
  border-bottom-color: var(--color-error);
}

.field.has-error .field__label {
  color: var(--color-error);
}

/* Keyboard users still need a visible focus ring on inputs */
.field__input:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 4px;
}

.btn--submit {
  position: relative;
  overflow: hidden;
  justify-self: start;
  min-width: 13rem;
  /* Anime.js owns this button's transform — a CSS transition on the same
     property would re-ease every frame and turn the shake into a wobble. */
  transition:
    background-color var(--dur-micro) ease,
    border-color var(--dur-micro) ease,
    color var(--dur-micro) ease;
}

.btn--submit:hover,
.btn--submit:active {
  transform: none;
}

.btn__progress {
  position: absolute;
  inset: 0;
  background: var(--color-accent-deep);
  transform: scaleX(0);
  transform-origin: left;
}

.btn__label {
  position: relative;
  z-index: 1;
  display: block;
}

.btn--submit.is-sent {
  background: var(--color-accent-deep);
  border-color: var(--color-accent-deep);
  color: #ffffff;
}

.form-status {
  font-family: var(--font-mono);
  font-size: var(--fs-2xs);
  line-height: 1.7;
  letter-spacing: 0.03em;
  color: var(--color-text-muted);
  min-height: 1.2em;
}

.form-status:empty {
  display: none;
}

.form-status.is-error {
  color: var(--color-error);
}
