/* Our work pages: /audio/, /vfx/, /pixel/. Extends site.css (tokens, header, footer, buttons, links).
   One sample per anchor: a pitch links /vfx/#shield-dome and that sample is marked with the red pupil cell. */

.px { image-rendering: pixelated; image-rendering: crisp-edges; image-rendering: pixelated; }

/* ---------- Hero: one line for the skill, and the three work pages ---------- */
.wk-hero { position: relative; isolation: isolate; padding-top: calc(var(--header-h) + clamp(40px, 6vw, 80px)); padding-bottom: clamp(40px, 5vw, 64px); }
.wk-hero::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 100%; z-index: -1; pointer-events: none;
  background: url("../img/reeboo-labs_pattern_overlay-light_tile960.png") 0 0 / 480px 480px repeat;
  -webkit-mask-image: linear-gradient(#000 20%, transparent); mask-image: linear-gradient(#000 20%, transparent);
}
.wk-hero .wrap { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gutter); row-gap: 32px; align-items: end; }
.wk-hero__copy { grid-column: 1 / span 8; }
.wk-hero h1 { font-size: clamp(2.5rem, 5vw, 4.25rem); line-height: 1.02; letter-spacing: -0.02em; max-width: 20ch; }
.wk-hero__sub { margin-top: 20px; font-size: var(--t-lead); line-height: 1.5; color: var(--n-300); max-width: 52ch; }

.wk-nav { grid-column: 9 / span 4; justify-self: end; }
.wk-nav ul { display: flex; gap: 4px; padding: 4px; border: 1px solid var(--line); border-radius: 12px; background: var(--ink); }
.wk-nav a {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border-radius: var(--r-btn);
  color: var(--n-300); font-weight: 500; text-decoration: none; white-space: nowrap;
  box-shadow: inset 0 0 0 0 var(--n-850);
  transition: box-shadow 160ms steps(3, end), color 0ms linear 80ms;
}
.wk-nav a:hover { color: var(--cream); box-shadow: inset 0 -48px 0 0 var(--n-850); }
.wk-nav a[aria-current="page"] { background: var(--cream); color: var(--ink); font-weight: 600; box-shadow: none; }

/* ---------- Samples ---------- */
.wk-samples { padding-bottom: clamp(72px, 8vw, 120px); }
.specs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(56px, 6vw, 88px) var(--gutter); }
.spec { display: grid; grid-template-rows: auto 1fr; row-gap: 20px; align-content: start; }
/* the first sample is the strongest: it takes the full row, media left, words right */
.spec:first-child { grid-column: 1 / -1; grid-template-columns: repeat(12, minmax(0, 1fr)); grid-template-rows: auto; column-gap: var(--gutter); align-items: center; }
.spec:first-child .spec__media { grid-column: 1 / span 8; }
.spec:first-child .spec__body { grid-column: 9 / span 4; }
/* an even count leaves the last sample alone on its row: it takes the full row too, words first */
.spec:nth-child(even):last-child { grid-column: 1 / -1; grid-template-columns: repeat(12, minmax(0, 1fr)); grid-template-rows: auto; column-gap: var(--gutter); align-items: center; }
.spec:nth-child(even):last-child .spec__media { grid-column: 5 / span 8; grid-row: 1; }
.spec:nth-child(even):last-child .spec__body { grid-column: 1 / span 4; grid-row: 1; }

.spec__media {
  position: relative; margin: 0; border-radius: var(--r-media); overflow: hidden; background: var(--n-900);
  outline: 1px solid color-mix(in srgb, var(--cream) 10%, transparent); outline-offset: -1px;
  transition: outline-color 200ms var(--ease);
}
.spec__video { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; background: var(--n-900); }
.spec__media--pixel { display: grid; place-items: center; aspect-ratio: 16 / 10; padding: clamp(8px, 1.5vw, 16px); }
.spec__media--pixel picture { display: contents; }
.spec__media--pixel img { width: 100%; height: 100%; object-fit: contain; }

/* Audio: the waveform is the clip; the played part is covered in ink as it plays, a click on it seeks */
.spec__media--audio { display: grid; padding: 24px 20px 16px; gap: 16px; }
.spec__wave { width: 100%; height: clamp(56px, 7vw, 96px); object-fit: fill; }
.spec__played {
  position: absolute; left: 20px; right: 20px; top: 24px; height: clamp(56px, 7vw, 96px); pointer-events: none;
  background: var(--red); mix-blend-mode: darken; /* tints only the waveform: the dark ground stays as it is */
  transform: scaleX(0); transform-origin: 0 50%;
}
.spec__media--audio.is-seekable .spec__wave { cursor: pointer; }
.spec__media--audio audio { width: 100%; height: 44px; color-scheme: dark; }

.spec__body { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; }
.spec__title { position: relative; font-size: clamp(1.375rem, 1.8vw, 1.75rem); line-height: 1.15; }
.spec:first-child .spec__title { font-size: clamp(1.75rem, 2.6vw, 2.5rem); }
.spec__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px; color: var(--muted); font-size: var(--t-small); }
.spec__for { color: var(--n-300); max-width: 52ch; }
.spec__tags { display: flex; flex-wrap: wrap; gap: 8px; }
.spec__tags li {
  padding: 4px 10px; border: 1px solid var(--line); border-radius: var(--r-chip);
  color: var(--n-300); font-size: 0.8125rem; font-weight: 500; line-height: 1.3;
}
.spec__from { color: var(--muted); }
.spec__from a { color: var(--cream); font-weight: 600; }
.spec__anchor { min-height: 36px; color: var(--muted); font-size: var(--t-small); }
.spec__anchor:hover, .spec__anchor:focus-visible { color: var(--cream); }

.spec__toggle {
  display: inline-flex; align-items: center; min-height: 32px; padding: 0 12px; border: 1px solid var(--line);
  border-radius: var(--r-chip); background: transparent; color: var(--n-300); font: 500 0.8125rem/1 var(--font); cursor: pointer;
}
.spec__toggle:hover { color: var(--cream); border-color: var(--n-400); }
.spec__toggle[hidden] { display: none; }
.spec__toggle:active { translate: 0 1px; }

/* The linked sample (a pitch points here): red pupil cell before its name, red frame */
.spec:target .spec__media { outline: 2px solid var(--red); outline-offset: -2px; }
.spec:target .spec__title { padding-left: 24px; }
.spec:target .spec__title::before {
  content: ""; position: absolute; left: 0; top: 0.42em; width: 12px; height: 12px; border-radius: 2px; background: var(--red);
}

/* ---------- Close: one line ---------- */
.wk-close { padding-block: clamp(64px, 8vw, 112px); border-top: 1px solid var(--line); }
.wk-close__line { font-size: clamp(1.625rem, 3.2vw, 2.75rem); font-weight: 700; line-height: 1.15; letter-spacing: -0.01em; max-width: 30ch; }
.wk-close__line a {
  color: var(--cream); text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 0.16em;
  text-decoration-color: var(--red); overflow-wrap: anywhere; transition: color 160ms var(--ease);
}
.wk-close__line a:hover { color: var(--red); }

/* ---------- Narrow screens ---------- */
@media (max-width: 1100px) {
  .wk-hero__copy { grid-column: 1 / -1; }
  .wk-nav { grid-column: 1 / -1; justify-self: start; }
  .spec:first-child .spec__media { grid-column: 1 / span 7; }
  .spec:first-child .spec__body { grid-column: 8 / span 5; }
  .spec:nth-child(even):last-child .spec__media { grid-column: 6 / span 7; }
  .spec:nth-child(even):last-child .spec__body { grid-column: 1 / span 5; }
}
@media (max-width: 860px) {
  .specs { grid-template-columns: minmax(0, 1fr); }
  .spec:first-child { display: grid; grid-template-columns: minmax(0, 1fr); row-gap: 20px; }
  .spec:first-child .spec__media, .spec:first-child .spec__body { grid-column: 1; }
  .spec:nth-child(even):last-child { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto; row-gap: 20px; }
  .spec:nth-child(even):last-child .spec__media { grid-column: 1; grid-row: 1; }
  .spec:nth-child(even):last-child .spec__body { grid-column: 1; grid-row: 2; }
}
@media (max-width: 560px) {
  .wk-nav, .wk-nav ul { width: 100%; }
  .wk-nav li { flex: 1 1 0; }
  .wk-nav a { justify-content: center; width: 100%; padding: 0 8px; }
  .spec__media--audio { padding: 16px 12px 12px; }
  .spec__played { left: 12px; right: 12px; top: 16px; }
}
