/* ==========================================================================
   /animation/ — wireframe build of "Animation Page Mockup.pdf"
   One unit = one point on the 1024.5pt-wide Canva page. --u converts it to
   pixels: 1366px at full width (the width the mockup exports at), scaling
   down with the window to 760px, below which the page stacks.
   Tokens (ink, paper, fonts) come from ../styles.css.
   ========================================================================== */

.ap {
  --u: calc(min(100vw, 1366px) / 1024.5);
  --crt: #2f0807;                 /* sampled off the mockup's TV-wall band */
  --slot: #ececea;
  --slot-line: #cfcdc8;
  --slot-dark: #1f1c18;
  background: #fff;               /* the mockup ground is pure white */
}

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap;
}

/* ── bands and plates ─────────────────────────────────────────────────── */
.ap-band { position: relative; }
.ap-band--crt { background: var(--crt); }
.ap-sec {
  position: relative;
  width: calc(1024.5 * var(--u));
  height: calc(var(--h) * var(--u));
  margin: 0 auto;
}
.ap-sec > .a, .ap-cast > .a {
  position: absolute; margin: 0;
  left: calc(var(--x) * var(--u));
  top:  calc(var(--y) * var(--u));
  width: calc(var(--w) * var(--u));
}
.ap-cast { display: contents; }

/* ── type ─────────────────────────────────────────────────────────────── */
/* Headline face is Helvetica Now Text Condensed Bold Italic in the mockup;
   the site stands Bricolage in for it. Bold at wdth 80 and 60pt matches the
   mockup's line widths to within a few points ("For All The Wrong Reasons"
   483pt in the mockup, 481 here). Bricolage has no italic, so the slant is
   the browser's synthetic oblique — per glyph, so every line still ends on
   the right edge, which a skew transform on the block would not. */
.t-title {
  font-family: var(--f-display); font-weight: 700;
  font-style: italic; font-synthesis: style;
  font-variation-settings: "wdth" 80;
  font-size: calc(60 * var(--u));
  line-height: calc(var(--lh) * var(--u));
  letter-spacing: -0.035em;
  color: #000;
}
.t-sub, .t-subsm, .t-copy, .t-label, .t-lyric, .t-capsm, .t-caplg, .t-turn {
  font-family: var(--f-body); font-weight: 400; color: #000;
  line-height: calc(var(--lh, 22) * var(--u));
}
.t-sub   { font-size: calc(32   * var(--u)); --lh: 34; }
.t-subsm { font-size: calc(21.5 * var(--u)); }
.t-copy  { font-size: calc(16   * var(--u)); white-space: nowrap; }  /* lines are the mockup's own <br>s */
.t-label { font-size: calc(17   * var(--u)); }
.t-lyric { font-size: calc(14.3 * var(--u)); }
.t-capsm { font-size: calc(14   * var(--u)); }
.t-caplg { font-size: calc(26   * var(--u)); }
.t-turn  { font-size: calc(32.5 * var(--u)); }
.t-quote {
  font-family: "Courier Prime", "Courier New", monospace;
  font-size: calc(9.5 * var(--u)); line-height: calc(var(--lh) * var(--u));
}
.t-copy a { color: inherit; text-underline-offset: 0.18em; text-decoration-thickness: 1px; }

.al-r  { text-align: right; }
.al-l  { text-align: left; }
.al-c  { text-align: center; }
.al-j  { text-align: justify; text-align-last: right; }   /* ragged-left justified, as in the mockup */
.al-jc { text-align: justify; text-align-last: center; }
.al-jl { text-align: justify; text-align-last: left; }
.ap-lyrics { white-space: pre-line; }

/* ── asset slots ──────────────────────────────────────────────────────── */
.ap-box {
  position: relative;
  height: calc(var(--h) * var(--u));
  background: var(--slot);
  border: 1px dashed var(--slot-line);
  display: grid; place-items: center;
  overflow: hidden;
}
.ap-box > img, .ap-box > video, .ap-box > iframe {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border: 0;
}
.ap-box__label {
  font: 500 clamp(9px, calc(10 * var(--u)), 13px)/1.3 ui-monospace, "SF Mono", Menlo, monospace;
  color: rgba(0, 0, 0, 0.5);
  text-align: center; padding: 0.5em 0.8em; max-width: 90%;
}
.ap-box--video { background: var(--slot-dark); border-color: #3a3631; }
.ap-box--video .ap-box__label { color: rgba(255, 255, 255, 0.6); }
.ap-box--video::before {          /* play mark */
  content: ""; position: absolute; left: 50%; top: 50%;
  width: 0; height: 0; transform: translate(-35%, -140%);
  border-style: solid; border-color: transparent transparent transparent rgba(255,255,255,0.45);
  border-width: calc(9 * var(--u)) 0 calc(9 * var(--u)) calc(15 * var(--u));
}
.ap-box--onDark { background: #1a0504; border-color: rgba(255,255,255,0.25); }
.ap-box--round { border-radius: calc(10 * var(--u)); }
.ap-box--line  { border: 1.5px solid #000; }

/* Every image and video on the page: 11pt corners (Kelly, 14 Nov). The
   radius lives on the slot and its media inherits it, so a player's controls
   and a YouTube frame are clipped to the same curve. The TV wall's screens are
   masked by the set artwork and are not part of this. */
.ap-sec .ap-box, .ap-col .ap-box, .ap-grid .ap-box {
  border-radius: calc(11 * var(--u)) !important;
  overflow: hidden;
}
.ap-box > img, .ap-box > video, .ap-box > iframe, .ap-yt, .ap-yt img { border-radius: inherit; }

/* a slot with its asset in: no placeholder ground, no dashed edge */
.ap-box--filled { background: none; border: 0; }
.ap-box--filled > video { background: #000; }
.ap-box--filled.ap-box--line { border: 1.5px solid #000; }   /* the Knight animatics keep their frame */
/* the early-animation pairs: white tiles with a thin rounded rule, as drawn */
.ap-box--filled.ap-box--frame { border: 1px solid rgba(0, 0, 0, 0.55); border-radius: calc(10 * var(--u)); background: #fff; }
.ap-box--frame > video, .ap-box--frame > img { background: #fff; border-radius: inherit; }
[data-slot^="early/turnaround"] > video { background: #fff; }
/* the red-hoodie turn is cropped tight; it sits in the middle of its tile
   at about the figure size of the one beside it */
[data-slot="early/turnaround-early"] > video { inset: 13% 0; height: 74%; object-fit: contain; }
.ap-box--round > * { border-radius: inherit; }

/* Mr. Incorrect: the still is a button until clicked */
.ap-yt {
  position: absolute; inset: 0; padding: 0; border: 0;
  background: #000; cursor: pointer;
}
.ap-yt img { width: 100%; height: 100%; display: block; }
.ap-yt:focus-visible { outline: 3px solid #000; outline-offset: 3px; }

/* boxes nested in a figure or column: full width of the parent */
.ap-in { width: 100%; }

/* labels laid over the sketch sheet */
.ap-tag {
  position: absolute; left: var(--tx); top: var(--ty);
  line-height: 1; color: #000; z-index: 1;
}
.ap-box:has(.ap-tag) { overflow: visible; }

/* the Animation Career Review badge sits on the Unreal screenshot */
.ap-badge {
  position: absolute; left: 82.6%; top: 66%; width: 15.3%; height: 25.7%;
  display: grid; place-items: center;
  border: 1px dashed rgba(255,255,255,0.5); border-radius: 50%;
}

.ap-fig { margin: 0; }
.ap-fig figcaption { margin-top: calc(8 * var(--u)); line-height: 1.2; }
.ap-col { margin: 0; display: grid; gap: calc(40 * var(--u)); }

/* ── grids ────────────────────────────────────────────────────────────── */
.ap-grid {
  display: grid;
  height: calc(var(--h) * var(--u));
  grid-template-columns: repeat(var(--cols), 1fr);
  grid-template-rows: repeat(var(--rows), 1fr);
  column-gap: calc(var(--cg) * var(--u));
  row-gap: calc(var(--rg) * var(--u));
}
.ap-grid > .ap-box { height: auto; }
.ap-grid--frames .ap-box__label { font-size: clamp(8px, calc(8 * var(--u)), 11px); }
.ap-grid--early {
  grid-template-rows: calc(39 * var(--u)) repeat(5, 1fr);
}
.ap-grid--early h3 { margin: 0; line-height: 1; }

/* ── phones: stop being a plate, stack in reading order ───────────────── */
@media (max-width: 759px) {
  .ap { --u: calc(100vw / 430); }
  .ap-sec {
    width: auto; height: auto;
    padding: calc(56 * var(--u)) var(--gut);
    display: flex; flex-direction: column; gap: calc(18 * var(--u));
  }
  .ap-band--crt .ap-sec { padding-block: calc(40 * var(--u)); }
  .ap-sec > .a, .ap-cast > .a {
    position: static; width: auto; left: auto; top: auto;
  }
  .ap-box { height: auto; aspect-ratio: var(--w) / var(--h); }
  .ap-sec > .ap-box, .ap-cast > .ap-box { position: relative; }   /* keep it the box its media fills */
  /* portrait slots (Zoe, the process photos) would run several screens tall
     at full width: cap them at ~60% of the screen height and centre them */
  .ap-sec > .ap-box {
    width: min(100%, calc(var(--w) / var(--h) * 60svh));
    align-self: center;
  }
  .ap-sec > .ap-box[data-slot$="laurel"] { width: 28%; align-self: flex-end; }
  /* the composite boards are too fine to shrink to a phone's width and still
     read, so they scroll sideways at a legible size instead */
  .ap-sec > .ap-box[data-slot="cyberpunk/storyboards-keyframes"],
  .ap-sec > .ap-box[data-slot="cyberpunk/concept-sheet"],
  .ap-sec > .ap-box[data-slot="knight/storyboards"] {
    width: 100%; aspect-ratio: auto; height: auto;
    overflow-x: auto; display: block; overscroll-behavior-x: contain;
  }
  .ap-sec > .ap-box[data-slot="cyberpunk/storyboards-keyframes"] > img,
  .ap-sec > .ap-box[data-slot="cyberpunk/concept-sheet"] > img,
  .ap-sec > .ap-box[data-slot="knight/storyboards"] > img {
    position: static; width: 760px; max-width: none; height: auto;
  }
  .ap-in  { aspect-ratio: auto; height: calc(var(--h) * 100vw / 1024.5 * 1.6); }

  br.d { display: none; }
  .t-title { font-size: calc(40 * var(--u)); line-height: 1.02; text-align: left; }
  .t-sub   { font-size: calc(22 * var(--u)); line-height: 1.2; }
  .t-subsm { font-size: calc(19 * var(--u)); }
  .t-copy, .al-j, .al-jl { text-align: left; text-align-last: auto; }
  .t-copy  { font-size: calc(15.5 * var(--u)); line-height: 1.45; white-space: normal; }
  .t-quote { font-size: calc(11 * var(--u)); }
  .t-turn  { font-size: calc(26 * var(--u)); }
  .al-r { text-align: left; }
  .ap-sec > h2.t-title + .t-sub { margin-top: calc(-6 * var(--u)); }

  /* first-try / improvement pairs stay side by side; everything else thins out */
  .ap-grid { height: auto; }
  .ap-grid > .ap-box { aspect-ratio: 16 / 9; }
  .ap-grid--frames { --cols: 3 !important; grid-template-rows: none; }
  .ap-grid:not(.ap-grid--frames):not(.ap-grid--early) { --cols: 1 !important; grid-template-rows: none; }
  .ap-grid--early { grid-template-rows: auto; column-gap: calc(14 * var(--u)); row-gap: calc(14 * var(--u)); }
  .ap-grid--early h3 { font-size: calc(17 * var(--u)); }

  .ap-cast {
    display: grid; grid-template-columns: 1fr 1fr; align-items: end;
    column-gap: calc(14 * var(--u));
  }
  .ap-cast > .ap-box { grid-row: span 2; }
  .ap-cast > .t-caplg { text-align: left; }
  .ap-cast > .t-capsm { text-align: left; text-align-last: auto; }
  .ap-cast > .ap-box[data-slot="knight/maiden"] { aspect-ratio: 108 / 200; }
}
