/* ---------------------------------------------------------------
   The ARO card, rebuilt as a real component.

   One component, two jobs, which is the thesis of the case study:
   the offer card nests inside a restaurant card, and stands alone.
   Values come from the Figma spec (16 padding, 12 radius, 264x107
   offer card, 132 rail) rather than being eyeballed.

   Sized in cqw against a 393px phone column so it scales as one
   piece, the way the card does on a real device.
   --------------------------------------------------------------- */
.phone {
  container-type: inline-size;
  width: 100%;
  max-width: 393px;
  margin-inline: auto;
  /* 1px at a 393px-wide container. Lives here so any card inside scales,
     whether it is nested or standing alone. */
  --u: 0.2545cqw;
}

/* --- Restaurant card: the container ------------------------------ */
.rcard p, .ocard p { margin: 0; }

/* Corner tokens. Corners nest, so the outer radius is the inner radius plus
   the gap between the two: that keeps the curves concentric. */
.rcard, .ocard {
  --r-offer: calc(7 * var(--u));
  --gap-rail: calc(12 * var(--u));
  --r-outer: calc(var(--r-offer) + var(--gap-rail));
}

.rcard {
  border-radius: var(--r-outer);
  overflow: hidden;
  background: #050c4d;
  color: #fff;
  font-family: "Noto Sans", var(--font-sans);
}

.rcard__head {
  position: relative;
  padding: calc(16 * var(--u));
  isolation: isolate;
}
.rcard__head img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: -2;
}
/* The scrim is what makes white text legible over any venue photo. */
.rcard__head::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  backdrop-filter: blur(calc(7 * var(--u)));
  background: linear-gradient(268.8deg,
    rgba(0,0,0,0.18) 29%, rgba(0,0,0,0.45) 52%, rgba(0,0,0,0.88) 102%);
}

.rcard .rcard__name {
  margin: 0;
  font-size: calc(18 * var(--u));
  line-height: calc(24 * var(--u));
  font-weight: 600;
}
.rcard .rcard__meta {
  margin: calc(4 * var(--u)) 0 0;
  font-size: max(12px, calc(14 * var(--u)));
  line-height: calc(20 * var(--u));
}
.rcard .rcard__count {
  margin: calc(12 * var(--u)) 0 0;
  font-size: max(12px, calc(14 * var(--u)));
  line-height: calc(20 * var(--u));
  font-weight: 600;
}

/* --- The offer rail ---------------------------------------------- */
/* Horizontal inside a vertical list: the axes differ, so the two
   scrolls don't compete. This is rule one, working. */
.rcard__rail {
  display: flex;
  gap: var(--gap-rail);
  padding: var(--gap-rail);
  background: #000;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  /* Without this the snap eats the rail's left padding and the first card
     sits flush against the card border. */
  scroll-padding-left: var(--gap-rail);
  scrollbar-width: none;
  overscroll-behavior-x: contain;
}
.rcard__rail::-webkit-scrollbar { display: none; }

/* Exactly one offer: nothing to scroll, so no scroll is offered. */
.rcard--single .rcard__rail {
  overflow-x: visible;
  scroll-snap-type: none;
}
/* No offers: the rail collapses and the restaurant is all that is left. */
.rcard--empty .rcard__rail { display: none; }

/* --- Offer card: the unit ---------------------------------------- */
.ocard[hidden], .rcard__rail[hidden] { display: none !important; }

.ocard {
  display: flex;
  flex: 0 0 calc(264 * var(--u));
  width: calc(264 * var(--u));
  height: calc(110 * var(--u));
  overflow: hidden;
  background: #fff;
  border: 1px solid #e8e8e8;
  border-radius: var(--r-offer);
  scroll-snap-align: start;
  text-align: left;
}
.ocard__thumb {
  position: relative;
  flex: 0 0 calc(80 * var(--u));
  overflow: hidden;
}
.ocard__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* The offer card clips the photo with its own curve. A radius here (the
     figure styles add one to every image) would give the thumbnail a second,
     different corner. */
  border-radius: 0;
}
.ocard__thumb::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(153deg, rgba(18,18,18,0) 34%, rgba(18,18,18,0.8) 67%);
}
.ocard__body {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: calc(4 * var(--u));
  padding: calc(10 * var(--u)) calc(8 * var(--u)) calc(8 * var(--u));
  min-width: 0;
}
.ocard .ocard__title {
  margin: 0;
  font-size: calc(18 * var(--u));
  line-height: calc(24 * var(--u));
  font-weight: 600;
  color: #121212;
}

/* The time pill. Its gradient encodes the offer type: warm for a
   one-off event, cool for something recurring. */
.ocard .ocard__when {
  display: flex;
  align-items: center;
  gap: calc(4 * var(--u));
  align-self: flex-start;
  height: calc(24 * var(--u));
  padding-inline: calc(8 * var(--u)) calc(10 * var(--u));
  border-radius: calc(12 * var(--u));
  font-size: max(12px, calc(12 * var(--u)));
  line-height: calc(16 * var(--u));
  color: #000;
  white-space: nowrap;
  background: linear-gradient(90deg, var(--pill-a), var(--pill-b));
}
.ocard__when img { width: calc(16 * var(--u)); height: auto; }
.ocard__when--event     { --pill-a: #ffe8ae; --pill-b: #ffa658; }
.ocard__when--recurring { --pill-a: #f2f4ff; --pill-b: #b5beea; }

.ocard .ocard__desc {
  margin: 0;
  font-size: max(12px, calc(13 * var(--u)));
  line-height: calc(18 * var(--u));
  color: #464343;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* --- The three rules, as one card you change ---------------------- */
/* Showing the same card three times would repeat the thing the case
   study argues against. One card whose offer count you change makes
   the rule the reader's own observation. */
.ruledemo {
  display: grid;
  grid-template-columns: minmax(0, 340px) minmax(0, 1fr);
  gap: var(--space-2xl);
  align-items: start;
  margin-top: var(--space-xl);
}
@media (max-width: 760px) {
  .ruledemo { grid-template-columns: 1fr; gap: var(--space-lg); }
}

.ruledemo__controls { margin-bottom: var(--space-md); }
.ruledemo .ruledemo__hint {
  margin-top: var(--space-sm);
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.rule-copy { display: grid; gap: var(--space-lg); }
.rule-copy__item p {
  font-size: 17px;
  line-height: 1.75;
}
/* With JS on, only the selected rule is shown; the control already names
   it, so the copy carries no heading of its own. Without JS all three
   stay readable. */
.js .rule-copy__item { display: none; }
.js .rule-copy__item.is-active { display: block; }

/* --- Old / new screen toggle -------------------------------------- */
.swap { margin-top: var(--space-xl); }

.segmented {
  display: inline-flex;
  padding: 3px;
  background: rgba(30, 30, 30, 0.06);
  border-radius: var(--radius-pill);
}
.segmented button {
  padding: 7px 18px;
  border-radius: var(--radius-pill);
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-muted);
  transition: background 220ms var(--ease), color 220ms var(--ease);
}
.segmented button[aria-pressed="true"] {
  background: var(--ink);
  color: #fff;
}

.swap__stage {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-xl);
  max-width: 660px;
  margin-top: var(--space-lg);
}
@media (max-width: 620px) {
  .swap__stage { grid-template-columns: 1fr; max-width: 320px; margin-inline: auto; }
}

.screen { container-type: inline-size; }
.screen__label {
  margin-bottom: var(--space-xs);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-muted);
}
.screen__frame {
  position: relative;
  aspect-ratio: 393 / 852;
  overflow: hidden;
  border-radius: 6cqw;
  border: 2px solid var(--ink);
  background: #000;
}
.screen__frame img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* Both versions stack; only the selected one is shown. */
  opacity: 0;
  transition: opacity 260ms var(--ease);
}
.screen__frame img.is-shown { opacity: 1; }

/* Numbered callouts, so the eye lands on the tile rather than
   wandering across two whole screens. */
.callout {
  position: absolute;
  z-index: 2;
  display: grid;
  place-items: center;
  width: max(22px, 7cqw);
  height: max(22px, 7cqw);
  margin: calc(max(22px, 7cqw) / -2) 0 0 calc(max(22px, 7cqw) / -2);
  border-radius: 50%;
  background: var(--ink);
  color: #fff;
  font-family: var(--font-sans);
  font-size: max(12px, 3.4cqw);
  font-weight: 600;
  box-shadow: 0 0 0 0.8cqw rgba(255, 255, 255, 0.85);
  opacity: 0;
  transition: opacity 220ms var(--ease);
}
.callout.is-shown { opacity: 1; }
/* A soft ring drawing attention to the region, not just the number. */
.callout::after {
  content: "";
  position: absolute;
  inset: -2.2cqw;
  border: 0.6cqw solid var(--ink);
  border-radius: 50%;
  opacity: 0.22;
}

.legend {
  display: grid;
  gap: var(--space-xs);
  margin-top: var(--space-lg);
  padding-top: var(--space-md);
  border-top: 1px solid var(--rule);
  max-width: 660px;
}
.legend li {
  display: grid;
  grid-template-columns: 24px 1fr;
  gap: var(--space-sm);
  font-size: 14px;
  line-height: 1.55;
}
.legend b {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--ink);
  color: #fff;
  font-family: var(--font-sans);
  font-size: 12px;
}
.legend[hidden] { display: none; }

/* --- Token annotations on the real card --------------------------- */
.anno {
  container-type: inline-size;
  position: relative;
  margin-top: var(--space-xl);
  padding: var(--space-xl);
  background: #fff;
  border: 2px solid var(--ink);
  border-radius: var(--radius-lg);
}
.anno__grid {
  display: grid;
  grid-template-columns: 1fr minmax(0, 300px) 1fr;
  gap: 2cqw;
  align-items: center;
}
@media (max-width: 760px) {
  .anno__grid { grid-template-columns: 1fr; }
  .anno__col { order: 2; }
}

.anno__col { display: grid; gap: 1.6cqw; }
.anno__col--l { justify-items: end; text-align: right; }

/* Token callouts, in the annotation style from the Figma reference:
   one blue, a leader line to the thing it names, the value beside it.
   Positioned on a 820x460 canvas and sized in cqw so the whole figure
   scales as one piece. */
.tokfig {
  container-type: inline-size;
  position: relative;
  aspect-ratio: 820 / 430;
  width: 100%;
  max-width: 700px;
  margin-inline: auto;
  margin-top: var(--space-xl);
  background: #fff;
  border-radius: var(--radius-lg);
}
.tokfig__card {
  position: absolute;
  left: 28%;
  top: 34%;
  width: 48%;
  --u: 0.1818cqw;          /* 264 design px across 48% of 820 */
}

.tokmark {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 1cqw;
  font-family: var(--font-sans);
  font-size: 1.75cqw;
  white-space: nowrap;
}
.tokmark b {
  padding: 0.5cqw 1.1cqw;
  border-radius: 999px;
  background: #e8103c;
  color: #fff;
  font-weight: 500;
}
.tokmark i { font-style: normal; color: var(--ink); }

/* The leader line. Direction decides which side it leaves from. */
.tokmark::after {
  content: "";
  position: absolute;
  background: #e8a3b2;
}
.tokmark--l::after { left: 100%; top: 50%; height: 1px; width: var(--len); margin-left: 0.6cqw; }
.tokmark--r::after { right: 100%; top: 50%; height: 1px; width: var(--len); margin-right: 0.6cqw; }
.tokmark--below::after { left: 50%; top: 100%; width: 1px; height: var(--len); margin-top: 0.6cqw; }
.tokmark--above::after { left: 50%; bottom: 100%; width: 1px; height: var(--len); margin-bottom: 0.6cqw; }

@media (max-width: 680px) {
  /* Too tight for leader lines; fall back to the card plus a plain list. */
  .tokfig { aspect-ratio: auto; padding: var(--space-lg); }
  .tokfig__card { position: static; width: 100%; max-width: 300px; margin-inline: auto; --u: 1.05px; }
  .tokmark { position: static; margin-top: var(--space-sm); font-size: 13px; gap: 8px; }
  .tokmark::after { display: none; }
  .tokmark b { padding: 4px 10px; }
}

.anno__note {
  margin-top: var(--space-lg);
  padding-top: var(--space-md);
  border-top: 1px solid var(--rule);
  font-size: 14px;
  line-height: 1.6;
  color: var(--ink-muted);
}

/* The annotated card needs its own unit, since it sits outside a phone. */
.anno__card { --u: 1.15px; }
@media (max-width: 760px) { .anno__card { --u: 0.95px; } }

/* Leader lines running from each label toward the card. */
.tok { position: relative; }
.anno__col--l .tok::after,
.anno__col--r .tok::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 1.6cqw;
  height: 1px;
  background: var(--ink-subtle);
}
.anno__col--l .tok::after { left: 100%; }
.anno__col--r .tok::after { right: 100%; }
@media (max-width: 760px) {
  .anno__col--l .tok::after, .anno__col--r .tok::after { display: none; }
  .anno__col--l { justify-items: start; text-align: left; }
}

/* Contrast badge, the same idea as the Mamut figure. */
.anno__badge {
  display: inline-flex;
  flex-direction: column;
  gap: 2px;
  margin-top: var(--space-lg);
  padding: 10px 14px;
  border: 2px solid #1b7a3f;
  border-radius: var(--radius-lg);
  background: #fff;
}
.anno__badge span {
  font-family: var(--font-sans);
  font-size: 12px;
  line-height: 1.4;
  color: var(--ink-muted);
}
.anno__badge b {
  font-family: var(--font-sans);
  font-size: 26px;
  font-weight: 600;
  color: #1b7a3f;
}

/* --- Spec browser -------------------------------------------------- */
/* The specification as something you open rather than read: pick a
   category on the left, the card on the right becomes that thing. */
.spec-browser {
  display: grid;
  grid-template-columns: minmax(0, 320px) minmax(0, 1fr);
  gap: var(--space-2xl);
  align-items: start;
  margin-top: var(--space-xl);
  padding: var(--space-xl);
  background: #fff;
  border-radius: var(--radius-lg);
}
@media (max-width: 800px) {
  .spec-browser { grid-template-columns: 1fr; gap: var(--space-lg); padding: var(--space-lg); }
  /* Stacked: the component comes first, the controls that change it below. */
  .spec-stage { order: -1; }
}

.spec-item { border-bottom: 1px solid rgba(30, 30, 30, 0.18); }
.spec-item:first-child { border-top: 1px solid rgba(30, 30, 30, 0.18); }

.spec-item__trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
  width: 100%;
  padding: var(--space-md) 0;
  font-family: var(--font-sans);
  font-size: 20px;
  font-weight: 600;
  text-align: left;
}
.spec-item__trigger::after {
  content: "";
  width: 9px; height: 9px;
  border-right: 2px solid var(--ink);
  border-bottom: 2px solid var(--ink);
  transform: rotate(45deg);
  transition: transform 260ms var(--ease);
  flex-shrink: 0;
}
.spec-item__trigger[aria-expanded="true"]::after { transform: rotate(-135deg); }

.spec-item__panel {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 320ms var(--ease);
}
.spec-item__trigger[aria-expanded="true"] + .spec-item__panel { grid-template-rows: 1fr; }
.spec-item__panel > div { overflow: hidden; }
.spec-item__panel p {
  padding-bottom: var(--space-sm);
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink-muted);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding-bottom: var(--space-md);
}
.chips button {
  padding: 5px 12px;
  border: 1px solid rgba(30, 30, 30, 0.25);
  border-radius: var(--radius-pill);
  background: #fff;
  font-family: var(--font-sans);
  font-size: 13px;
  color: var(--ink-muted);
  transition: background 200ms var(--ease), color 200ms var(--ease),
              border-color 200ms var(--ease);
}
.chips button[aria-pressed="true"] {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}

/* The stage keeps one height so switching categories doesn't jump. */
.spec-stage {
  display: grid;
  place-items: center;
  min-height: 380px;
  padding: var(--space-xl);
}
/* Each view centres its own content so the card and its caption line up.
   The [hidden] guard must outrank the display declaration. */
.spec-view[hidden] { display: none !important; }
.spec-view {
  display: grid;
  justify-items: center;
  width: 100%;
}
.spec-stage .spec-stage__cap {
  margin-top: var(--space-md);
  font-size: 13px;
  line-height: 1.5;
  text-align: center;
  color: var(--ink-muted);
}

/* Labels naming which component you are looking at. */
.tag {
  display: inline-block;
  margin-bottom: 6px;
  padding: 3px 9px;
  border-radius: var(--radius-pill);
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.tag--container { background: rgba(206, 177, 235, 0.35); color: #5d3a7e; }
.tag--unit      { background: rgba(177, 209, 235, 0.4);  color: #2c5f8c; }

/* --- Offer card states -------------------------------------------- */
.ocard { position: relative; transition: transform 160ms var(--ease), box-shadow 160ms var(--ease); }

.ocard--pressed { transform: scale(0.975); }
.ocard--pressed::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.06);
  border-radius: inherit;
  pointer-events: none;
}

.ocard .ocard__save {
  position: absolute;
  top: calc(8 * var(--u));
  left: calc(8 * var(--u));
  width: calc(22 * var(--u));
  height: calc(22 * var(--u));
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.35);
  color: #fff;
  font-size: max(12px, calc(12 * var(--u)));
  line-height: 1;
}
.ocard--saved .ocard__save { background: #e8103c; }

/* Loading: the shape arrives before the content, so nothing reflows. */
.ocard--loading .ocard__thumb img { visibility: hidden; }
.ocard--loading .ocard__body > * { color: transparent; }
.ocard--loading .ocard__when img { visibility: hidden; }
.ocard--loading .ocard__thumb,
.ocard--loading .ocard__body > * {
  position: relative;
  border-radius: calc(4 * var(--u));
  background: linear-gradient(90deg, #ececec 25%, #f6f6f6 37%, #ececec 63%);
  background-size: 400% 100%;
  animation: shimmer 1.4s linear infinite;
}
.ocard--loading .ocard__thumb::after { display: none; }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }
@media (prefers-reduced-motion: reduce) {
  .ocard--loading .ocard__thumb,
  .ocard--loading .ocard__body > * { animation: none; }
}

/* Unclaimed: the restaurant exists, nobody is maintaining it. */
.rcard .rcard__unclaimed {
  display: flex;
  align-items: center;
  gap: calc(6 * var(--u));
  padding: calc(10 * var(--u)) calc(16 * var(--u));
  background: #1b1b1b;
  color: rgba(255, 255, 255, 0.68);
  font-size: max(12px, calc(12 * var(--u)));
  line-height: calc(16 * var(--u));
}
.rcard__unclaimed b {
  flex-shrink: 0;
  width: calc(14 * var(--u));
  height: calc(14 * var(--u));
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid currentColor;
  font-size: calc(9 * var(--u));
  font-weight: 600;
}

/* Token list under the card in the spec browser's Tokens view. */
.tokgrid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px;
  margin-top: var(--space-lg);
  width: 100%;
}
.tokgrid .tok { align-items: flex-start; }
.tokgrid .tok::after { display: none; }

/* The stage centres its content, so the phone needs an explicit width
   or it collapses to the card's intrinsic size. */
.spec-view .phone { width: 100%; max-width: 330px; }
.spec-view { width: 100%; }
.spec-view .anno__card { display: grid; place-items: center; }

/* The old-feed screenshot is a tall phone column; cap it so it does not
   dominate the page. */
.feed-shot {
  max-width: 340px;
  margin-inline: auto;
  border-radius: var(--radius-lg);
}

/* Tokens need the full column: an annotation figure with side labels is
   illegible inside the browser's narrow stage. */
.spec-aside {
  margin-top: var(--space-2xl);
  font-family: var(--font-sans);
  font-size: 20px;
  font-weight: 600;
}
.spec-aside__intro {
  margin-top: 4px;
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink-muted);
}

/* ---------------------------------------------------------------
   Presentation pass: the artefacts carry the craft argument, so they
   sit centred in the column rather than hugging its left edge.
   --------------------------------------------------------------- */
.hero-card { display: grid; justify-items: center; }
/* Breathing room before the first body section that follows the hero card. */
.hero-card + .case-section { margin-top: var(--space-3xl); }
.hero-card .phone { max-width: 360px; }
.hero-card figcaption { max-width: 420px; text-align: center; }

/* justify-items: center makes grid children size to their content, which
   collapses the query containers inside. Centre each block instead. */
.swap .segmented { display: flex; width: fit-content; margin-inline: auto; }
.swap__stage { margin-inline: auto; }
.legend { margin-inline: auto; }

.ruledemo { align-items: center; }
.ruledemo .ruledemo__controls { width: fit-content; margin-inline: auto; }
.ruledemo .phone { margin-inline: auto; }
.ruledemo .ruledemo__hint { text-align: center; }

/* The spec stage had more room under the card than above it. */
.spec-stage { padding-block: var(--space-2xl); align-content: center; }
.spec-view { align-content: center; }

/* Purposeful motion on the component instead of on the prose: the offer
   card answers the pointer the way it does on a phone. */
.rcard__rail .ocard { transition: transform 180ms var(--ease), box-shadow 180ms var(--ease); }
@media (hover: hover) {
  .rcard__rail .ocard:hover {
    transform: translateY(calc(-2 * var(--u)));
    box-shadow: 0 calc(6 * var(--u)) calc(14 * var(--u)) rgba(0, 0, 0, 0.28);
  }
}
.rcard__rail .ocard:active { transform: scale(0.985); }
@media (prefers-reduced-motion: reduce) {
  .rcard__rail .ocard { transition: none; }
}

/* --- Explorations --------------------------------------------------
   The directions tried, what each optimised for, and why it lost. The
   "why it lost" line is the reason the section exists.
   ------------------------------------------------------------------- */
.explorations {
  display: grid;
  gap: var(--space-3xl);
  margin-top: var(--space-xl);
}
/* One direction per row: artefact on the left, the reasoning beside it,
   so the 17px text keeps a comfortable line length. */
.exploration {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  column-gap: var(--space-xl);
  align-items: start;
}
.exploration > * { grid-column: 2; }
.exploration > .exploration__frame { grid-column: 1; grid-row: 1 / span 4; }
.exploration__n { margin-bottom: 4px; }
@media (max-width: 760px) {
  .exploration { display: flex; flex-direction: column; gap: var(--space-sm); }
}
/* The artefacts are very different shapes, so show each at its own
   proportions, centred, with no frame behind it. */
.exploration__frame {
  display: flex;
  align-items: center;
  justify-content: center;
}
.exploration__frame img {
  display: block;
  max-width: 100%;
  max-height: 420px;
  width: auto;
  height: auto;
  border-radius: var(--radius-lg);
}
/* Type follows the rest of the case study: 17px body, 14px labels,
   and the h3 size used elsewhere. Nothing below 14px. */
.exploration__n {
  font-size: 14px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink-muted);
}
.exploration__title { font-size: 20px; line-height: 1.35; }
.exploration dl { margin: 0; font-size: 17px; line-height: 1.7; }
.exploration dt {
  margin-top: var(--space-sm);
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink-muted);
}
.exploration dd { margin: 2px 0 0; }
.exploration--chosen .exploration__frame img { box-shadow: 0 0 0 4px var(--tint); }
.exploration__badge {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 10px;
  border-radius: var(--radius-pill);
  background: var(--ink);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* --- The repetition, shown rather than described -------------------
   Two columns at the same scale: the feed as built, with the repeated
   restaurant marked, beside the same content grouped into one card.
   ------------------------------------------------------------------- */
/* One slot, toggled. Side by side meant two phone-width columns, which
   is cramped on a phone, and this is a phone card. */
.swap--feed { margin-top: var(--space-xl); }
.swap__one {
  position: relative;
  max-width: 340px;
  margin: var(--space-lg) auto 0;
}
.feed-ver { display: none; }
.feed-ver.is-shown { display: block; }
.feed-ver .repeat__note { text-align: center; }

.repeat__label {
  margin-bottom: var(--space-xs);
  font-family: var(--font-sans);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-muted);
}
.repeat__shot { position: relative; container-type: inline-size; }
.repeat__shot img {
  width: 100%;
  height: auto;
  border-radius: var(--radius-lg);
  border: 2px solid var(--ink);
}

/* Ring the repeated restaurant name so the duplication is the first
   thing the eye finds, not a grey label you have to read twice. */
.repeat__ring {
  position: absolute;
  border: 2px solid #e8103c;
  border-radius: 999px;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.5);
}
.repeat__ring::after {
  content: attr(data-note);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 1.5cqw);
  transform: translateX(-50%);
  padding: 0.6cqw 1.8cqw;
  border-radius: 999px;
  background: #e8103c;
  color: #fff;
  font-family: var(--font-sans);
  font-size: max(12px, 2.6cqw);
  font-weight: 600;
  white-space: nowrap;
}
.repeat__ring + .repeat__ring::after { content: none; }

.repeat__note {
  margin-top: var(--space-sm);
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink-muted);
}

/* ---------------------------------------------------------------
   Mobile. This is a card for a phone, so on a phone it should render
   at something close to its real device size rather than being
   squeezed by nested padding.
   --------------------------------------------------------------- */
@media (max-width: 620px) {
  /* The browser's padding plus the stage's padding was costing ~100px,
     which took the offer card down to 152. */
  .spec-browser { padding: var(--space-md) var(--space-sm) var(--space-lg); }
  .spec-stage { padding: var(--space-lg) 0; min-height: 0; }
  .spec-view .phone { max-width: none; }

  /* Give the card the full column: a 393px component shown at 226px
     stops being a fair representation of the craft. */
  .hero-card .phone,
  .ruledemo .phone { max-width: none; }

  .tokfig { padding: var(--space-md); }
  .tokfig__card { max-width: none; }

  /* The feed comparison takes the full column on a phone. */
  .swap__one { max-width: none; }

  /* Explorations read one per row, so let each artefact breathe. */
}

/* Touch: the rail is the interaction, so keep the browser from
   hijacking the horizontal drag into a page swipe. */
.rcard__rail { touch-action: pan-x; }

/* Screen images: no stroke, one radius, one soft shadow. The doubled
   selectors are there to win over the older border rules above. */
.screen-shot,
.screen__frame.screen-shot,
.repeat__shot img.screen-shot {
  border: 0;
  border-radius: 24px;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.08), 0 2px 6px rgba(0, 0, 0, 0.06), 0 12px 32px rgba(0, 0, 0, 0.10);
}

/* The old screenshots were exported with a white margin and a faint phone
   outline around them. The files stay as they are; the frame shows only
   the screen inside. Insets in source pixels, from a 786 x 1704 export:
   restaurant 15 left and right, 15 top, 23 bottom; offer 6, 15, 23. */
.screen__frame img[src$="old-restaurant.jpg"] {
  inset: auto;
  left: -1.984%;
  top: -0.9%;
  width: 103.97%;
  height: 102.28%;
  max-width: none;
  object-fit: fill;
}
.screen__frame img[src$="old-offer.jpg"] {
  inset: auto;
  left: -0.775%;
  top: -0.9%;
  width: 101.55%;
  height: 102.28%;
  max-width: none;
  object-fit: fill;
}
/* The old feed screenshot has 22px of white either side (724 x 825). */
.repeat__shot img.screen-shot {
  aspect-ratio: 680 / 824;
  object-fit: cover;
}

/* The Carpaccio night card is exported with its own rounded corners and soft
   shadow on a transparent background, so it gets no extra radius that could
   clip the shadow, and no stroke. */
.exploration__frame img.exploration__card { border-radius: 0; }

/* The scrolling rail is focusable so keyboard users can scroll it with the arrow keys. */
.rcard__rail:focus-visible { outline: 3px solid var(--ink); outline-offset: -3px; border-radius: 0; }
