/* ==========================================================================
   Team of Keys — projects hub + project case pages
   Builds on styles.css (tokens, keycaps) and pages.css (sections, buttons, CTA).
   Motion lives in js/page-projects.js; without it everything sits in place.
   ========================================================================== */

.wk-tags { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.wk-tags li {
  padding: 0.42rem 0.8rem; border-radius: 99px; font-family: var(--mono); font-size: 0.72rem; line-height: 1.2; white-space: nowrap;
  background: rgba(5, 5, 5, 0.28); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.28);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}

/* cursor bubble (driven by js/site.js [data-follow]) */
.wk-follow {
  position: fixed; left: 0; top: 0; z-index: 60; pointer-events: none;
  width: 6.5rem; height: 6.5rem; margin: -3.25rem 0 0 -3.25rem; border-radius: 50%;
  display: grid; place-items: center; background: var(--orange); color: var(--ink);
  font-family: var(--mono); font-size: 0.78rem; letter-spacing: 0.04em; text-transform: uppercase;
  opacity: 0; transform: scale(0.4);
  box-shadow: 0 1rem 3rem -0.5rem rgba(255, 100, 40, 0.55);
}
@media (hover: none), (pointer: coarse) { .wk-follow { display: none; } }

/* ==========================================================================
   Hub hero
   ========================================================================== */
.wk-hero {
  position: relative; min-height: 100svh; overflow: clip;
  display: grid; grid-template-rows: auto 1fr auto auto; gap: clamp(1.5rem, 4svh, 3rem);
  padding: calc(var(--nav-h) + clamp(1.5rem, 4svh, 3rem)) var(--gutter) clamp(1.5rem, 4svh, 2.5rem);
}
.wk-hero__glow {
  position: absolute; inset: -20% -20% auto 35%; height: 90%; pointer-events: none;
  background: radial-gradient(closest-side, rgba(255, 100, 40, 0.24), rgba(255, 100, 40, 0.05) 60%, transparent);
}
.wk-hero__top { position: relative; display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.wk-hero__title {
  position: relative; align-self: center; display: grid;
  font-size: clamp(4.2rem, 15.5vw, 17rem); line-height: 0.86; letter-spacing: -0.065em; font-weight: 500;
}
.wk-hero__line { display: block; }
.wk-hero__line--2 { display: flex; align-items: center; justify-content: flex-end; gap: 0.12em; }
.wk-hero__line--2 em {
  font-family: "Instrument Serif", Georgia, serif; font-style: italic; font-weight: 400; letter-spacing: -0.03em; color: var(--orange);
  padding-right: 0.06em;
}
.wk-hero__window {
  position: relative; display: block; flex: none; overflow: hidden;
  width: 1.85em; height: 0.74em; border-radius: 999px; margin-top: 0.08em;
  background: #151311; box-shadow: inset 0 0 0 1px rgba(255, 100, 40, 0.45), 0 1.5rem 4rem -1rem rgba(255, 100, 40, 0.35);
}
.wk-hero__pic { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; }
.wk-hero__pic.is-on { opacity: 1; }
.wk-hero__foot { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 2rem; align-items: end; border-top: 1px solid var(--line); padding-top: 1.5rem; }
.wk-hero__lede { max-width: 38ch; color: var(--paper-dim); font-size: clamp(1rem, 1.3vw, 1.2rem); line-height: 1.55; }
.wk-hero__index { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.2rem 2rem; }
.wk-hero__index a { display: flex; gap: 0.9rem; align-items: baseline; padding: 0.35rem 0; font-size: clamp(1rem, 1.3vw, 1.2rem); letter-spacing: -0.02em; transition: color 0.3s var(--ease), transform 0.5s var(--ease); }
.wk-hero__index .mono { font-size: 0.72rem; color: var(--orange); }
.wk-hero__index a:hover { color: var(--orange); transform: translateX(0.4rem); }
.wk-hero__cue, .pj-hero__cue { display: flex; align-items: center; gap: 0.8rem; font-size: 0.72rem; color: var(--paper-dim); }
.wk-hero__cue i, .pj-hero__cue i { position: relative; display: block; width: 4rem; height: 1px; background: var(--line); overflow: hidden; }
.wk-hero__cue i::after, .pj-hero__cue i::after { content: ""; position: absolute; inset: 0; background: var(--orange); animation: pj-cue 2.4s var(--ease) infinite; }
@keyframes pj-cue { 0% { transform: translateX(-100%); } 60%, 100% { transform: translateX(100%); } }
@media (prefers-reduced-motion: reduce) { .wk-hero__cue i::after, .pj-hero__cue i::after { animation: none; } }

@media (max-width: 899px) {
  .wk-hero { min-height: 0; grid-template-rows: auto auto auto; }
  .wk-hero__title { margin-block: 3rem 1rem; font-size: clamp(3.6rem, 21vw, 7rem); }
  .wk-hero__foot { grid-template-columns: 1fr; }
  .wk-hero__cue { display: none; }
}

/* ==========================================================================
   Hub list: full-bleed covers that stack as you scroll
   ========================================================================== */
.wk-list { position: relative; }
.wk-card { position: sticky; top: 0; height: 100svh; min-height: 34rem; overflow: hidden; background: var(--ink); }
.wk-card__link { position: relative; display: block; height: 100%; color: var(--paper); transform-origin: 50% 0%; }
.wk-card__link::after { content: ""; position: absolute; inset: 0; z-index: 3; pointer-events: none; background: #050505; opacity: var(--dim, 0); }
.wk-card__media { position: absolute; inset: 0; overflow: hidden; background: #111; }
.wk-card__img {
  width: 100%; height: 100%; object-fit: cover; transform-origin: 50% 50%;
  transition: scale 1.4s var(--ease), filter 0.8s var(--ease);
}
.wk-card__link:hover .wk-card__img, .wk-card__link:focus-visible .wk-card__img { scale: 1.07; filter: saturate(1.15); }
.wk-card__shade {
  position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(180deg, rgba(5, 5, 5, 0.55) 0%, rgba(5, 5, 5, 0) 26%),
    linear-gradient(0deg, rgba(5, 5, 5, 0.92) 0%, rgba(5, 5, 5, 0.45) 34%, rgba(5, 5, 5, 0) 62%);
}
.wk-card__body {
  position: absolute; inset: 0; display: grid; grid-template-rows: auto 1fr auto auto;
  padding: calc(var(--nav-h) + 1rem) var(--gutter) clamp(1.5rem, 5svh, 3rem);
}
.wk-card__meta { display: flex; justify-content: space-between; gap: 1rem; font-size: 0.78rem; color: var(--paper-dim); }
.wk-card__num { color: var(--paper); }
.wk-card__title {
  grid-row: 3; font-size: clamp(3.2rem, 11.5vw, 13rem); line-height: 0.88; letter-spacing: -0.065em; font-weight: 500;
  max-width: 11ch; text-wrap: balance; transition: transform 0.9s var(--ease);
}
.wk-card__link:hover .wk-card__title { transform: translateX(0.12em); }
.wk-card__row { grid-row: 4; display: flex; justify-content: space-between; align-items: end; gap: 1.25rem 3rem; flex-wrap: wrap; margin-top: clamp(1rem, 3svh, 2rem); }
.wk-card__text { max-width: 46ch; color: var(--paper-dim); font-size: clamp(0.98rem, 1.15vw, 1.1rem); line-height: 1.55; }
.wk-card__cta {
  position: absolute; right: var(--gutter); top: calc(var(--nav-h) + 2.6rem);
  display: inline-flex; gap: 0.6rem; align-items: center; font-size: 0.78rem;
  padding: 0.7rem 1.1rem; border-radius: 99px; background: var(--paper); color: var(--ink);
  opacity: 0; transform: translateY(0.5rem); transition: opacity 0.5s var(--ease), transform 0.5s var(--ease);
}
.wk-card__cta i { font-style: normal; }
.wk-card__link:hover .wk-card__cta, .wk-card__link:focus-visible .wk-card__cta { opacity: 1; transform: none; }
@media (hover: none) { .wk-card__cta { opacity: 1; transform: none; background: var(--orange); } }
@media (max-width: 899px) {
  .wk-card { min-height: 30rem; }
  .wk-card__title { font-size: clamp(2.8rem, 14vw, 5.5rem); }
  .wk-card__cta { top: auto; bottom: auto; position: static; justify-self: start; grid-row: 5; margin-top: 1.25rem; }
  .wk-card__body { grid-template-rows: auto 1fr auto auto auto; }
}

/* ==========================================================================
   Hub craft band
   ========================================================================== */
.wk-craft { position: relative; z-index: 2; padding: var(--section-y) var(--gutter); display: grid; gap: clamp(3rem, 6vw, 5rem); }
.wk-craft__text { margin-top: 1.75rem; font-size: clamp(1.7rem, 3.6vw, 3.5rem); line-height: 1.12; letter-spacing: -0.035em; max-width: 32ch; text-wrap: pretty; }
.wk-craft__keys { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 2rem 1.5rem; border-top: 1px solid var(--line); padding-top: 2.5rem; --cap: clamp(4.5rem, 6.5vw, 6rem); }
.wk-craft__key { display: grid; justify-items: start; gap: 1.1rem; }
.wk-craft__key > span:last-child { font-size: 1.05rem; letter-spacing: -0.02em; }
@media (max-width: 899px) { .wk-craft__keys { grid-template-columns: repeat(2, minmax(0, 1fr)); --cap: 4.25rem; } }

/* ==========================================================================
   Project hero
   ========================================================================== */
.pj-hero { position: relative; height: 100svh; min-height: 36rem; overflow: clip; color: var(--paper); }
.pj-hero__frame { position: absolute; inset: 0; overflow: hidden; background: #0e0d0c; }
html.js:not(.no-motion):not(.reduced-motion) .pj-hero__frame { clip-path: inset(22% 26% 22% 26% round 1.5rem); }
.pj-hero__img { width: 100%; height: 100%; object-fit: cover; transform-origin: 50% 50%; }
.pj-hero__shade {
  position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(180deg, rgba(5, 5, 5, 0.6) 0%, rgba(5, 5, 5, 0) 24%),
    linear-gradient(0deg, rgba(5, 5, 5, 0.95) 0%, rgba(5, 5, 5, 0.5) 36%, rgba(5, 5, 5, 0) 65%);
}
.pj-hero__top {
  position: absolute; inset: calc(var(--nav-h) + 1rem) var(--gutter) auto; z-index: 2;
  display: flex; justify-content: space-between; align-items: center; gap: 1rem;
}
.pj-hero__count { font-size: 0.78rem; color: var(--paper-dim); }
.pj-hero__copy { position: absolute; inset: auto var(--gutter) clamp(4rem, 10svh, 6rem); z-index: 2; display: grid; gap: 1rem; }
.pj-hero__title { font-size: clamp(3.4rem, 12.5vw, 14rem); line-height: 0.86; letter-spacing: -0.065em; font-weight: 500; max-width: 12ch; text-wrap: balance; }
.pj-hero__specs { display: flex; flex-wrap: wrap; gap: 1rem clamp(2rem, 5vw, 4.5rem); margin-top: 1rem; padding-top: 1.25rem; border-top: 1px solid rgba(255, 255, 255, 0.2); }
.pj-hero__specs dt { font-size: 0.7rem; color: var(--paper-dim); margin-bottom: 0.35rem; }
.pj-hero__specs dd { font-size: clamp(1rem, 1.3vw, 1.2rem); letter-spacing: -0.02em; }
.pj-hero__cue { position: absolute; right: var(--gutter); bottom: 1.5rem; z-index: 2; }
@media (max-width: 899px) {
  .pj-hero__copy { bottom: 3.5rem; }
  .pj-hero__top .crumbs { font-size: 0.72rem; }
  .pj-hero__cue { left: var(--gutter); right: auto; }
}

/* ---------- ticker band ---------- */
.pj-over { border-block: 1px solid var(--line); padding-block: clamp(1rem, 2.5vw, 1.8rem); overflow: clip; }
.pj-over span { font-size: clamp(2rem, 5.5vw, 5.5rem); letter-spacing: -0.05em; line-height: 1; padding-inline: clamp(1rem, 2.5vw, 2.25rem); white-space: nowrap; font-weight: 500; }
.pj-over span:nth-child(4n + 3) { font-family: "Instrument Serif", Georgia, serif; font-style: italic; font-weight: 400; color: var(--orange); letter-spacing: -0.02em; }
.pj-over i { flex: none; width: clamp(0.8rem, 1.4vw, 1.2rem); aspect-ratio: 1; border-radius: 22%; background: linear-gradient(160deg, #ff8a55, #e45a22); box-shadow: 0 0.2rem 0 -1px #8a3210; }

/* ==========================================================================
   Story chapters
   ========================================================================== */
.pj-story {
  position: relative; padding: var(--section-y) var(--gutter);
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: clamp(1rem, 2vw, 2rem);
}
.pj-story--1 { border-radius: 2rem 2rem 0 0; margin-top: -1px; }
.pj-story__head { grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: center; gap: 1rem; --cap: clamp(3.5rem, 5vw, 4.5rem); }
.pj-story__title {
  grid-column: 1 / span 5; margin-top: clamp(1.5rem, 4vw, 3rem);
  font-size: clamp(2.4rem, 5.4vw, 5.6rem); line-height: 0.95; letter-spacing: -0.05em; font-weight: 500; text-wrap: balance;
}
.pj-story__text {
  grid-column: 6 / -1; margin-top: clamp(1.5rem, 4vw, 3rem);
  font-size: clamp(1.45rem, 2.7vw, 2.75rem); line-height: 1.15; letter-spacing: -0.03em; text-wrap: pretty;
}
.pj-story__media { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: inherit; margin-top: clamp(3rem, 8vw, 7rem); }
.pj-shot { position: relative; overflow: hidden; border-radius: 1.25rem; background: #151311; margin: 0; }
.pj-shot__img { position: absolute; left: 0; top: -8%; width: 100%; height: 116%; object-fit: cover; }
.pj-shot--a { grid-column: 1 / span 8; }
.pj-shot--b { grid-column: 8 / -1; grid-row: 1; align-self: end; margin-bottom: -18%; z-index: 1; box-shadow: 0 2rem 4rem -1.5rem rgba(5, 5, 5, 0.6); }
.pj-story__media--one .pj-shot--a { grid-column: 1 / -1; }
.pj-story--1 .pj-story__media { padding-bottom: 8%; }
/* the second chapter mirrors the first */
.pj-story--2 .pj-story__title { grid-column: 8 / -1; grid-row: 2; }
.pj-story--2 .pj-story__text { grid-column: 1 / span 7; grid-row: 2; }
.pj-story--2 .pj-shot--a { grid-column: 5 / -1; }
.pj-story--2 .pj-shot--b { grid-column: 1 / span 5; margin-bottom: 0; margin-top: -10%; align-self: start; }
.pj-story--2 .pj-story__media { padding-bottom: 0; }
@media (max-width: 899px) {
  .pj-story { grid-template-columns: 1fr; }
  .pj-story__title, .pj-story__text, .pj-story--2 .pj-story__title, .pj-story--2 .pj-story__text { grid-column: 1; grid-row: auto; }
  .pj-story__text { margin-top: 1.25rem; }
  .pj-story__media { grid-template-columns: repeat(6, minmax(0, 1fr)); margin-top: 2.5rem; }
  .pj-shot--a, .pj-story--2 .pj-shot--a { grid-column: 1 / -1; }
  .pj-shot--b, .pj-story--2 .pj-shot--b { grid-column: 2 / -1; grid-row: 2; margin: -12% 0 0; align-self: start; }
  .pj-story--1 .pj-story__media { padding-bottom: 0; }
}

/* ==========================================================================
   Gallery filmstrip — native horizontal scroll, pinned by JS on desktop
   ========================================================================== */
.pj-film { position: relative; overflow: clip; }
.pj-film__pin { padding: var(--section-y) 0; display: grid; align-content: center; gap: clamp(2rem, 5svh, 3.5rem); }
.pj-film.is-pinned .pj-film__pin { min-height: 100svh; padding-block: calc(var(--nav-h) + 1rem) 2.5rem; }
.pj-film__head { display: flex; justify-content: space-between; align-items: end; gap: 2rem; padding-inline: var(--gutter); }
.pj-film__head .display-2 { max-width: 14ch; }
.pj-film__count { font-size: clamp(0.9rem, 1.2vw, 1.1rem); color: var(--paper-dim); white-space: nowrap; }
.pj-film__count span { color: var(--orange); }
.pj-film__viewport {
  overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x mandatory; scrollbar-width: none;
  padding-inline: var(--gutter); scroll-padding-inline: var(--gutter); cursor: grab;
}
.pj-film__viewport::-webkit-scrollbar { display: none; }
.pj-film__viewport:focus-visible { outline: 2px solid var(--orange); outline-offset: -2px; }
.pj-film.is-pinned .pj-film__viewport { overflow: visible; scroll-snap-type: none; cursor: default; }
.pj-film__track { display: flex; align-items: flex-start; gap: clamp(0.9rem, 1.6vw, 1.5rem); width: max-content; }
.pj-film.is-pinned .pj-film__track { will-change: transform; }
.pj-frame { position: relative; flex: none; height: clamp(15rem, 56svh, 38rem); aspect-ratio: var(--ar); scroll-snap-align: start; }
.pj-frame__fig { position: relative; width: 100%; height: 100%; margin: 0; overflow: hidden; border-radius: 1.1rem; background: #151311; }
.pj-frame__img { position: absolute; inset: 0 -8%; width: 116%; height: 100%; max-width: none; object-fit: cover; }
.pj-frame__num { position: absolute; left: 1rem; bottom: 1rem; font-size: 0.72rem; padding: 0.35rem 0.6rem; border-radius: 99px; background: rgba(5, 5, 5, 0.6); color: var(--paper); }
.pj-film__bar { margin-inline: var(--gutter); height: 2px; background: var(--line); }
.pj-film__bar span { display: block; height: 100%; background: var(--orange); transform-origin: left; transform: scaleX(0); }
@media (max-width: 899px) {
  .pj-film__head { flex-direction: column; align-items: start; gap: 1rem; }
  .pj-frame { height: auto; width: 82vw; aspect-ratio: auto; }
  .pj-frame__fig { aspect-ratio: var(--ar); height: auto; }
}

/* ==========================================================================
   Next project
   ========================================================================== */
.pj-next { position: relative; border-top: 1px solid var(--line); }
.pj-next__link {
  position: relative; display: grid; gap: 1rem; overflow: hidden; isolation: isolate;
  padding: clamp(5rem, 14vw, 12rem) var(--gutter); min-height: clamp(26rem, 80svh, 52rem); align-content: center;
}
.pj-next__media {
  position: absolute; inset: 0; z-index: -1; overflow: hidden;
  clip-path: inset(50% 50% 50% 50% round 1.5rem); transition: clip-path 1.1s cubic-bezier(0.7, 0, 0.2, 1);
}
.pj-next__img { width: 100%; height: 100%; object-fit: cover; filter: brightness(0.5) saturate(1.1); scale: 1.2; transition: scale 1.4s var(--ease); }
.pj-next__link:hover .pj-next__media, .pj-next__link:focus-visible .pj-next__media { clip-path: inset(0% 0% 0% 0% round 0rem); }
.pj-next__link:hover .pj-next__img, .pj-next__link:focus-visible .pj-next__img { scale: 1; }
.pj-next__title { font-size: clamp(3.2rem, 12vw, 13.5rem); line-height: 0.88; letter-spacing: -0.065em; font-weight: 500; max-width: 12ch; text-wrap: balance; }
.pj-next__word { display: inline-block; transition: color 0.6s var(--ease), transform 1s var(--ease); }
.pj-next__link:hover .pj-next__word { color: var(--orange); transform: translateX(0.06em); }
.pj-next__row { display: flex; justify-content: space-between; align-items: center; gap: 1.5rem; flex-wrap: wrap; margin-top: 1rem; }
.pj-next__arrow {
  display: grid; place-items: center; width: clamp(4rem, 7vw, 6rem); aspect-ratio: 1; border-radius: 50%;
  box-shadow: inset 0 0 0 1px var(--line); font-size: clamp(1.4rem, 2.2vw, 2rem);
  transition: background 0.5s var(--ease), color 0.5s var(--ease), transform 0.8s var(--ease);
}
.pj-next__link:hover .pj-next__arrow { background: var(--orange); color: var(--ink); transform: rotate(-35deg); }
@media (hover: none) {
  .pj-next__media { clip-path: none; }
  .pj-next__img { scale: 1; filter: brightness(0.42); }
}
