/* ── Alternative case-study pages (same language as alt home, own layout) ── */
body.alt.ap {
  --bg: var(--paper);
  --fg: var(--ink);
  --fg-inv: #0b0b0b;
  --mid: #a3a29c;
  --light: #6f6e69;
  --border: var(--line);
  font-size: 16px;
}
body.ap img { border-radius: 14px; }

/* Hero: oversized title, meta as a row underneath */
.ap .project-page-hero {
  background: transparent;
  padding: 150px 24px 0;
}
.ap .project-page-hero-inner {
  max-width: none;
  display: block;
}
.ap .ap-kicker {
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 28px;
}
.ap .project-page-title {
  font-size: clamp(64px, 13vw, 220px);
  line-height: 0.9;
  letter-spacing: -0.035em;
  font-weight: 400;
  color: var(--ink);
}
.ap .project-page-title .w { opacity: 0; display: inline-block; transform: translateY(0.25em); transition: opacity 0.6s ease, transform 0.6s ease; }
.ap .project-page-title.in .w { opacity: 1; transform: none; }
.ap .project-page-meta {
  flex-direction: row;
  flex-wrap: wrap;
  gap: 0;
  padding: 0;
  border-left: 0;
  margin-top: 8vh;
  border-top: 1px solid var(--line);
}
.ap .project-page-meta-row,
.ap .project-page-meta-row:first-child {
  flex-direction: column;
  justify-content: flex-start;
  gap: 6px;
  border: 0;
  padding: 18px 48px 18px 0;
}
.ap .project-page-meta-label { color: var(--ink-soft); font-size: 11px; }
.ap .project-page-meta-value { color: var(--ink); font-size: 15px; font-weight: 400; }

/* Intro: big lede on the left, supporting copy on the right */
.ap .project-body { background: transparent; }
.ap .project-desc-block {
  max-width: none;
  padding: 12vh 24px 10vh;
  border-bottom: 0;
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 24px;
  align-items: end;
}
.ap .project-desc-block .project-lede {
  grid-column: 1 / span 8;
  font-size: clamp(30px, 3.6vw, 58px);
  line-height: 1.08;
  letter-spacing: -0.015em;
  max-width: none;
  margin: 0;
  color: var(--ink);
}
.ap .project-desc-block p:not(.project-lede) {
  grid-column: 9 / span 4;
  font-size: 16px;
  line-height: 1.6;
  color: var(--mid);
  max-width: none;
}
.ap .project-desc-block p:not(.project-lede) + p:not(.project-lede) { grid-row: auto; }

/* Media goes edge to edge (inside the 24px gutter) */
.ap .showcase,
.ap .project-media-full,
.ap .project-media-contained,
.ap .project-media-grid {
  max-width: none;
  padding: 0 24px;
  margin-bottom: 24px;
}
.ap .project-media-grid { gap: 24px; }
.ap .project-media-grid.app-shots { max-width: 960px; margin-left: auto; margin-right: auto; }
/* Orbiiit: app screenshots sit in a soft dark panel (a step lighter than the page), 3 per row */
.ap .project-media-grid.app-shots {
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  padding: 40px;
  /* keep the site's side gutter: the aqua panel sits inside the 24px margins */
  max-width: none;
  margin-left: max(24px, calc((100% - 960px) / 2));
  margin-right: max(24px, calc((100% - 960px) / 2));
  background: #262626;
  border-radius: 16px;
  box-sizing: border-box;
}
.ap .project-media-grid.app-shots img { border-radius: 12px; }
.ap .project-desc-block + .project-media-grid,
.ap .project-desc-block + .project-media-full { margin-top: 0; }

/* Chapters: numbered sticky label + large reading text */
.ap .project-body { counter-reset: chapter; }
.ap .project-text-block {
  max-width: none;
  padding: 16vh 24px;
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 24px;
  counter-increment: chapter;
}
.ap .project-text-label {
  grid-column: 1 / span 3;
  align-self: start;
  position: sticky;
  top: 90px;
  margin: 0;
  font-size: 12px;
  color: var(--ink-soft);
}
.ap .project-text-label::before {
  content: counter(chapter, decimal-leading-zero);
  display: block;
  font-size: 56px;
  line-height: 1;
  letter-spacing: -0.02em;
  text-transform: none;
  color: var(--ink);
  margin-bottom: 14px;
}
.ap .project-text-block > :not(.project-text-label) { grid-column: 5 / span 7; }
.ap .project-text-block p {
  font-size: clamp(20px, 1.9vw, 28px);
  line-height: 1.35;
  letter-spacing: -0.005em;
  color: var(--ink);
  max-width: none;
}
.ap .project-text-block p + p { margin-top: 1em; }
.ap .decision-grid h3 { color: var(--ink); font-size: 18px; }
.ap .decision-grid p { font-size: 15px; color: var(--mid); }
.ap .live-link { justify-self: start; }
.ap .live-link:hover { color: #fff; opacity: 1; }

/* Outcome */
.ap .project-outcome {
  max-width: none;
  padding: 14vh 24px;
  border-color: var(--line);
}
.ap .project-outcome-stat { font-size: clamp(96px, 16vw, 260px); letter-spacing: -0.04em; color: var(--ink); }
.ap .project-outcome p { font-size: clamp(20px, 1.9vw, 28px); line-height: 1.35; color: var(--ink); }

/* Next project */
.ap-next {
  display: block;
  padding: 16vh 24px 12vh;
  border-top: 1px solid var(--line);
  margin-top: 12vh;
  color: var(--ink);
  text-decoration: none;
}
.ap-next span { display: block; }
.ap-next .lbl { font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-soft); margin-bottom: 18px; }
.ap-next .nm {
  font-size: clamp(56px, 10vw, 168px);
  line-height: 0.95;
  letter-spacing: -0.03em;
  transition: transform 0.4s ease;
}
.ap-next .nm::after { content: ' →'; opacity: 0; transition: opacity 0.3s ease; }
.ap-next:hover .nm { transform: translateX(16px); }
.ap-next:hover .nm::after { opacity: 1; }

/* Scroll-in */
.ap .up { opacity: 0; transform: translateY(40px); transition: opacity 0.8s ease, transform 0.8s ease; }
.ap .up.in { opacity: 1; transform: none; }

@media (max-width: 860px) {
  .ap .project-page-hero { padding-top: 120px; }
  .ap .project-desc-block,
  .ap .project-text-block { grid-template-columns: 1fr; }
  .ap .project-desc-block .project-lede,
  .ap .project-desc-block p:not(.project-lede),
  .ap .project-text-label,
  .ap .project-text-block > :not(.project-text-label) { grid-column: 1; }
  .ap .project-text-label { position: static; }
  .ap .project-text-label::before { font-size: 40px; }
  .ap .project-text-block { padding: 10vh 24px; }
  .ap .project-outcome { grid-template-columns: 1fr; gap: 24px; }
  .ap .project-page-meta-row { padding-right: 28px; }
}

@media (prefers-reduced-motion: reduce) {
  .ap .up, .ap .project-page-title .w { opacity: 1 !important; transform: none !important; }
}

/* Pages whose intro has no lede: the first paragraph takes the lede role */
.ap .project-desc-block p:first-child:not(.project-lede) {
  grid-column: 1 / span 8;
  font-size: clamp(26px, 2.8vw, 44px);
  line-height: 1.12;
  letter-spacing: -0.01em;
  color: var(--ink);
}
@media (max-width: 860px) {
  .ap .project-media-grid.cols-3 { grid-template-columns: 1fr; }
  .ap .project-media-grid.app-shots { grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 14px; }
  .ap .project-media-grid.app-shots img { border-radius: 8px; }
  .ap .project-desc-block p:first-child:not(.project-lede) { grid-column: 1; }
}

/* Live-site button sits at the end of each case, just before "Next project" */
.ap .ap-live { padding: 10vh 24px 0; }
.ap .ap-live .live-link { margin-top: 0; }
.ap .live-link .live-arrow { width: 1.1em; height: 1.1em; flex: none; }

/* App video (Komodo): phone recording, centered */
.ap .ap-video { display: flex; justify-content: center; padding: 0 24px; margin: 8vh 0; }
.ap .ap-video video { width: 100%; max-width: 340px; height: auto; display: block; }

/* Victoria Royals: loose app screens, each in an iPhone mockup, two per row */
.ap .vr-phones {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px 48px;
  max-width: 760px;
  margin: 0 auto 64px;
  padding: 0 24px;
  box-sizing: content-box;
}
.ap .vr-phone { container-type: inline-size; }
.ap .vr-phone:last-child:nth-child(odd) { grid-column: 1 / -1; justify-self: center; width: calc(50% - 24px); }
.ap .vr-phones .phone {
  position: relative; right: auto; bottom: auto;
  width: 100%;
  border-radius: 11.5cqw;
  padding: 3.4cqw;
  box-shadow: 0 0 0 0.7cqw #2b2b2b, 0 8cqw 14cqw -4cqw rgba(0,0,0,0.55);
}
.ap .vr-phones .phone .screen { border-radius: 8cqw; padding-top: 0; aspect-ratio: 391 / 892; }
@media (max-width: 860px) {
  .ap .vr-phones { gap: 28px 16px; }
  .ap .vr-phone:last-child:nth-child(odd) { width: calc(50% - 8px); }
}
.ap .vr-phones .screen img { width: 100%; height: 100%; object-fit: cover; object-position: top center; display: block; border-radius: 0; }

/* Victoria Royals: food ordering flow video (phone mockup is part of the video) */
.ap .ap-video.ap-video-lg video { max-width: 420px; }

/* Journey: rows of two phones */
.ap .phones-row.pair { grid-template-columns: repeat(2, 1fr); gap: 10%; padding: 7% 18%; }
.ap .phones-row.pair .phone:nth-child(2) { transform: translateY(-6%); }
@media (max-width: 860px) { .ap .phones-row.pair { padding: 8% 12%; } }

/* Case video as the first thing on the page (Journey, Komodo) */
.ap .ap-video.ap-video-top { margin: 0 0 10vh; }
