/* ============================================================
   PantryPal case study — the about page's chapter system, retold
   as a six-slide pitch: sidebar menu + warm gliding chip beside
   the self-drawing hairline and its orange reading thread, with
   the chapters stacked VERTICALLY to the right. Content centres
   on the CONTENT AXIS --ax = midline of [247px … right edge].
   ============================================================ */

.case-stage {
  /* inside the case study, the accents speak PANTRYPAL, not the site
     orange: coral is the ink (deepened for contrast), butter yellow is
     the highlighter (chips + marker sweeps, like the app's banners),
     and all three brand colors ride the reading thread */
  --pp-yellow: #ffd67e;
  --pp-coral: #ff8d7e;
  --pp-blue: #b8edf8;
  --pp-red: #eb614b;
  --pp-yellow-wash: rgba(255, 214, 126, 0.35);
  --pp-yellow-line: rgba(226, 168, 68, 0.55);
  --pp-mark: rgba(255, 214, 126, 0.6);

  position: relative;
  height: 100vh;
  height: 100dvh;
  width: 100%;
  overflow: hidden;
  opacity: 0;
  transition: opacity var(--t-stage) ease;
}
.case-stage.revealed { opacity: 1; }
/* the keyboard ring speaks the case's ink here, not the site orange */
.case-stage :focus-visible { outline-color: var(--pp-red); }

/* ---- the sidebar: hairline at 247 that draws itself top-down,
   menu aligned to the house chip (left 31 / padding 17.5 puts the
   icons on the house glyph's axis), one warm chip gliding ---- */
.case-divider {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 247px;
  width: 1px;
  background: #d9d9d9;
  z-index: 4;
  pointer-events: none;
  transform: scaleY(0);
  transform-origin: top;
  transition: transform 0.9s var(--ease-draw) 0.1s;
}
.case-stage.revealed .case-divider { transform: none; }

/* the reading thread — js/pantry.js maps the scroller onto --p; the
   orange ink pours from the top and fills the line by the last slide */
.case-thread {
  position: absolute;
  top: 0;
  left: 246px;
  width: 3px;
  height: calc(56px + (100% - 56px) * var(--p, 0));
  border-radius: 1.5px;
  background: linear-gradient(180deg,
    var(--pp-yellow), var(--pp-coral) 55%, var(--pp-blue));
  z-index: 4;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.5s ease 0.9s;
}
.case-stage.revealed .case-thread { opacity: 1; }

.case-menu {
  position: absolute;
  top: 133px;
  left: 31px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 5;
}
/* the one chip — sized/placed by pantry.js, painted BEHIND the words */
.menu-glass {
  position: absolute;
  top: 0;
  left: 0;
  width: var(--gw, 0px);
  height: var(--gh, 44px);
  translate: 0 var(--gt, 0px);
  border-radius: 20px;
  background: var(--pp-yellow-wash);      /* the app's banner yellow */
  border: 1px solid var(--pp-yellow-line);
  opacity: 0;
  pointer-events: none;
}
.menu-glass.is-ready {
  transition: translate var(--t-glide) var(--ease-glide),
              width var(--t-glide) var(--ease-glide),
              height var(--t-glide) var(--ease-glide),
              opacity 0.45s ease 0.4s;
}
.case-stage.revealed .menu-glass.is-ready { opacity: 1; }
.menu-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 8px 16px 8px 17.5px;
  border-radius: 20px;
  font-size: 24px;                     /* six chapters — a notch under about's 28 */
  color: #5e5e5e;
  text-decoration: none;
  --d: 0.3s;
  transition: color var(--t-micro) ease,
              opacity var(--t-fade) ease var(--d),
              translate var(--t-rise) var(--ease-rise) var(--d);
}
.case-stage:not(.revealed) .menu-item {
  opacity: 0;
  translate: -14px 0;
}
.case-menu a:nth-of-type(2) { --d: 0.37s; }
.case-menu a:nth-of-type(3) { --d: 0.44s; }
.case-menu a:nth-of-type(4) { --d: 0.51s; }
.case-menu a:nth-of-type(5) { --d: 0.58s; }
.case-menu a:nth-of-type(6) { --d: 0.65s; }
.menu-item svg { flex: none; }
.menu-item:hover,
.menu-item:focus-visible,
.menu-item.is-current,
.menu-item[aria-current='page'] { color: var(--pp-red); }
.case-menu:hover .menu-item.is-current:not(:hover) { color: var(--ink); }

/* menu icons redraw on hover — the about page's pen, same recipe */
.menu-item:hover svg :is(path, rect, circle),
.menu-item:focus-visible svg :is(path, rect, circle) {
  stroke-dasharray: 1;
  animation: case-redraw 0.7s var(--ease-draw) both;
}
.menu-item:hover svg g > :nth-child(2),
.menu-item:focus-visible svg g > :nth-child(2) { animation-delay: 0.1s; }
.menu-item:hover svg g > :nth-child(3),
.menu-item:focus-visible svg g > :nth-child(3) { animation-delay: 0.2s; }
.menu-item:hover svg g > :nth-child(4),
.menu-item:focus-visible svg g > :nth-child(4) { animation-delay: 0.3s; }

/* ---- the chapter stack ---- */
.case-scroll {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
  scroll-behavior: smooth;
  scrollbar-width: none;
}
.case-scroll::-webkit-scrollbar { display: none; }
.case-slide {
  position: relative;
  flex: none;
  width: 100%;
  height: 100%;
  --ax: calc(50% + 123.5px);
}

/* ---- per-slide title pair (the site standard) ---- */
.case-title {
  position: absolute;
  top: 40px;
  left: var(--ax);
  transform: translateX(-50%);
  display: flex;
  align-items: baseline;
  gap: 10px;
  white-space: nowrap;
}
.case-title :is(h1, h2) {
  font-size: 28px;
  font-weight: 400;
  color: #5e5e5e;
}
.case-title p {
  font-size: 28px;
  color: rgba(0, 0, 0, 0.3);
}
/* faint chapter numeral — the notebook's page number */
.case-num {
  font-size: 13.25px;
  color: rgba(0, 0, 0, 0.35);
  font-variant-numeric: tabular-nums;
  margin-right: 2px;
}

/* ---- entrance: everything rises softly when its slide snaps in;
   grids deal their cards one at a time on --n ---- */
.case-title, .case-pitch, .case-hero, .built-for, .hmw,
.flow-steps, .flow-phone, .flow-copy,
.craft2-principle, .learned, .case-outro {
  transition: opacity var(--t-fade) ease, translate var(--t-rise) var(--ease-rise);
}
.case-slide:not(.revealed) :is(.case-title, .case-pitch, .case-hero,
.built-for, .hmw, .flow-steps, .flow-phone, .flow-copy,
.craft2-principle, .learned, .case-outro) {
  opacity: 0;
  translate: 0 16px;
}
.case-slide:not(.revealed) :is(.prob-card, .wire-card, .craft2-card, .metric-card) {
  opacity: 0;
  translate: 0 18px;
}

/* ---- the site's line-art system (about.css, verbatim) ---- */
.stroke {
  fill: none;
  stroke: #5e5e5e;
  stroke-width: 1.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  transition: stroke-dashoffset 1.1s var(--ease-draw);
}
.stroke.s2 { transition-delay: 0.25s; }
.guide {
  fill: none;
  stroke: #d9d9d9;
  stroke-width: 1.2;
  stroke-dasharray: 2 5;
  stroke-linecap: round;
  opacity: 0;
  transition: opacity 0.5s ease 0.9s;
}
.case-slide.revealed .stroke { stroke-dashoffset: 0; }
.case-slide.revealed .guide { opacity: 1; }
@keyframes case-redraw {
  from { stroke-dashoffset: 1; }
  to   { stroke-dashoffset: 0; }
}

/* the diagrams can be asked to draw again — hovering a problem card
   replays the whole sketch: guides march, ink redraws, the arc regrows */
@keyframes guide-march {
  to { stroke-dashoffset: -14; }
}
@keyframes arc-grow {
  from { stroke-dasharray: 0 1; }
  to   { stroke-dasharray: 0.35 0.65; }
}
.prob-card:hover svg .stroke {
  stroke-dasharray: 1;
  animation: case-redraw 0.8s var(--ease-draw) both;
}
.prob-card:hover svg .stroke.s2 { animation-delay: 0.15s; }
.prob-card:hover svg .guide { animation: guide-march 1.4s linear infinite; }
.prob-card:hover svg .arc {
  animation: arc-grow 1.1s var(--ease-draw) both;
}
.prob-card:hover svg .check {
  animation: case-redraw 0.5s var(--ease-draw) 0.7s both;
}

/* ============================================================
   01 · overview — pitch (logo, two paragraphs with the marker
   underlines, spec chips, headline metric) beside the login mock.
   Group centred: text 460 + 60 gap + phone 280.
   ============================================================ */
.case-pitch {
  position: absolute;
  top: 148px;
  left: calc(var(--ax) - 400px);
  width: 460px;
  font-size: 20px;
  line-height: 30px;
  color: #5e5e5e;
}
.case-pitch p + p { margin-top: 22px; }
.pitch-logo {
  display: block;
  height: 54px;
  width: auto;              /* the height/width attrs reserve ratio only */
  margin-bottom: 26px;
}
/* the key phrases get a butter-yellow HIGHLIGHTER sweep — a real
   marker, drawn left to right behind the ink once the slide settles */
.case-pitch strong,
.learned strong,
.craft2-principle strong,
.hmw strong {
  font-weight: 400;                   /* emphasis by INK, not weight */
  color: #404040;
  background: linear-gradient(var(--pp-mark), var(--pp-mark))
              no-repeat left 78% / 0% 0.58em;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
  transition: background-size 0.55s var(--ease-draw) var(--ud, 0.6s);
}
.case-slide.revealed :is(.case-pitch, .learned, .craft2-principle, .hmw) strong {
  background-size: 100% 0.58em;
}
.case-pitch p:nth-of-type(1) strong:nth-of-type(1) { --ud: 0.6s; }
.case-pitch p:nth-of-type(1) strong:nth-of-type(2) { --ud: 0.9s; }
.case-pitch p:nth-of-type(2) strong:nth-of-type(1) { --ud: 1.2s; }
.case-pitch p:nth-of-type(2) strong:nth-of-type(2) { --ud: 1.5s; }
/* the case-study ledger — labeled facts on a hairline, the pattern
   every good case study opens with: role · timeline · platform · tools */
.spec-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 24px;
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid #e5e5e5;
}
.spec-cell dt {
  font-size: 13.25px;
  color: rgba(0, 0, 0, 0.42);
}
.spec-cell dd {
  margin-top: 2px;
  font-size: 15px;
  line-height: 21px;
  color: #5e5e5e;
}
/* the suggestion-chip recipe (craft-chip family) */
.case-chip {
  padding: 5px 12px;
  font-size: 14px;
  line-height: 1.35;
  color: #5e5e5e;
  background: rgba(233, 233, 233, 0.48);
  border: 1px solid #d9d9d9;
  border-radius: 20px;
  white-space: nowrap;
}
/* the one number a recruiter should leave with — banner yellow, coral ink */
.headline-metric {
  display: inline-block;
  margin-top: 20px;
  padding: 7px 16px;
  font-size: 16px;
  color: var(--pp-red);
  background: var(--pp-yellow-wash);
  border: 1px solid var(--pp-yellow-line);
  border-radius: 20px;
  white-space: nowrap;
}
.case-hero {
  position: absolute;
  top: 140px;
  left: calc(var(--ax) + 120px);
  width: 280px;
  height: 560px;
}
/* once the chapter has settled, the phone floats — slow, weightless */
.case-slide.revealed .case-hero {
  animation: hero-float 6s ease-in-out 1.2s infinite;
}
@keyframes hero-float {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-8px); }
}
.case-hero img {
  display: block;
  width: 100%;
  height: 100%;
}

/* the about page's quiet scroll cue, verbatim */
.scroll-hint {
  position: absolute;
  bottom: 24px;
  left: var(--ax);
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  font-size: 13.25px;
  color: rgba(0, 0, 0, 0.42);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.6s ease 1.4s;
}
.case-slide.revealed .scroll-hint { opacity: 1; }
.case-stage.is-scrolled .scroll-hint {
  opacity: 0;
  transition: opacity 0.3s ease;
}
.scroll-hint svg { animation: hint-bob 2.2s ease-in-out infinite; }
@keyframes hint-bob {
  0%, 100% { translate: 0 0; }
  50%      { translate: 0 4px; }
}

/* ============================================================
   02 · problem — two court cards; the 35% arc DRAWS itself
   ============================================================ */
.prob-grid {
  position: absolute;
  top: 150px;
  left: var(--ax);
  transform: translateX(-50%);
  display: flex;
  gap: 18px;
}
.prob-card,
.craft2-card {
  width: 420px;
  height: 390px;
  padding: 26px 30px;
  background: rgba(233, 233, 233, 0.23);
  border: 2px solid #eeeded;
  border-radius: 31px;
  box-shadow: 0 4px 4px rgba(0, 0, 0, 0.25);
  transition: transform var(--t-lift) var(--ease-lift),
              border-color var(--t-micro) ease, box-shadow var(--t-micro) ease,
              opacity var(--t-fade) ease calc(var(--n) * 0.09s),
              translate var(--t-rise) var(--ease-rise) calc(var(--n) * 0.09s);
}
.prob-card:hover,
.craft2-card:hover,
.wire-card:hover,
.metric-card:hover {
  transform: translateY(-3px);
  border-color: rgba(0, 0, 0, 0.1);
  box-shadow: 0 8px 14px rgba(0, 0, 0, 0.08),
              0 1px 2px rgba(0, 0, 0, 0.06);
}
.prob-illo {
  height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.prob-illo svg {
  width: 160px;
  height: 160px;
}
/* the food-waste share, drawn as ink: dotted full circle, an orange
   arc that GROWS to 35%, the number fading in once it lands */
.arc {
  fill: none;
  stroke: var(--pp-red);
  stroke-width: 9;
  stroke-linecap: round;
  stroke-dasharray: 0 1;
  transition: stroke-dasharray 1.2s var(--ease-draw) 0.3s;
}
.case-slide.revealed .arc { stroke-dasharray: 0.35 0.65; }
/* a second dotted ring, sparse dashes reading as tick marks */
.tick-ring { stroke-dasharray: 2 14; }
.illo-num {
  font: inherit;
  font-size: 28px;
  text-anchor: middle;
  fill: #404040;
  opacity: 0;
  transition: opacity 0.5s ease 0.35s;   /* visible early — it counts up */
}
.illo-sub {
  font: inherit;
  font-size: 12px;
  text-anchor: middle;
  fill: rgba(0, 0, 0, 0.42);
  opacity: 0;
  transition: opacity 0.5s ease 1.3s;
}
.case-slide.revealed .illo-num,
.case-slide.revealed .illo-sub { opacity: 1; }
.check {
  fill: none;
  stroke: var(--pp-red);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  transition: stroke-dashoffset 0.6s var(--ease-draw) 0.9s;
}
.case-slide.revealed .check { stroke-dashoffset: 0; }
.prob-head {
  margin-top: 10px;
  font-size: 20px;
  font-weight: 400;
  color: #404040;
}
/* a brand dot anchors each card's heading — the palette carrying the
   hierarchy instead of weight */
.prob-head::before {
  content: '';
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 10px;
  background: var(--dot, var(--pp-coral));
}
.prob-grid .prob-card:nth-child(1) .prob-head { --dot: var(--pp-coral); }
.prob-grid .prob-card:nth-child(2) .prob-head { --dot: var(--pp-yellow); }
.craft2-grid .craft2-card:nth-child(1) .prob-head { --dot: var(--pp-yellow); }
.craft2-grid .craft2-card:nth-child(2) .prob-head { --dot: var(--pp-blue); }
.prob-copy {
  margin-top: 10px;
  font-size: 15px;
  line-height: 23px;
  color: #5e5e5e;
}
.built-for {
  position: absolute;
  top: 578px;
  left: var(--ax);
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
}
.built-label {
  font-size: 16px;
  color: rgba(0, 0, 0, 0.42);
  margin-right: 4px;
}
/* the audience trio wears the brand — one chip per palette color */
.built-for .case-chip:nth-of-type(1) {
  background: var(--pp-yellow-wash);
  border-color: var(--pp-yellow-line);
}
.built-for .case-chip:nth-of-type(2) {
  background: rgba(255, 141, 126, 0.22);
  border-color: rgba(235, 97, 75, 0.45);
}
.built-for .case-chip:nth-of-type(3) {
  background: rgba(184, 237, 248, 0.4);
  border-color: rgba(122, 191, 209, 0.55);
}
/* the chapter's closing beat — a how-might-we set a notch louder than
   body text, bridging straight into the solution slide; the key phrase
   takes the same marker sweep as the pitch */
.hmw {
  position: absolute;
  top: 632px;
  left: var(--ax);
  transform: translateX(-50%);
  text-align: center;
  white-space: nowrap;
}
.hmw-label {
  font-size: 13.25px;
  color: rgba(0, 0, 0, 0.42);
}
.hmw-q {
  margin-top: 6px;
  font-size: 24px;
  color: #404040;
}

/* ============================================================
   04 · process — three wireframes; the winner sits on the warm wash
   ============================================================ */
.wire-grid {
  position: absolute;
  top: 150px;
  left: var(--ax);
  transform: translateX(-50%);
  display: flex;
  gap: 18px;
}
.wire-card {
  width: 320px;
  height: 500px;
  padding: 20px 22px;
  background: rgba(233, 233, 233, 0.23);
  border: 2px solid #eeeded;
  border-radius: 31px;
  box-shadow: 0 4px 4px rgba(0, 0, 0, 0.25);
  transition: transform var(--t-lift) var(--ease-lift),
              border-color var(--t-micro) ease, box-shadow var(--t-micro) ease,
              opacity var(--t-fade) ease calc(var(--n) * 0.09s),
              translate var(--t-rise) var(--ease-rise) calc(var(--n) * 0.09s);
}
/* the shipped structure carries the warm wash — the verdict readable
   from across the room */
.wire-card.is-shipped {
  background: rgba(255, 214, 126, 0.12);
  border-color: var(--pp-yellow-line);
}
.wire-card.is-shipped:hover { border-color: rgba(226, 168, 68, 0.8); }
.wire-shot {
  height: 320px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.wire-shot img {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
}
/* idea name leads, the verdict lands at the far edge — scan the row of
   three and the story reads: no, no, YES */
.wire-verdict {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 14px;
}
.verdict {
  padding: 3px 10px;
  font-size: 13.25px;
  color: #5e5e5e;
  background: rgba(0, 0, 0, 0.03);
  border: 0.663px solid #d9d9d9;
  border-radius: 6.625px;
  white-space: nowrap;
}
/* the reviewer's pen: a quiet ✕ on the discards, a ✓ on the keeper */
.verdict::before {
  content: '\2715\2002';
  color: rgba(0, 0, 0, 0.42);
}
.verdict.is-yes::before {
  content: '\2713\2002';
  color: inherit;
}
.verdict.is-yes {
  color: var(--pp-red);
  background: var(--pp-yellow-wash);
  border-color: var(--pp-yellow-line);
}
.wire-name {
  font-size: 16px;
  color: rgba(0, 0, 0, 0.42);
}
.wire-copy {
  margin-top: 10px;
  font-size: 15px;
  line-height: 23px;
  color: #5e5e5e;
}

/* ============================================================
   03 · solution — the interactive walkthrough: steps · phone · why
   ============================================================ */
.flow-steps {
  position: absolute;
  top: 168px;
  left: calc(var(--ax) - 460px);
  width: 250px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.flow-glass {
  position: absolute;
  top: 0;
  left: 0;
  width: var(--gw, 0px);
  height: var(--gh, 40px);
  translate: var(--gx, 0px) var(--gt, 0px);
  border-radius: 16px;
  background: var(--pp-yellow-wash);
  border: 1px solid var(--pp-yellow-line);
  opacity: 0;
  pointer-events: none;
}
.flow-glass.is-ready {
  opacity: 1;
  transition: translate var(--t-glide) var(--ease-glide),
              width var(--t-glide) var(--ease-glide),
              height var(--t-glide) var(--ease-glide);
}
.step-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 7px 14px;
  border-radius: 16px;
  border: none;
  background: none;
  font: inherit;
  font-size: 20px;
  color: #5e5e5e;
  text-align: left;
  cursor: pointer;
  transition: color var(--t-micro) ease;
}
.step-item:hover,
.step-item:focus-visible,
.step-item.is-current { color: var(--pp-red); }
.flow-steps:hover .step-item.is-current:not(:hover) { color: var(--ink); }
.step-n {
  font-size: 13.25px;
  color: rgba(0, 0, 0, 0.42);
  font-variant-numeric: tabular-nums;
  transition: color var(--t-micro) ease;
}
.step-item.is-current .step-n { color: var(--pp-red); }
/* the screens sit by themselves — no card, no shadow; the mockups
   carry their own device chrome */
.flow-phone {
  position: absolute;
  top: 145px;
  left: calc(var(--ax) - 138px);
  width: 282px;
  height: 560px;
  cursor: pointer;
  transition: transform var(--t-lift) var(--ease-lift),
              opacity var(--t-fade) ease,
              translate var(--t-rise) var(--ease-rise);
}
.flow-phone:hover { transform: translateY(-2px); }
.flow-phone img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0;
  transition: opacity 0.35s ease;
}
.flow-phone img.is-on { opacity: 1; }
.flow-copy {
  position: absolute;
  top: 145px;
  left: calc(var(--ax) + 200px);
  width: 265px;
  height: 560px;
}
.flow-cap {
  position: absolute;
  top: 50%;
  width: 100%;
  transform: translateY(-50%);
  opacity: 0;
  translate: 0 10px;
  transition: opacity 0.35s ease, translate 0.4s var(--ease-rise);
  pointer-events: none;
}
.flow-cap.is-on {
  opacity: 1;
  translate: 0 0;
}
.flow-cap h3 {
  font-size: 20px;
  font-weight: 400;
  color: #404040;
}
.flow-cap p {
  margin-top: 10px;
  font-size: 16px;
  line-height: 24px;
  color: #5e5e5e;
}
.flow-hint {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  font-size: 13.25px;
  color: rgba(0, 0, 0, 0.42);
}

/* ============================================================
   05 · craft — palette + illustration cards, then the principle
   ============================================================ */
.craft2-grid {
  position: absolute;
  top: 165px;
  left: var(--ax);
  transform: translateX(-50%);
  display: flex;
  gap: 18px;
}
.swatch-row {
  height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 26px;
}
.swatch {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
/* ink outlines that FILL with their color as the slide settles */
.swatch-dot {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: transparent;
  border: 1.5px solid #d9d9d9;
  transition: background-color 0.6s ease var(--sd, 0.4s),
              border-color 0.6s ease var(--sd, 0.4s),
              transform var(--t-glide) var(--ease-glide);
}
.swatch:hover .swatch-dot { transform: scale(1.1); }
.swatch:nth-child(1) .swatch-dot { --sd: 0.4s; }
.swatch:nth-child(2) .swatch-dot { --sd: 0.6s; }
.swatch:nth-child(3) .swatch-dot { --sd: 0.8s; }
.case-slide.revealed .swatch-dot {
  background: var(--c);
  border-color: transparent;
}
.food-row {
  height: 180px;
  display: grid;
  grid-template-columns: repeat(3, auto);
  align-content: center;
  justify-content: center;
  gap: 10px 26px;
}
/* the dishes arrive in full color and gently bob, each on its own beat;
   hovering one whispers its name (the social-row label trick) */
.food {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}
.food img {
  height: 74px;
  width: auto;
  animation: food-bob 3.4s ease-in-out calc(var(--f, 0) * 0.4s) infinite;
}
.food:nth-child(1) { --f: 0; }
.food:nth-child(2) { --f: 1; }
.food:nth-child(3) { --f: 2; }
.food:nth-child(4) { --f: 3; }
.food:nth-child(5) { --f: 4; }
.food:nth-child(6) { --f: 5; }
@keyframes food-bob {
  0%, 100% { translate: 0 0; }
  50%      { translate: 0 -5px; }
}
.food::after {
  content: attr(aria-label);
  position: absolute;
  top: calc(100% - 4px);
  left: 50%;
  transform: translateX(-50%);
  font-size: 12px;
  color: rgba(0, 0, 0, 0.42);
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--t-micro) ease;
}
.food:hover::after { opacity: 1; }
.craft2-principle {
  position: absolute;
  top: 645px;
  left: var(--ax);
  transform: translateX(-50%);
  font-size: 20px;
  color: #404040;
  white-space: nowrap;
}

/* ============================================================
   06 · results — three numbers, three lessons, two doors out
   ============================================================ */
.metric-grid {
  position: absolute;
  top: 165px;
  left: var(--ax);
  transform: translateX(-50%);
  display: flex;
  gap: 18px;
}
.metric-card {
  width: 250px;
  height: 170px;
  padding: 24px 24px;
  background: rgba(233, 233, 233, 0.23);
  border: 2px solid #eeeded;
  border-radius: 31px;
  box-shadow: 0 4px 4px rgba(0, 0, 0, 0.25);
  transition: transform var(--t-lift) var(--ease-lift),
              border-color var(--t-micro) ease, box-shadow var(--t-micro) ease,
              opacity var(--t-fade) ease calc(var(--n) * 0.09s),
              translate var(--t-rise) var(--ease-rise) calc(var(--n) * 0.09s);
}
.metric-num {
  font-size: 28px;
  color: var(--pp-red);
}
.metric-label {
  margin-top: 10px;
  font-size: 14px;
  line-height: 20px;
  color: #5e5e5e;
}
.learned {
  position: absolute;
  top: 375px;
  left: var(--ax);
  transform: translateX(-50%);
  width: 660px;
  font-size: 17px;
  line-height: 26px;
  color: #5e5e5e;
}
.learned p + p { margin-top: 10px; }
.learned-label {
  font-size: 16px;
  color: rgba(0, 0, 0, 0.42);
  margin-bottom: 12px;
}
.learned strong {
  font-weight: 400;
  color: #404040;
}
.case-outro {
  position: absolute;
  top: 660px;
  left: var(--ax);
  transform: translateX(-50%);
  display: flex;
  gap: 46px;
  white-space: nowrap;
}
.case-link {
  font-size: 16px;
  color: #5e5e5e;
  text-decoration: none;
  transition: color var(--t-micro) ease;
}
.case-link:hover, .case-link:focus-visible { color: var(--pp-red); }

/* the notebook's last word: a small tomato and a wish, pinned to the
   bottom of the final page */
.bon {
  position: absolute;
  bottom: 26px;
  left: var(--ax);
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}
.bon svg {
  width: 40px;
  height: 40px;
  rotate: -6deg;
}
.bon span {
  font-size: 13.25px;
  color: rgba(0, 0, 0, 0.42);
  opacity: 0;
  transition: opacity 0.6s ease 1.6s;
}
.case-slide.revealed .bon span { opacity: 1; }

/* ============================================================
   MOBILE (≤700px) — the chapter deck unrolls into one flowing
   scroll: sidebar chrome retired, every slide becomes a stacked,
   centred column at natural height. The desktop geometry above
   is untouched. js/pantry.js swaps wheel-paging for a viewport
   observer under the same breakpoint.
   ============================================================ */
@media (max-width: 700px) {
  .case-stage {
    height: auto;
    min-height: 100dvh;
    overflow: visible;
  }
  .case-divider, .case-thread, .case-menu { display: none; }
  .case-scroll {
    position: static;
    inset: auto;
    display: block;
    overflow: visible;
  }
  .case-slide {
    height: auto;
    padding: 30px 20px 42px;
    --ax: 50%;
  }
  .case-slide:first-of-type { padding-top: 54px; }  /* no top nav on mobile now (bar is at the foot) */
  /* pantry.js appends this: a slim reading-progress line at the very top,
     the brand yellow→coral→blue sweep filling as you read the six chapters */
  .read-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    z-index: 45;
    transform: scaleX(var(--rp, 0));
    transform-origin: left;
    background: linear-gradient(90deg,
      var(--pp-yellow), var(--pp-coral) 55%, var(--pp-blue));
    pointer-events: none;
  }
  /* the last chapter clears the site-nav bottom bar (styles.css) */
  .case-slide:last-of-type { padding-bottom: 116px; }

  .case-title {
    position: static;
    transform: none;
    justify-content: center;
    flex-wrap: wrap;
    white-space: normal;
    row-gap: 0;
    margin-bottom: 20px;
    text-align: center;
  }
  .case-title :is(h1, h2) { font-size: 22px; }
  .case-title p { font-size: 16px; }
  .case-num { font-size: 12px; }
  .scroll-hint { display: none; }

  /* 01 · overview */
  .case-pitch {
    position: static;
    width: auto;
    max-width: 460px;
    margin: 0 auto;
    font-size: 17px;
    line-height: 26px;
  }
  .pitch-logo { height: 44px; margin: 0 auto 18px; }
  .headline-metric { white-space: normal; text-align: center; }
  .case-hero {
    position: static;
    width: 210px;
    height: 420px;
    margin: 26px auto 0;
  }

  /* 02 · problem */
  .prob-grid {
    position: static;
    transform: none;
    flex-direction: column;
    align-items: center;
    gap: 16px;
  }
  .prob-card, .craft2-card {
    width: min(420px, 100%);
    height: auto;
    padding: 22px 24px 24px;
  }
  .built-for {
    position: static;
    transform: none;
    flex-wrap: wrap;
    justify-content: center;
    white-space: normal;
    margin-top: 24px;
  }
  .hmw {
    position: static;
    transform: none;
    white-space: normal;
    margin-top: 28px;
  }
  .hmw-q { font-size: 19px; line-height: 27px; }

  /* 03 · solution — the walkthrough stacks: chips, phone, caption */
  .flow-steps {
    position: relative;              /* keeps the gliding chip's geometry */
    top: auto;
    left: auto;
    width: auto;
    max-width: 400px;
    margin: 0 auto;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    gap: 4px;
  }
  .step-item { font-size: 14px; padding: 5px 10px; gap: 6px; }
  .step-n { font-size: 11px; }
  .flow-glass { border-radius: 14px; }
  .flow-phone {
    position: relative;              /* contains the absolute crossfade imgs
                                        (static would let inset:0 escape to
                                        the slide and blow the phone up) */
    top: auto;                       /* drop the desktop 145px shift, else the
                                        phone rides down over the caption */
    left: auto;
    width: 210px;
    height: 418px;
    margin: 18px auto 0;
  }
  .flow-copy {
    position: relative;              /* the captions crossfade inside */
    top: auto;
    left: auto;
    width: auto;
    max-width: 340px;
    height: 150px;
    margin: 14px auto 0;
    text-align: center;
  }
  .flow-cap { top: 44%; }
  .flow-cap h3 { font-size: 17px; }
  .flow-cap p { font-size: 15px; line-height: 22px; }
  .flow-hint { font-size: 12px; }

  /* 04 · process */
  .wire-grid {
    position: static;
    transform: none;
    flex-direction: column;
    align-items: center;
    gap: 16px;
  }
  .wire-card {
    width: min(320px, 100%);
    height: auto;
  }
  .wire-shot { height: auto; }
  .wire-shot img { max-height: 300px; }

  /* 05 · craft */
  .craft2-grid {
    position: static;
    transform: none;
    flex-direction: column;
    align-items: center;
    gap: 16px;
  }
  .craft2-principle {
    position: static;
    transform: none;
    white-space: normal;
    text-align: center;
    max-width: 340px;
    margin: 24px auto 0;
    font-size: 17px;
    line-height: 26px;
  }

  /* 06 · results */
  .metric-grid {
    position: static;
    transform: none;
    flex-direction: column;
    align-items: center;
    gap: 14px;
  }
  .metric-card { width: min(300px, 100%); height: auto; }
  .learned {
    position: static;
    transform: none;
    width: auto;
    max-width: 460px;
    margin: 26px auto 0;
    font-size: 16px;
    line-height: 24px;
  }
  .case-outro {
    position: static;
    transform: none;
    justify-content: center;
    margin-top: 28px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .case-scroll { scroll-behavior: auto; }
  .case-title, .case-pitch, .case-hero, .built-for, .hmw,
  .prob-card, .wire-card, .craft2-card, .metric-card,
  .flow-steps, .flow-phone, .flow-copy,
  .craft2-principle, .learned, .case-outro {
    transition: opacity 0.25s ease;
    translate: none;
  }
  .case-divider { transition: none; transform: none; }
  .case-thread { transition: opacity 0.25s ease; }
  .menu-item { transition: color var(--t-micro) ease; }
  .case-stage:not(.revealed) .menu-item { opacity: 1; translate: none; }
  .menu-glass.is-ready { transition: opacity 0.25s ease; }
  .flow-glass.is-ready { transition: none; }
  .menu-item:hover svg :is(path, rect, circle),
  .menu-item:focus-visible svg :is(path, rect, circle) { animation: none; }
  .scroll-hint { transition: opacity 0.25s ease; }
  .scroll-hint svg { animation: none; }
  .stroke { transition: none; stroke-dashoffset: 0; }
  .guide { transition: none; opacity: 1; }
  .arc { transition: none; stroke-dasharray: 0.35 0.65; }
  .check { transition: none; stroke-dashoffset: 0; }
  .illo-num, .illo-sub { transition: none; opacity: 1; }
  .prob-card:hover svg :is(.stroke, .guide, .arc, .check) { animation: none; }
  .food img { animation: none; }
  .case-pitch strong, .learned strong, .craft2-principle strong,
  .hmw strong {
    transition: none;
    background-size: 100% 0.58em;
  }
  .swatch-dot { transition: none; background: var(--c); border-color: transparent; }
  .swatch:hover .swatch-dot { transform: none; }
  .case-slide.revealed .case-hero { animation: none; }
  .flow-phone:hover { transform: none; }
  .prob-card:hover, .craft2-card:hover, .wire-card:hover,
  .metric-card:hover { transform: none; }
}
