/* Peter J Duggan · Theme 1, black, white and yellow
   Loaded on top of colour.css. Every colour-bar letter turns black; the only
   colour bars are on the telly's screen and under his name, in the test-card colours. */

:root {
  --c1: var(--ink);
  --c2: var(--ink);
  --c3: var(--ink);
  --c4: var(--ink);
  --c5: var(--ink);
  --c6: var(--ink);
  --c7: var(--ink);
  /* The test card, as on the telly's screen. */
  --bars: linear-gradient(90deg, #fff 0 14.28%, #ff0 0 28.57%, #0ff 0 42.85%, #0f0 0 57.14%,
    #f0f 0 71.42%, #f00 0 85.71%, #00f 0);
}

/* ---------- Name: underlined with the telly's colour bars ---------- */

.t1 .mark__bars {
  height: 8px;
  border: 2px solid currentColor;
  box-sizing: content-box;
  background: var(--bars);
}
.t1 .mark__bars i { background: none !important; }

/* ---------- COLOUR: one big word over the bottom edge of the card ---------- */

.t1 .hero__stage:has(.hero__word--one) { display: block; }
.t1 .hero__stage:has(.hero__word--one) > .cycle { margin: 0 auto; }

/* Two-line landing line (heroLines in content.js): paper outline so black letters
   stay crisp over the picture, and a yellow full stop. */
.t1 .hero__line { -webkit-text-stroke: 0.024em var(--paper); paint-order: stroke fill; }
.t1 .hero__line--2 > span[aria-hidden] > span:last-child { color: var(--yellow); -webkit-text-stroke: 0.03em var(--ink); }

.t1 .hero__word--one {
  display: block;
  margin: clamp(-150px, -10.5vw, -40px) 0 0;
  text-align: center;
  font-size: clamp(84px, 21vw, 330px);
  line-height: 0.82;
  /* Black letters over the picture get a paper outline so they stay crisp. */
  -webkit-text-stroke: 0.02em var(--paper);
  paint-order: stroke fill;
}

/* The card takes you down to the work rather than opening a video. */
.t1 .cycle__item { cursor: s-resize; }
.t1 .cycle__cap::before { content: '\25BC  Latest work \00B7  '; }

/* The menu is black, so its hover can't be black too. */
.t1 .menu__nav a:hover { color: var(--yellow); }

/* Email gets a highlighter stroke instead of a striped underline. */
.t1 .contact__mail {
  background: linear-gradient(transparent 58%, var(--yellow) 0) 0 0 / 100% 100% no-repeat;
  padding: 0 4px;
}
.t1 .contact__mail:hover { color: var(--ink); background-size: 100% 100%; opacity: 0.7; }

/* ---------- Work strips: taller on wide screens so heads aren't cut off ---------- */

.t1 .tile__media img { object-position: 50% 28%; }

@media (min-width: 641px) {
  .t1 .bands .tile__media { height: clamp(320px, 46vw, 84vh); }
  .t1 .bands--half .tile__media { height: clamp(260px, 26vw, 62vh); }
}

/* ---------- Player: the picture with a credits panel beside it ---------- */

.player__body {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(260px, 22vw, 340px);
  gap: 24px;
  align-items: center;
}
.player__body .player__stage { height: 100%; min-width: 0; }

.player__info {
  position: relative;
  max-height: 100%;
  overflow: auto;
  padding: 30px 24px 24px;
  background: #161616;
  color: var(--white);
}
.player__info::before {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 8px;
  background: var(--bars);
}
.player__info:empty { display: none; }

/* Each line slides in, one after another, every time a video opens. */
.player__info > * { animation: infoIn 0.5s var(--ease) both; }
.player__info > :nth-child(2) { animation-delay: 0.04s; }
.player__info > :nth-child(3) { animation-delay: 0.08s; }
.player__info > :nth-child(4) { animation-delay: 0.12s; }
.player__info > :nth-child(5) { animation-delay: 0.16s; }
.player__info > :nth-child(n+6) { animation-delay: 0.2s; }
@keyframes infoIn { from { opacity: 0; transform: translateY(10px); } }

.info__type {
  margin: 0;
  color: var(--yellow);
  font-weight: 900;
  font-style: italic;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.info__client {
  margin: 8px 0 6px;
  font-weight: 900;
  text-transform: uppercase;
  font-size: clamp(26px, 2.2vw, 36px);
  line-height: 0.92;
  letter-spacing: -0.03em;
}
.info__title { margin: 0; font-weight: 700; font-size: 16px; color: rgba(255, 255, 255, 0.8); }
.info__cut {
  margin: 16px 0 0;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.16);
  font-size: 13px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.7);
}
.info__cut b { color: var(--yellow); font-weight: 900; }
.info__blurb { margin: 16px 0 0; font-size: 15px; font-weight: 600; line-height: 1.45; }
.info__label {
  margin: 18px 0 6px;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
}
.info__did { margin: 0; padding: 0; list-style: none; display: grid; gap: 4px; }
.info__did li { position: relative; padding-left: 16px; font-weight: 800; font-size: 15px; }
.info__did li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.45em;
  width: 7px;
  height: 7px;
  background: var(--yellow);
}
.info__credits { margin: 18px 0 0; display: grid; gap: 8px; }
.info__credits div { display: grid; grid-template-columns: 92px 1fr; gap: 10px; align-items: baseline; }
.info__credits dt {
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
}
.info__credits dd { margin: 0; font-weight: 800; font-size: 15px; }

/* The button only matters on phones; on a PC the whole panel sits beside the picture. */
.info__more { display: none; }

@media (max-width: 900px) {
  .player { overflow-y: auto; }
  .player__top { min-height: 40px; }
  .player__title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
  .player__body { flex: none; grid-template-columns: 1fr; gap: 12px; align-items: start; }
  .player__body .player__stage { height: auto; }
  .player__step { display: none; }
  /* As big as the screen allows, sideways too. */
  .player__frame { width: min(100%, calc((100svh - 92px) * 16 / 9)); }
  .player__frame.is-vertical { width: auto; height: min(calc(100svh - 150px), 640px); }

  /* Folded: one slim bar under the picture. */
  .player__info { max-height: none; overflow: visible; padding: 14px 16px 12px; }
  .player__info::before { height: 5px; }
  .info__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
  .info__type { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .info__more {
    display: inline-flex; align-items: center; gap: 8px; flex: none;
    border: 0; padding: 9px 12px; background: var(--yellow); color: var(--ink);
    font: inherit; font-size: 12px; font-weight: 900; letter-spacing: 0.06em; text-transform: uppercase;
    cursor: pointer;
  }
  .info__more i { position: relative; width: 10px; height: 10px; }
  .info__more i::before, .info__more i::after {
    content: ''; position: absolute; left: 0; top: 4px; width: 10px; height: 2px; background: currentColor;
    transition: transform 0.25s var(--ease);
  }
  .info__more i::after { transform: rotate(90deg); }
  .player__info.is-open .info__more i::after { transform: rotate(0deg); }
  .info__rest { display: none; padding-top: 4px; }
  .player__info.is-open .info__rest { display: block; animation: infoIn 0.35s var(--ease) both; }
  .info__client { font-size: 26px; margin-top: 12px; }
}

/* ---------- The way into the archive: a quiet line under Latest work ---------- */

.t1 .older { padding-bottom: clamp(48px, 6vw, 80px); }

.older__link {
  display: inline-block;
  font-weight: 800;
  font-size: 15px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  text-decoration: none;
  color: var(--muted);
}
.older__link span { color: var(--ink); background: linear-gradient(transparent 60%, var(--yellow) 0); padding: 0 2px; }
.older__link:hover { color: var(--ink); }

/* ---------- Archive page ---------- */

.archive { max-width: 1440px; margin: 0 auto; padding: clamp(96px, 11vw, 140px) var(--gutter) clamp(64px, 8vw, 110px); }

.archive__back { position: relative; z-index: 3; margin: 0 0 18px; font-weight: 800; font-size: 13px; text-transform: uppercase; letter-spacing: 0.04em; }
.archive__back a { display: inline-block; padding: 8px 0; text-decoration: none; color: var(--muted); }
.archive__back a:hover { color: var(--ink); }

.archive__title {
  margin: 0;
  font-weight: 900;
  text-transform: uppercase;
  font-size: clamp(64px, 13vw, 210px);
  line-height: 0.8;
  letter-spacing: -0.05em;
}
.archive__title::after {
  content: '';
  display: block;
  width: min(420px, 60%);
  height: 10px;
  margin-top: clamp(14px, 1.6vw, 22px);
  border: 2px solid var(--ink);
  background: var(--bars);
}
.archive__intro { margin: 22px 0 0; max-width: 620px; font-weight: 800; font-size: clamp(15px, 1.3vw, 18px); line-height: 1.35; text-transform: uppercase; }

.archive__jump { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 26px; }
.archive__jump a {
  border: 2px solid var(--ink); border-radius: 999px; padding: 7px 14px 6px;
  text-decoration: none; font-weight: 900; font-size: 13px; text-transform: uppercase; letter-spacing: 0.03em;
}
.archive__jump a b { opacity: 0.55; margin-left: 4px; }
.archive__jump a:hover { background: var(--ink); color: var(--white); }

.arch { margin-top: clamp(48px, 6vw, 84px); scroll-margin-top: 90px; }
.arch__head {
  display: flex; justify-content: space-between; align-items: flex-end; gap: 8px 20px; flex-wrap: wrap;
  padding-bottom: 12px; border-bottom: 3px solid var(--ink);
}
.arch__title { margin: 0; font-weight: 900; text-transform: uppercase; font-size: clamp(34px, 4.6vw, 70px); line-height: 0.86; letter-spacing: -0.04em; }
.arch__count { margin: 0 0 4px; font-weight: 900; font-style: italic; text-transform: uppercase; font-size: 14px; }

.arch__list { list-style: none; margin: 0; padding: 0; }
.arch__list li { border-bottom: 1px solid var(--line); }

.row {
  position: relative;
  display: grid;
  grid-template-columns: 44px clamp(150px, 15vw, 220px) minmax(0, 1fr) 64px 44px;
  align-items: center;
  gap: 0 clamp(14px, 2vw, 28px);
  width: 100%;
  padding: 12px 0;
  border: 0;
  background: none;
  text-align: left;
  cursor: pointer;
  isolation: isolate;
}
/* A yellow highlight sweeps in behind the row on hover. */
.row::before {
  content: '';
  position: absolute; inset: 0 -12px; z-index: -1;
  background: var(--yellow);
  transform: scaleX(0); transform-origin: left;
  transition: transform 0.35s var(--ease);
}
.row:hover::before, .row:focus-visible::before { transform: scaleX(1); }

.row__num { font: 700 13px/1 var(--mono, ui-monospace, Menlo, Consolas, monospace); color: var(--muted); }
.row__thumb { display: block; aspect-ratio: 16 / 9; overflow: hidden; background: var(--ink); }
.row__thumb img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%; transition: transform 0.6s var(--ease); }
.row:hover .row__thumb img { transform: scale(1.06); }
.row__text { display: grid; gap: 4px; min-width: 0; }
.row__client { font-weight: 900; text-transform: uppercase; font-size: clamp(20px, 2vw, 30px); line-height: 0.95; letter-spacing: -0.025em; }
.row__title { font-weight: 700; font-size: 15px; color: var(--ink); opacity: 0.75; }
.row__title i { font-style: normal; font-weight: 900; font-size: 12px; margin-left: 6px; opacity: 0.7; }
.row__len { font: 700 14px/1 var(--mono, ui-monospace, Menlo, Consolas, monospace); text-align: right; }
.row__play {
  width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center;
  border: 2px solid var(--ink);
  transition: background-color 0.2s, color 0.2s;
}
.row__play svg { width: 14px; height: 14px; fill: currentColor; margin-left: 2px; }
.row:hover .row__play { background: var(--ink); color: var(--yellow); }

/* The old showreel: one wide card. */
.feature { display: block; width: 100%; max-width: 1100px; margin-top: 18px; padding: 0; border: 0; background: none; text-align: left; cursor: pointer; }
/* The card takes the still's own shape, so a wide cinema frame isn't cropped. */
.feature__media { position: relative; display: block; overflow: hidden; background: var(--ink); }
.feature__media img { width: 100%; height: auto; transition: transform 1s var(--ease); }
.feature:hover .feature__media img { transform: scale(1.03); }
.feature__play {
  position: absolute; left: 50%; top: 50%; width: 84px; height: 84px; margin: -42px 0 0 -42px; border-radius: 50%;
  background: var(--yellow); color: var(--ink); display: grid; place-items: center;
  transition: transform 0.3s var(--ease);
}
.feature__play svg { width: 28px; height: 28px; fill: currentColor; margin-left: 4px; }
.feature:hover .feature__play { transform: scale(1.08); }
.feature__cap { display: flex; align-items: baseline; gap: 14px; padding-top: 12px; }
.feature__cap b { font-weight: 900; text-transform: uppercase; font-size: clamp(22px, 2.4vw, 34px); letter-spacing: -0.02em; }
.feature__cap span { font: 700 14px var(--mono, ui-monospace, Menlo, Consolas, monospace); }

@media (max-width: 640px) {
  .row { grid-template-columns: 112px minmax(0, 1fr) 36px; gap: 0 12px; padding: 10px 0; }
  .row__num, .row__len { display: none; }
  .row__play { width: 34px; height: 34px; }
  .row__client { font-size: 18px; }
  .row__title { font-size: 13px; }
  .feature__play { width: 64px; height: 64px; margin: -32px 0 0 -32px; }
}

/* A word in [brackets] in heroLines: solid yellow with a black outline, like the full stop.
   (The fuzzy TV-screen version is kept in _build/archive/good-tv-fuzz/.) */
.tv-word > span { color: var(--yellow) !important; -webkit-text-stroke: 0.028em var(--ink) !important; paint-order: stroke fill; }

/* ---------- Pac-Man: scroll down and the full stop eats "the good bit." ----------
   site.js sets --cut (how much of the line is left, 100% to 0%), --pac (0 to 1,
   how far into the eat) and the ghost's state, all from the scroll position. */

@property --cut { syntax: '<percentage>'; inherits: true; initial-value: 100%; }

.t1 .hero__line--2 { position: relative; }
.t1 .hero__line--2 > span[aria-hidden]:not(.pac):not(.ghost) { display: inline-block; }
/* Only clip while eating, so nothing (the full stop included) is cut at rest. */
.t1 .hero__line--2.is-eating > span[aria-hidden]:not(.pac):not(.ghost) {
  clip-path: inset(-0.3em calc(100% - var(--keep, 100%)) -0.3em -0.05em);
}

.pac, .ghost { position: absolute; top: 50%; pointer-events: none; }
.pac svg, .ghost svg { display: block; width: 100%; height: 100%; overflow: visible; }

/* Placed and sized by site.js: starts as the full stop, grows into Pac-Man. */
.pac {
  left: 0;
  top: 0;
  width: 0.78em;
  height: 0.78em;
  transform-origin: 50% 50%;
  visibility: hidden;
  will-change: transform;
}
.t1 .hero__line--2.is-eating .pac { visibility: visible; }

/* Once he's out, the full stop has become him. */
.t1 .hero__line--2.is-eating > span[aria-hidden]:not(.pac):not(.ghost) > span:last-child { visibility: hidden; }

/* Blinky, waiting to the left of the line. */
.ghost {
  right: calc(100% + 0.14em);
  width: 0.66em;
  height: 0.7em;
  margin-top: -0.38em;
  opacity: var(--ghost, 0);
  transform: translateY(calc((1 - var(--ghost, 0)) * 0.3em)) scale(var(--ghost-size, 1));
}
.ghost__body { fill: #f00; stroke: var(--ink); stroke-width: 5; stroke-linejoin: round; transition: fill 0.25s; }
.ghost__pupils { animation: nervous 1.1s steps(1) infinite; }
.ghost.is-scared .ghost__body { fill: #2121ff; }
.ghost.is-scared .ghost__pupils { animation-duration: 0.35s; }
.ghost.is-scared .ghost__eye { fill: #ffd400; }

/* Eyes flicking left and right, a bit too often. */
@keyframes nervous {
  0%   { transform: translateX(-5px); }
  18%  { transform: translateX(5px); }
  30%  { transform: translateX(-5px); }
  52%  { transform: translateX(4px); }
  60%  { transform: translateX(-4px); }
  78%  { transform: translateX(5px); }
}

@media (prefers-reduced-motion: reduce) {
  .pac, .ghost { display: none; }
}
