/* ═══ Case study pages — shared layout ═══
   Reuses style.css for fonts, vars, navbar, footer.
   Design canvas: 1440px, content column 1368px. */

.cs-page { background: var(--cream); }

.cs-main {
  /* content edges align with the navbar's Home / Contact (48px) */
  max-width: none;
  margin: 0 auto;
  padding: 140px 48px 0;
}

/* ── Hero ── */
.cs-hero { position: relative; }

.cs-hero-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: clamp(28px, 3.2vw, 46px);
}

.cs-title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(44px, 6.7vw, 96px);
  line-height: 1.05;
  color: var(--charcoal);
  letter-spacing: -0.01em;
}

/* paperclip straddles the hero image's top edge */
.cs-hero-media { position: relative; }

.cs-hero-arrow {
  position: absolute;
  right: clamp(8px, 2.5vw, 36px);
  top: calc(clamp(36px, 4.6vw, 66px) * -0.45); /* mostly overlapping the image */
  width: clamp(36px, 4.6vw, 66px);
  transform: scaleY(-1) rotate(-178deg);
  z-index: 2;
}

.cs-hero-img {
  width: 100%;
  display: block;
}

/* ── Meta + overview ── */
.cs-meta-row {
  display: flex;
  gap: clamp(48px, 8vw, 140px);
  padding: clamp(56px, 5.6vw, 80px) 0 clamp(120px, 12.5vw, 180px);
  align-items: flex-start;
}

.cs-meta {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  gap: 26px;
  padding-left: clamp(0px, 7.4vw, 106px); /* Figma: meta starts 106px in */
}

.cs-meta div {
  display: grid;
  grid-template-columns: 110px auto;
  gap: 38px;
  font-size: 16px;
}

.cs-meta dt { font-weight: 400; color: var(--charcoal); }
.cs-meta dd { font-weight: 600; color: var(--charcoal); }

.cs-overview {
  font-size: clamp(18px, 1.67vw, 24px);
  font-weight: 300;
  line-height: 1.5;
  letter-spacing: -0.022em;
  color: #1e1e1e;
  max-width: 775px;
  margin-left: auto; /* right edge aligns with the hero image (per Figma) */
  margin-top: clamp(0px, 12vw, 174px); /* Figma: overview starts 174px below meta */
}

/* ── Divider ── */
.cs-divider {
  height: 13px;
  background: #e6e6e6;
  margin: clamp(48px, 5.5vw, 80px) calc(50% - 50vw); /* full bleed + breathing room */
}

/* ── Problem / solution ── */
.cs-problem-solution {
  display: flex;
  gap: clamp(40px, 5vw, 70px);
  padding: clamp(72px, 6.5vw, 94px) 0 clamp(60px, 6.3vw, 90px);
  align-items: flex-start;
}

/* Orbit only: the narrow phone mockup (≤270px) floated far right with a dead
   gap on wide screens. Cap the block and centre it on the page so the text
   and phone read as one cohesive pair. */
.cs-orbit .cs-problem-solution {
  max-width: 1080px;
  margin-left: auto;
  margin-right: auto;
}

/* From the Ground Up only: centre the block but keep the iPad large. A wider
   cap leaves more room for the mockup column, and removing the text's top
   offset lets the iPad sit level with the text instead of floating above it. */
.cs-ftgu .cs-problem-solution {
  max-width: 1500px;
  margin-left: auto;
  margin-right: auto;
  align-items: center; /* iPad sits level with the middle of the text */
}
.cs-ftgu .cs-ps-text { padding-top: 0; }

.cs-ps-text { padding-top: clamp(0px, 11.4vw, 164px); } /* Figma: text starts below iPad top */

.cs-ps-text { max-width: 800px; flex: 1 1 60%; }

/* Motion frame */
.cs-motion { padding: clamp(96px, 10vw, 144px) 0 clamp(24px, 2.8vw, 40px); }
.cs-caption--right { text-align: right; margin-top: 20px; }

.cs-label {
  font-size: 20px;
  font-weight: 600;
  color: var(--charcoal);
  margin-bottom: 18px;
}

.cs-body {
  font-size: clamp(17px, 1.67vw, 24px);
  font-weight: 300;
  line-height: 1.45;
  color: #000;
}

.cs-ps-text .cs-body { margin-bottom: clamp(56px, 6vw, 86px); }
.cs-ps-text .cs-body:last-child { margin-bottom: 0; }

.cs-ps-mockup {
  flex: 1;
  min-width: 0;
  text-align: center;
}
.cs-ps-mockup img {
  width: 100%;
  max-width: 648px;
  display: block;
  margin: 0 auto;
  /* source export has a black strip baked into its right edge */
  clip-path: inset(0 13% 0 0);
  transform: translateX(6.5%);
}

.cs-caption {
  font-size: clamp(14px, 1.39vw, 20px);
  font-weight: 300;
  color: #000;
  margin-top: 14px;
}
.cs-impact-grid + .cs-caption { margin-top: clamp(36px, 3.5vw, 50px); font-size: clamp(17px, 1.67vw, 24px); }

/* ── Generic section ── */
.cs-section { padding: clamp(88px, 11vw, 160px) 0; }

.cs-heading {
  font-size: clamp(34px, 4.45vw, 64px);
  font-weight: 300;
  font-family: var(--font-body);
  color: var(--charcoal);
  margin-bottom: clamp(48px, 5.5vw, 80px);
}

.cs-narrow { max-width: 791px; margin-bottom: clamp(48px, 5vw, 72px); }
.cs-full-img { width: 100%; display: block; }
video.cs-full-img { background: #f3f1e7; }

/* Insights section — contained within the page margins (was full-bleed, which
   pushed the black stat panels to the screen edges). Constraining the whole
   section keeps the heading, stat panels and sketch+text aligned together. */
.cs-section:has(.cs-insights-imgs) {
  max-width: 1110px;
  margin-left: auto;
  margin-right: auto;
}
.cs-insights-imgs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(24px, 3.2vw, 46px);
  margin-bottom: clamp(56px, 6.3vw, 90px);
}
.cs-bleed { margin-left: calc(50% - 50vw); margin-right: calc(50% - 50vw); }
.cs-insights-imgs img { width: 100%; display: block; }

.cs-insights-bottom {
  display: flex;
  align-items: center;
  gap: clamp(48px, 9.7vw, 140px);
  /* centre the sketch + text pair on the page instead of pinning it left */
  max-width: 1100px;
  margin: clamp(64px, 7vw, 100px) auto 0;
}
.cs-sketch {
  width: clamp(110px, 12.4vw, 179px);
  flex-shrink: 0;
  display: block;
}
.cs-insights-bottom .cs-body { max-width: 766px; }

/* ── Primary role band ── */
.cs-role-band {
  background: #154939;
  margin: clamp(90px, 10vw, 150px) calc(50% - 50vw) clamp(40px, 4.5vw, 64px);
  padding: clamp(140px, 16vw, 230px) 48px;
}

.cs-role-inner { max-width: 962px; margin: 0 auto; }

.cs-role-label {
  display: block;
  color: #a9b847;
  font-size: 20px;
  font-weight: 600;
  margin-bottom: clamp(28px, 3vw, 44px);
}

.cs-role-text {
  color: #fff;
  font-size: clamp(20px, 2.22vw, 32px);
  font-weight: 600;
  line-height: 1.2;
  text-transform: lowercase;
}

/* ── Trio rows (ideation) ── */
.cs-trio {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(20px, 4vw, 58px);
}
.cs-trio img { width: 100%; aspect-ratio: 417/312; object-fit: cover; display: block; }
.cs-trio .cs-caption { margin-top: clamp(20px, 2.2vw, 32px); }

/* ── iPad rows ── */
.cs-ipad-row { display: grid; gap: clamp(14px, 2.6vw, 38px); }
.cs-ipad-row--3 { grid-template-columns: repeat(3, 1fr); flex: 0 0 62%; }
.cs-ipad-row--4 { grid-template-columns: repeat(4, 1fr); margin-top: clamp(64px, 6.5vw, 94px); margin-left: auto; width: min(100%, 77%); }

.cs-iter-top { display: flex; gap: clamp(28px, 4vw, 60px); align-items: flex-end; }

.cs-ipad-row img {
  width: 100%;
  display: block;
  border: 6px solid #000;
  border-radius: 24px;
  box-shadow: -7px 2px 4px rgba(0,0,0,0.25);
  aspect-ratio: 292/388;
  object-fit: cover;
}

.cs-iter-note { max-width: 527px; padding-bottom: clamp(8px, 2vw, 28px); }

/* ── Final coded interface — recording left, map + text right per Figma ── */
.cs-final {
  display: flex;
  gap: clamp(40px, 6.6vw, 95px);
  align-items: flex-start;
}
.cs-final-rec {
  flex: 0 0 41%;
  min-width: 0;
  display: block;
  width: 41%;
  /* iPad-style device frame */
  border: clamp(8px, 1vw, 14px) solid #000;
  border-radius: clamp(28px, 3.6vw, 52px);
  box-shadow: -9px 4px 4px rgba(0,0,0,0.25);
  background: #000;
}
.cs-final-right { flex: 1; min-width: 0; }
.cs-final-map img { width: 100%; display: block; clip-path: inset(0 3.5% 0 0); margin-right: -3.5%; }
.cs-final-map .cs-caption { margin-top: 20px; }
.cs-final-text {
  display: flex;
  flex-direction: column;
  gap: 28px;
  max-width: 527px;
  margin-top: clamp(64px, 6.5vw, 94px);
}

/* ── Space testing — note sits below the image, right-aligned per Figma ── */
.cs-space-img { width: min(100%, 79%); display: block; }
.cs-space-note { max-width: 663px; margin: clamp(48px, 4.6vw, 67px) 0 0 auto; font-size: clamp(16px, 1.39vw, 20px); }

/* ── Impact ── */
.cs-impact-head {
  display: flex;
  align-items: flex-start;
  margin-bottom: clamp(64px, 7vw, 100px);
}
.cs-impact-head .cs-heading { margin-bottom: 0; flex-shrink: 0; }
.cs-impact-head .cs-body {
  max-width: 641px;
  /* Figma: paragraph column starts ~55% across the content width */
  margin-left: auto;
  width: min(641px, 45%);
}

.cs-impact-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: clamp(16px, 2vw, 30px);
  align-items: start;
}
.cs-impact-grid img { width: 100%; display: block; }
.cs-impact-a { grid-column: 1 / 8; }
.cs-impact-b { grid-column: 8 / 13; clip-path: inset(0 6.5% 0 2%); } /* trim black frame edges baked into the export */
.cs-impact-c { grid-column: 1 / 5; }
.cs-impact-d { grid-column: 5 / 13; }
.cs-impact-e2 { width: min(100%, 55%); display: block; margin-top: clamp(36px, 3.5vw, 50px); }

/* ── Other work ── */
/* Other work — reuse the home-page folder cards, contained and centred like
   the home projects grid so the heading + folders sit "in more". */
.cs-other-section { max-width: 1110px; margin-left: auto; margin-right: auto; }

.cs-other-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: clamp(40px, 6vw, 96px);
  margin-top: clamp(32px, 4vw, 56px);
}

/* Coming-soon folder: a blurred folder with a sharp label on top */
.fc--soon { --folder-img: url(assets/orbit-folder.png); cursor: default; position: relative; }
.fc--soon:hover { transform: none; }
.fc--soon .folder-body { filter: blur(5px); }
.fc-soon-label {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 196.6px; /* matches the folder body height */
  z-index: 3; /* above the blurred folder body */
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 24px;
  letter-spacing: 0.01em;
  color: var(--charcoal);
}

/* ═══ Responsive ═══ */
@media (max-width: 900px) {
  .cs-main { padding-top: 110px; }
  .cs-meta-row { flex-direction: column; gap: 40px; padding: 48px 0 64px; }
  .cs-meta { padding-left: 0; }
  .cs-problem-solution { flex-direction: column; }
  .cs-final { flex-direction: column; }
  .cs-final-rec { width: 70%; flex: 0 0 auto; }
  .cs-final-text { margin-top: 40px; }
  .cs-space-img { width: 100%; }
  .cs-space-note { margin: 32px 0 0; }
  .cs-iter-top { flex-direction: column; align-items: flex-start; }
  .cs-ipad-row--4 { width: 100%; }
  .cs-ps-text { padding-top: 0; }
  .cs-overview { margin-top: 0; }
  .cs-meta { padding-left: 0; }
  .cs-impact-e2 { width: 100%; }
  .cs-impact-head { flex-direction: column; gap: 24px; }
  .cs-insights-bottom { flex-direction: column; align-items: flex-start; gap: 24px; }
}

@media (max-width: 600px) {
  .cs-main { padding: 96px 20px 0; }
  .cs-section { padding: 56px 0; }
  .cs-insights-imgs { grid-template-columns: 1fr; }
  .cs-trio { grid-template-columns: 1fr; gap: 40px; }
  .cs-ipad-row--3, .cs-ipad-row--4 { grid-template-columns: repeat(2, 1fr); }
  .cs-impact-grid img { grid-column: 1 / 13 !important; }
  .cs-other-grid { grid-template-columns: 1fr; }
  .cs-role-band { padding: 72px 20px; }
  .cs-meta div { grid-template-columns: 90px auto; gap: 24px; }
}

/* On case-study pages "Home" is just a link, not the current page */
.cs-page .nav-home {
  text-decoration: none;
  font-weight: 400;
  color: rgba(33,33,33,0.6);
  transition: color 0.2s ease;
}
.cs-page .nav-home:hover { color: var(--charcoal); }


/* extra air before the footer */
.cs-main > .cs-section:last-of-type { padding-bottom: clamp(120px, 13vw, 190px); }

/* ═══ Scroll reveals — subtle rise + fade, exponential ease-out ═══ */
.cs-anim {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.85s cubic-bezier(0.23, 1, 0.32, 1),
              transform 0.85s cubic-bezier(0.23, 1, 0.32, 1);
  will-change: opacity, transform;
}
.cs-anim.in-view {
  opacity: 1;
  transform: translateY(0);
  will-change: auto;
}

/* gentle stagger inside grids */
.cs-trio figure.cs-anim:nth-child(2),
.cs-ipad-row img.cs-anim:nth-child(2),
.cs-insights-imgs img.cs-anim:nth-child(2),
.cs-other-card.cs-anim:nth-child(2) { transition-delay: 90ms; }
.cs-trio figure.cs-anim:nth-child(3),
.cs-ipad-row img.cs-anim:nth-child(3),
.cs-other-card.cs-anim:nth-child(3) { transition-delay: 180ms; }
.cs-ipad-row img.cs-anim:nth-child(4) { transition-delay: 270ms; }

@media (prefers-reduced-motion: reduce) {
  .cs-anim { opacity: 1 !important; transform: none !important; transition: none !important; }
}

/* ═══ Afterglo page specifics ═══ */

/* Problem/solution: geometric prism shapes decorate the right column */
.ag-ps { position: relative; overflow: visible; }
/* let the crystals escape the content padding and run off-screen */
.ag-ps .ag-geo { margin-right: -48px; }
.ag-ps-text { padding-top: 0; } /* no iPad above the text on this page */
.ag-geo {
  position: relative;
  flex: 1;
  min-width: 0;
  min-height: clamp(320px, 38vw, 560px);
  pointer-events: none;
}
.ag-geo img { position: absolute; display: block; }
/* Text inset from the left so it matches the centred blocks on the other
   case studies (the shards stay anchored to the screen's right edge). */
.cs-afterglo .ag-ps-text { margin-left: clamp(40px, 15vw, 320px); }

/* Three shards spread across the upper-right and hung off the right edge of
   the screen at staggered heights, each partly visible. */
.ag-geo-a { /* angled prism, top */
  width: clamp(120px, 12vw, 175px);
  right: -5%;
  top: -12%;
  transform: rotate(34.77deg);
}
.ag-geo-b { /* wide shard, middle right */
  width: clamp(150px, 17vw, 240px);
  right: -9%;
  top: 48%;
}
.ag-geo-c { /* small prism, lower right */
  width: clamp(85px, 9vw, 130px);
  right: -2%;
  top: 88%;
  transform: rotate(-69.75deg);
}

/* User goal band — black with blurred prisms (vs FTGU's green) */
.ag-band {
  background: #000;
  position: relative;
  overflow: hidden;
  padding-top: clamp(200px, 22vw, 320px);
  padding-bottom: clamp(200px, 22vw, 320px);
}
.ag-band-label { color: #6d58e3; }
/* text matches the FTGU primary-role band exactly (lowercase, single weight) */
.ag-band-text strong { font-weight: inherit; }
.ag-band-geo {
  position: absolute;
  filter: blur(5px);
  opacity: 0.85;
  pointer-events: none;
}
.ag-band-geo--l { width: clamp(180px, 22vw, 330px); left: -4%; top: 12%; transform: rotate(18deg); }
.ag-band-geo--r { width: clamp(160px, 19vw, 280px); right: -3%; bottom: 8%; transform: rotate(-24deg); }
.ag-band .cs-role-inner { position: relative; z-index: 1; }

/* Website walkthrough video — thick black frame per Figma */
.ag-walkthrough-video {
  width: min(100%, 1336px);
  display: block;
  margin: 0 auto;
  border: clamp(12px, 2.2vw, 31px) solid #000;
  background: #000;
}

/* Impact wide poster strip */
.ag-impact-wide { width: min(100%, 65%); }

@media (max-width: 900px) {
  .ag-geo { display: none; } /* decor only — free the column on small screens */
  .ag-impact-wide { width: 100%; }
}

/* ═══ Orbit page specifics ═══ */

/* Narrow phone mockup beside problem/solution */
.ob-phone img {
  max-width: clamp(200px, 19vw, 270px);
  clip-path: none;
  transform: none;
}

/* Cycle-of-disconnection doodle is wider than the bulb */
.ob-cycle { width: clamp(220px, 30.7vw, 443px); }

/* Competitor analysis: matrix left, note trailing right below */
.ob-competitor {
  width: min(100%, 68%);
  display: block;
  margin-bottom: clamp(40px, 4.5vw, 64px);
}

/* User goal band — charcoal with steel-blue label */
.ob-band {
  background: #212121;
  padding-top: clamp(200px, 22vw, 320px);
  padding-bottom: clamp(200px, 22vw, 320px);
}
.ob-band-label { color: #afc3d9; }

/* Ideation process rows: bullets beside a large photo */
.ob-process {
  display: flex;
  gap: clamp(40px, 6vw, 90px);
  align-items: flex-end;
  margin-bottom: clamp(64px, 7vw, 100px);
}
.ob-process:last-child { margin-bottom: 0; }
.ob-process-img {
  width: min(100%, 65%);
  display: block;
  min-width: 0;
}
.ob-list {
  list-style: disc;
  padding-left: 30px;
  font-size: clamp(16px, 1.39vw, 20px);
  display: flex;
  flex-direction: column;
  gap: 9px;
  max-width: 431px;
  padding-bottom: 8px;
}

/* Stylescape strips — wider than the viewport, offset like film strips */
.ob-stylescapes {
  margin: 0 calc(50% - 50vw) clamp(64px, 7vw, 100px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: clamp(24px, 3.5vw, 50px);
}
.ob-stylescape {
  width: 150vw;
  max-width: none;
  display: block;
  flex-shrink: 0;
}
.ob-stylescape--a { align-self: flex-start; margin-left: 14vw; }  /* Figma: starts 210px in, runs off the right */
.ob-stylescape--b { align-self: flex-start; margin-left: -71vw; } /* Figma: starts off-screen left */

/* Impact grid: Figma collage arrangement */
.ob-imp-poster { grid-column: 1 / 8; }
.ob-imp-iphones { grid-column: 8 / 13; clip-path: inset(0 14% 0 0); align-self: center; } /* export has black strip on right */
.cs-impact-c { grid-column: 1 / 6; margin-top: clamp(40px, 4.5vw, 64px); }
.ob-imp-phones { grid-column: 6 / 13; margin-top: clamp(40px, 4.5vw, 64px); align-self: center; }
.ob-imp-13 { grid-column: 4 / 11; margin-top: clamp(64px, 7vw, 100px); }

@media (max-width: 900px) {
  .ob-process { flex-direction: column; align-items: flex-start; }
  .ob-process--imgright { flex-direction: column-reverse; }
  .ob-process-img { width: 100%; }
  .ob-competitor { width: 100%; }
  .ob-phone { display: flex; justify-content: center; width: 100%; }
}
