/* ==========================================================================
   SUPERNOVA case study (js/supernova.js). Loaded after portfolio.css and built
   on its tokens: --u, the fonts, --pf-ink, --pf-bg, the hairline rule and the
   section rhythm. Every class here starts with "sn-", so nothing in the shared
   project template is affected.
   ========================================================================== */

:root {
  --sn-gap-section: var(--pf-gap-text);          /* between the big sections */
  --sn-gap-block: calc(72 * var(--u));           /* between blocks inside a section */
  --sn-gap-title: calc(20 * var(--u));           /* label -> title -> content */
  --sn-gap-media: calc(40 * var(--u));           /* title -> media, media -> text */
  --sn-media-gap: calc(16 * var(--u));           /* between two videos in a row */
  --sn-label-size: var(--pf-filter-size);        /* small mono labels */
  --sn-title-size: calc(40 * var(--u));
  --sn-headline-size: calc(32 * var(--u));       /* hero headline */
  --sn-number-size: calc(104 * var(--u));        /* research figures */
  --sn-opportunity-size: calc(36 * var(--u));
  --sn-copy-width: var(--pf-about-width);
  --sn-secondary-width: 72%;                     /* secondary videos are smaller */
  --sn-proto-width: calc(330 * var(--u));        /* app walkthrough */
  --sn-slide-w: calc(270 * var(--u));            /* one app screen in the carousel */
  --sn-slide-gap: calc(28 * var(--u));
  --sn-nav: calc(32 * var(--u));
  --sn-dot: calc(8 * var(--u));
  --sn-bar-h: calc(14 * var(--u));
  --sn-columns-3: 3;
  --sn-columns-4: 4;
  --sn-lookbook-columns: 4;
  --sn-lookbook-gap: var(--pf-grid-gap);        /* the shared column gap */
  --sn-lead-size: var(--pf-subtitle-size);      /* lead lines: a step above body text */
  --sn-lead-line: 1.4;

  /* SUPERNOVA brand colours, sampled from the app screens (accents only) */
  --sn-blue: #0200cd;
  --sn-yellow: #ffd961;
  --sn-neutral: color-mix(in srgb, var(--pf-ink) 7%, var(--pf-bg));
}

.pf .sn-section h3,
.pf .sn-section h4,
.pf .sn-section figure {
  margin: 0;
  font-weight: inherit;
  font-size: inherit;
}

/* ---------- Shared pieces ---------- */

.sn-section {
  margin-top: var(--sn-gap-section);
}

.sn-label {
  font-family: var(--font-mono);
  font-weight: 400;
  font-size: var(--sn-label-size);
  line-height: 1.5;
  letter-spacing: 0.02em;
}

.pf .sn-label {
  font-size: var(--sn-label-size);
}

.sn-title {
  margin-top: var(--sn-gap-title);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: var(--sn-title-size);
  line-height: 1.15;
  text-wrap: balance;
}

.sn-subtitle {
  margin-top: calc(10 * var(--u));
  font-family: var(--font-body);
  font-weight: 600;
  font-size: var(--pf-goal-size);
  line-height: 1.2;
}

.pf .sn-subtitle {
  font-weight: 600;
  font-size: var(--pf-goal-size);
}

.sn-copy {
  max-width: var(--sn-copy-width);
  font-family: var(--font-body);
  font-size: var(--pf-body-size);
  line-height: var(--pf-body-line);
  text-wrap: pretty;
}

.sn-copy p + p {
  margin-top: calc(16 * var(--u));
}

.sn-title + .sn-copy {
  margin-top: var(--sn-gap-media);
}

.sn-note {
  margin-top: calc(4 * var(--u));
  font-family: var(--font-body);
  font-style: italic;
  font-size: var(--pf-caption-size);
  line-height: 1.4;
}

.sn-caption {
  margin-top: calc(11 * var(--u));
  font-family: var(--font-body);
  font-style: italic;
  font-size: var(--pf-caption-size);
  line-height: 1.35;
}

/* research source links, in the live-link style */
.sn-source {
  display: inline-flex;
  align-items: baseline;
  gap: 0.3em;
  font-family: var(--font-mono);
  font-size: var(--pf-caption-size);
  line-height: 1.5;
  transition: opacity 0.2s var(--ease);
}

.sn-source__label {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

.sn-source__arrow {
  font-size: 0.85em;
}

.sn-source:hover {
  opacity: 0.6;
}

/* ---------- Hero ---------- */

.sn-hero__headline {
  margin-top: calc(18 * var(--u));
  font-family: var(--font-body);
  font-weight: 600;
  font-size: var(--sn-headline-size);
  line-height: 1.15;
}

.sn-hero__headline + .sn-hero__subtitle {
  margin-top: calc(10 * var(--u));
  max-width: var(--sn-copy-width);
}

/* ---------- Project overview ---------- */

.sn-overview {
  margin-top: var(--pf-gap-snapshot);
}

.sn-overview .sn-copy {
  margin-top: var(--sn-gap-title);
}

.sn-overview__facts {
  margin-top: calc(28 * var(--u));
}

.sn-overview__facts dd {
  min-width: 0;
}

/* ---------- Research & opportunity ---------- */

.sn-intro {
  margin-top: var(--sn-gap-title);
}

.sn-findings {
  display: grid;
  grid-template-columns: repeat(var(--sn-columns-3), minmax(0, 1fr));
  column-gap: var(--pf-grid-gap);
  row-gap: calc(48 * var(--u));
  margin-top: var(--sn-gap-block);
}

.sn-finding {
  display: flex;
  flex-direction: column;
  padding-top: calc(22 * var(--u));
  border-top: var(--pf-rule) solid currentColor;
}

.sn-finding__number {
  font-family: var(--font-display);
  font-size: var(--sn-number-size);
  line-height: 1;
  font-kerning: normal;
  white-space: nowrap;
}

.pf .sn-finding__label {
  margin-top: calc(18 * var(--u));
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: var(--sn-label-size);
  line-height: 1.5;
}

.sn-finding__text {
  margin-top: calc(8 * var(--u));
  font-family: var(--font-body);
  font-size: var(--pf-body-size);
  line-height: var(--pf-body-line);
  text-wrap: pretty;
}

.sn-finding__sources {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: calc(4 * var(--u));
  margin-top: auto;
  padding-top: calc(16 * var(--u));
}

/* Korean baseball benchmark: a plain horizontal bar chart */
.sn-bench {
  margin-top: var(--sn-gap-block);
  padding-top: calc(22 * var(--u));
  border-top: var(--pf-rule) solid currentColor;
}

.sn-bars__axis {
  margin-top: calc(18 * var(--u));
  font-family: var(--font-mono);
  font-size: var(--pf-caption-size);
  line-height: 1.5;
}

.sn-bars__axis + .sn-bars {
  margin-top: calc(12 * var(--u));
}

.sn-bars {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr) max-content;
  column-gap: calc(24 * var(--u));
  row-gap: calc(14 * var(--u));
  align-items: center;
  max-width: calc(860 * var(--u));
  margin-top: calc(28 * var(--u));
  font-family: var(--font-body);
  font-size: var(--pf-body-size);
  line-height: 1.3;
}

.sn-bar {
  display: contents;
}

.sn-bar__track {
  display: block;
  height: var(--sn-bar-h);
}

.sn-bar__fill {
  display: block;
  height: 100%;
  background: var(--pf-ink);
}

.sn-bar__value {
  font-family: var(--font-mono);
  font-size: var(--pf-body-size);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.sn-bench__source {
  margin-top: calc(18 * var(--u));
  font-family: var(--font-mono);
  font-size: var(--pf-caption-size);
  line-height: 1.5;
}

.sn-bench .sn-copy {
  margin-top: calc(28 * var(--u));
}

/* Canadian reference: the research figure style, then short copy */
.sn-canada__figure {
  margin-top: calc(24 * var(--u));
}

.pf .sn-canada .sn-canada__copy {
  margin-top: calc(14 * var(--u));
}

.sn-canada .sn-bench__source + .sn-note {
  margin-top: calc(6 * var(--u));
}

/* one line connecting the two references */
.sn-connection {
  margin-top: calc(40 * var(--u));
}

/* design opportunity: the editorial statement */
.sn-opportunity {
  margin-top: var(--sn-gap-section);
}

.sn-opportunity__text {
  max-width: calc(940 * var(--u));
  margin-top: var(--sn-gap-title);
  font-family: var(--font-body);
  font-weight: 600;
  font-style: italic;
  font-size: var(--sn-opportunity-size);
  line-height: 1.25;
  text-wrap: balance;
}

/* ---------- Video ---------- */

.sn-video {
  min-width: 0;
}

.sn-video__frame {
  width: 100%;
  background: var(--pf-placeholder);
}

/* the box has the video's own proportions, so cover never crops */
.sn-video__media {
  background: transparent;
}

/* the play / pause button is always there (not only with reduced motion) */
.sn-video__toggle:focus-visible {
  outline: var(--pf-rule) solid var(--pf-ink);
  outline-offset: 3px;
}

/* a row of videos at one height: each one's width follows its aspect ratio
   (flex-grow is set to width / height by js/supernova.js) */
.sn-media-row {
  display: flex;
  align-items: flex-start;
  gap: var(--sn-media-gap);
}

.sn-media-row__item {
  flex: 1 1 0;
}

.sn-title + .sn-media-row {
  margin-top: var(--sn-gap-media);
}

.sn-media-row + .sn-copy {
  margin-top: var(--sn-gap-media);
}

.sn-media-row--secondary {
  width: var(--sn-secondary-width);
  margin-top: var(--sn-gap-block);
}

/* ---------- Digital product ---------- */

.sn-product {
  display: grid;
  grid-template-columns: var(--sn-proto-width) minmax(0, 1fr);
  column-gap: calc(64 * var(--u));
  align-items: center;
  margin-top: var(--sn-gap-media);
}

/* engagement ecosystem: four inputs -> three steps -> two rewards */
.sn-eco {
  margin-top: var(--sn-gap-block);
  font-family: var(--font-body);
}

.sn-eco__inputs,
.sn-eco__rewards {
  display: grid;
  grid-template-columns: repeat(var(--sn-columns-4), minmax(0, 1fr));
  column-gap: var(--pf-grid-gap);
  row-gap: calc(20 * var(--u));
  margin-top: calc(20 * var(--u));
}

.sn-eco__rewards {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 0;
}

.sn-eco__input,
.sn-eco__reward {
  padding-top: calc(14 * var(--u));
  border-top: var(--pf-rule) solid currentColor;
}

.sn-eco__name {
  display: block;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: var(--pf-meta-size);
  line-height: 1.3;
}

.sn-eco__text {
  display: block;
  margin-top: calc(6 * var(--u));
  font-size: var(--pf-body-size);
  line-height: var(--pf-body-line);
}

.sn-eco__reward {
  font-weight: 600;
  font-size: var(--pf-meta-size);
  line-height: 1.3;
}

.sn-eco__arrow {
  display: block;
  margin: calc(18 * var(--u)) 0;
  font-family: var(--font-mono);
  font-size: var(--pf-meta-size);
  line-height: 1;
}

/* the three steps: outlined pills joined by arrows, like the logic map */
.sn-eco__steps {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  row-gap: calc(12 * var(--u));
}

.sn-eco__step {
  display: inline-flex;
  align-items: center;
  min-height: var(--lm-pill-h);
  padding: 0 var(--lm-pill-pad);
  border: var(--pf-rule) solid currentColor;
  border-radius: 999px;
  font-size: var(--lm-size);
  line-height: 1.2;
  white-space: nowrap;
}

.sn-eco__step:last-child {
  border-color: var(--pf-ink);
  background: var(--pf-ink);
  color: var(--pf-bg);
}

/* the arrow between two steps sits in the gap before the second one */
.sn-eco__step + .sn-eco__step {
  position: relative;
  margin-left: calc(48 * var(--u));
}

.sn-eco__step + .sn-eco__step::before {
  content: "\2192";
  position: absolute;
  right: 100%;
  width: calc(48 * var(--u));
  color: var(--pf-ink);
  font-family: var(--font-mono);
  text-align: center;
}

.sn-eco__note {
  max-width: var(--sn-copy-width);
  margin-top: calc(24 * var(--u));
  font-style: italic;
  font-size: var(--pf-body-size);
  line-height: var(--pf-body-line);
}

/* ---------- Mobile UI carousel ---------- */

.sn-showcase {
  margin-top: var(--sn-gap-block);
}

.sn-carousel {
  margin-top: calc(24 * var(--u));
}

.sn-carousel__viewport {
  position: relative;          /* the slides' offsetLeft is measured from here */
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}

.sn-carousel__viewport::-webkit-scrollbar {
  display: none;
}

.sn-carousel__viewport:focus-visible {
  outline: var(--pf-rule) solid currentColor;
  outline-offset: 4px;
}

/* the first screen starts at the content's left edge; the trailing space
   lets the last one reach that edge too */
.sn-carousel__track {
  display: flex;
  gap: var(--sn-slide-gap);
  width: max-content;
  padding-right: max(0px, calc(100cqw - var(--sn-slide-w)));
}

.sn-carousel__viewport {
  container-type: inline-size;
}

.sn-carousel__slide {
  flex: none;
  width: var(--sn-slide-w);
  scroll-snap-align: start;
}

.sn-carousel__img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 780 / 1688;
}

.sn-carousel__caption {
  display: block;
  margin-top: calc(14 * var(--u));
  font-family: var(--font-body);
}

.sn-carousel__index {
  display: block;
  font-family: var(--font-mono);
  font-size: var(--pf-caption-size);
  line-height: 1.5;
}

.sn-carousel__title {
  display: block;
  margin-top: calc(4 * var(--u));
  font-weight: 600;
  font-size: calc(18 * var(--u));
  line-height: 1.3;
}

.sn-carousel__text {
  display: block;
  margin-top: calc(4 * var(--u));
  font-style: italic;
  font-size: var(--pf-caption-size);
  line-height: 1.4;
}

.sn-carousel__controls {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: calc(20 * var(--u));
  margin-top: calc(28 * var(--u));
}

.sn-carousel__nav {
  flex: none;
  width: var(--sn-nav);
  height: var(--sn-nav);
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
  cursor: pointer;
  transition: opacity 0.2s var(--ease);
}

.sn-carousel__nav svg {
  display: block;
  width: 100%;
  height: 100%;
}

.sn-carousel__nav circle {
  fill: var(--pf-arrow);
}

.sn-carousel__nav path {
  fill: #fff;
}

.sn-carousel__nav:hover {
  opacity: 0.7;
}

.sn-carousel__nav:disabled {
  opacity: 0.25;
  cursor: default;
}

.sn-carousel__status {
  min-width: 5.5ch;
  font-family: var(--font-mono);
  font-size: var(--sn-label-size);
  line-height: 1.5;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.sn-carousel__dots {
  display: flex;
  align-items: center;
}

.sn-carousel__dot {
  display: block;
  width: calc(var(--sn-dot) + 12 * var(--u));
  height: calc(var(--sn-dot) + 16 * var(--u));
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  position: relative;
}

.sn-carousel__dot::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: var(--sn-dot);
  height: var(--sn-dot);
  border: var(--pf-rule) solid var(--pf-ink);
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

.sn-carousel__dot[aria-current]::before {
  background: var(--pf-ink);
}

.sn-carousel__dot:focus-visible {
  outline: var(--pf-rule) solid var(--pf-ink);
  outline-offset: -2px;
}

/* ---------- Commerce: editorial lookbook ----------
   A uniform grid of equal columns (4 desktop, 2 tablet, 1 mobile). Every
   photo keeps its own proportions, nothing is cropped. */

.sn-label--collection {
  margin-top: calc(6 * var(--u));
  font-weight: 700;
}

.sn-label--collection + .sn-title {
  margin-top: calc(10 * var(--u));
}

.sn-editorial {
  margin-top: var(--sn-gap-block);
}

.sn-editorial .sn-copy {
  margin-top: calc(14 * var(--u));
}

.sn-lookbook {
  display: grid;
  grid-template-columns: repeat(var(--sn-lookbook-columns), minmax(0, 1fr));
  gap: calc(40 * var(--u)) var(--sn-lookbook-gap);
  align-items: start;
  margin-top: var(--sn-gap-media);
}

.sn-lookbook__img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 928 / 1232;
}

.sn-lifestyle__copy {
  margin-top: var(--sn-gap-block);
}

.sn-audience {
  margin-top: var(--sn-gap-block);
}

.sn-audience__list {
  display: grid;
  grid-template-columns: repeat(var(--sn-columns-4), minmax(0, 1fr));
  column-gap: var(--pf-grid-gap);
  row-gap: calc(20 * var(--u));
  margin-top: calc(20 * var(--u));
}

.sn-audience__item {
  padding-top: calc(14 * var(--u));
  border-top: var(--pf-rule) solid currentColor;
}

.sn-audience__index {
  display: block;
  font-family: var(--font-mono);
  font-size: var(--sn-label-size);
  line-height: 1.5;
}

.sn-audience__name {
  display: block;
  margin-top: calc(8 * var(--u));
  font-family: var(--font-body);
  font-weight: 600;
  font-size: var(--pf-meta-size);
  line-height: 1.25;
  text-wrap: balance;
}

/* ---------- Business opportunity ---------- */

.sn-metrics {
  margin-top: var(--sn-gap-block);
}

.sn-metrics .decisions {
  margin-top: calc(20 * var(--u));
}

/* ---------- Lead lines and core hypothesis ---------- */

.sn-lead {
  max-width: var(--sn-copy-width);
  margin-top: calc(14 * var(--u));
  font-family: var(--font-body);
  font-size: var(--sn-lead-size);
  line-height: var(--sn-lead-line);
  text-wrap: pretty;
}

.sn-title + .sn-lead + .sn-media-row,
.sn-lead + .sn-product {
  margin-top: var(--sn-gap-media);
}

.sn-hypothesis {
  margin-top: var(--sn-gap-block);
  padding-top: calc(28 * var(--u));
  border-top: var(--pf-rule) solid currentColor;
}

.sn-hypothesis__title {
  margin-top: var(--sn-gap-title);
  font-family: var(--font-body);
  font-weight: 700;
  font-style: italic;
  font-size: var(--pf-title-size);
  line-height: 1.1;
}

.sn-hypothesis__text {
  max-width: calc(900 * var(--u));
  margin-top: calc(16 * var(--u));
  font-family: var(--font-body);
  font-size: var(--sn-lead-size);
  line-height: var(--sn-lead-line);
  text-wrap: pretty;
}

/* ---------- Badge System (inside the retention section) ---------- */

.sn-badges {
  margin-top: var(--sn-gap-section);
  outline: none;
  scroll-margin-top: calc(24 * var(--u));
}

.sn-badges__subhead {
  margin-top: calc(8 * var(--u));
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: var(--sn-label-size);
  line-height: 1.5;
}

.sn-badges__images {
  display: flex;
  gap: var(--sn-slide-gap);
  margin-top: var(--sn-gap-media);
}

.sn-badges__image {
  flex: none;
  width: var(--sn-slide-w);
}

.sn-badges__img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 780 / 1688;
}

/* comparison: rules between rows, no boxes */
.sn-badge-table {
  width: 100%;
  margin-top: var(--sn-gap-block);
  border-collapse: collapse;
  font-family: var(--font-body);
  font-size: var(--pf-body-size);
  line-height: var(--pf-body-line);
  text-align: left;
}

.sn-badge-table th,
.sn-badge-table td {
  padding: calc(16 * var(--u)) calc(24 * var(--u)) calc(16 * var(--u)) 0;
  border-top: var(--pf-rule) solid currentColor;
  vertical-align: baseline;
  font-weight: 400;
}

.sn-badge-table tr:last-child > * {
  border-bottom: var(--pf-rule) solid currentColor;
}

.sn-badge-table thead th {
  border-top: 0;
  padding-top: 0;
  font-family: var(--font-mono);
  font-size: var(--sn-label-size);
  line-height: 1.5;
}

.sn-badge-table tbody th {
  font-weight: 600;
  font-size: var(--pf-meta-size);
  white-space: nowrap;
}

.sn-badge-table td:nth-child(2) {
  font-family: var(--font-mono);
  white-space: nowrap;
}

.sn-rationale {
  margin-top: var(--sn-gap-block);
}

.sn-rationale .decisions,
.sn-metrics .decisions {
  margin-top: calc(20 * var(--u));
}

/* two reward paths -> one result */
.sn-paths {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: calc(48 * var(--u));
  font-family: var(--font-body);
}

.sn-paths__panels {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  width: 100%;
}

.sn-paths__panel {
  padding: calc(32 * var(--u));
}

.sn-paths__panel--gift {
  background: var(--sn-blue);
  color: #fff;
  --sn-path-accent: var(--sn-yellow);
}

.sn-paths__panel--unlock {
  background: var(--sn-yellow);
  color: var(--sn-blue);
  --sn-path-accent: var(--sn-blue);
}

.sn-paths__icon {
  display: block;
  width: calc(28 * var(--u));
  height: calc(28 * var(--u));
  color: var(--sn-path-accent);
}

.sn-paths__icon svg {
  display: block;
  width: 100%;
  height: 100%;
}

.sn-paths__title {
  margin-top: calc(16 * var(--u));
  padding-bottom: calc(16 * var(--u));
  border-bottom: var(--pf-rule) solid var(--sn-path-accent);
  color: var(--sn-path-accent);
  font-weight: 600;
  font-size: var(--pf-goal-size);
  line-height: 1.2;
}

.sn-paths__lines {
  margin-top: calc(16 * var(--u));
  font-size: var(--pf-body-size);
  line-height: var(--pf-body-line);
}

.sn-paths__arrow {
  margin: calc(14 * var(--u)) 0;
  font-family: var(--font-mono);
  font-size: var(--pf-meta-size);
  line-height: 1;
}

.sn-paths__result {
  width: 100%;
  padding: calc(22 * var(--u)) calc(32 * var(--u));
  background: var(--sn-neutral);
  font-weight: 600;
  font-size: var(--pf-meta-size);
  line-height: 1.3;
  text-align: center;
}

.sn-badges__note {
  margin-top: calc(18 * var(--u));
}

/* ---------- Business ecosystem: engagement loop ----------
   A ring with four clockwise arrows in the middle column; the stages sit in
   the four corners (Reach top left, Recognize top right, Reward bottom
   right, Express bottom left). */

.sn-loop {
  margin-top: var(--sn-gap-block);
}

.sn-loop__diagram {
  display: grid;
  grid-template-columns: minmax(0, 1fr) calc(220 * var(--u)) minmax(0, 1fr);
  grid-template-rows: auto auto;
  column-gap: calc(40 * var(--u));
  row-gap: calc(48 * var(--u));
  align-items: center;
  margin-top: calc(32 * var(--u));
}

.sn-loop__centre {
  grid-column: 2;
  grid-row: 1 / span 2;
  align-self: center;
  color: var(--pf-ink);
}

.sn-loop__ring {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
  fill: none;
  stroke: var(--sn-blue);
  stroke-width: 1.2;
  color: var(--sn-blue);
}

.sn-loop__dot {
  fill: var(--sn-yellow);
  stroke: var(--sn-blue);
}

.sn-loop__stages {
  display: contents;
}

.sn-loop__stage {
  max-width: calc(360 * var(--u));
}

.sn-loop__stage--1 { grid-column: 1; grid-row: 1; justify-self: end; text-align: right; }
.sn-loop__stage--2 { grid-column: 3; grid-row: 1; }
.sn-loop__stage--3 { grid-column: 3; grid-row: 2; }
.sn-loop__stage--4 { grid-column: 1; grid-row: 2; justify-self: end; text-align: right; }

.sn-loop__index {
  display: block;
  font-family: var(--font-mono);
  font-size: var(--sn-label-size);
  line-height: 1.5;
}

.pf .sn-loop__name {
  margin-top: calc(4 * var(--u));
  font-family: var(--font-body);
  font-weight: 600;
  font-size: var(--pf-goal-size);
  line-height: 1.2;
}

.sn-loop__name::after {
  content: "";
  display: block;
  width: calc(28 * var(--u));
  height: 2px;
  margin-top: calc(8 * var(--u));
  background: var(--sn-yellow);
}

.sn-loop__stage--1 .sn-loop__name::after,
.sn-loop__stage--4 .sn-loop__name::after {
  margin-left: auto;
}

.sn-loop__text {
  margin-top: calc(10 * var(--u));
  font-family: var(--font-body);
  font-size: var(--pf-body-size);
  line-height: var(--pf-body-line);
  text-wrap: pretty;
}

/* the return to Reach is drawn by the ring; the line shows on mobile only */
.sn-loop__return {
  display: none;
}

.sn-loop__line {
  max-width: calc(900 * var(--u));
  margin-top: calc(48 * var(--u));
  font-family: var(--font-body);
  font-weight: 600;
  font-style: italic;
  font-size: var(--sn-lead-size);
  line-height: var(--sn-lead-line);
}

.sn-loop__line + .sn-note {
  margin-top: calc(10 * var(--u));
}

/* "See Badge System" */
.sn-jump {
  display: inline-block;
  margin-top: calc(8 * var(--u));
  font-family: var(--font-mono);
  font-size: var(--pf-caption-size);
  line-height: 1.5;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  transition: opacity 0.2s var(--ease);
}

.sn-jump::after {
  content: " \2191";
}

.sn-jump:hover {
  opacity: 0.6;
}

/* ---------- Proposed success metrics ---------- */

.sn-metrics {
  margin-top: var(--sn-gap-block);
}

.sn-metric-list {
  font-family: var(--font-body);
}

.sn-metric-list li + li {
  margin-top: calc(4 * var(--u));
}

.sn-metric-list + .sn-note {
  margin-top: calc(10 * var(--u));
}

/* pilot questions: set apart from the four stages */
.sn-pilot {
  margin-top: calc(56 * var(--u));
  padding: calc(24 * var(--u)) calc(28 * var(--u));
  background: var(--sn-neutral);
}

.sn-pilot .sn-subtitle {
  margin-top: 0;
}

.sn-pilot__list {
  margin-top: calc(16 * var(--u));
  font-family: var(--font-body);
  font-size: var(--pf-body-size);
  line-height: var(--pf-body-line);
}

.sn-pilot__item {
  display: grid;
  grid-template-columns: 2ch minmax(0, 1fr);
  column-gap: calc(10 * var(--u));
  max-width: var(--sn-copy-width);
}

.sn-pilot__item + .sn-pilot__item {
  margin-top: calc(10 * var(--u));
}

.sn-pilot__index {
  font-family: var(--font-mono);
}

.sn-pilot__area {
  font-weight: 600;
}

.sn-pilot__support {
  margin-top: calc(18 * var(--u));
}

/* ---------- Tablet + mobile (below 1180px) ---------- */
@media (max-width: 1179.98px) {
  :root {
    --sn-gap-section: 88px;
    --sn-gap-block: 56px;
    --sn-gap-title: 14px;
    --sn-gap-media: 28px;
    --sn-media-gap: 12px;
    --sn-label-size: 13px;
    --sn-title-size: 32px;
    --sn-headline-size: 26px;
    --sn-number-size: 68px;
    --sn-opportunity-size: 28px;
    --sn-secondary-width: 82%;
    --sn-proto-width: 260px;
    --sn-slide-w: 240px;
    --sn-slide-gap: 20px;
    --sn-nav: 44px;
    --sn-dot: 8px;
    --sn-bar-h: 12px;
    --sn-columns-4: 2;
    --sn-lookbook-columns: 2;
    --sn-lead-size: 16px;
  }

  .sn-loop__diagram {
    grid-template-columns: minmax(0, 1fr) 140px minmax(0, 1fr);
    column-gap: 24px;
  }

  .sn-paths__panel {
    padding: 24px;
  }

  .sn-paths__icon {
    width: 24px;
    height: 24px;
  }

  .sn-product {
    column-gap: 36px;
  }

  .sn-findings {
    row-gap: 40px;
  }

  .sn-carousel__nav {
    padding: 6px;
  }

  .sn-carousel__dot {
    width: 20px;
    height: 32px;
  }

  .sn-carousel__title {
    font-size: 16px;
  }

}

/* tablet only: findings stay in three narrow columns would be cramped */
@media (min-width: 600px) and (max-width: 899.98px) {
  :root {
    --sn-columns-3: 1;
  }

  .sn-finding {
    display: grid;
    grid-template-columns: 180px minmax(0, 1fr);
    column-gap: 28px;
  }

  .sn-finding__number {
    grid-row: 1 / span 3;
  }

  .sn-finding__label,
  .sn-finding__text,
  .sn-finding__sources {
    grid-column: 2;
  }

  .pf .sn-finding__label {
    margin-top: 0;
  }
}

/* ---------- Mobile (599px and below) ---------- */
@media (max-width: 599.98px) {
  :root {
    --sn-gap-section: 72px;
    --sn-gap-block: 48px;
    --sn-title-size: 26px;
    --sn-headline-size: 22px;
    --sn-number-size: 64px;
    --sn-opportunity-size: 23px;
    --sn-secondary-width: 100%;
    --sn-slide-w: 68vw;
    --sn-slide-gap: 14px;
    --sn-columns-3: 1;
    --sn-columns-4: 1;
    --sn-lookbook-columns: 1;
    --sn-lead-size: 16px;
  }

  /* badge screens: two side by side, half the width each */
  .sn-badges__image {
    flex: 1 1 0;
    width: auto;
  }

  /* comparison table: one block per badge */
  .sn-badge-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }

  .sn-badge-table,
  .sn-badge-table tbody,
  .sn-badge-table tr,
  .sn-badge-table th,
  .sn-badge-table td {
    display: block;
  }

  .sn-badge-table tr {
    padding: 14px 0;
    border-top: var(--pf-rule) solid currentColor;
  }

  .sn-badge-table tr:last-child {
    border-bottom: var(--pf-rule) solid currentColor;
  }

  .sn-badge-table th,
  .sn-badge-table td,
  .sn-badge-table tr:last-child > * {
    padding: 0;
    border: 0;
  }

  .sn-badge-table td {
    margin-top: 6px;
  }

  .sn-badge-table td:nth-child(2) {
    margin-top: 2px;
  }

  .sn-badge-table td:last-child::before {
    content: attr(data-col) ": ";
    font-family: var(--font-mono);
    font-size: 12px;
  }

  /* reward paths stack; the arrow stays between them and the result */
  .sn-paths__panels {
    grid-template-columns: minmax(0, 1fr);
  }

  /* loop: a vertical sequence with a return arrow to Reach */
  .sn-loop__diagram {
    display: block;
  }

  .sn-loop__centre {
    display: none;
  }

  .sn-loop__stages {
    display: block;
  }

  .sn-loop__stage,
  .sn-loop__stage--1,
  .sn-loop__stage--4 {
    max-width: none;
    text-align: left;
  }

  .sn-loop__stage + .sn-loop__stage {
    margin-top: 12px;
  }

  .sn-loop__stage + .sn-loop__stage::before {
    content: "\2193";
    display: block;
    margin-bottom: 12px;
    font-family: var(--font-mono);
    color: var(--sn-blue);
  }

  .sn-loop__stage--1 .sn-loop__name::after,
  .sn-loop__stage--4 .sn-loop__name::after {
    margin-left: 0;
  }

  .sn-loop__return {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 16px;
    padding-top: 12px;
    border-top: var(--pf-rule) solid currentColor;
    font-family: var(--font-mono);
    font-size: 13px;
  }

  .sn-loop__return-arrow {
    color: var(--sn-blue);
    font-size: 18px;
  }

  .sn-pilot {
    padding: 18px 16px;
  }

  /* videos stack, each at its own proportions */
  .sn-media-row {
    flex-direction: column;
    gap: 28px;
  }

  .sn-media-row__item {
    flex: none !important;
    width: 100%;
  }

  /* the portrait videos would be very tall at full width */
  .sn-media-row--primary .is-portrait {
    width: 82%;
  }

  .sn-media-row--secondary .is-portrait {
    width: 56%;
  }

  .sn-media-row--secondary .is-landscape {
    width: 88%;
  }

  /* prototype above its text, centred */
  .sn-product {
    grid-template-columns: minmax(0, 1fr);
    row-gap: 28px;
  }

  .sn-product__proto {
    width: 68%;
    justify-self: center;
  }

  /* bar chart: the label on its own line above bar + value */
  .sn-bars {
    grid-template-columns: minmax(0, 1fr) max-content;
    row-gap: 6px;
    column-gap: 14px;
  }

  .sn-bar__label {
    grid-column: 1 / -1;
    margin-top: 10px;
  }

  .sn-eco__rewards {
    grid-template-columns: minmax(0, 1fr);
  }

  /* the three steps stack, joined by down arrows */
  .sn-eco__steps {
    flex-direction: column;
    align-items: flex-start;
    row-gap: 0;
  }

  .sn-eco__step + .sn-eco__step {
    margin-left: 0;
    margin-top: 34px;
  }

  .sn-eco__step + .sn-eco__step::before {
    content: "\2193";
    right: auto;
    left: var(--lm-pill-pad);
    bottom: 100%;
    width: auto;
    line-height: 34px;
  }

  .sn-carousel__controls {
    flex-wrap: wrap;
    gap: 4px 12px;
  }

  .sn-carousel__dots {
    order: 3;
    flex-basis: 100%;
    justify-content: flex-start;
    margin-left: -6px;           /* the first dot's mark on the content edge */
  }


  /* the overview facts wrap under their label */
  .sn-overview__facts .snapshot__row {
    flex-wrap: wrap;
  }
}

