/* ============================================================
   ConvoyGo case — scroll-driven slides + 3D phones
   Neo-brutalist: cream / ink / purple / yellow / green / red
   ============================================================ */

.cg {
  --cg-cream: #F7F5F2;
  --cg-ink: #1E1B15;
  --cg-purple: #4E46B4;
  --cg-yellow: #FFE34D;
  --cg-green: #50C878;
  --cg-red: #FF4B4B;
  /* No flat fill — let the site-wide grid-paper background (body / body::before
     cursor-hover effect from styles.css) show through, same as the home page. */
  background: transparent;
  color: var(--cg-ink);
  font-family: "DM Sans", "Poppins", sans-serif;
  overflow: visible;
}
.cg .cg-afacad, .cg h1, .cg h2, .cg h3 { font-family: "Afacad", "Poppins", sans-serif; }

/* ---------- shared bits ---------- */
.cg .cg-kicker {
  font-size: 14px; font-weight: 700; letter-spacing: 0.18em;
  color: var(--cg-purple); text-transform: uppercase;
}
.cg .cg-h2 {
  font-size: clamp(34px, 5vw, 64px); font-weight: 700;
  letter-spacing: -0.02em; line-height: 1; margin: 10px 0 18px;
}
.cg .cg-lead { max-width: 720px; font-size: clamp(15px, 1.6vw, 19px); line-height: 1.55; opacity: 0.82; }
.cg .cg-chip {
  display: inline-block; padding: 6px 14px; border: 2px solid var(--cg-ink);
  border-radius: 999px; font-size: 12px; font-weight: 700; letter-spacing: 0.14em;
  background: #fff; color: var(--cg-ink); box-shadow: 3px 3px 0 var(--cg-ink);
}
.cg .cg-card {
  background: #fff; border: 2.5px solid var(--cg-ink); border-radius: 18px;
  box-shadow: 6px 6px 0 var(--cg-ink); padding: 26px 26px 24px;
}
.cg .cg-card h3 { font-size: 26px; margin: 10px 0 10px; }
.cg .cg-card p { font-size: 15px; line-height: 1.55; opacity: 0.85; margin: 12px 0 0; }
.cg .cg-bar { display: block; width: 46px; height: 9px; border: 2px solid var(--cg-ink); border-radius: 5px; }
.cg .cg-avatar {
  width: 56px; height: 56px; border-radius: 50%; border: 2.5px solid var(--cg-ink);
  box-shadow: 3px 3px 0 var(--cg-ink); display: flex; align-items: center; justify-content: center;
  font-family: "Afacad", sans-serif; font-size: 26px; font-weight: 700;
}
.cg .cg-dots { display: flex; align-items: center; gap: 7px; margin-top: 22px; }
.cg .cg-dots span {
  width: 10px; height: 10px; border-radius: 50%;
  border: 2px solid var(--cg-ink); background: transparent; transition: all .3s ease;
}
.cg .cg-dots span.on { background: var(--cg-purple); transform: scale(1.25); }
.cg .cg-count { border: none !important; width: auto !important; height: auto !important; background: none !important;
  font-size: 13px; font-weight: 700; letter-spacing: 0.08em; margin-left: 8px; opacity: 0.6; transform: none !important; }

/* ---------- phones (3D) ---------- */
.cg .cg-phone {
  border: 3px solid var(--cg-ink); border-radius: 6px; overflow: hidden;
  background: #fff; box-shadow: 10px 12px 0 rgba(30, 27, 21, 0.92);
}
.cg .cg-phone img { display: block; width: 100%; height: 100%; object-fit: cover; }
.cg .cg-tilt { transition: transform .35s ease-out; will-change: transform; transform-style: preserve-3d; }

/* ---------- hero ---------- */
.cg .cg-hero { padding-top: 28px; text-align: center; position: relative; }
/* Back link on its own line, top-left — the hero is centered, so without this the
   inline-flex link sits centered on the same row as the CASE STUDY pill. */
.cg .cg-back { display: flex; justify-content: flex-start; align-self: flex-start; margin-bottom: 30px; }
.cg .cg-chip--hero { background: var(--cg-yellow); }
.cg .cg-title {
  font-size: clamp(64px, 13vw, 170px); font-weight: 700; line-height: 0.95;
  letter-spacing: -0.03em; margin: 18px 0 8px;
}
.cg .cg-title span { color: var(--cg-purple); }
.cg .cg-tag { font-size: clamp(16px, 2vw, 24px); font-weight: 500; opacity: 0.8; margin: 0 0 34px; }

.cg .cg-hero-fan { display: flex; justify-content: center; }
.cg .cg-hero-fan .cg-tilt { position: relative; width: min(640px, 86vw); height: min(520px, 110vw); }
.cg .cg-hero-fan .cg-phone { position: absolute; width: 38%; aspect-ratio: 440 / 956; top: 0; }
.cg .cg-fan-c { left: 50%; transform: translateX(-50%) translateZ(40px); z-index: 3; }
.cg .cg-fan-l { left: 2%; top: 7% !important; transform: rotate(-8deg); z-index: 2; }
.cg .cg-fan-r { right: 2%; top: 7% !important; transform: rotate(8deg); z-index: 2; }

.cg .cg-facts {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 14px;
  margin-top: -40px; position: relative; z-index: 4;
}
.cg .cg-facts > div {
  background: #fff; border: 2px solid var(--cg-ink); border-radius: 14px;
  box-shadow: 4px 4px 0 var(--cg-ink); padding: 12px 20px; text-align: left;
}
.cg .cg-facts b { display: block; font-family: "Afacad", sans-serif; font-size: 22px; line-height: 1.05; }
.cg .cg-facts span { font-size: 12.5px; opacity: 0.65; }
.cg .cg-scrollcue {
  margin: 40px auto 8px; font-size: 12.5px; font-weight: 700; letter-spacing: 0.18em;
  text-transform: uppercase; opacity: 0.55;
}

/* ---------- context ---------- */
.cg .cg-context { padding-top: 16vh; padding-bottom: 10vh; display: flex; justify-content: center; }
.cg .cg-chars {
  max-width: 820px; font-size: clamp(20px, 2.8vw, 32px); line-height: 1.45;
  font-weight: 500; text-align: center; margin: 0 20px;
}
.cg .cg-chars span { transition: opacity .18s linear; }

/* ---------- pinned stages (shared) ---------- */
.cg .cg-stage {
  position: sticky; top: 0; height: 100vh; height: 100svh;
  display: flex; align-items: center; overflow: hidden;
}
.cg .cg-ghost {
  position: absolute; top: 2vh; right: 2vw; font-family: "Afacad", sans-serif;
  font-size: clamp(90px, 16vw, 250px); font-weight: 700; letter-spacing: -0.02em;
  color: var(--cg-ink); opacity: 0.06; pointer-events: none; user-select: none;
}

/* ---------- problem deck ---------- */
.cg .cg-deck-inner { width: 100%; }
.cg .cg-deck-grid {
  display: grid; grid-template-columns: minmax(120px, 0.35fr) 1fr;
  gap: clamp(20px, 5vw, 70px); align-items: center; margin-top: 26px;
}
.cg .cg-deck-num {
  font-family: "Afacad", sans-serif; font-weight: 700;
  font-size: clamp(110px, 20vw, 290px); line-height: 0.9;
  color: var(--cg-purple); text-shadow: 7px 7px 0 rgba(30,27,21,0.9);
  animation: cgPop .45s cubic-bezier(.22,1,.36,1);
}
@keyframes cgPop { from { transform: translateY(26px) scale(.96); opacity: 0; } to { transform: none; opacity: 1; } }
.cg .cg-deck-copy { position: relative; min-height: 200px; }
.cg .cg-deck-slide {
  position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: center;
  opacity: 0; transform: translateY(34px); transition: opacity .45s ease, transform .45s ease;
  pointer-events: none;
}
.cg .cg-deck-slide.on { opacity: 1; transform: none; }
.cg .cg-deck-slide.past { opacity: 0; transform: translateY(-26px); }
.cg .cg-deck-slide h3 { font-size: clamp(30px, 4.6vw, 58px); margin: 0 0 14px; letter-spacing: -0.01em; }
.cg .cg-deck-slide p { font-size: clamp(15px, 1.8vw, 20px); line-height: 1.55; max-width: 560px; opacity: 0.82; margin: 0; }

/* ---------- roles ---------- */
.cg .cg-roles { padding-top: 12vh; padding-bottom: 12vh; }
.cg .cg-roles-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 26px; margin-top: 30px; }

/* ---------- flows ---------- */
.cg .cg-flows-head { padding-top: 6vh; padding-bottom: 4vh; }
.cg .cg-flowstage {
  display: grid; grid-template-columns: 0.9fr 1.1fr;
  gap: clamp(16px, 4vw, 60px); align-items: center;
  padding: 0 clamp(20px, 6vw, 90px);
}
.cg .cg-flowstage.flip { direction: rtl; }
.cg .cg-flowstage.flip > * { direction: ltr; }

.cg .cg-flownum {
  display: block; font-family: "Afacad", sans-serif; font-weight: 700;
  font-size: clamp(64px, 9vw, 130px); line-height: 1; color: transparent;
  -webkit-text-stroke: 3px var(--cg-ink); -webkit-text-stroke-color: var(--cg-ink);
  margin-bottom: 6px; opacity: 0.9;
}
.cg .cg-flowname { font-size: clamp(30px, 4.4vw, 56px); margin: 12px 0 10px; line-height: 1; letter-spacing: -0.015em; }
.cg .cg-flowblurb { font-size: clamp(14px, 1.5vw, 17px); line-height: 1.5; opacity: 0.75; max-width: 460px; margin: 0 0 26px; }
.cg .cg-step { animation: cgPop .4s cubic-bezier(.22,1,.36,1); }
.cg .cg-step-t {
  font-family: "Afacad", sans-serif; font-size: clamp(22px, 2.6vw, 34px); font-weight: 700;
  border: 2.5px solid var(--cg-ink); border-radius: 14px; background: #fff;
  box-shadow: 5px 5px 0 var(--cg-ink); display: inline-block; padding: 8px 18px;
}
.cg .cg-step-s { font-size: 14.5px; margin-top: 10px; opacity: 0.65; }

.cg .cg-flowmedia { display: flex; align-items: center; justify-content: center; gap: 22px; }

/* vertical stepper beside the phone — cues "scroll down to advance" */
.cg .cg-stepper {
  position: relative; flex: 0 0 auto; align-self: center;
  flex-direction: column; gap: 11px; margin-top: 0;
}
.cg .cg-stepper::before {
  content: ""; position: absolute; left: 50%; transform: translateX(-50%);
  top: 26px; bottom: 30px; width: 2px; background: rgba(30, 27, 21, 0.22); border-radius: 2px;
}
.cg .cg-stepper > span { position: relative; z-index: 1; }
.cg .cg-stepper .cg-step-cue {
  border: none !important; width: auto !important; height: auto !important; background: none !important;
  font-family: "Afacad", sans-serif; font-size: 17px; font-weight: 700; line-height: 1;
  opacity: 0.45; margin-bottom: 2px;
}
.cg .cg-stepper .cg-count {
  margin: 8px 0 0; font-size: 12px; letter-spacing: 0.06em; white-space: nowrap;
}
.cg .cg-stage3d { transform-style: preserve-3d; will-change: transform; }
.cg .cg-phone--show {
  position: relative; width: clamp(220px, 26vw, 330px); aspect-ratio: 440 / 956;
  border-radius: 6px;
}
/* Each screen is a fixed-size window; a taller image scrolls within it (see panPct). */
.cg .cg-phone--show .cg-screen {
  position: absolute; inset: 0; overflow: hidden;
  opacity: 0; transform: translateY(34px) scale(0.965);
  transition: opacity .45s ease, transform .45s ease;
}
.cg .cg-phone--show .cg-screen.on { opacity: 1; transform: none; }
.cg .cg-phone--show .cg-screen.past { opacity: 0; transform: translateY(-26px) scale(0.985); }
.cg .cg-phone--show .cg-screen img {
  display: block; width: 100%; height: auto; min-height: 100%;
  object-fit: fill; will-change: transform;
}
/* flipped flows lean left (rotateY+) → hard shadow falls to the left */
.cg .cg-flowstage.flip .cg-phone--show { box-shadow: -10px 12px 0 rgba(30, 27, 21, 0.92); }

/* ---------- tokens ---------- */
.cg .cg-tokens { padding-top: 14vh; padding-bottom: 10vh; }
.cg .cg-token-row { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 30px; }
.cg .cg-token {
  display: flex; align-items: center; gap: 12px; background: #fff;
  border: 2.5px solid var(--cg-ink); border-radius: 999px;
  box-shadow: 4px 4px 0 var(--cg-ink); padding: 10px 20px 10px 12px;
}
.cg .cg-token .sw { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--cg-ink); }
.cg .cg-token b { font-size: 14.5px; }
.cg .cg-token i { font-style: normal; font-size: 12px; opacity: 0.55; }
.cg .cg-token-note {
  margin-top: 26px; display: inline-block; background: var(--cg-yellow);
  border: 2.5px solid var(--cg-ink); border-radius: 14px; box-shadow: 5px 5px 0 var(--cg-ink);
  padding: 12px 18px; font-weight: 600; font-size: 14.5px;
}

/* ---------- outcomes ---------- */
.cg .cg-outcomes { padding-top: 4vh; padding-bottom: 8vh; }
.cg .cg-out-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; margin-top: 30px; }

/* ---------- generic content block ---------- */
.cg .cg-block { padding-top: 9vh; padding-bottom: 9vh; }
.cg .cg-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; margin-top: 30px; }
.cg .cg-chip--mini { font-size: 11px; padding: 4px 12px; box-shadow: 2px 2px 0 var(--cg-ink); }

/* ---------- personas + empathy ---------- */
.cg .cg-persona .cg-persona-head { display: flex; align-items: center; gap: 16px; }
.cg .cg-persona .cg-persona-head h3 { margin: 0 0 6px; }
.cg .cg-persona > .cg-chip--mini { margin-top: 16px; }
.cg .cg-list { list-style: none; margin: 10px 0 4px; padding: 0; }
.cg .cg-list li {
  position: relative; padding-left: 20px; font-size: 14.5px; line-height: 1.5;
  opacity: 0.85; margin-bottom: 5px;
}
.cg .cg-list li::before {
  content: ""; position: absolute; left: 0; top: 7px; width: 9px; height: 9px;
  border-radius: 50%; background: var(--dot, var(--cg-purple)); border: 1.5px solid var(--cg-ink);
}
.cg .cg-quote {
  display: flex; gap: 10px; align-items: flex-start; margin-top: 18px;
  background: #EBEAF7; border: 2px solid var(--cg-ink); border-radius: 12px; padding: 13px 16px;
}
.cg .cg-quote b { font-family: "Afacad", sans-serif; font-size: 34px; line-height: 0.7; color: var(--cg-purple); }
.cg .cg-quote span { font-size: 14.5px; font-weight: 600; line-height: 1.4; }
.cg .cg-emp { margin-top: 34px; }
.cg .cg-emp-label { font-size: 12.5px; font-weight: 700; letter-spacing: 0.16em; opacity: 0.55; margin-bottom: 14px; }
.cg .cg-emp-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.cg .cg-emp-q { padding: 18px 18px 14px; box-shadow: 4px 4px 0 var(--cg-ink); }
.cg .cg-emp-q p { font-size: 13.5px; line-height: 1.45; margin: 10px 0 0; opacity: 0.82; }

/* ---------- sitemap ---------- */
.cg .cg-map { margin-top: 34px; text-align: center; }
.cg .cg-map-root {
  display: inline-block; font-family: "Afacad", sans-serif; font-size: 24px; font-weight: 700;
  background: var(--cg-purple); color: #fff; border: 2.5px solid var(--cg-ink);
  border-radius: 14px; box-shadow: 5px 5px 0 var(--cg-ink); padding: 10px 26px;
}
.cg .cg-map-stem { width: 3px; height: 26px; background: var(--cg-ink); margin: 0 auto; }
.cg .cg-map-cols {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px;
  border-top: 3px solid var(--cg-ink); padding-top: 24px;
  max-width: 980px; margin: 0 auto;
}
.cg .cg-map-col { display: flex; flex-direction: column; align-items: center; gap: 10px; position: relative; }
.cg .cg-map-col::before { content: ""; position: absolute; top: -24px; width: 3px; height: 24px; background: var(--cg-ink); }
.cg .cg-map-sec {
  font-size: 13.5px; font-weight: 700; border: 2.5px solid var(--cg-ink); border-radius: 999px;
  box-shadow: 3px 3px 0 var(--cg-ink); padding: 7px 16px;
}
.cg .cg-map-leaf {
  font-size: 12.5px; font-weight: 600; background: #fff; border: 2px solid var(--cg-ink);
  border-radius: 999px; padding: 5px 14px; box-shadow: 2px 2px 0 var(--cg-ink);
}

/* ---------- key decisions ---------- */
.cg .cg-dec-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; margin-top: 30px; }
.cg .cg-dec h3 { font-size: 28px; margin: 14px 0 4px; }
.cg .cg-dec-num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border-radius: 10px; border: 2px solid var(--cg-ink);
  box-shadow: 3px 3px 0 var(--cg-ink); font-family: "Afacad", sans-serif; font-size: 20px; font-weight: 700;
}
.cg .cg-dec-part { margin-top: 14px; }
.cg .cg-dec-k {
  display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: 0.14em;
  background: #EDEAE5; border: 1.5px solid var(--cg-ink); border-radius: 6px; padding: 3px 9px;
}
.cg .cg-dec-k--call { background: var(--cg-yellow); }
.cg .cg-dec-part p { margin-top: 8px; }

/* ---------- process (wireframes → final) ---------- */
.cg .cg-proc {
  display: grid; grid-template-columns: 1fr auto 1fr; gap: clamp(14px, 3vw, 40px);
  align-items: center; margin-top: 34px;
}
.cg .cg-proc-label { font-size: 12.5px; font-weight: 700; letter-spacing: 0.16em; opacity: 0.55; margin-bottom: 14px; text-align: center; }
.cg .cg-proc-row { display: flex; gap: 18px; justify-content: center; }
.cg .cg-proc-shot { width: clamp(130px, 14vw, 200px); aspect-ratio: 440 / 956; border-radius: 6px; }
.cg .cg-proc-arrow { font-family: "Afacad", sans-serif; font-size: clamp(40px, 5vw, 72px); font-weight: 700; }
.cg .cg-ph {
  display: flex; align-items: center; justify-content: center; text-align: center;
  border: 2.5px dashed rgba(30, 27, 21, 0.4); border-radius: 6px; background: rgba(255, 255, 255, 0.5);
  padding: 12px;
}
.cg .cg-ph span { font-size: 11.5px; font-weight: 600; opacity: 0.55; word-break: break-all; }

/* ---------- design system extras ---------- */
.cg .cg-ds-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; margin-top: 26px; }
.cg .cg-type-row { display: flex; align-items: center; gap: 18px; }
.cg .cg-type-row h3 { margin: 0 0 2px; font-size: 24px; }
.cg .cg-type-row p { margin: 0; font-size: 13.5px; opacity: 0.65; }
.cg .cg-type-aa { font-size: 54px; font-weight: 700; line-height: 1; }
.cg .cg-type-div { height: 2px; background: rgba(30, 27, 21, 0.12); margin: 16px 0; }
.cg .cg-atomic h3 { margin: 0 0 14px; }
.cg .cg-atomic-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.cg .cg-atomic-row i { font-style: normal; font-weight: 700; }

/* ---------- validation loop ---------- */
.cg .cg-loop { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 26px; }
.cg .cg-loop i { font-style: normal; font-family: "Afacad", sans-serif; font-size: 30px; font-weight: 700; }
.cg .cg-loop-back { color: var(--cg-purple); font-size: 36px !important; }

/* ---------- responsive ---------- */
@media (max-width: 920px) {
  .cg .cg-grid-3, .cg .cg-dec-grid, .cg .cg-ds-grid { grid-template-columns: 1fr; }
  .cg .cg-emp-grid { grid-template-columns: 1fr 1fr; }
  .cg .cg-map-cols { grid-template-columns: repeat(2, 1fr); border-top: none; padding-top: 0; }
  .cg .cg-map-col::before { display: none; }
  .cg .cg-map-stem { display: none; }
  .cg .cg-map { text-align: left; }
  .cg .cg-map-root { margin-bottom: 14px; }
  .cg .cg-map-col { align-items: flex-start; border-left: 3px solid var(--cg-ink); padding-left: 14px; margin-bottom: 10px; }
  .cg .cg-proc { grid-template-columns: 1fr; }
  .cg .cg-proc-arrow { transform: rotate(90deg); text-align: center; }
}

@media (max-width: 920px) {
  .cg .cg-roles-grid, .cg .cg-out-grid { grid-template-columns: 1fr; }
  /* stack the flow: info on top, phone below — no overlap */
  .cg .cg-flowstage { grid-template-columns: 1fr; grid-auto-rows: min-content; gap: 18px; align-content: center; justify-items: center; padding: 0 22px; }
  .cg .cg-flowstage.flip { direction: ltr; }
  .cg .cg-flowinfo { max-width: 100%; width: 100%; }
  .cg .cg-flownum { font-size: 54px; -webkit-text-stroke-width: 2px; }
  .cg .cg-flowname { font-size: 30px; margin: 6px 0; }
  .cg .cg-flowblurb { margin-bottom: 8px; }
  .cg .cg-phone--show { width: min(50vw, 230px); }
  .cg .cg-flowmedia { justify-content: center; margin-top: 0; width: 100%; }
  .cg .cg-deck-grid { grid-template-columns: 1fr; gap: 10px; }
  .cg .cg-deck-num { font-size: 90px; }
  .cg .cg-facts { margin-top: 8px; }
  .cg .cg-hero-fan .cg-tilt { height: 100vw; }
}

/* ---------- small phones ---------- */
@media (max-width: 560px) {
  .cg .cg-emp-grid { grid-template-columns: 1fr; }
  .cg .cg-card { padding: 20px 18px 18px; box-shadow: 5px 5px 0 var(--cg-ink); }
  .cg .cg-card h3 { font-size: 22px; }
  .cg .cg-dec h3 { font-size: 23px; }
  .cg .cg-proc-row { gap: 12px; }
  .cg .cg-proc-shot { width: min(40vw, 150px); }
  .cg .cg-loop { gap: 10px; }
  .cg .cg-loop .cg-step-t { font-size: 17px; padding: 7px 13px; }
  .cg .cg-token { padding: 8px 14px 8px 10px; }
  .cg .cg-token b { font-size: 13px; }
  .cg .cg-facts > div { padding: 10px 14px; }
  .cg .cg-facts b { font-size: 18px; }

  /* flows: hide blurb + shrink so info+phone fit one screen */
  .cg .cg-flowblurb { display: none; }
  .cg .cg-flownum { font-size: 46px; }
  .cg .cg-flowname { font-size: 26px; }
  .cg .cg-flowstage { gap: 12px; }
  .cg .cg-phone--show { width: min(50vw, 188px); }
  .cg .cg-step-t { font-size: 20px; padding: 7px 14px; }

  /* sitemap → vertical tree with a left rail (readable on narrow screens) */
  .cg .cg-map { text-align: left; padding-left: 2px; }
  .cg .cg-map-root { display: inline-block; margin-bottom: 0; }
  .cg .cg-map-stem { display: block; width: 3px; height: 16px; background: var(--cg-ink); margin: 0 0 0 26px; }
  .cg .cg-map-cols {
    grid-template-columns: 1fr; gap: 0; border-top: none; padding-top: 0;
    border-left: 3px solid var(--cg-ink); margin: 0 0 0 26px; padding-left: 0; max-width: none;
  }
  .cg .cg-map-col {
    align-items: flex-start; border-left: none; gap: 7px;
    padding: 0 0 0 22px; margin-bottom: 18px; position: relative;
  }
  .cg .cg-map-col:last-child { margin-bottom: 0; }
  .cg .cg-map-col::before {
    display: block; content: ""; position: absolute;
    left: 0; top: 16px; width: 18px; height: 3px; background: var(--cg-ink);
  }
}

/* ---------- viewport-simulator mirrors (body[data-sim]) ----------
   The portfolio's Tweaks panel simulates tablet/mobile by narrowing
   the root, so media queries don't fire — mirror the key rules. */
body[data-sim="tablet"] .cg .cg-emp-grid { grid-template-columns: 1fr 1fr; }
body[data-sim="tablet"] .cg .cg-grid-3 { grid-template-columns: 1fr 1fr; }
body[data-sim="tablet"] .cg .cg-proc { grid-template-columns: 1fr; }
body[data-sim="tablet"] .cg .cg-proc-arrow { transform: rotate(90deg); text-align: center; }

body[data-sim="mobile"] .cg .cg-grid-3,
body[data-sim="mobile"] .cg .cg-dec-grid,
body[data-sim="mobile"] .cg .cg-ds-grid,
body[data-sim="mobile"] .cg .cg-roles-grid,
body[data-sim="mobile"] .cg .cg-out-grid,
body[data-sim="mobile"] .cg .cg-emp-grid,
body[data-sim="mobile"] .cg .cg-map-cols { grid-template-columns: 1fr; }
body[data-sim="mobile"] .cg .cg-map { text-align: left; padding-left: 2px; }
body[data-sim="mobile"] .cg .cg-map-root { display: inline-block; margin-bottom: 0; }
body[data-sim="mobile"] .cg .cg-map-stem { display: block; width: 3px; height: 16px; background: var(--cg-ink); margin: 0 0 0 26px; }
body[data-sim="mobile"] .cg .cg-map-cols { border-top: none; padding-top: 0; gap: 0; border-left: 3px solid var(--cg-ink); margin: 0 0 0 26px; padding-left: 0; max-width: none; }
body[data-sim="mobile"] .cg .cg-map-col { align-items: flex-start; border-left: none; gap: 7px; padding: 0 0 0 22px; margin-bottom: 18px; position: relative; }
body[data-sim="mobile"] .cg .cg-map-col:last-child { margin-bottom: 0; }
body[data-sim="mobile"] .cg .cg-map-col::before { display: block; content: ""; position: absolute; left: 0; top: 16px; width: 18px; height: 3px; background: var(--cg-ink); }
body[data-sim="mobile"] .cg .cg-proc { grid-template-columns: 1fr; }
body[data-sim="mobile"] .cg .cg-proc-arrow { transform: rotate(90deg); text-align: center; }
body[data-sim="mobile"] .cg .cg-card { padding: 20px 18px 18px; }
body[data-sim="mobile"] .cg .cg-flowstage { grid-template-columns: 1fr; grid-auto-rows: min-content; gap: 12px; align-content: center; justify-items: center; padding: 0 22px; }
body[data-sim="mobile"] .cg .cg-flowstage.flip { direction: ltr; }
body[data-sim="mobile"] .cg .cg-flowinfo { max-width: 100%; width: 100%; }
body[data-sim="mobile"] .cg .cg-flowblurb { display: none; }
body[data-sim="mobile"] .cg .cg-flownum { font-size: 46px; -webkit-text-stroke-width: 2px; }
body[data-sim="mobile"] .cg .cg-flowname { font-size: 26px; margin: 6px 0; }
body[data-sim="mobile"] .cg .cg-phone--show { width: min(50vw, 188px); }
body[data-sim="mobile"] .cg .cg-flowmedia { justify-content: center; margin-top: 0; width: 100%; }
body[data-sim="mobile"] .cg .cg-deck-grid { grid-template-columns: 1fr; gap: 10px; }
body[data-sim="mobile"] .cg .cg-deck-num { font-size: 90px; }

/* ============================================================
   Apple-style additions: progress bar, hero settle, big metrics
   ============================================================ */
.cg-progress {
  position: fixed; top: 0; left: 0; height: 4px; z-index: 998;
  background: var(--cg-purple, #4E46B4); border-radius: 0 4px 4px 0;
  box-shadow: 0 1px 0 rgba(30, 27, 21, 0.35);
  transition: width .12s linear; pointer-events: none;
}
.cg .cg-heropx { will-change: transform, opacity; }
.cg .cg-facts b { font-size: 30px; letter-spacing: -0.01em; }

/* ============================================================
   Night mode — neo-brutalism inverted: dark surface, light ink
   (follows the site theme toggle: body[data-theme="dark"])
   ============================================================ */
body[data-theme="dark"] .cg {
  --cg-cream: #15120D;
  --cg-ink: #F2EFE9;
  /* transparent — site grid-paper background shows through in night mode too */
  background: transparent;
  color: #F2EFE9;
}
body[data-theme="dark"] .cg .cg-card,
body[data-theme="dark"] .cg .cg-chip,
body[data-theme="dark"] .cg .cg-phone,
body[data-theme="dark"] .cg .cg-facts > div,
body[data-theme="dark"] .cg .cg-step-t,
body[data-theme="dark"] .cg .cg-token,
body[data-theme="dark"] .cg .cg-map-leaf { background: #221E17; }
body[data-theme="dark"] .cg .cg-quote { background: #2A2542; }
body[data-theme="dark"] .cg .cg-dec-k { background: #353025; }
body[data-theme="dark"] .cg .cg-dec-k--call { background: var(--cg-yellow); color: #1E1B15; }
body[data-theme="dark"] .cg .cg-ph { background: rgba(34, 30, 23, 0.6); border-color: rgba(242, 239, 233, 0.4); }
body[data-theme="dark"] .cg .cg-type-div { background: rgba(242, 239, 233, 0.15); }
body[data-theme="dark"] .cg .cg-ghost { opacity: 0.08; }
body[data-theme="dark"] .cg .cg-phone { box-shadow: 9px 11px 0 rgba(242, 239, 233, 0.85); }
body[data-theme="dark"] .cg .cg-flowstage.flip .cg-phone--show { box-shadow: -9px 11px 0 rgba(242, 239, 233, 0.85); }
body[data-theme="dark"] .cg .cg-deck-num { text-shadow: 7px 7px 0 rgba(242, 239, 233, 0.85); }
/* accent chips keep dark text for contrast on yellow/green */
body[data-theme="dark"] .cg .cg-chip[style*="rgb(255, 227, 77)"],
body[data-theme="dark"] .cg .cg-chip[style*="rgb(80, 200, 120)"] { color: #1E1B15; }
body[data-theme="dark"] .cg-progress { box-shadow: 0 1px 0 rgba(242, 239, 233, 0.3); }

/* ---------- reduced motion (Apple-style static fallback) ---------- */
@media (prefers-reduced-motion: reduce) {
  .cg .cg-screen, .cg .cg-deck-slide, .cg .cg-step,
  .cg .cg-deck-num, .cg .cg-tilt, .cg .cg-dots span { transition: none !important; animation: none !important; }
  .cg .cg-heropx { transform: none !important; opacity: 1 !important; }
  .cg .cg-stage3d { transform: none !important; }
  .cg .cg-chars span { transition: none !important; opacity: 1 !important; }
  .cg-progress { transition: none !important; }
}
