/* =====================================================================
   Daily POS case study — page-specific styles (loaded after css/project.css)
   Same scale as the shared file: 1 Figma px = calc(N * var(--p)).
   Phones (≤767px) at the bottom.
   ===================================================================== */

/* ---------- Overview: laptop mockup + text, vertically centred ---------- */
.overview { margin-top: calc(120 * var(--p)); align-items: center; min-height: calc(458 * var(--p)); }
.overview__image { flex-basis: calc(632 * var(--p)); height: calc(408 * var(--p)); border-radius: calc(16 * var(--p)); overflow: hidden; }
.overview__text { margin-top: 0; }

/* ---------- At a glance (uses the shared .outcomes / .stats) ---------- */
.outcomes { margin-top: calc(90 * var(--p)); }
.chapters { margin-top: calc(340 * var(--p)); }   /* "At a glance" cards end → chapter 01 */

/* ---------- Space under each chapter (Figma: content end → next block) ---------- */
.chapter--zero        { --after: calc(305 * var(--p)); }
.chapter--friction    { --after: calc(301 * var(--p)); --intro-w: calc(670 * var(--p)); }
.chapter--performance { --after: calc(341 * var(--p)); }
.chapter--ipad        { --after: calc(292 * var(--p)); }
.chapter--contests    { --after: calc(138 * var(--p)); }

/* Chapter 04 uses the bold title weight in Figma */
.chapter__title--bold h2 { font-weight: 700; }

/* Galleries: panel of a different width, gap/caption tweaks */
.rail__item--narrow { flex-basis: calc(790 * var(--p)); }
.rail__item--narrow img { height: calc(608 * var(--p)); }
.chapter--performance .rail,
.chapter--contests .rail { --rail-gap: calc(28 * var(--p)); margin-top: calc(20 * var(--p)); }
.rail__item figcaption.body-text { line-height: 1.5; }

/* ---------- Chapter 02: before / after onboarding flow (real HTML text) ---------- */
.flow {
  position: relative; margin-top: calc(40 * var(--p)); height: calc(609 * var(--p));
  background: var(--soft); border-radius: calc(32.49 * var(--p)); overflow: hidden;
}
.flow__card {
  position: absolute; left: calc(29 * var(--p)); width: calc(1142 * var(--p)); height: calc(260 * var(--p));
  border-radius: calc(22.294 * var(--p)); overflow: hidden; box-shadow: 0 6px 3px rgba(0,0,0,.06);
  background: #fff;
}
.flow__card--before { top: calc(31 * var(--p)); }
.flow__card--after  { top: calc(319 * var(--p)); background: #343434; }

.flow__head {
  position: absolute; left: calc(30.65 * var(--p)); top: calc(32.87 * var(--p));
  display: flex; align-items: center; gap: calc(11.147 * var(--p));
}
.flow__card--after .flow__head { top: calc(32 * var(--p)); }
.flow__head p { font-size: calc(11 * var(--p)); color: #5b5e66; white-space: nowrap; }
.flow__card--after .flow__head p { color: #c9ccd3; }

/* little pill label: BEFORE / AFTER / WHAT WE ENVISIONED … */
.badge {
  display: inline-block; border-radius: 999px; background: #edeef1; color: #222326; white-space: nowrap;
  padding: calc(5.573 * var(--p)) calc(11.147 * var(--p));
  font-weight: 500; font-size: calc(9.753 * var(--p)); line-height: 1.25; letter-spacing: calc(1.3934 * var(--p));
}
.badge--green { background: #15d699; color: #1c1d1f; }

.flow__track {
  position: absolute; left: calc(30.65 * var(--p)); right: calc(30.65 * var(--p)); top: calc(84.45 * var(--p));
  display: flex; align-items: flex-start; margin: 0; padding: 0; list-style: none;
}
.flow__card--after .flow__track { top: calc(112.79 * var(--p)); }
/* connecting lines (solid part + dashed part) */
.flow__line { position: absolute; top: calc(7.54 * var(--p)); height: calc(3 * var(--p)); border-radius: calc(2.787 * var(--p)); background: #e3e6f0; }
.flow__card--before .flow__line { left: calc(90.35 * var(--p)); width: calc(721 * var(--p)); }
.flow__card--after  .flow__line { left: calc(137.56 * var(--p)); width: calc(539 * var(--p)); background: #15d699; }
.flow__dashes { position: absolute; height: calc(2 * var(--p)); max-width: none; }
.flow__card--before .flow__dashes { left: calc(807.35 * var(--p)); top: calc(9.54 * var(--p)); width: calc(192 * var(--p)); }
.flow__card--after  .flow__dashes { left: calc(679.35 * var(--p)); top: calc(9.21 * var(--p)); width: calc(262 * var(--p)); }

.step { position: relative; flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: calc(9.753 * var(--p)); text-align: center; }
.step__dot {
  width: calc(18.114 * var(--p)); height: calc(18.114 * var(--p)); border-radius: 50%;
  border: calc(2.7867 * var(--p)) solid #545454; background: #fff;
}
.step__dot--warn   { border-color: #d9541e; }
.step__dot--end    { border-color: #d9541e; background: #d9541e; }
.step__dot--done   { border-color: #15d699; background: #343434; }
.step__dot--now    { border-color: #15d699; background: #15d699; }
.step__dot--next   { border-color: #868686; background: #868686; }
.step__text { display: flex; flex-direction: column; gap: calc(4.18 * var(--p)); width: 100%; }
.step__label { font-weight: 500; font-size: calc(10 * var(--p)); line-height: 1.25; letter-spacing: calc(1.3934 * var(--p)); color: #5b5e66; }
.step__title { font-weight: 500; font-size: calc(13.237 * var(--p)); line-height: 1.25; color: #545454; }
.step__desc  { font-weight: 400; font-size: calc(10.15 * var(--p)); line-height: 1.35; color: #5b5e66; }
.step__warn  { font-weight: 500; font-size: calc(8.7 * var(--p)); line-height: 1.25; color: #c2410c; }
.step--landing .step__title { color: #c2410c; }
.flow__card--after .step__label { color: #15d699; }
.flow__card--after .step__title { color: #fff; }
.flow__card--after .step__desc  { color: #b9bcc3; }
.flow__card--after .step--landing .step__label { color: #b6b6b6; }
.flow__card--after .step--landing .step__title { color: #15d699; }
.step__title--bold { font-weight: 700 !important; }
/* side trip out of onboarding: dashed stem + "Locations page" pill */
.step__stem { width: 0; height: calc(26.336 * var(--p)); border-left: calc(1.39 * var(--p)) dashed #d9541e; }
.step__exit {
  border: calc(1.045 * var(--p)) dashed #f0a27a; background: #fff4ed; color: #c2410c; border-radius: 999px; white-space: nowrap;
  padding: calc(5.573 * var(--p)) calc(11.147 * var(--p)); font-size: calc(11.147 * var(--p)); line-height: 1.25;
}

/* stat card with a smaller number ("Manual → Autofilled") */
.stat__num--sm { font-size: calc(31 * var(--p)); line-height: calc(55 * var(--p)); }
.stat__mark { position: relative; display: inline-block; }
.squiggle--autofilled { left: calc(2.67 * var(--p)); top: calc(23 * var(--p)); width: calc(148 * var(--p)); height: calc(27 * var(--p)); }
.stat__mark > span { position: relative; }   /* text sits above its squiggle */

/* ---------- Chapter 04: two iPads (one composite image) + HTML labels ---------- */
.ipads {
  --u: var(--p);
  position: relative; margin-top: calc(20 * var(--u)); height: calc(827 * var(--u));
}
.ipads > img { position: absolute; left: calc(-44.5 * var(--u)); top: 0; width: calc(1267.5 * var(--u)); max-width: none; }
.ipads .badge { position: absolute; z-index: 1; }
.ipads__label--envisioned { left: calc(8 * var(--u)); top: calc(54 * var(--u)); }
.ipads__label--allowed    { left: calc(981 * var(--u)); top: calc(266 * var(--u)); }

/* ---------- Early merchant feedback ---------- */
.feedback { width: calc(1200 * var(--p)); margin-bottom: calc(153 * var(--p)); }
.feedback .h2 { margin-bottom: calc(30 * var(--p)); }
.feedback .stat { min-height: calc(178 * var(--p)); }
.stat__star { display: inline-block; vertical-align: baseline; width: calc(39.25 * var(--p)); height: calc(37.53 * var(--p)); margin-left: calc(6 * var(--p)); }
.squiggle--rating { left: calc(28.5 * var(--p)); top: calc(59.77 * var(--p)); width: calc(82 * var(--p)); height: calc(32.73 * var(--p)); }
.quote { padding: calc(23 * var(--p)) calc(32 * var(--p)) calc(24 * var(--p)); gap: 0; }
.quote__stars { width: calc(111.222 * var(--p)); height: calc(21 * var(--p)); margin-left: calc(-3.67 * var(--p)); }
.quote__text { margin-top: calc(21 * var(--p)); font-size: calc(16 * var(--p)); line-height: 1.5; color: var(--body-2); }
.quote__who  { margin-top: calc(15 * var(--p)); font-weight: 500; font-size: calc(14 * var(--p)); line-height: 1.5; color: #838384; }

/* ---------- What stayed with me: 3 columns ---------- */
.learnings__grid--3 { grid-template-columns: repeat(3, 1fr); column-gap: calc(32 * var(--p)); }
.learnings__grid--3 .lesson { padding: calc(32 * var(--p)) 0; }
.learnings__grid--3 .squiggle--number { left: calc(2.86 * var(--p)); }

/* =====================================================================
   Phones (≤767px)
   ===================================================================== */
@media (max-width: 767px) {
  .overview { margin-top: 80px; min-height: 0; }
  .overview__image { aspect-ratio: 632 / 408; border-radius: 12px; }
  .outcomes { margin-top: 64px; }

  .chapter--zero, .chapter--friction, .chapter--performance, .chapter--ipad, .chapter--contests { --after: 96px; }
  .chapter--performance .rail, .chapter--contests .rail { margin-top: 24px; --rail-gap: 12px; }
  .rail__item--narrow { flex-basis: 72%; }
  .rail__item--narrow img { height: auto; aspect-ratio: 790 / 608; }

  /* flow: the two cards stack, steps become a vertical list */
  .flow { height: auto; margin-top: 24px; padding: 12px; border-radius: 16px; display: flex; flex-direction: column; gap: 12px; }
  .flow__card { position: static; width: auto; height: auto; padding: 20px; border-radius: 14px; }
  .flow__head { position: static; flex-wrap: wrap; gap: 8px; }
  .flow__head p { font-size: 12px; white-space: normal; }
  .badge { font-size: 10px; padding: 4px 10px; letter-spacing: 1.2px; }
  .flow__track, .flow__card--after .flow__track { position: static; flex-direction: column; gap: 16px; margin-top: 20px; }
  .flow__line, .flow__dashes { display: none; }
  .step { flex-direction: row; flex-wrap: wrap; align-items: flex-start; gap: 4px 12px; text-align: left; }
  .step__dot { flex: none; width: 16px; height: 16px; border-width: 3px; margin-top: 1px; }
  .step__text { width: auto; flex: 1; gap: 3px; }
  .step__label { font-size: 10px; letter-spacing: 1.2px; }
  .step__title { font-size: 14px; }
  .step__desc { font-size: 12px; }
  .step__desc br { display: none; }
  .step__warn { font-size: 11px; }
  .step__stem { display: none; }
  .step__exit { margin-left: 28px; font-size: 12px; padding: 3px 10px; border-width: 1px; }

  .stat__num--sm { font-size: 28px; line-height: 44px; }
  .squiggle--autofilled { left: 2px; top: 19px; width: 120px; height: 22px; }

  /* iPads: the whole composite scales with the column */
  .ipads { --u: calc((100vw - 48px) / 1200); margin-top: 48px; }
  .ipads .badge { font-size: 9px; padding: 3px 8px; letter-spacing: 1px; }
  .ipads__label--envisioned { top: -34px; left: 0; }
  .ipads__label--allowed { left: auto; right: 0; top: calc(827 * var(--u) + 14px); }
  .chapter--ipad { --after: 136px; }

  .feedback { width: auto; margin-bottom: 96px; }
  .feedback .h2 { margin-bottom: 20px; }
  .feedback .stat { min-height: 0; }
  .stat__star { width: 32px; height: 30px; }
  .squiggle--rating { left: 18px; top: 47px; width: 70px; height: 28px; }
  .quote { padding: 20px 24px 24px; }
  .quote__stars { width: 100px; height: 19px; }
  .quote__text { margin-top: 14px; font-size: 15px; }
  .quote__who { margin-top: 10px; font-size: 13px; }

  .learnings__grid--3 { grid-template-columns: 1fr; }
  .learnings__grid--3 .lesson { padding: 24px 16px 8px; }
  .learnings__grid--3 .squiggle--number { left: 14px; }
}
