/* Unknown 9: Awakening client work page. Shared header, footer and tokens come from /style.css. */

.project-page {
  --gutter: clamp(16px, 4vw, 64px);
  --clip-gap: clamp(16px, 2vw, 28px);
  --study-space: clamp(36px, 5vw, 72px);
}

.project-page main {
  max-width: 1320px;
  padding: 12px var(--gutter) 64px;
}

/* Back link */
.project-page .project-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  font-size: 13px;
  letter-spacing: .04em;
  color: var(--muted);
  text-decoration: none;
}

.project-page .project-back:hover,
.project-page .project-back:focus-visible {
  color: var(--hot-1);
}

/* Opening: the title and credit share one row, then the lead clip runs full width. */
.u9-open {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "title credit"
    "lead lead"
    "index note";
  align-items: end;
  gap: 18px 40px;
  padding: 8px 0 var(--study-space);
}

.u9-title { grid-area: title; min-width: 0; }

.project-page .u9-title .eyebrow {
  margin: 0 0 8px;
  font-size: 12px;
}

.project-page h1 {
  margin: 0;
  font-size: clamp(30px, 4.4vw, 64px);
  font-weight: 800;
  letter-spacing: -.04em;
  line-height: 1.02;
}

.u9-credit {
  grid-area: credit;
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 4px;
}

.u9-credit img {
  flex: none;
  background: white;
}

.project-page .u9-credit p {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
  color: var(--tile);
}

.u9-role,
.u9-studio { display: block; }
.u9-role { font-weight: 600; }
.u9-dot { padding: 0 4px; color: var(--hot-1); }
.project-page .u9-studio { color: var(--muted); }
.project-page .u9-studio strong { color: var(--tile); font-weight: 600; }

.u9-lead {
  grid-area: lead;
  margin-top: 6px;
  scroll-margin-top: 16px;
}

/* On short desktop windows the lead shrinks so the whole frame and its controls stay in view. */
.u9-lead video {
  width: min(100%, calc((100svh - 190px) * 16 / 9));
  min-width: min(100%, 640px);
}

.u9-index {
  grid-area: index;
  align-self: start;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.project-page .u9-index a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid var(--plum-rule);
  font-size: 13px;
  letter-spacing: .02em;
  color: var(--tile);
  text-decoration: none;
}

.project-page .u9-index a:hover,
.project-page .u9-index a:focus-visible {
  border-color: var(--hot-1);
  color: var(--hot-1);
}

.project-page .u9-note {
  grid-area: note;
  align-self: center;
  max-width: 34ch;
  margin: 0;
  font-size: 12px;
  line-height: 1.5;
  text-align: right;
  color: var(--muted);
}

/* Sections */
.u9-study {
  padding: var(--study-space) 0;
  border-top: 1px solid var(--plum-rule);
  scroll-margin-top: 16px;
}

.project-page .u9-study h2 {
  margin: 0 0 clamp(16px, 2vw, 24px);
  font-size: clamp(24px, 2.6vw, 36px);
  font-weight: 700;
  letter-spacing: -.03em;
  line-height: 1.15;
}

/* Clips keep their own proportions. */
.clip { margin: 0; min-width: 0; }

.clip video {
  display: block;
  width: 100%;
  height: auto;
  background: var(--plum-deep);
  object-fit: contain;
}

.clip video:focus-visible {
  outline: 2px solid var(--hot-1);
  outline-offset: 3px;
}

.ar-16x9 { aspect-ratio: 1280 / 720; }
.ar-sand { aspect-ratio: 1088 / 268; }
.ar-houdini-a { aspect-ratio: 1100 / 576; }
.ar-houdini-b { aspect-ratio: 1074 / 572; }
.ar-ui { aspect-ratio: 1930 / 1114; }
.ar-shader { aspect-ratio: 816 / 736; }
.ar-rock { aspect-ratio: 1930 / 1118; }

.project-page .clip figcaption {
  max-width: 72ch;
  margin-top: 10px;
  font-size: 14px;
  line-height: 1.55;
  color: var(--muted);
}

.clip figcaption b {
  display: block;
  margin-bottom: 2px;
  font: 500 11px/1.6 "IBM Plex Mono", Consolas, monospace;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--hot-1);
}

/* Galleries: the heading and the lead clip span the row. Column widths follow
   each clip's aspect ratio, so clips that share a row also share a height. */
.u9-gallery {
  display: grid;
  gap: clamp(28px, 3vw, 40px) var(--clip-gap);
  align-items: start;
}

.project-page .u9-gallery h2 { margin: 0 0 -8px; }
.u9-gallery > h2,
.u9-gallery > .clip-wide,
.u9-gallery > .u9-pair { grid-column: 1 / -1; }

/* Sand apparition: the Unreal Engine clip first, the two Houdini studies together beneath it. */
.clip-wide { container-type: inline-size; }

.u9-pair {
  display: grid;
  grid-template-columns: 1.9097fr 1.8776fr;
  gap: 14px var(--clip-gap);
  align-items: start;
}

.project-page .u9-pair h3 {
  grid-column: 1 / -1;
  margin: 0;
  font: 500 12px/1.6 "IBM Plex Mono", Consolas, monospace;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--tile);
}

/* UI: the 16:9 menu clip and the near-square artwork shader share a row. */
#ui-apparition { grid-template-columns: 1.7325fr 1.1087fr; }

/* Rock dissolve and reactive tail each get a full-width section. */
.u9-final-studies { display: block; }

@media (max-width: 900px) {
  .u9-open {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "title" "credit" "lead" "index" "note";
    gap: 14px;
  }
  .u9-credit { padding-bottom: 0; }
  .project-page .u9-note { text-align: left; }
  .u9-lead { margin-top: 4px; }
}

@media (max-width: 640px) {
  .project-page main { padding-top: 4px; }
  .u9-open { padding-top: 0; }
  .project-page .u9-title .eyebrow { font-size: 11px; margin-bottom: 6px; }
  .project-page .clip figcaption { font-size: 13px; }

  /* The lead clip and the wide sand clip run edge to edge on a phone. */
  .u9-lead,
  .clip-wide { margin-inline: calc(-1 * var(--gutter)); }
  .u9-lead video { width: 100%; min-width: 0; }
  .u9-lead figcaption,
  .clip-wide figcaption { padding-inline: var(--gutter); }

  /* The sand clip is about 4:1. Its box gets extra height under the picture
     so the player controls sit below the footage instead of covering it. */
  .clip-wide video {
    aspect-ratio: auto;
    height: calc(100cqi * 268 / 1088 + 72px);
    object-position: 50% 0;
  }

  .u9-index { gap: 6px; }
  .project-page .u9-index a { padding: 0 12px; font-size: 12.5px; }

  #ui-apparition,
  .u9-pair { grid-template-columns: minmax(0, 1fr); row-gap: 24px; }
}

@media (prefers-contrast: more) {
  .project-page .project-back,
  .project-page .u9-studio,
  .project-page .u9-note,
  .project-page .clip figcaption { color: color-mix(in srgb, var(--tile) 90%, transparent); }
}
