/* Our Work page — leans on style.css tokens; scoped section styles only.
   The hero deliberately mirrors the About page hero (css/about.css) so the two
   read as a matched pair. Kept in its own file rather than sharing `ab-`
   classes: the two pages diverge below the fold, and a shared prefix would
   mean every later change to one had to be checked against the other. */
:root { --work-accent: #ff914d; }

/* ── Hero ────────────────────────────────────────────────────────── */
.wk-hero { padding: clamp(120px,13vh,160px) clamp(24px,5vw,72px) clamp(48px,6vh,88px); }
.wk-hero__title {
  font-family: 'Barlow Condensed', 'Onest', sans-serif;
  font-weight: 800; font-size: clamp(2.6rem, 9vw, 10rem);
  line-height: 0.9; letter-spacing: -0.015em; text-transform: uppercase;
  margin: 0; color: #0d0d0d;
}
.wk-hero__title em { font-family: 'Instrument Serif', serif; font-style: italic; font-weight: 400; color: var(--work-accent); }
.wk-hero__title .w { display: inline-block; will-change: transform, opacity; }

/* Headline entrance — must match services.css and about.css exactly. All three
   are sibling top-level pages reached from the same nav, so a headline that
   cascades on one and pops as a single block on another makes navigation feel
   like three different sites. Values are the house entrance: 0.9s on
   var(--ease-out), words 70ms apart from 0.15s.
   Change one, change all three. */
@media (prefers-reduced-motion: no-preference) {
  .wk-hero__title .w {
    opacity: 0;
    transform: translateY(0.14em);
    animation: wkIn 0.9s var(--ease-out) both;
  }
  .wk-hero__title .w:nth-child(1) { animation-delay: 0.15s; }
  .wk-hero__title .w:nth-child(2) { animation-delay: 0.22s; }
  .wk-hero__title .w:nth-child(3) { animation-delay: 0.29s; }
  .wk-hero__title .w:nth-child(4) { animation-delay: 0.36s; }
  .wk-hero__title .w:nth-child(5) { animation-delay: 0.43s; }
  .wk-hero__title .w:nth-child(6) { animation-delay: 0.5s;  }
  .wk-hero__title .w:nth-child(7) { animation-delay: 0.57s; }
  .wk-hero__title .w:nth-child(8) { animation-delay: 0.64s; }
  .wk-hero__title .w:nth-child(9) { animation-delay: 0.71s; }
  .wk-hero__title .w:nth-child(10){ animation-delay: 0.78s; }

  /* Supporting copy lands after the headline has finished reading, mirroring
     .svc-hero__foot / .svc-hero__kicker on services. */
  .wk-hero__intro {
    opacity: 0;
    animation: wkIn 0.8s var(--ease-out) 0.9s both;
  }
}
@keyframes wkIn { to { opacity: 1; transform: none; } }
.wk-hero__intro {
  display: grid; grid-template-columns: 1fr 1fr; gap: clamp(28px, 5vw, 96px);
  margin-top: clamp(48px, 8vh, 100px); max-width: 100%;
}
.wk-hero__intro p {
  font-family: 'Onest', sans-serif; font-weight: 400;
  font-size: clamp(15px, 1.05vw, 19px); line-height: 1.55; margin: 0;
  color: #0d0d0d;
}
.wk-hero__intro p + p { color: rgba(13,13,13,0.72); }

/* ── Featured — horizontal scroll-snap carousel ──────────────────
   The track is a native overflow-x container. That buys touch swipe,
   trackpad gestures, keyboard arrows and the scrollbar-drag affordance for
   free; the buttons are a convenience on top, not the mechanism. */
.wk-featured {
  padding: clamp(56px, 8vh, 96px) clamp(24px, 5vw, 72px) clamp(72px, 10vh, 120px);
}

.wk-featured__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: clamp(28px, 3.5vw, 48px);
}

.wk-featured__label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #1d1c1c;
  opacity: 0.55;
  margin: 0;
}

.wk-featured__nav { display: flex; gap: 10px; }

.wk-featured__btn {
  width: clamp(42px, 3.4vw, 52px);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(13, 13, 13, 0.18);
  border-radius: 3px;
  background: transparent;
  color: #0d0d0d;
  cursor: pointer;
  transition: background-color 0.2s var(--ease-state),
              border-color 0.2s var(--ease-state),
              color 0.2s var(--ease-state),
              opacity 0.2s var(--ease-state);
}
.wk-featured__btn svg { width: 45%; height: 45%; display: block; }

@media (hover: hover) and (pointer: fine) {
  .wk-featured__btn:not(:disabled):hover {
    background: #0d0d0d;
    border-color: #0d0d0d;
    color: #fff3eb;
  }
}
.wk-featured__btn:not(:disabled):active { transform: scale(0.96); transition-duration: 0.12s; }
.wk-featured__btn:disabled { opacity: 0.25; cursor: default; }
.wk-featured__btn:focus-visible { outline: 2px solid var(--work-accent); outline-offset: 3px; }

.wk-featured__track {
  --cards: 3;
  --gap: clamp(14px, 1.5vw, 22px);
  /* A sliver of the next card is the only thing telling a touch user the row
     scrolls — the buttons are often off-screen at that width. */
  --peek: clamp(32px, 5vw, 72px);
  display: flex;
  gap: var(--gap);
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  /* Continuous rule under the whole row; the per-card rules above break at
     each gutter, exactly as in the reference. */
  border-bottom: 1px solid rgba(13, 13, 13, 0.14);
  scrollbar-width: none;
}
.wk-featured__track::-webkit-scrollbar { display: none; }
.wk-featured__track:focus-visible { outline: 2px solid var(--work-accent); outline-offset: 4px; }

/* Cards are <a> once the project has a case study and <article> until then,
   so the anchor styling has to be neutralised here rather than assumed. */
.wk-card {
  text-decoration: none;
  color: inherit;
  flex: 0 0 calc((100% - var(--peek) - (var(--cards) - 1) * var(--gap)) / var(--cards));
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
  border-top: 1px solid rgba(13, 13, 13, 0.14);
  padding: clamp(20px, 2vw, 30px) 0 clamp(26px, 3vw, 44px);
  min-width: 0;
}

.wk-card__title {
  font-family: 'Onest', sans-serif;
  font-weight: 500;
  font-size: clamp(15px, 1.35vw, 23px);
  line-height: 1.25;
  letter-spacing: -0.005em;
  color: #0d0d0d;
  margin: 0 0 clamp(18px, 1.8vw, 28px);
  /* Two lines are reserved whether or not the title needs them, so a longer
     title in one card never pushes its plate out of line with its neighbours.
     Titles are author-supplied, so this cannot be left to chance. */
  min-height: 2.5em;
}

/* More Work reuses the whole component two-up, so the plates run wider and
   the ratio opens out to match. Everything else is shared. */
.wk-featured--wide .wk-featured__track { --cards: 2; }
.wk-featured--wide .wk-card__plate { aspect-ratio: 16 / 9; }

.wk-card__plate {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: 3px;
  overflow: hidden;
  background: #1d1c1c;
}
.wk-card__art {
  display: block;
  width: 100%;
  height: 100%;
  /* Resting just above 1 so the hover push has somewhere to travel from. */
  transform: scale(1.005);
  transition: transform 0.26s var(--ease-state);
}

@media (hover: hover) and (pointer: fine) {
  .wk-card:hover .wk-card__art { transform: scale(1.03); }
  .wk-card:hover .wk-card__client { color: var(--work-accent); }
}
a.wk-card:focus-visible { outline: 2px solid var(--work-accent); outline-offset: 6px; border-radius: 4px; }
a.wk-card:active { transform: scale(0.995); transition: transform 0.14s var(--ease-state); }
.wk-card__client { transition: color 0.2s var(--ease-state); }

.wk-card__foot {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: clamp(13px, 1.3vw, 18px);
  /* Pinned to the bottom of the card rather than spaced off the plate: cards
     stretch to equal height, so every project name lands on one baseline
     across the row regardless of how long each title ran. */
  margin-top: auto;
  padding-top: clamp(18px, 1.8vw, 26px);
}

/* Single row. Freed from sharing this line with the project name, the tags
   now get the card's full width — enough for three short labels. Anything
   longer is clipped rather than wrapped, so keep tags terse. */
.wk-card__tags {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  list-style: none;
  margin: 0;
  padding: 0;
  max-width: 100%;
  overflow: hidden;
}

.wk-card__tag {
  /* JetBrains Mono — the brand's micro-label face, same as .projects-tag and
     .showcase-card__tag. */
  font-family: 'JetBrains Mono', monospace;
  font-size: clamp(8.5px, 0.66vw, 10px);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #1d1c1c;
  background: rgba(13, 13, 13, 0.07);
  border-radius: 3px;
  padding: 6px 9px;
  white-space: nowrap;
  flex-shrink: 0;
}

.wk-card__client {
  /* Barlow Condensed — the brand display face, same treatment as
     .svc-card__title and .showcase-card__title. Sits below the tags at a
     size that actually reads, rather than tucked into the corner. */
  font-family: 'Barlow Condensed', 'Onest', sans-serif;
  font-weight: 800;
  font-size: clamp(1.15rem, 1.55vw, 1.7rem);
  line-height: 1;
  letter-spacing: -0.005em;
  text-transform: uppercase;
  color: #0d0d0d;
}

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 991.98px) {
  .wk-hero { padding: clamp(96px, 12vh, 140px) 24px 48px; min-height: auto; }
  .wk-hero__title { font-size: clamp(2.4rem, 12vw, 6rem); }
  .wk-hero__intro { grid-template-columns: 1fr; gap: 24px; margin-top: 40px; }

  .wk-featured { padding-left: 24px; padding-right: 24px; }
  .wk-featured__track { --cards: 2; }
  /* Two-up is already wide at this size — drop it straight to one. */
  .wk-featured--wide .wk-featured__track { --cards: 1; }
}
@media (max-width: 575.98px) {
  .wk-hero__title { font-size: clamp(2rem, 12vw, 3rem); }

  /* A narrower peek buys the tag row the width it needs to stay on one line
     at this size; the chips tighten to match. Budget is roughly 44 characters
     of tag text per card — past that the row clips rather than wraps. */
  .wk-featured__track,
  .wk-featured--wide .wk-featured__track { --cards: 1; --peek: 32px; }
  .wk-card__tags { gap: 4px; }
  .wk-card__tag { padding: 5px 7px; letter-spacing: 0.06em; }
}

@media (prefers-reduced-motion: reduce) {
  .wk-featured__btn { transition: none; }
  .wk-featured__btn:not(:disabled):active { transform: none; }
  .wk-card__art { transition: none; }
  .wk-card:hover .wk-card__art { transform: scale(1.005); }
}
