/* Design language adapted from mchiu.co.uk (Alex Chiu), rebuilt for upamanyu.in */
@import './tokens.css';

/* ── Disable image dragging globally ── */
img {
  -webkit-user-drag: none;
  user-drag: none;
  -khtml-user-drag: none;
  -moz-user-drag: none;
  -o-user-drag: none;
  user-select: none;
  pointer-events: auto;
  draggable: false;
}

/* ── Custom cursor — native cursor hidden, DOM shape takes over ── */
/* Only hide on wide screens with a fine pointer (mouse/trackpad) */
@media (pointer: fine) and (min-width: 769px) {
  *, *::before, *::after {
    cursor: none !important;
  }
}

/* ── Cursor shape (CursorShape.js) — morph driven by rAF in JS ── */
.cs-root {
  position: fixed;
  top: 0; left: 0;
  pointer-events: none;
  z-index: 10001;
}

/* ── Cursor tooltip ── */
.cursor-tooltip {
  position: fixed;
  pointer-events: none;
  z-index: 9999;
  background: var(--color-primary);
  opacity: 0.9;
  border-radius: 8px;
  padding: 8px 16px;
  color: var(--color-text-on-primary);
  font-family: var(--font-family-primary);
  font-size: var(--tooltip-size);
  font-weight: var(--tooltip-weight);
  line-height: var(--tooltip-leading);
  white-space: pre-line;
  /* Fade in on first appearance */
  animation: tooltip-in 0.12s ease forwards;
}

@keyframes tooltip-in {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 0.85; transform: translateY(0); }
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
img { display: block; }

/* ── Body / background ── */
body {
  min-height: 100vh;
  background: var(--color-bg-body);
  font-family: var(--font-family-primary);
  color: var(--color-text-primary);
  transition: background 0.5s ease, color 0.5s ease;
}

/* ── Global semibold → gradient ── */
strong, b {
  font-weight: var(--weight-semibold);
  background: var(--gradient-brand);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ── Back to top ── */
.back-to-top {
  position: fixed;
  bottom: 32px;
  right: 32px;
  z-index: 500;
  width: 40px;
  height: 40px;
  border-radius: 100px;
  border: none;
  background: var(--color-surface-action-icon);
  color: var(--color-text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 40px var(--color-shadow-action-icon);
  opacity: 0;
  transform: scale(0.8);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease, background 0.5s ease;
  filter: var(--filter-action-icon);
}

.back-to-top--visible {
  opacity: 1;
  transform: scale(1);
  pointer-events: auto;
}

.back-to-top:hover {
  transform: scale(1.08);
}

.back-to-top:active {
  transform: scale(0.95);
}

/* ── Navigation ── */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  padding: 20px 48px;
  transform: translateY(0);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav--hidden {
  transform: translateY(-110%);
}

.nav-logo {
  width: 46px;
  height: 46px;
  flex-shrink: 0;
}

.nav-pills {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--color-surface-nav-blur);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: 4px;
  border-radius: 100px;
  transition: background 0.5s ease;
}

/* ── Hover ghost pill (iPad-like cursor replacement) ── */
.nav-pill-hover-ghost {
  position: absolute;
  top: 4px;
  bottom: 4px;
  border-radius: 100px;
  background: var(--color-surface-nav);
  opacity: 0;
  pointer-events: none;
  transition: left 0.25s cubic-bezier(0.25, 1, 0.5, 1),
              width 0.25s cubic-bezier(0.25, 1, 0.5, 1),
              opacity 0.18s ease;
  box-shadow: 0 0 12px var(--color-shadow-nav);
  /* Much fainter than the active indicator */
  filter: opacity(0.35);
}

/* Sliding pill indicator */
.nav-pill-indicator {
  position: absolute;
  top: 4px;
  bottom: 4px;
  border-radius: 100px;
  background: var(--color-surface-nav);
  box-shadow: 0 0 40px var(--color-shadow-nav);
  pointer-events: none;
  will-change: left, width, transform;
  transform-origin: center center;
  /* transition added only after initial placement */
}

.nav-pill-indicator--ready {
  transition: left 0.62s cubic-bezier(0.34, 1.56, 0.64, 1),
              width 0.62s cubic-bezier(0.34, 1.56, 0.64, 1),
              transform 0.48s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Liquid-glass: looser spring while stretching mid-flight */
.nav-pill-indicator--liquid {
  transition: left 0.72s cubic-bezier(0.22, 1, 0.36, 1),
              width 0.72s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.42s cubic-bezier(0.22, 1, 0.36, 1);
}

.nav-pill {
  position: relative; /* sit above the indicator */
  z-index: 1;
  padding: 8px 16px;
  border-radius: 100px;
  font-family: var(--font-family-primary);
  font-weight: 500;
  font-size: 16px;
  color: var(--color-text-primary);
  text-decoration: none;
  transition: color 0.2s;
}

/* Hide cursor inside pill area — the ghost pill IS the cursor */
.nav-pills:hover {
  cursor: none;
}
.nav-pill {
  cursor: none;
  user-select: none;
  -webkit-user-select: none;
}

/* Active text stays dark (indicator handles the background) */
.nav-pill.active {
  color: var(--color-text-primary);
}

/* Hover — teal text, no pill (ghost does the pill job) */
.nav-pill:not(.active):hover {
  color: var(--color-primary);
}


/* ── Lazy-mode toggle ── */
.lazy-toggle {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 14px 0 10px;
  border: none;
  border-radius: 100px;
  background: var(--color-surface-nav-blur);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: var(--color-text-primary);
  cursor: none;
  user-select: none;
  -webkit-user-select: none;
  overflow: hidden;
  white-space: nowrap;
  transition: width 0.5s cubic-bezier(0.22, 1, 0.36, 1),
              padding 0.5s cubic-bezier(0.22, 1, 0.36, 1),
              background 0.3s ease,
              transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.lazy-toggle__icon {
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.lazy-toggle__label {
  font-family: 'Syne', sans-serif;
  font-weight: 500;
  font-size: 13px;
  transition: opacity 0.15s ease;
}

.lazy-toggle:hover {
  background: var(--color-surface-nav);
  box-shadow: 0 0 20px var(--color-shadow-nav);
}

/* Press-down — matches bento-card :active feel */
.lazy-toggle:active {
  transform: scale(0.92);
}

/* Crossfade label during icon morph */
.lazy-toggle__label--fading {
  opacity: 0 !important;
  transition: opacity 0.08s ease !important;
}

/* ── Mobile-only page logo (above the grid) ── */
.mobile-page-logo {
  display: none; /* hidden on desktop */
}

/* ── Main layout ── */
.main {
  display: flex;
  justify-content: center;
  padding: 110px 24px 80px;
}

/* ── Bento grid ── */
.grid {
  display: grid;
  grid-template-columns: repeat(4, 252px);
  grid-auto-rows: 252px;
  gap: 18px;   /* card positions computed in pack.js, set inline */
}

/* ══════════════════════════════════════
   BENTO CARD (reusable base)
══════════════════════════════════════ */
.bento-card {
  background: var(--color-surface-card);
  border-radius: 32px;
  border: 1px solid var(--color-border-card);
  box-shadow:
    0 1px 3px var(--color-shadow-card-rest),
    0 1px 2px var(--color-shadow-card-rest),
    inset 0 1px 0 var(--color-card-inset-top),
    inset 0 -1px 0 var(--color-card-inset-bottom);
  overflow: hidden;
  position: relative;
  cursor: pointer;
  transition: background 0.5s ease, box-shadow 0.3s ease, border-color 0.3s ease, transform 0.15s ease;
  /* Fix Chrome bug: overflow:hidden + border-radius distortion */
  isolation: isolate;
  /* Staggered enter animation — delay overridden per card below */
  animation: card-enter 0.8s cubic-bezier(0.16, 1, 0.3, 1) backwards;
  animation-delay: var(--card-enter-delay, 0s);
}

/* Grain texture layer — multiply on light, screen on dark */
.bento-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
  background-size: 180px 180px;
  opacity: var(--card-grain-opacity);
  mix-blend-mode: var(--card-grain-blend);
  pointer-events: none;
  z-index: 0;
  transition: opacity 0.5s ease;
}

.bento-card:hover {
  box-shadow:
    0 12px 40px var(--color-shadow-card-hover),
    0 4px 12px var(--color-shadow-card-hover-2),
    inset 0 1px 0 var(--color-card-inset-top),
    inset 0 -1px 0 var(--color-card-inset-bottom);
  transform: translateY(-3px);
}

.bento-card:active,
.bento-card--pressed {
  transform: scale(0.97);
  box-shadow:
    0 1px 3px var(--color-shadow-card-rest),
    0 1px 2px var(--color-shadow-card-rest),
    inset 0 1px 0 var(--color-card-inset-top),
    inset 0 -1px 0 var(--color-card-inset-bottom);
  transition: background 0.5s ease, box-shadow 0.08s ease, border-color 0.3s ease, transform 0.08s ease;
}

/* Dark-variant cards (case studies) — always dark regardless of theme */
.bento-card.dark {
  --color-card-inset-top:     rgba(255, 255, 255, 0.05);
  --color-card-inset-bottom:  rgba(0, 0, 0, 0.30);
  --card-grain-opacity:       0.05;
  --card-grain-blend:         screen;
  --color-card-ripple:        rgba(255, 255, 255, 0.22);
  border-color: rgba(255, 255, 255, 0.06);
  box-shadow:
    0 1px 3px var(--color-shadow-card-rest),
    0 1px 2px var(--color-shadow-card-rest),
    inset 0 1px 0 var(--color-card-inset-top),
    inset 0 -1px 0 var(--color-card-inset-bottom);
}

.bento-card.dark:hover {
  box-shadow:
    0 12px 40px var(--color-shadow-card-hover),
    0 4px 12px var(--color-shadow-card-hover-2),
    inset 0 1px 0 var(--color-card-inset-top),
    inset 0 -1px 0 var(--color-card-inset-bottom);
}

/* ── Action icon ── */
.action-icon {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 40px;
  height: 40px;
  background: var(--color-surface-action-icon);
  border-radius: 100px;
  box-shadow: 0 2px 40px var(--color-shadow-action-icon);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: scale(0.8);
  transition: opacity 0.2s ease, transform 0.2s ease, background 0.5s ease;
  z-index: 10;
}

/* Higher specificity so card-level img rules can't override it */
.bento-card .action-icon img {
  width: 16px !important;
  height: 16px !important;
  transform: none !important;
  filter: var(--filter-action-icon);
}

/* Lottie toggle inside the bulb-card action icon */
.bulb-card .action-icon .bulb-lottie {
  width: 22px;
  height: 22px;
  pointer-events: none;
}
.bulb-card .action-icon .bulb-lottie svg {
  display: block;
  filter: var(--filter-action-icon);
}

.bento-card:hover .action-icon {
  opacity: 1;
  transform: scale(1);
}

/* ══════════════════════════════════════
   CARD ENTER ANIMATION
══════════════════════════════════════ */
@keyframes card-enter {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* Stagger delays — reading order: left→right, top→bottom, 0.1s apart */
/* Row 1 */
.about-card-wrapper { --card-enter-delay: 0s; }    /* cols 1-2 */
.gmail-card         { --card-enter-delay: 0.1s; }  /* col 3    */
.linkedin-card      { --card-enter-delay: 0.2s; }  /* col 4    */
/* Row 2 */
.bulb-card          { --card-enter-delay: 0.3s; }  /* col 1    */
.birds-card         { --card-enter-delay: 0.4s; }  /* col 2    */
.agentic-ds-card    { --card-enter-delay: 0.5s; }  /* cols 3-4 */
/* Rows 3-5 — the case studies */
.ticketing-card     { --card-enter-delay: 0.6s; }  /* cols 1-2 */
.reviews-card       { --card-enter-delay: 0.7s; }  /* cols 3-4 */
.optimiser-card     { --card-enter-delay: 0.8s; }  /* cols 1-2 */
/* Row 6 */
.stat-money-card    { --card-enter-delay: 0.9s; }  /* col 3    */
.stat-users-card    { --card-enter-delay: 1.0s; }  /* col 4    */
/* Row 7 */
.film-forest-card   { --card-enter-delay: 1.1s; }  /* col 1    */
.film-kea-card      { --card-enter-delay: 1.2s; }  /* col 2    */
.stat-years-card    { --card-enter-delay: 1.3s; }  /* cols 3-4 */
/* Rows 8-9 */
.ds-quote-card      { --card-enter-delay: 1.4s; }  /* cols 3-4 */
.ux-quote-card      { --card-enter-delay: 1.5s; }  /* cols 1-4 */

/* ══════════════════════════════════════
   GRID SLOT (wrapper div per card)
   Span is set via inline styles in App.js
   from layouts.yml; the grid auto-packs.
══════════════════════════════════════ */
.grid-slot {
  min-width: 0;
  min-height: 0;
  transition: opacity 0.4s ease;
}

/* Cards inside a slot fill the slot area */
.grid-slot > * {
  width: 100%;
  height: 100%;
}

/* De-prioritised cards at 30 % opacity */
.grid-slot--dim {
  opacity: 0.3;
  pointer-events: none;
}

/* ══════════════════════════════════════
   CARD CONTENT STYLES
══════════════════════════════════════ */

/* ── About card (collapsed) ── */
.about-card-wrapper {
  position: relative;   /* grid placement set in GRID PLACEMENT section */
}

.about-card-wrapper > .about-card {
  width: 100%;
  height: 100%;
}

.about-card {
  display: flex;
  align-items: center;
  padding-right: 28px;
  cursor: pointer;
  transition: background 0.5s ease, box-shadow 0.25s ease, border-color 0.3s ease, transform 0.15s ease, opacity 0.25s ease;
}
.about-avatar { width: 215px; height: 215px; object-fit: cover; flex-shrink: 0; }
.about-bio { font-size: var(--about-bio-size); line-height: var(--about-bio-leading); padding-left: 4px; }

/* Keep grid slot occupied, hide card while expanded */
.about-card--ghost { opacity: 0; pointer-events: none; }

/* Once the card has been interacted with, kill the entrance animation
   so it doesn't replay when returning from ghost state.
   Also snap opacity instantly (no transition) to avoid a flicker
   when the expanded overlay is removed on the same frame. */
.about-card.about-card--was-open {
  animation: none;
  transition: background 0.5s ease, box-shadow 0.25s ease, border-color 0.3s ease, transform 0.15s ease;
}

/* ── Backdrop — sits behind expanded card ── */
.about-backdrop {
  position: fixed;
  inset: 0;
  background: var(--color-backdrop);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 200;
  animation: about-backdrop-in 0.3s ease forwards;
  touch-action: none;
}

@keyframes about-backdrop-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* Backdrop fades out when closing */
.about-backdrop--out {
  animation: about-backdrop-out 0.45s ease forwards;
}

@keyframes about-backdrop-out {
  from { opacity: 1; }
  to   { opacity: 0; }
}

/* ── Expanded card — FLIP animated, above backdrop ── */
.about-expanded-card {
  position: fixed;
  background: var(--color-surface-card);
  border-radius: 32px;
  border: 1px solid var(--color-border-card);
  box-shadow:
    0 2px 200px var(--color-shadow-card-expanded),
    inset 0 1px 0 var(--color-card-inset-top),
    inset 0 -1px 0 var(--color-card-inset-bottom);
  z-index: 300;
  overflow: hidden;
  isolation: isolate;
  transition: background 0.5s ease, border-color 0.3s ease;
}

/* Grain texture — matches collapsed .bento-card */
.about-expanded-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
  background-size: 180px 180px;
  opacity: var(--card-grain-opacity);
  mix-blend-mode: var(--card-grain-blend);
  pointer-events: none;
  z-index: 0;
  transition: opacity 0.5s ease;
}

/* Transition fires once JS adds --settled (open) or keeps it during --closing */
.about-expanded-card--settled {
  transition:
    left         0.7s cubic-bezier(0.34, 1.1, 0.64, 1),
    top          0.7s cubic-bezier(0.34, 1.1, 0.64, 1),
    width        0.7s cubic-bezier(0.34, 1.1, 0.64, 1),
    height       0.7s cubic-bezier(0.34, 1.1, 0.64, 1),
    background   0.5s ease,
    border-color 0.3s ease;
}

/* Scrollable inner wrapper */
.about-expanded-inner {
  width: 100%;
  height: 100%;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 40px 80px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 32px;
  scrollbar-width: thin;
  box-sizing: border-box;
}

/* Content fades in after growing, fades out instantly when closing */
.about-expanded-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 32px;
  width: 100%;
  flex-shrink: 0;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.about-expanded-card--settled .about-expanded-content {
  transition: opacity 0.3s ease 0.38s;
  opacity: 1;
}

/* Snap content out immediately so only the card shape shrinks back */
.about-expanded-card--closing .about-expanded-content {
  opacity: 0;
  transition: opacity 0.1s ease;
}

.about-expanded-avatar {
  width: 150px;
  height: 150px;
  object-fit: cover;
  border-radius: 50%;
  flex-shrink: 0;
}

/* Flying avatar — fixed, travels between collapsed and expanded positions */
.about-avatar-fly {
  position: fixed;
  object-fit: cover;
  z-index: 400;
  pointer-events: none;
}

.about-expanded-bio {
  font-size: var(--about-expanded-size);
  line-height: var(--about-expanded-leading);
  color: var(--color-text-body);
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
}

.about-expanded-bio p { margin: 0; }

/* Bio hyperlinks — animated underline (slide L→R in, R→L out, multi-line safe) */
.bio-link {
  text-decoration: none;
  background-image: linear-gradient(currentColor, currentColor);
  background-repeat: no-repeat;
  background-position: left bottom;
  background-size: 0% 1.5px;
  padding-bottom: 2px;
  transition: background-size 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

.bio-link:hover {
  background-size: 100% 1.5px;
}

/* ── Bio link preview (iOS-style peek) ── */
.bio-link-preview {
  position: fixed;
  z-index: 500;
  width: 320px;
  transform: scale(0.92);
  transform-origin: top left;
  opacity: 0;
  pointer-events: none;
  border-radius: 16px;
  overflow: hidden;
  box-shadow:
    0 20px 60px rgba(0, 0, 0, 0.25),
    0 8px 20px rgba(0, 0, 0, 0.12),
    0 0 0 1px rgba(0, 0, 0, 0.06);
  background: var(--color-surface-card);
  transition:
    opacity 0.25s cubic-bezier(0.2, 0, 0, 1),
    transform 0.25s cubic-bezier(0.2, 0, 0, 1);
  transform-origin: bottom center;
}

.bio-link-preview--visible {
  opacity: 1;
  transform: scale(1);
}

.bio-link-preview-img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  object-position: top left;
  background: var(--color-surface-card);
}

/* ── No screenshot available — compact branded chip ── */
.bio-link-preview--chip {
  width: auto;
  border-radius: 12px;
  box-shadow:
    0 8px 24px rgba(0, 0, 0, 0.16),
    0 0 0 1px rgba(0, 0, 0, 0.06);
}

.bio-link-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px 10px 12px;
  white-space: nowrap;
}

.bio-link-chip-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.bio-link-chip-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.bio-link-chip-label {
  font-family: var(--font-family-primary);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.25;
}

.bio-link-chip-sub {
  font-family: var(--font-family-primary);
  font-size: 11px;
  line-height: 1.25;
  color: var(--color-text-primary);
  opacity: 0.4;
}

/* Shrink / close button */
.about-shrink-btn img {
  filter: var(--filter-action-icon);
}

.about-shrink-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 40px;
  height: 40px;
  background: var(--color-surface-card-white);
  border: none;
  border-radius: 100px;
  box-shadow: 0 2px 40px var(--color-shadow-action-icon);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 1;
  flex-shrink: 0;
}

/* ── Case Study Overlay (shared fullscreen expand) ──────────── */

.cs-card-wrapper { position: relative; }
.cs-card-wrapper > .bento-card { width: 100%; height: 100%; }

/* Ghost — keep grid slot occupied while expanded */
.cs-card--ghost { opacity: 0; pointer-events: none; }
.cs-card--was-open { animation: none; }

/* ── Backdrop ── */
.cs-backdrop {
  position: fixed;
  inset: 0;
  background: var(--color-backdrop);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 200;
  animation: cs-backdrop-in 0.3s ease forwards;
  touch-action: none;
}

@keyframes cs-backdrop-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.cs-backdrop--out {
  animation: cs-backdrop-out 0.45s ease forwards;
}

@keyframes cs-backdrop-out {
  from { opacity: 1; }
  to   { opacity: 0; }
}

/* ── Expanded fullscreen card — FLIP animated ── */
.cs-expanded {
  position: fixed;
  background: var(--color-bg-body);
  border-radius: 32px;
  box-shadow: 0 2px 200px rgba(0, 0, 0, 0.01);
  z-index: 300;
  overflow: hidden;
  transition: background 0.5s ease;
}

.cs-expanded--settled {
  border-radius: 0;
  transition:
    left          0.7s cubic-bezier(0.34, 1.1, 0.64, 1),
    top           0.7s cubic-bezier(0.34, 1.1, 0.64, 1),
    width         0.7s cubic-bezier(0.34, 1.1, 0.64, 1),
    height        0.7s cubic-bezier(0.34, 1.1, 0.64, 1),
    border-radius 0.7s cubic-bezier(0.34, 1.1, 0.64, 1);
}

/* ── Header bar (logo left, close right) ── */
.cs-header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 40px calc(6.25% + 74px);
  z-index: 2;
  pointer-events: none;
}

.cs-header-close {
  pointer-events: auto;
}

.cs-header-close {
  width: 40px;
  height: 40px;
  background: var(--color-surface-action-icon);
  border: none;
  border-radius: 100px;
  box-shadow: 0 2px 40px var(--color-shadow-action-icon);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.5s ease;
}

.cs-header-close img {
  filter: var(--filter-action-icon);
}

/* ── Scrollable inner area ── */
.cs-expanded-inner {
  width: 100%;
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  box-sizing: border-box;
}

/* Content fades in after expand, fades out instantly on close */
.cs-expanded-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  flex-shrink: 0;
  opacity: 0;
  transition: opacity 0.25s ease;
  padding-bottom: 80px;
}

.cs-expanded--settled .cs-expanded-content {
  transition: opacity 0.3s ease 0.38s;
  opacity: 1;
}

.cs-expanded--closing .cs-expanded-content {
  opacity: 0;
  transition: opacity 0.1s ease;
}

/* ── Hero video in expanded view ── */
.cs-hero-video {
  display: block;
  border-radius: 32px;
  object-fit: cover;
  flex-shrink: 0;
  margin-top: 40px;
  transition: opacity 0.2s ease;
}

/* ── Back-to-top inside expanded case study ── */
.cs-back-to-top {
  position: absolute;
  bottom: 32px;
  right: 32px;
  z-index: 20;
  width: 40px;
  height: 40px;
  border-radius: 100px;
  border: none;
  background: var(--color-surface-action-icon);
  color: var(--color-text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 40px var(--color-shadow-action-icon);
  opacity: 0;
  transform: scale(0.8);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease, background 0.5s ease;
  filter: var(--filter-action-icon);
  cursor: pointer;
}

.cs-back-to-top--visible {
  opacity: 1;
  transform: scale(1);
  pointer-events: auto;
}

.cs-back-to-top:hover {
  transform: scale(1.08);
}

.cs-back-to-top:active {
  transform: scale(0.95);
}

/* ── Flying video — fixed, travels between card and hero positions ── */
.cs-video-fly {
  position: fixed;
  object-fit: cover;
  z-index: 400;
  pointer-events: none;
}

/* ── TL;DR toggle — liquid glass pill (matches main nav) ── */
.tldr-bar {
  position: sticky;
  top: 40px;
  z-index: 10;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  margin: 24px 0 8px;
  padding: 4px;
  border-radius: 100px;
  background: var(--color-surface-nav-blur);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  width: fit-content;
  transition: background 0.5s ease;
}
.tldr-indicator {
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 4px;
  width: calc(50% - 6px);
  border-radius: 100px;
  background: var(--color-surface-nav);
  box-shadow: 0 0 40px var(--color-shadow-nav);
  pointer-events: none;
  transition: transform 0.62s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.tldr-pill {
  position: relative;
  z-index: 1;
  padding: 8px 24px;
  border-radius: 100px;
  border: none;
  background: transparent;
  font-family: var(--font-family-primary);
  font-size: var(--action-size);
  font-weight: var(--action-weight);
  color: var(--color-text-primary);
  cursor: pointer;
  user-select: none;
  transition: color 0.2s ease;
  text-align: center;
}
.tldr-pill:not(.tldr-pill--active):hover {
  color: var(--color-primary);
}

/* ── TL;DR collapsible content ── */
.tldr-collapsible {
  display: grid;
  grid-template-rows: 1fr;
  opacity: 1;
  transition: grid-template-rows 0.55s cubic-bezier(0.4, 0, 0.2, 1),
              opacity 0.35s ease;
}
.tldr-collapsible > * {
  overflow: hidden;
}
.tldr-collapsible--hidden {
  grid-template-rows: 0fr;
  opacity: 0;
}

/* ── Case study body sections ── */
.cs-body {
  max-width: 680px;
  width: 100%;
  padding: 0 24px;
  margin-top: 80px;
}

.cs-title {
  font-family: var(--font-family-primary);
  font-size: var(--cs-title-size);
  font-weight: var(--cs-title-weight);
  line-height: var(--cs-title-leading);
  color: var(--color-text-primary);
  margin: 0 0 24px;
  transition: color 0.5s ease;
}

.cs-section-title {
  font-family: var(--font-family-primary);
  font-size: var(--cs-section-size);
  font-weight: var(--cs-section-weight);
  line-height: var(--cs-section-leading);
  color: var(--color-text-primary);
  margin: 48px 0 8px;
  transition: color 0.5s ease;
}

.cs-subsection-title {
  font-family: var(--font-family-primary);
  font-size: var(--cs-subsection-size);
  font-weight: var(--cs-subsection-weight);
  line-height: var(--cs-subsection-leading);
  color: var(--color-text-primary);
  margin: 32px 0 0;
  transition: color 0.5s ease;
}

.cs-body-text {
  font-family: var(--font-family-primary);
  font-size: var(--cs-body-size);
  font-weight: var(--cs-body-weight);
  line-height: var(--cs-body-leading);
  color: var(--color-text-body);
  margin: 4px 0 24px 0;
  transition: color 0.5s ease;
}

.cs-body-list {
  padding-left: 24px;
  margin: -12px 0 24px 0;
  font-family: var(--font-family-primary);
  font-size: var(--cs-body-size);
  font-weight: var(--cs-body-weight);
  line-height: var(--cs-body-leading);
  color: var(--color-text-body);
  transition: color 0.5s ease;
}
.cs-body-list li {
  margin: 0 0 6px 0;
}
.cs-body-list .cs-body-text {
  margin: 0 0 6px 0;
}


/* ── Case study stat row ── */
.cs-stat-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  padding: 48px 0 40px;
}

.cs-stat-item {
  padding-right: 28px;
}

.cs-stat-item + .cs-stat-item {
  padding-left: 28px;
  padding-right: 0;
  border-left: 1px solid var(--color-text-muted);
}

.cs-stat-num {
  font-size: var(--text-9xl);
  font-weight: var(--weight-bold);
  line-height: 1.1;
  background: var(--gradient-brand);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 8px;
}

.cs-stat-lbl {
  font-size: var(--text-base);
  color: var(--color-text-body);
  line-height: var(--leading-normal);
  transition: color 0.5s ease;
}

@media (max-width: 600px) {
  .cs-stat-row {
    grid-template-columns: 1fr;
  }

  .cs-stat-item {
    padding-right: 0;
    padding-bottom: 24px;
  }

  .cs-stat-item + .cs-stat-item {
    padding-left: 0;
    padding-top: 24px;
    border-left: none;
    border-top: 1px solid var(--color-text-muted);
  }
}


.cs-link {
  color: var(--color-text-primary);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
  transition: opacity 0.15s ease;
}
.cs-link:hover {
  opacity: 0.6;
}

/* Second cs-body block (Problem / Solution) — less top margin since it follows the antonym section */
.cs-body--continued {
  margin-top: 48px;
}

/* Demo video inside case study body */
.cs-demo-video {
  display: block;
  width: 680px;
  aspect-ratio: 3024 / 1822;
  border-radius: 20px;
  margin-top: 32px;
}

/* Cover image inside case study body */
.cs-cover-img {
  display: block;
  width: 680px;
  border-radius: 20px;
  margin-top: 32px;
}

.cs-cover-img--full {
  width: calc(100% - 48px);
  max-width: 100%;
  padding: 0 24px;
  box-sizing: content-box;
}

/* ── Case Study Image Scroll Reveal ───────────────────────── */

.cs-expanded-content .cs-cover-img,
.cs-expanded-content .cs-demo-video,
.cs-expanded-content .cs-demo {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 1.2s ease, transform 1.2s ease;
}

.cs-expanded-content .cs-cover-img.cs-img-visible,
.cs-expanded-content .cs-demo-video.cs-img-visible,
.cs-expanded-content .cs-demo.cs-img-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── "Interactive" hint under a demo ── */
.cs-hint {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 10px 0 32px 0;
  font-family: var(--font-family-primary);
  font-size: 13px;
  color: var(--color-text-primary);
  opacity: 0.45;
}

.cs-hint--centered {
  justify-content: center;
}

.cc-interactive-tag {
  flex-shrink: 0;
  padding: 3px 9px;
  border-radius: 100px;
  border: 1px solid currentColor;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* ── Sun / Moon Theme Toggle Card ─────────────────────────── */
.bulb-card {
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  overflow: hidden;
  transition: background 0.5s ease, box-shadow 0.25s ease;
}


/* Icon wrapper — sun and moon are stacked inside */
.icon-wrap {
  position: relative;
  width: 90px;
  height: 90px;
  z-index: 1;
  overflow: visible;
}

/* ── Sun ── */
.sun {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 1;
  transform: rotate(0deg) scale(1);
  transition:
    opacity    0.35s cubic-bezier(0.4, 0, 0.2, 1),
    transform  0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.sun.hidden {
  opacity: 0;
  transform: rotate(90deg) scale(0.4);
}


.sun-circle {
  position: absolute;
  width: 49px;
  height: 49px;
  background: var(--gradient-sun);
  border-radius: 50%;
  box-shadow: 0 0 18px var(--color-sun-glow);
  animation: sun-breathe 2.8s ease-in-out infinite;
  z-index: 2;
}

@keyframes sun-breathe {
  0%, 100% { box-shadow: 0 0 14px rgba(245, 166, 35, 0.45); }
  50%       { box-shadow: 0 0 36px rgba(245, 166, 35, 0.90), 0 0 64px rgba(255, 190, 40, 0.28); }
}

/*
 * B-style sharp burst rays:
 * .ray-arm  — zero-size anchor at icon centre, rotated per ray
 * .ray-bar  — sits at centre (bottom: 0), shoots outward via scaleY, fades as it travels
 */
.ray-arm {
  position: absolute;
  top: 50%; left: 50%;
  width: 0; height: 0;
  z-index: 1;
}

.ray-bar {
  position: absolute;
  width: 3px; height: 110px;
  bottom: 0; margin-left: -1.5px;
  transform-origin: bottom center;
  transform: scaleY(0);
  opacity: 0;
  border-radius: 2px 2px 1px 1px;
  background: linear-gradient(to top,
    rgba(245, 158, 11, 1)   0%,
    rgba(245, 158, 11, 0)   100%);
  animation: shoot-b 1.6s cubic-bezier(0.25, 0, 0.6, 1) infinite;
}

@keyframes shoot-b {
  0%   { transform: scaleY(0);    opacity: 0;    }
  5%   { transform: scaleY(0.05); opacity: 0.95; }
  100% { transform: scaleY(1);    opacity: 0;    }
}

/* Pause all sun animations when hidden (dark mode) */
.sun.hidden .ray-bar,
.sun.hidden .sun-circle { animation-play-state: paused; }

/* ── Moon ── */
.moon {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: rotate(-90deg) scale(0.4);
  transition:
    opacity    0.35s cubic-bezier(0.4, 0, 0.2, 1) 0.05s,
    transform  0.45s cubic-bezier(0.34, 1.56, 0.64, 1) 0.05s;
}
.moon.visible {
  opacity: 1;
  transform: rotate(0deg) scale(1);
}

/* Crescent shape — full circle with a punched-out circle on top-right */
.moon-shape {
  position: relative;
  width: 50px;
  height: 50px;
}
.moon-shape::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--gradient-moon);
  box-shadow: 0 0 18px var(--color-moon-glow);
}
/* The punch-out circle uses the card's own background colour to carve the crescent */
.moon-shape::after {
  content: '';
  position: absolute;
  width: 35px;
  height: 35px;
  top: -7px;
  left: 18px;
  border-radius: 50%;
  background: var(--color-surface-card);
  transition: background 0.5s ease;
}

/* Twinkling stars beside the moon */
.moon-stars {
  position: absolute;
  inset: 0;
}
.mstar {
  position: absolute;
  border-radius: 50%;
  background: var(--color-moon-star);
  animation: twinkle 1.8s ease-in-out infinite;
}
.mstar:nth-child(1) { width: 7px; height: 7px; top:  5px; right:  2px; animation-delay: 0.0s; }
.mstar:nth-child(2) { width: 5px; height: 5px; top: 26px; right: -8px; animation-delay: 0.6s; }
.mstar:nth-child(3) { width: 5px; height: 5px; top:  0px; right: 15px; animation-delay: 1.1s; }

@keyframes twinkle {
  0%, 100% { opacity: 1;   transform: scale(1);   }
  50%       { opacity: 0.2; transform: scale(0.4); }
}

/* ── Click ripple (all cards) ── */
.card-ripple {
  position: absolute;
  border-radius: 50%;
  transform: scale(0);
  animation: card-ripple 0.52s linear forwards;
  background: var(--color-card-ripple);
  pointer-events: none;
  z-index: 10;
}
@keyframes card-ripple {
  to { transform: scale(20); opacity: 0; }
}

/* Gmail / LinkedIn */
.gmail-card, .linkedin-card { display: flex; align-items: center; justify-content: center; }

/* ── LinkedIn animated icon ── */
.li-svg {
  overflow: visible;
  display: block;
}

.li-dot {
  fill: var(--color-brand-linkedin);
  transform-origin: 11px 10px;
  transform: scale(0);
  opacity: 0;
  animation: li-pop-in 0.28s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.li-path {
  fill: none;
  stroke: var(--color-brand-linkedin);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 3.2;
  stroke-dasharray: var(--len);
  stroke-dashoffset: var(--len);
  animation: li-draw var(--draw-dur, 0.5s) cubic-bezier(0.4, 0, 0.2, 1) var(--draw-delay, 0s) forwards;
}

@keyframes li-draw {
  to { stroke-dashoffset: 0; }
}
@keyframes li-pop-in {
  to { transform: scale(1); opacity: 1; }
}

/* ── Gmail copy animation ── */

/* 1. Container transitions: grows + flips bg after the icon fades (delay 0.1s) */
.gmail-card .action-icon {
  overflow: hidden;
  transition:
    width            0.28s cubic-bezier(0.34, 1.4, 0.64, 1) 0.1s,
    background-color 0.22s ease                              0.1s,
    padding          0.28s ease                              0.1s;
}

.gmail-card .action-icon.gmail-copied-label {
  opacity: 1 !important;
  transform: scale(1) !important;
  width: 86px;
  padding: 0 14px;
  background: var(--color-text-primary);
}

/* 2. Copy icon fades out immediately on click */
.gm-copy-icon {
  flex-shrink: 0;
  transition: opacity 0.12s ease;
}

.gm-copy-icon--out {
  opacity: 0 !important;
}

/* 3. "Copied" text fades in once the pill has grown (delay 0.3s) */
.gm-copied-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  gap: 3px;
  opacity: 0;
  font-size: var(--text-md);
  font-weight: var(--weight-semibold);
  color: var(--color-surface-card);
  white-space: nowrap;
  letter-spacing: var(--tracking-tight);
  pointer-events: none;
  transition: opacity 0.15s ease 0s;
}

.gm-copied-text--in {
  opacity: 1;
  transition: opacity 0.4s ease 0.3s;
}

.gm-check-lottie {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.gm-check-lottie svg {
  display: block;
  width: 100%;
  height: 100%;
  filter: var(--filter-checkmark);
}

/* ── Gmail animated icon ── */
.gm-svg {
  overflow: hidden;
  display: block;
}

.gm-from-top   { transform: translateY(-50px); opacity: 0; }
.gm-from-left  { transform: translateX(-70px); opacity: 0; }
.gm-from-right { transform: translateX(70px);  opacity: 0; }

.gm-from-top,
.gm-from-left,
.gm-from-right {
  animation-duration: 0.5s;
  animation-timing-function: cubic-bezier(0.34, 1.15, 0.64, 1);
  animation-delay: 0s;
  animation-fill-mode: both;
}

.gm-from-top   { animation-name: gm-in-top; }
.gm-from-left  { animation-name: gm-in-left; }
.gm-from-right { animation-name: gm-in-right; }

@keyframes gm-in-top {
  from { transform: translateY(-50px); opacity: 0; }
  to   { transform: translateY(0);     opacity: 1; }
}
@keyframes gm-in-left {
  from { transform: translateX(-70px); opacity: 0; }
  to   { transform: translateX(0);     opacity: 1; }
}
@keyframes gm-in-right {
  from { transform: translateX(70px);  opacity: 0; }
  to   { transform: translateX(0);     opacity: 1; }
}


/* ── UX Quote Card — expandable wrapper ── */
.ux-quote-card-wrapper {
  position: relative;
  width: 100%; height: 100%;
}

.ux-quote-card-wrapper > .ux-quote-card {
  width: 100%; height: 100%;
}

/* Ghost: hide collapsed card while expanded, keep grid slot occupied */
.ux-quote-card--ghost { opacity: 0; pointer-events: none; }

/* ── UX Quote expanded content ── */
.ux-quote-expanded-inner {
  padding: 40px 56px !important;   /* narrower side padding for 560px card */
  justify-content: center;
}

.ux-quote-expanded-icon {
  width: 36px; height: auto;
  display: block; flex-shrink: 0;
}

.ux-quote-expanded-quote {
  font-size: var(--quote-expanded-size);
  font-weight: var(--quote-expanded-weight);
  line-height: var(--quote-expanded-leading);
  text-align: center;
  color: var(--color-text-primary);
  transition: color 0.5s ease;
  margin: 0;
}

.ux-quote-expanded-quote strong {
  background: var(--gradient-brand);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: var(--weight-bold);
}


.ux-quote-expanded-body {
  font-size: var(--quote-body-size);
  line-height: var(--quote-body-leading);
  color: var(--color-text-body);
  display: flex;
  flex-direction: column;
  gap: 16px;
  text-align: left;
  width: 100%;
  transition: color 0.5s ease;
}

.ux-quote-expanded-body p { margin: 0; }

.ux-quote-expanded-list {
  padding-left: 20px;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ux-quote-expanded-list li {
  padding-left: 4px;
}

/* ── DS Quote Card — expandable wrapper ── */
.ds-quote-card-wrapper {
  position: relative;
  width: 100%; height: 100%;
}

.ds-quote-card-wrapper > .ds-quote-card {
  width: 100%; height: 100%;
}

.ds-quote-card--ghost {
  opacity: 0;
  pointer-events: none;
}

.ds-quote-expanded-inner {
  padding: 40px 56px !important;
  justify-content: center;
}

.ds-quote-expanded-icon {
  width: 36px;
  height: auto;
  display: block;
  flex-shrink: 0;
}

.ds-quote-expanded-quote {
  font-size: var(--quote-expanded-size);
  font-weight: var(--quote-expanded-weight);
  line-height: var(--quote-expanded-leading);
  text-align: center;
}

.ds-quote-expanded-quote strong {
  background: var(--gradient-brand);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}


.ds-quote-expanded-body {
  font-size: var(--quote-body-size);
  line-height: var(--quote-body-leading);
  color: var(--color-text-body);
  display: flex;
  flex-direction: column;
  gap: 16px;
  text-align: left;
}

/* Quote cards */
.ux-quote-card, .ds-quote-card {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 32px; gap: 16px;
}

.ux-quote-card .quote-text,
.ds-quote-card .quote-text {
  font-size: var(--quote-size); line-height: var(--quote-leading);
  color: var(--color-text-primary); transition: color 0.5s ease;
  font-weight: var(--quote-weight);
}

.ux-quote-card strong,
.ds-quote-card strong {
  background: var(--gradient-brand);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: var(--weight-bold);
}

.quote-icon {
  width: 29px; height: auto;
  display: block; flex-shrink: 0;
}

.design-principle {
  font-size: var(--principle-size);
  font-weight: var(--principle-weight);
  letter-spacing: var(--principle-tracking);
  text-transform: uppercase;
  color: var(--color-text-primary);
  opacity: 0.3;
  transition: color 0.5s ease;
}

/* ══════════════════════════════════════
   MOBILE BREAKPOINT — 2 columns
══════════════════════════════════════ */
@media (max-width: 768px) {

  /* ── Nav: floating pill at bottom ── */
  .nav {
    top: auto;
    bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    left: 24px;
    right: 24px;
    padding: 0;
    background: none;
    border: none;
  }

  /* Never hide on mobile — thumb needs it reachable */
  .nav--hidden {
    transform: none;
  }

  /* Logo lives at top of page on mobile, not in the nav */
  .nav-logo {
    display: none;
  }

  /* Hide lazy-mode toggle on mobile */
  .lazy-toggle {
    display: none;
  }

  /* Mobile page logo — centred above the grid */
  .mobile-page-logo {
    display: block;
    width: 48px;
    height: 48px;
    margin: 0 auto 20px;
  }

  /* Pills stretch to fill the nav, with more generous spacing */
  .nav-pills {
    position: relative;
    left: 0;
    transform: none;
    width: 100%;
    justify-content: center;
    padding: 6px;
    gap: 0;
  }

  /* nowrap: longer filter names must stay one line or the pill grows */
  .nav-pill {
    flex: 1;
    text-align: center;
    padding: 10px 4px;
    white-space: nowrap;
  }

  /* Stack logo above grid instead of side-by-side */
  .main {
    flex-direction: column;
    align-items: center;
    padding-top: 40px;
    padding-bottom: calc(90px + env(safe-area-inset-bottom, 0px));
  }

  /* ── Grid: 4 → 2 columns, fluid width ── */
  /* Row height = column width → 1:1 cards.
     Column width = (viewport − 2×24px padding − 18px gap) / 2
     width: 100% overrides align-items:center on .main so 1fr
     columns actually fill the available space. */
  .grid {
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: minmax(calc((100vw - 66px) / 2), auto);
    width: 100%;
  }

  /* Single-cell cards: enforce 1:1 via aspect-ratio as a safety net
     in case grid-auto-rows and column width drift apart. */
  .gmail-card,
  .linkedin-card,
  .bulb-card,
  .birds-card {
    aspect-ratio: 1 / 1;
  }

  /* Quote cards: 50% taller so text doesn't crop.
     Full-width cards (1/3), alone in their row, so growing is safe. */
  .ds-quote-card,
  .ux-quote-card {
    min-height: calc((100vw - 66px) * 0.75);
  }

  /* Card spans come from inline styles in App.js (the `m` value in
     layouts.yml); grid-auto-flow: dense (inherited) does the packing. */

  /* ── Animation delays — re-staggered for mobile reading order ── */
  .about-card-wrapper { --card-enter-delay: 0s;   }
  .gmail-card         { --card-enter-delay: 0.1s;  }
  .linkedin-card      { --card-enter-delay: 0.2s;  }
  .agentic-ds-card    { --card-enter-delay: 0.3s;  }
  .film-forest-card   { --card-enter-delay: 0.4s;  }
  .film-kea-card      { --card-enter-delay: 0.5s;  }
  .stat-money-card    { --card-enter-delay: 0.6s;  }
  .stat-users-card    { --card-enter-delay: 0.7s;  }
  .stat-years-card    { --card-enter-delay: 0.8s;  }
  .ds-quote-card      { --card-enter-delay: 0.9s;  }
  .ux-quote-card      { --card-enter-delay: 1.0s;  }
  .bulb-card          { --card-enter-delay: 1.1s;  }
  .birds-card         { --card-enter-delay: 1.2s;  }

  /* ── About card avatar — 1/3 of card width ── */
  .about-avatar {
    width:  calc((100vw - 48px) / 3);
    height: calc((100vw - 48px) / 3);
  }

  /* ── Expanded about card — tighter side padding on mobile ── */
  .about-expanded-inner {
    padding-left: 40px;
    padding-right: 40px;
  }

  /* ── Case study header — bring close button to edge on narrow screens ── */
  .cs-header {
    padding: 24px 24px;
  }

  /* ── TLDR bar — align with exit button ── */
  .tldr-bar {
    top: 24px;
  }

  /* ── Case study hero video — scale down with page padding ── */
  .cs-hero-video {
    width:  calc(100vw - 48px) !important;
    height: calc(100vw - 48px) !important;
    max-width: 448px;
    max-height: 448px;
  }

  /* ── Agentic DS hero wrap — match shrunk hero size ── */
  .ads-hero-wrap {
    width:  calc(100vw - 48px) !important;
    height: calc(100vw - 48px) !important;
    max-width: 448px;
    max-height: 448px;
  }

  /* ── Case study back-to-top — clear mobile browser nav bar ── */
  .cs-back-to-top {
    bottom: 48px;
  }

  /* ── Disable scroll-reveal on demo video only (IO unreliable in overlay on mobile) ── */
  .cs-expanded-content .cs-demo-video {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }

  /* ── Case study containers — fit viewport with same padding as text ── */
  .cs-demo-video {
    width: calc(100vw - 48px) !important;
    max-width: 680px;
  }

  .cs-cover-img {
    width: calc(100vw - 48px) !important;
    max-width: 680px;
  }


  /* Simplestream logo rail — 150% faster on smaller screen */
  .pc1-track {
    animation-duration: 16s;
  }

  /* ── Back-to-top sits above the bottom nav pill ── */
  .back-to-top {
    right: 24px;
    bottom: calc(78px + env(safe-area-inset-bottom, 0px));
  }

  /* ── Always show action icon (no hover needed) ── */
  .action-icon {
    opacity: 1;
    transform: scale(1);
  }

  /* ── Disable hover lift so tap goes straight to click ── */
  .bento-card:hover {
    transform: none;
    border-color: var(--color-border-card);
    box-shadow:
      0 1px 3px var(--color-shadow-card-rest),
      0 1px 2px var(--color-shadow-card-rest),
      inset 0 1px 0 var(--color-card-inset-top),
      inset 0 -1px 0 var(--color-card-inset-bottom);
  }

  .bento-card.dark:hover {
    border-color: rgba(255, 255, 255, 0.06);
    box-shadow:
      0 1px 3px var(--color-shadow-card-rest),
      0 1px 2px var(--color-shadow-card-rest),
      inset 0 1px 0 var(--color-card-inset-top),
      inset 0 -1px 0 var(--color-card-inset-bottom);
  }

  /* ── Pressed state — MUST come after hover reset to win specificity ── */
  .bento-card:active,
  .bento-card--pressed {
    transform: scale(0.97) !important;
    box-shadow:
      0 1px 3px var(--color-shadow-card-rest),
      0 1px 2px var(--color-shadow-card-rest),
      inset 0 1px 0 var(--color-card-inset-top),
      inset 0 -1px 0 var(--color-card-inset-bottom) !important;
    transition: transform 0.08s ease, box-shadow 0.08s ease !important;
  }
}

/* ══════════════════════════════════════
   REDUCED MOTION
   When the OS (or low-power mode) signals reduced motion,
   disable all keyframe animations and heavy transitions.
   Cards appear instantly; hover/active still work via
   simple property changes — just without animated movement.
══════════════════════════════════════ */
@media (prefers-reduced-motion: reduce) {
  /* Kill all keyframe animations globally */
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    animation-delay: 0s !important;
  }

  /* Cap transition durations to instant-feeling snaps */
  .bento-card,
  .bento-card:hover,
  .bento-card:active,
  .bento-card--pressed,
  .grid-slot,
  .nav-pill-indicator,
  .nav-pill-indicator--ready,
  .nav-pill-indicator--liquid,
  .back-to-top {
    transition-duration: 0.1s !important;
  }

  /* Hide custom cursor — native cursor is fine */
  .cs-root,
  .cursor-tooltip {
    display: none !important;
  }

  /* Restore native cursor when custom one is hidden */
  *, *::before, *::after {
    cursor: auto !important;
  }

  /* Remove persistent GPU layers that aren't needed without animation */
  .bento-card {
    will-change: auto !important;
  }

  .nav-pill-indicator {
    will-change: auto !important;
  }

  .ba-img {
    will-change: auto !important;
  }
}


/* ═══════════════════════════════════════════════════════════
 *  AGENTIC DS CASE STUDY
 * ═══════════════════════════════════════════════════════════ */

/* ── Card styling ── */
.agentic-ds-card {
  background: var(--color-surface-claude);
}

.agentic-ds-card video {
  width: 100%;
  height: 100%;
  opacity: 0;
  pointer-events: none;
}

/* Magnetic canvas background */
.ads-card-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

/* Card face — logos + pixel title */
.ads-card-face {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  pointer-events: none;
  z-index: 1;
}

.ads-card-logos {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ads-card-logo-wrap {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.ads-card-logo {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.ads-card-logo--claude {
  filter: brightness(0) invert(1);
}

.ads-card-title {
  font-family: 'Tiny5', monospace;
  font-size: 40px;
  line-height: 1;
  color: var(--color-text-on-primary);
  text-align: center;
  white-space: pre-line;
  margin: 0;
}

/* Collapsed card image — fills card for fly animation bounding rect */
.ads-hero-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Hero wrapper — mirrors ss-ds-hero-wrap pattern */
.ads-hero-wrap {
  border-radius: 32px;
  overflow: hidden;
  margin-top: 40px;
}

.ads-hero-wrap .cs-hero-video {
  margin-top: 0;
}

.ads-hero-overlay {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  overflow: hidden;
}

/* Fly overlay — logos + text that ride the flying element during transition */
.ads-fly-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  pointer-events: none;
}

/* ── Token Layer Demo ── */
.ads-token-demo {
  margin: 20px 0 4px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--color-border-card);
}

.ads-token-layer {
  border-bottom: 1px solid var(--color-border-card);
}

.ads-token-layer:last-child {
  border-bottom: none;
}

.ads-token-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  cursor: pointer;
  background: var(--color-surface-card);
  transition: background 0.15s ease;
}

.ads-token-header:hover {
  background: var(--color-surface-card-white);
}

.ads-token-tier {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ads-token-tier-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 6px;
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  background: var(--color-surface-card-white);
  color: var(--color-text-primary);
  letter-spacing: var(--tracking-wide);
  border: 1px solid var(--color-border-card);
  font-family: var(--font-family-mono, monospace);
}

.ads-token-tier-desc {
  font-size: var(--text-sm);
  color: var(--color-text-subtle);
}

.ads-token-chevron {
  font-size: 20px;
  color: var(--color-text-subtle);
  font-weight: var(--weight-bold);
  width: 24px;
  text-align: center;
}

.ads-token-rows-wrap {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.55s cubic-bezier(0.22, 0.61, 0.36, 1);
  will-change: grid-template-rows;
}

.ads-token-layer--open .ads-token-rows-wrap {
  grid-template-rows: 1fr;
}

.ads-token-rows {
  min-height: 0;
  overflow: hidden;
  padding: 0 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--color-surface-card-white);
  opacity: 0;
  transition: opacity 0.4s cubic-bezier(0.22, 0.61, 0.36, 1) 0.05s;
}

.ads-token-layer--open .ads-token-rows {
  opacity: 1;
}

.ads-token-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 0;
}

.ads-token-swatch {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  flex-shrink: 0;
}

.ads-token-swatch--sm {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  display: inline-block;
  vertical-align: middle;
  margin-right: 4px;
}

.ads-token-name {
  font-family: var(--font-family-mono);
  font-size: var(--text-xs);
  color: var(--color-text-primary);
  min-width: 260px;
}

.ads-token-value {
  font-size: var(--text-xs);
  color: var(--color-text-subtle);
}

.ads-token-dark {
  font-size: var(--text-xs);
  color: var(--color-text-subtle);
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 4px;
}


/* ── Workflow crossfade transition ── */
.ads-fade-enter-active,
.ads-fade-leave-active {
  transition: opacity 0.35s cubic-bezier(0.22, 0.61, 0.36, 1),
              transform 0.35s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.ads-fade-enter-from {
  opacity: 0;
  transform: translateY(6px);
}

.ads-fade-leave-to {
  opacity: 0;
  transform: translateY(-6px);
}

/* ── Agent Workflow Demo ── */
.ads-workflow-demo {
  margin: 20px 0 4px;
  border-radius: 12px;
  border: 1px solid var(--color-border-card);
  overflow: hidden;
}

.ads-workflow-tabs {
  display: flex;
  gap: 0;
  background: var(--color-surface-card);
  border-bottom: 1px solid var(--color-border-card);
}

.ads-workflow-tab {
  flex: 1;
  padding: 12px 16px;
  border: none;
  background: none;
  font-family: var(--font-family-primary);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--color-text-subtle);
  cursor: pointer;
  transition: all 0.15s ease;
  border-bottom: 2px solid transparent;
}

.ads-workflow-tab:hover {
  color: var(--color-text-primary);
}

.ads-workflow-tab--active {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
}

.ads-workflow-card-wrap {
  background: var(--color-surface-card-white);
  overflow: hidden;
  transition: height 0.35s cubic-bezier(0.22, 0.61, 0.36, 1);
  will-change: height;
}

.ads-workflow-card {
  display: flex;
  align-items: stretch;
  padding: 24px;
  gap: 16px;
}

.ads-workflow-step {
  flex: 1;
  padding: 16px;
  border-radius: 8px;
  background: var(--color-surface-card);
}

.ads-workflow-step p {
  font-size: var(--text-base);
  line-height: var(--leading-relaxed);
  color: var(--color-text-primary);
  margin: 0;
}

.ads-workflow-step--outcome {
  background: linear-gradient(135deg, rgba(0, 139, 139, 0.06), rgba(124, 92, 252, 0.06));
}

.ads-workflow-label {
  display: block;
  font-size: var(--text-2xs);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-widest);
  text-transform: uppercase;
  color: var(--color-text-subtle);
  margin-bottom: 8px;
}

.ads-workflow-arrow {
  display: flex;
  align-items: center;
  color: var(--color-text-subtle);
  font-size: 20px;
  flex-shrink: 0;
}

@keyframes ads-slide-in {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.ads-workflow-slide {
  opacity: 0;
  animation: ads-slide-in 0.45s cubic-bezier(0.22, 0.61, 0.36, 1) forwards;
  animation-delay: var(--delay, 0ms);
}


/* ── Browser Window ── */
.ads-browser-window {
  display: block;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--color-border-card);
  background: var(--color-surface-card);
  margin: 32px 40px 16px;
}

.ads-browser-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  background: var(--color-surface-card);
  border-bottom: 1px solid var(--color-border-card);
}

.ads-browser-dots {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.ads-browser-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.ads-browser-dot--red    { background: #ff5f57; }
.ads-browser-dot--yellow { background: #febc2e; }
.ads-browser-dot--green  { background: #28c840; }

.ads-browser-address {
  flex: 1;
  text-align: center;
  font-size: var(--text-xs);
  color: var(--color-text-subtle);
  background: var(--color-surface-card-white);
  border-radius: 6px;
  padding: 4px 12px;
  font-family: var(--font-family-primary);
}

.ads-browser-viewport {
  position: relative;
  line-height: 0;
}

/* ── Results grid ── */
.cs-results {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin: 24px 0 40px;
}

.cs-result-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px 16px;
  border-radius: 12px;
  background: var(--color-surface-card);
  border: 1px solid var(--color-border-card);
  text-align: center;
}

.cs-result-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-family-heading);
  font-size: var(--text-8xl);
  font-weight: var(--weight-semibold);
  background: var(--gradient-brand);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
  margin-bottom: 8px;
}

/* Nudge the transition arrow onto the digits' optical centre */
.cs-result-arrow {
  font-size: 0.66em;
  margin: 0 0.04em;
  font-weight: var(--weight-medium);
}

.cs-result-label {
  font-size: var(--text-sm);
  color: var(--color-text-subtle);
  line-height: var(--leading-normal);
}


/* ── Mobile responsive ── */
@media (max-width: 768px) {
  .ads-workflow-card {
    flex-direction: column;
  }

  .ads-workflow-arrow {
    transform: rotate(90deg);
    justify-content: center;
  }

  .cs-results {
    grid-template-columns: repeat(2, 1fr);
  }

  .ads-token-name {
    min-width: 0;
    font-size: 9px;
  }

  .ads-token-tier-desc {
    display: none;
  }

  .cs-meta {
    flex-direction: column;
  }
}

/* ═══════════════════════════════════════════════════════════
 *  UPA ADDITIONS — logo, new cards, case-study demos
 * ═══════════════════════════════════════════════════════════ */

/* ── "Upa(manyu)" logo — nav + mobile page header ── */
.upa-logo {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}

.upa-logo-text {
  font-family: var(--font-family-primary);
  font-weight: 800;
  font-size: 26px;
  letter-spacing: -0.5px;
  color: var(--color-text-primary);
  transition: color 0.5s ease;
  white-space: nowrap;
}

.upa-logo-text::after {
  content: '.';
  background: var(--gradient-brand);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* The hidden "manyu" unfolds on hover */
.upa-logo-rest {
  display: inline-block;
  max-width: 0;
  opacity: 0;
  overflow: hidden;
  vertical-align: bottom;
  transition: max-width 0.45s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.3s ease;
}

.upa-logo:hover .upa-logo-rest {
  max-width: 160px;  /* "manyu" measures 144px — headroom for fallback fonts */
  opacity: 1;
}

.mobile-page-logo.upa-logo {
  display: none;
  width: auto;
  height: auto;
  justify-content: center;
}

/* ── About expanded — injected Jekyll content ── */
.about-expanded-body { display: contents; }

.about-pronounce {
  margin-top: 8px;
  padding: 14px 18px;
  border-radius: 16px;
  background: var(--color-surface-hover);
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: background 0.5s ease;
}

.about-pronounce-ipa {
  font-family: var(--font-family-mono);
  font-size: var(--text-sm);
  color: var(--color-primary);
}

.about-pronounce-guide {
  font-family: var(--font-family-primary);
  font-size: var(--text-sm);
  line-height: var(--leading-normal);
  color: var(--color-text-body);
}

.about-principles {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.about-principles-title {
  font-family: var(--font-family-primary);
  font-size: var(--text-2xl);
  font-weight: var(--weight-bold);
  color: var(--color-text-primary);
  margin: 0 0 2px;
  transition: color 0.5s ease;
}

.about-principle {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.about-principle-name {
  font-family: var(--font-family-primary);
  font-weight: var(--weight-semibold);
  font-size: var(--text-lg);
  background: var(--gradient-brand);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.about-principle-body {
  font-family: var(--font-family-primary);
  font-size: var(--text-base);
  line-height: var(--leading-relaxed);
  color: var(--color-text-body);
  margin: 0;
  transition: color 0.5s ease;
}

/* ── Brand-coloured bio links ── */
.bio-link.brand-octopus   { color: var(--color-brand-octopus);   font-weight: 700; }
.bio-link.brand-bms       { color: var(--color-brand-bms);       font-weight: 700; }
.bio-link.brand-cleartrip { color: var(--color-brand-cleartrip); font-weight: 700; }
.bio-link.brand-tmnz      { color: var(--color-brand-tmnz);      font-weight: 700; }
.bio-link.brand-nid       { color: var(--color-brand-nid);       font-weight: 700; }
.bio-link.brand-jj        { color: var(--color-brand-jj);        font-weight: 700; }
.bio-link.brand-forest    { color: var(--color-brand-forest);    font-weight: 700; }
.bio-link.brand-kea       { color: var(--color-brand-kea-orange);font-weight: 700; }

/* ── Bulb card — auto badge (third theme state) ── */
.bulb-auto-badge {
  position: absolute;
  left: 16px;
  bottom: 14px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border-radius: 100px;
  background: var(--color-surface-action-icon);
  box-shadow: 0 2px 12px var(--color-shadow-action-icon);
  font-family: var(--font-family-primary);
  font-size: 11px;
  font-weight: var(--weight-semibold);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-text-primary);
  opacity: 0;
  transform: translateY(6px) scale(0.9);
  transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.5s ease, color 0.5s ease;
  pointer-events: none;
}

.bulb-card.is-auto .bulb-auto-badge {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* ── Birds card ── */
.birds-card {
  cursor: pointer;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Lottie is 16:9 — sized off the card width, lifted clear of the label */
.birds-lottie {
  width: 126%;
  margin-top: -12%;
}

/* Dark theme: flip the toucan's monochrome plumage, leave the beak alone.
   Lottie paints these as presentation attributes, so CSS wins. */
[data-theme="dark"] .birds-lottie path[fill="rgb(0,0,0)"]         { fill: #ece9e3; }
[data-theme="dark"] .birds-lottie path[fill="rgb(255,255,255)"]   { fill: #1c1c22; }
[data-theme="dark"] .birds-lottie stop[stop-color="rgb(40,40,40)"] { stop-color: #f4f2ee; }
[data-theme="dark"] .birds-lottie stop[stop-color="rgb(20,20,20)"] { stop-color: #e4e1da; }
[data-theme="dark"] .birds-lottie stop[stop-color="rgb(0,0,0)"]    { stop-color: #cfcbc2; }

.birds-label {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 14px;
  display: flex;
  flex-direction: column;
  gap: 1px;
  pointer-events: none;
}

.birds-label-title {
  font-family: var(--font-family-primary);
  font-weight: var(--weight-semibold);
  font-size: var(--text-base);
  color: var(--color-text-primary);
  transition: color 0.5s ease;
}

.birds-label-sub {
  font-family: var(--font-family-primary);
  font-size: 11px;
  line-height: 1.35;
  color: var(--color-text-subtle);
  transition: color 0.5s ease;
}

/* ── Film poster cards ── */
.film-card {
  cursor: pointer;
  padding: 0 !important;
  overflow: hidden;
}

.film-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.film-card:hover .film-svg { transform: scale(1.04); }

/* Stars twinkle (forest) */
.film-star { animation: film-twinkle 3.4s ease-in-out infinite; }
@keyframes film-twinkle {
  0%, 100% { opacity: 0.25; }
  50%      { opacity: 1; }
}

/* Mist drifts between the ridgelines */
.film-mist--far  { animation: film-drift 14s ease-in-out infinite alternate; }
.film-mist--near { animation: film-drift 10s ease-in-out infinite alternate-reverse; }
@keyframes film-drift {
  from { transform: translateX(-14px); }
  to   { transform: translateX(16px); }
}

.film-title-block {
  position: absolute;
  left: 20px;
  right: 20px;
  bottom: 18px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  z-index: 1;
  pointer-events: none;
}

.film-eyebrow {
  font-family: var(--font-family-primary);
  font-size: 10px;
  font-weight: var(--weight-semibold);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.72);
}

.film-title {
  font-family: var(--font-family-primary);
  font-size: var(--text-3xl);
  font-weight: 800;
  line-height: 1.1;
  color: #ffffff;
}

.film-kea-card .film-eyebrow { color: rgba(30, 40, 30, 0.6); }
.film-kea-card .film-title   { color: #2a3324; }

/* ── Stat cards ── */
.stat-card-wrapper {
  position: relative;
  width: 100%; height: 100%;
}
.stat-card-wrapper > .stat-card { width: 100%; height: 100%; }

.stat-card {
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  padding: 28px;
  overflow: hidden;
}

.stat-card--ghost { opacity: 0; pointer-events: none; }

.stat-value {
  font-family: var(--font-family-heading);
  font-size: var(--text-8xl);
  font-weight: var(--weight-bold);
  line-height: 1;
  background: var(--gradient-brand);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stat-label {
  font-family: var(--font-family-primary);
  font-size: var(--text-sm);
  line-height: var(--leading-normal);
  color: var(--color-text-body);
  transition: color 0.5s ease;
}

.stat-expanded-inner { justify-content: center; }

.stat-expanded-value {
  font-family: var(--font-family-heading);
  font-size: 64px;
  font-weight: var(--weight-bold);
  line-height: 1;
  background: var(--gradient-brand);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stat-expanded-label {
  font-family: var(--font-family-primary);
  font-size: var(--text-xl);
  color: var(--color-text-primary);
  margin: 6px 0 0;
  transition: color 0.5s ease;
}

.stat-breakdown-title {
  font-family: var(--font-family-primary);
  font-size: var(--text-base);
  font-weight: var(--weight-semibold);
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--color-text-subtle);
  margin: 26px 0 0;
}

.stat-breakdown {
  display: flex;
  flex-direction: column;
  margin-top: 4px;
}

.stat-breakdown-row {
  padding: 14px 0;
  border-bottom: 1px solid var(--color-border-card);
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.stat-breakdown-row:last-child { border-bottom: none; }

.stat-breakdown-segment {
  font-family: var(--font-family-primary);
  font-weight: var(--weight-semibold);
  font-size: var(--text-lg);
  color: var(--color-text-primary);
  transition: color 0.5s ease;
}

.stat-breakdown-detail {
  font-family: var(--font-family-primary);
  font-size: var(--text-base);
  line-height: var(--leading-relaxed);
  color: var(--color-text-body);
  margin: 0;
  transition: color 0.5s ease;
}

.stat-footnote {
  font-family: var(--font-family-primary);
  font-size: var(--text-sm);
  font-style: italic;
  color: var(--color-text-subtle);
  margin: 18px 0 0;
}

/* ── Case study: injected Jekyll body ── */
.cs-jekyll-root,
.cs-jekyll-body { display: contents; }

/* Parent-class TL;DR variant (CsContent toggles .tldr-on) */
.tldr-on .tldr-collapsible {
  grid-template-rows: 0fr;
  opacity: 0;
}

/* ── Demo: token architecture diagram (ta-) ── */
.ta-diagram {
  width: 100%;
  max-width: 640px;
  margin: 24px auto 0;
  padding: 20px;
  border-radius: 20px;
  background: var(--color-surface-card);
  border: 1px solid var(--color-border-card);
  transition: background 0.5s ease;
}

.ta-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.ta-col-labels {
  display: flex;
  gap: 0;
  flex: 1;
}
.ta-col-labels span {
  flex: 1;
  font-family: var(--font-family-primary);
  font-size: 11px;
  font-weight: var(--weight-semibold);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-subtle);
}

.ta-toggle {
  display: flex;
  gap: 4px;
  background: var(--color-surface-hover);
  border-radius: 100px;
  padding: 3px;
}

.ta-toggle-btn {
  border: none;
  background: transparent;
  padding: 5px 12px;
  border-radius: 100px;
  font-family: var(--font-family-primary);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text-body);
  cursor: pointer;
  transition: background 0.25s ease, color 0.25s ease;
}

.ta-toggle-btn--active {
  background: var(--color-surface-card);
  color: var(--color-text-primary);
  box-shadow: 0 1px 4px var(--color-shadow-card-rest);
}

.ta-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 0;
  border-top: 1px solid var(--color-border-card);
}

.ta-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 11px;
  border-radius: 10px;
  font-family: var(--font-family-mono);
  font-size: 12px;
  background: var(--color-surface-hover);
  color: var(--color-text-primary);
  white-space: nowrap;
  transition: background 0.4s ease, color 0.4s ease;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ta-chip--semantic { color: var(--color-primary); font-weight: 600; }

.ta-swatch {
  width: 14px;
  height: 14px;
  border-radius: 4px;
  border: 1px solid var(--color-border-card);
  flex-shrink: 0;
  transition: background 0.4s ease;
}

.ta-chip-label { font-family: var(--font-family-primary); font-size: 12px; }

.ta-arrow {
  color: var(--color-text-subtle);
  font-size: 14px;
  flex-shrink: 0;
}

.ta-note {
  margin: 14px 0 0;
  font-family: var(--font-family-primary);
  font-size: var(--text-sm);
  font-style: italic;
  color: var(--color-text-subtle);
}

/* ── Demo: theme window (tw-) ── */
.tw-window {
  width: 100%;
  max-width: 640px;
  margin: 24px auto 0;
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid var(--color-border-card);
  background: #faf9f7;
  transition: background 0.45s ease;
}

.tw-window--dark { background: #12121e; }

.tw-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: rgba(0, 0, 0, 0.05);
}
.tw-window--dark .tw-bar { background: rgba(255, 255, 255, 0.06); }

.tw-dots { display: flex; gap: 5px; }
.tw-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.tw-dot--red    { background: #ff5f57; }
.tw-dot--yellow { background: #febc2e; }
.tw-dot--green  { background: #28c840; }

.tw-title {
  font-family: var(--font-family-mono);
  font-size: 11px;
  color: #888888;
  flex: 1;
}
.tw-window--dark .tw-title { color: #666680; }

.tw-modes { display: flex; gap: 3px; }

.tw-mode-btn {
  border: none;
  background: transparent;
  font-family: var(--font-family-primary);
  font-size: 11px;
  padding: 4px 9px;
  border-radius: 100px;
  color: #888888;
  cursor: pointer;
  transition: background 0.25s ease, color 0.25s ease;
}

.tw-mode-btn--active { background: #0f9b8e; color: #ffffff; }

.tw-canvas {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 12px;
  padding: 18px;
}

.tw-mini-card {
  border-radius: 14px;
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.07);
  padding: 12px;
  min-height: 84px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
  transition: background 0.45s ease, border-color 0.45s ease;
}
.tw-window--dark .tw-mini-card {
  background: #1a1a2e;
  border-color: rgba(255, 255, 255, 0.08);
}

.tw-mini-advisor { flex-direction: row; align-items: center; }

.tw-mini-avatar {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1b2a4a, #0f9b8e);
  flex-shrink: 0;
}

.tw-mini-lines { display: flex; flex-direction: column; gap: 6px; flex: 1; }

.tw-mini-line {
  height: 7px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.12);
  transition: background 0.45s ease;
}
.tw-mini-line--short { width: 60%; }
.tw-window--dark .tw-mini-line { background: rgba(255, 255, 255, 0.16); }

/* The savings figure — green is reserved for money saved, nothing else */
.tw-mini-figure {
  font-family: var(--font-family-heading);
  font-weight: 700;
  font-size: 17px;
  color: #2e9e5b;
}

.tw-mini-caption {
  font-family: var(--font-family-mono);
  font-size: 9px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #8a94a6;
}

.tw-mini-badge {
  align-self: flex-start;
  padding: 2px 7px;
  border-radius: 999px;
  font-family: var(--font-family-mono);
  font-size: 9px;
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.tw-mini-badge--advisor { background: rgba(15, 155, 142, 0.14); color: #0f9b8e; }
.tw-mini-badge--overdue { background: rgba(209, 61, 61, 0.14);  color: #d13d3d; }

.tw-caption {
  margin: 0;
  padding: 0 18px 16px;
  font-family: var(--font-family-primary);
  font-size: var(--text-sm);
  font-style: italic;
  color: #888888;
}
.tw-window--dark .tw-caption { color: #666680; }

/* ── Demo: component spec panel (sp-panel, cd- code pane) ── */
.sp-panel {
  width: 100%;
  max-width: 640px;
  margin: 24px auto 0;
}

.sp-toggle { justify-content: flex-start; margin-bottom: 10px; }

/* Short enough that the jump to the agent view is the point */
.sp-code { min-height: 150px; }

.sp-name {
  color: #ffffff;
  font-weight: 600;
}

.sp-caption { padding: 10px 2px 0; }

.cd-code {
  border-radius: 16px;
  background: var(--color-widget-bg);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
}

.cd-code-title {
  font-family: var(--font-family-mono);
  font-size: 10px;
  color: var(--color-primitive-neutral-350);
  margin-bottom: 10px;
}

.cd-pre {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1;
  overflow-x: auto;   /* long spec lines scroll, never widen the page */
}

.cd-line {
  font-family: var(--font-family-mono);
  font-size: 12px;
  line-height: 1.6;
  color: #c8c8d8;
  border-radius: 5px;
  padding: 0 6px;
  transition: background 0.3s ease, color 0.3s ease;
}

/* ── Demo: state matrix (sm-) ── */
.sm-matrix {
  width: 100%;
  max-width: 640px;
  margin: 24px auto 0;
}

.sm-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 14px;
}

.sm-tab {
  padding: 5px 11px;
  border: 1px solid var(--color-border-card);
  border-radius: 999px;
  background: transparent;
  font-family: var(--font-family-mono);
  font-size: 11px;
  color: var(--color-text-subtle);
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.sm-tab:hover { color: var(--color-text-primary); }
.sm-tab--active {
  background: var(--color-text-primary);
  border-color: var(--color-text-primary);
  color: var(--color-surface-card);
}

.sm-stage {
  border-radius: 16px;
  background: var(--color-surface-card);
  border: 1px solid var(--color-border-card);
  padding: 18px;
  transition: background 0.5s ease;
}

.sm-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid var(--color-border-card);
  border-left: 3px solid var(--sm-accent);
  background: var(--color-bg-body);
  animation: sm-in 0.3s ease both;
}

.sm-row--hover    { background: rgba(15, 155, 142, 0.08); }
.sm-row--focus    { outline: 2px solid #0f9b8e; outline-offset: 2px; }
.sm-row--disabled { opacity: 0.55; }

.sm-row-dot {
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--sm-accent);
  flex-shrink: 0;
}

.sm-row-label {
  flex: 1;
  font-family: var(--font-family-mono);
  font-size: 13px;
  color: var(--color-text-primary);
}

.sm-row-chevron { color: var(--color-text-subtle); font-size: 18px; }

.sm-note {
  margin: 12px 0 0;
  font-family: var(--font-family-primary);
  font-size: var(--text-sm);
  font-style: italic;
  color: var(--color-text-subtle);
}
.sm-note code {
  font-family: var(--font-family-mono);
  font-style: normal;
  font-size: 12px;
  color: var(--color-primary);
}

@keyframes sm-in {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: none; }
}

/* ── Demo: drift-audit terminal (dt-) ── */
.dt-terminal {
  width: 100%;
  max-width: 640px;
  margin: 24px auto 0;
  border-radius: 16px;
  overflow: hidden;
  background: var(--color-widget-bg);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.dt-bar {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.05);
}

.dt-title {
  font-family: var(--font-family-mono);
  font-size: 10px;
  color: var(--color-primitive-neutral-350);
  margin-left: 8px;
}

.dt-body {
  padding: 14px 16px 18px;
  min-height: 240px;
}

.dt-line {
  font-family: var(--font-family-mono);
  font-size: 12px;
  line-height: 1.75;
  white-space: pre-wrap;
  word-break: break-word;
}

.dt-cmd  { color: #ffffff; }
.dt-info { color: #c8c8d8; }
.dt-ok   { color: #34d399; }
.dt-warn { color: #fbbf24; }
.dt-dim  { color: #666680; }
.dt-typing { color: #c8c8d8; }

.dt-cursor {
  display: inline-block;
  width: 7px;
  height: 13px;
  margin-left: 2px;
  background: #34d399;
  vertical-align: text-bottom;
  animation: dt-blink 1s step-end infinite;
}
@keyframes dt-blink { 50% { opacity: 0; } }

/* ── Demo: Figma source-of-truth window (rw-) ── */
.rw-viewport {
  background: var(--color-surface-card);
  transition: background 0.5s ease;
}

.rw-tree {
  padding: 22px 26px;
  display: flex;
  flex-direction: column;
}

.rw-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 11px 0;
  border-bottom: 1px solid var(--color-border-card);
}
.rw-row:last-child { border-bottom: none; }

.rw-path {
  font-family: var(--font-family-mono);
  font-size: 13px;
  color: var(--color-text-primary);
  transition: color 0.5s ease;
}

.rw-note {
  font-family: var(--font-family-primary);
  font-size: var(--text-sm);
  font-style: italic;
  color: var(--color-text-subtle);
  text-align: right;
  white-space: nowrap;
}

/* ── Mobile — new components ── */
@media (max-width: 768px) {
  .mobile-page-logo.upa-logo { display: flex; }

  /* Logo lives above the grid on mobile — .upa-logo below re-shows it
     otherwise, so the hide has to be restated here. */
  .nav-logo.upa-logo { display: none; }

  .stat-card { min-height: calc((100vw - 66px) * 0.42); }

  /* Narrow card, four-line label — pull the bird up, and left of the icon */
  .birds-lottie { width: 84%; margin-top: -28%; transform: translateX(-12%); }

  .film-title { font-size: var(--text-2xl); }

  .sp-code { min-height: 0; }
  .sp-toggle { flex-wrap: wrap; }

  .sm-stage { padding: 12px; }
  .sm-row { padding: 12px; }

  .ta-row { flex-wrap: wrap; }
  .ta-chip { flex: 1 1 100%; }
  .ta-arrow { display: none; }
  .ta-col-labels { display: none; }

  .tw-canvas { grid-template-columns: 1fr 1fr; }
  .tw-mini-advisor { grid-column: 1 / 3; }

  .rw-note { display: none; }
}

/* Nav logo is a text wordmark, not the ref's 46px image */
.nav-logo.upa-logo {
  width: auto;
  height: 46px;
}

/* ═══════════════════════════════════════════════════════════
 *  CASE-STUDY DEMOS — shared primitives, then one block per study
 *  cs-*  shared   ·  pf-* phone  ·  aw-* app window
 *  tk-*  ticketing ·  rv-* reviews ·  go-* group optimiser
 * ═══════════════════════════════════════════════════════════ */

/* ── Shared: segmented tabs ── */
.cs-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.cs-tab {
  padding: 7px 14px;
  border-radius: 100px;
  border: 1px solid var(--color-border-card);
  background: var(--color-surface-card);
  font-family: var(--font-family-primary);
  font-size: var(--text-md);
  font-weight: var(--weight-medium);
  color: var(--color-text-primary);
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.cs-tab:hover { border-color: var(--color-primary); }

.cs-tab--on {
  background: var(--gradient-brand);
  border-color: transparent;
  color: var(--color-text-on-primary);
}

.cs-tabs--wide .cs-tab { flex: 1 1 auto; text-align: center; }

/* ── Shared: chips ── */
.cs-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 12px;
}

.cs-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 11px;
  border-radius: 100px;
  border: 1px solid var(--color-border-card);
  background: var(--color-surface-card);
  font-family: var(--font-family-primary);
  font-size: var(--text-sm);
  color: var(--color-text-primary);
  cursor: pointer;
  text-align: left;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

.cs-chip i {
  font-style: normal;
  font-size: var(--text-2xs);
  opacity: 0.55;
}

.cs-chip:hover { border-color: var(--color-primary); }

.cs-chip--on {
  background: var(--color-primary);
  border-color: transparent;
  color: var(--color-text-on-primary);
}

/* ── Shared: caption under a demo ── */
.cs-note {
  font-family: var(--font-family-primary);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  color: var(--color-text-primary);
  opacity: 0.62;
  margin: 12px 0 0;
}

/* ── Shared: action button ── */
.cs-run {
  padding: 8px 16px;
  border: none;
  border-radius: 100px;
  background: var(--gradient-brand);
  color: var(--color-text-on-primary);
  font-family: var(--font-family-primary);
  font-size: var(--text-md);
  font-weight: var(--weight-semibold);
  cursor: pointer;
  white-space: nowrap;
}

.cs-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

/* ── Shared: pull-quote in case-study prose ── */
.cs-quote-block {
  margin: 8px 0 28px;
  padding: 4px 0 4px 20px;
  border-left: 3px solid var(--color-primary);
  font-family: var(--font-family-primary);
  font-size: var(--text-5xl);
  font-weight: var(--weight-medium);
  line-height: var(--leading-loose);
  color: var(--color-text-primary);
}

/* ── Shared: phone frame ── */
.pf { margin: 0; }

.pf-body {
  position: relative;
  width: 260px;
  margin: 0 auto;
  padding: 7px;
  border-radius: 32px;
  background: #0b0b12;
  box-shadow: 0 10px 30px var(--color-shadow-card-expanded);
}

/* iPhone notch, cut into the top of the screen */
.pf-notch {
  position: absolute;
  z-index: 3;
  top: 7px;
  left: 50%;
  transform: translateX(-50%);
  width: 27%;
  aspect-ratio: 3.4;
  border-radius: 0 0 12px 12px;
  background: #0b0b12;
}

.pf-screen {
  display: flex;
  flex-direction: column;
  aspect-ratio: 430 / 932;   /* iPhone 14 Pro Max screen */
  min-height: 0;
  overflow: hidden;
  padding-top: 9%;           /* safe area under the notch */
  border-radius: 26px;
  background: var(--color-proto-screen);
  color: var(--color-primitive-neutral-750);
  font-family: var(--font-family-system);
}

/* No desktop scrollbars bleeding through any coded screenshot */
.cs-demo, .cs-demo *, .pf-screen, .pf-screen * { scrollbar-width: none; -ms-overflow-style: none; }
.cs-demo::-webkit-scrollbar, .cs-demo *::-webkit-scrollbar,
.pf-screen::-webkit-scrollbar, .pf-screen *::-webkit-scrollbar { width: 0; height: 0; display: none; }

.pf-body--dark .pf-screen { background: #14162a; color: #e6e6f0; }
.pf-body--warm .pf-screen { background: #fffaf6; }

.pf-label {
  margin-top: 10px;
  font-size: var(--text-sm);
  text-align: center;
  color: var(--color-text-primary);
  opacity: 0.6;
}

/* ── Shared: desktop app window ── */
.aw {
  display: flex;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--color-panel-border);
  background: var(--color-panel-bg);
  font-family: var(--font-family-system);
  color: var(--color-panel-text);
}

.aw-nav {
  flex: 0 0 132px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 12px 8px;
  background: #0c4a5e;
}

.aw-nav-item {
  padding: 6px 9px;
  border-radius: 6px;
  font-size: var(--text-2xs);
  color: rgba(255, 255, 255, 0.62);
  white-space: nowrap;
}

.aw-nav-item--on { background: rgba(255, 255, 255, 0.14); color: #fff; }

.aw-main { flex: 1 1 auto; min-width: 0; }

.aw-bar {
  padding: 10px 14px;
  border-bottom: 1px solid var(--color-panel-border-subtle);
  background: var(--color-panel-surface);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
}

.aw-body { padding: 14px; }

/* ═══ Study: re-envisioning a mass ticketing platform ═══ */

/* Audience split */
.tk-dots {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 6px;
  margin: 4px 0 18px;
}

.tk-dot {
  aspect-ratio: 1;
  border-radius: 50%;
  border: 1px solid var(--color-text-muted);
  background: transparent;
  transition: background 0.35s ease, border-color 0.35s ease;
}

.tk-dot--on { background: var(--color-primary); border-color: var(--color-primary); }

.tk-split-stat {
  font-size: var(--text-4xl);
  line-height: var(--leading-tight);
  color: var(--color-text-primary);
  margin: 0 0 8px;
}

.tk-split-stat strong {
  font-size: var(--text-8xl);
  background: var(--gradient-brand);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.tk-split-lever {
  font-size: var(--text-2xl);
  line-height: var(--leading-relaxed);
  color: var(--color-text-primary);
  margin: 0;
}

/* Navigation shell */
.tk-screenhead {
  padding: 12px 12px 8px;
  font-size: var(--text-md);
  font-weight: var(--weight-semibold);
}

.tk-screenbody {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 0 12px;
}

.tk-rowlabel {
  margin: 10px 0 6px;
  font-size: var(--text-2xs);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wider);
  opacity: 0.5;
}

.tk-banner {
  height: 62px;
  border-radius: 8px;
  margin-bottom: 8px;
  background: linear-gradient(120deg, var(--color-primary), var(--color-primitive-purple-600));
  opacity: 0.75;
}

.tk-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-bottom: 8px;
}

.tk-tile {
  aspect-ratio: 3 / 4;
  border-radius: 6px;
  background: currentColor;
  opacity: 0.12;
}

.tk-listrow {
  height: 26px;
  border-radius: 5px;
  margin-bottom: 6px;
  background: currentColor;
  opacity: 0.1;
}

.tk-rail { display: flex; gap: 6px; margin-bottom: 8px; }

.tk-rail-dot {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.18;
}

.tk-feedcard {
  height: 92px;
  border-radius: 8px;
  margin-bottom: 8px;
  background: currentColor;
  opacity: 0.12;
}

.tk-feedcard--short { height: 54px; }

.tk-navbar {
  display: flex;
  border-top: 1px solid rgba(128, 128, 128, 0.2);
  padding: 6px 2px 2px;
}

.tk-navbtn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 4px 0;
  border: none;
  background: none;
  color: inherit;
  opacity: 0.45;
  cursor: pointer;
  font-family: inherit;
}

.tk-navbtn span { font-size: 8px; }
.tk-navbtn--on { opacity: 1; color: var(--color-primary); }

/* Revenue loop */
.tk-loop-crown {
  text-align: center;
  font-size: var(--text-6xl);
  font-weight: var(--weight-bold);
  margin: 0 0 4px;
  background: var(--gradient-brand);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.tk-loop-row {
  display: grid;
  grid-template-columns: 1fr 1.25fr 1fr;
  gap: 10px;
  align-items: stretch;
}

.tk-loop-mid {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
  border: 1px dashed var(--color-text-muted);
  border-radius: 12px;
}

.tk-loop-midlabel {
  font-size: var(--text-2xs);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wider);
  text-align: center;
  opacity: 0.55;
}

.tk-node {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 12px;
  border-radius: 12px;
  border: 1px solid var(--color-border-card);
  background: var(--color-surface-card);
  color: var(--color-text-primary);
  font-family: var(--font-family-primary);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.tk-node:hover { transform: translateY(-2px); }
.tk-node--on { border-color: var(--color-primary); box-shadow: inset 0 0 0 1px var(--color-primary); }

.tk-node-kicker {
  font-size: var(--text-2xs);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
  opacity: 0.55;
}

.tk-node-title { font-size: var(--text-3xl); font-weight: var(--weight-bold); }

.tk-loop-detail {
  margin-top: 14px;
  padding: 14px 16px;
  border-radius: 12px;
  background: var(--color-surface-hover);
}

.tk-loop-detail h4 { margin: 0 0 6px; font-size: var(--text-xl); }
.tk-loop-detail p  { margin: 0; font-size: var(--text-lg); line-height: var(--leading-relaxed); }

/* Team shape */
.tk-slider { width: 100%; accent-color: var(--color-primary); }

.tk-org-ticks { display: flex; justify-content: space-between; margin: 4px 0 18px; }

.tk-org-tick {
  border: none;
  background: none;
  font-family: var(--font-family-primary);
  font-size: var(--text-sm);
  color: var(--color-text-primary);
  opacity: 0.45;
  cursor: pointer;
}

.tk-org-tick--on { opacity: 1; font-weight: var(--weight-semibold); }

.tk-org-groups { display: flex; flex-direction: column; gap: 14px; }

.tk-org-dots { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 5px; }

.tk-org-dot {
  width: 11px;
  height: 11px;
  border-radius: 3px;
  background: var(--color-text-muted);
  transition: background 0.3s ease;
}

.tk-org-dot--product { background: var(--color-primary); }
.tk-org-dot--craft   { background: var(--color-primitive-purple-600); }
.tk-org-dot--moved   { background: var(--color-text-muted); }

.tk-org-label { font-size: var(--text-sm); opacity: 0.7; }

.tk-org-meta {
  display: flex;
  gap: 24px;
  margin-top: 16px;
  font-size: var(--text-lg);
  color: var(--color-text-primary);
}

.tk-org-meta strong { font-size: var(--text-5xl); margin-right: 6px; }

/* Template pipeline */
.tk-pipe-clock {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 12px;
}

.tk-pipe-time {
  font-size: var(--text-9xl);
  font-weight: var(--weight-bold);
  line-height: 1;
  background: var(--gradient-brand);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.tk-pipe-caption { font-size: var(--text-base); opacity: 0.62; }

.tk-pipe-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 8px;
}

.tk-asset {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 12px 10px;
  border-radius: 8px;
  border: 1px dashed var(--color-text-muted);
  font-family: var(--font-family-mono);
  font-size: var(--text-2xs);
  color: var(--color-text-primary);
  opacity: 0.3;
  transition: opacity 0.25s ease, background 0.25s ease, border-color 0.25s ease;
}

.tk-asset--on {
  opacity: 1;
  border-style: solid;
  border-color: var(--color-border-card);
  background: var(--color-surface-hover);
}

.tk-asset--on.tk-asset--master {
  border-color: var(--color-primary);
  background: var(--color-primitive-alpha-teal-10);
}

.tk-asset-kind { opacity: 0.5; }

/* Buzz feed */
.tk-buzz-head { padding: 12px 12px 6px; }
.tk-buzz-head strong { display: block; font-size: var(--text-3xl); }
.tk-buzz-head span   { font-size: var(--text-2xs); opacity: 0.6; }

.tk-buzz-rail {
  flex: none;               /* never shrink — was clipping the story labels */
  display: flex;
  gap: 8px;
  padding: 8px 12px 12px;
  overflow-x: auto;
  overflow-y: hidden;
}


.tk-story {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  border: none;
  background: none;
  color: inherit;
  cursor: pointer;
  font-family: inherit;
}

.tk-story-ring {
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.25);
  background: linear-gradient(140deg, var(--color-primary), var(--color-primitive-purple-600));
}

.tk-story--on .tk-story-ring { border-color: var(--color-primary); }
.tk-story-label { font-size: 8px; opacity: 0.7; }

.tk-buzz-scroll {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 4px 12px 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.tk-buzz-now { margin: 0 0 8px; font-size: var(--text-2xs); opacity: 0.55; }

.tk-post { margin-bottom: 12px; }

.tk-post-art {
  position: relative;
  display: flex;
  align-items: flex-end;
  height: 74px;
  padding: 8px;
  border-radius: 8px;
  background: linear-gradient(150deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.04));
  cursor: pointer;
  user-select: none;
}

/* Double-tap heart burst */
.tk-post-burst {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ff5670;
  pointer-events: none;
}
.tk-post-burst svg { width: 44px; height: 44px; animation: tk-burst 650ms ease-out forwards; }

@keyframes tk-burst {
  0%   { transform: scale(0.3); opacity: 0; }
  30%  { transform: scale(1.15); opacity: 1; }
  60%  { transform: scale(1); opacity: 1; }
  100% { transform: scale(1.2); opacity: 0; }
}

.tk-post--tall .tk-post-art { height: 112px; }

.tk-post-kicker {
  padding: 2px 7px;
  border-radius: 100px;
  background: rgba(0, 0, 0, 0.35);
  font-size: 8px;
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
}

.tk-post h5 { margin: 6px 0 4px; font-size: var(--text-sm); line-height: var(--leading-snug); }

.tk-post-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 9px;
  opacity: 0.72;
}

.tk-post-like {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: none;
  background: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.tk-heart--on { color: #ff5670; }
.tk-post-meta { flex: 1 1 auto; }

.tk-post-cta {
  padding: 2px 8px;
  border-radius: 100px;
  background: var(--color-primary);
  color: #fff;
}

.tk-buzz-end { margin: 4px 0 0; font-size: 9px; text-align: center; opacity: 0.4; }

.tk-dwell {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 10px;
  margin-top: 14px;
}

.tk-dwell-time {
  font-family: var(--font-family-mono);
  font-size: var(--text-7xl);
  font-weight: var(--weight-bold);
  background: var(--gradient-brand);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.tk-dwell-caption { font-size: var(--text-base); opacity: 0.62; }

/* ══ Coded phone chrome (pitch + ad-tech) ══ */
.sp {
  position: relative;
  flex: 0 0 auto;
  width: 150px;
  padding: 5px;
  border-radius: 20px;
  background: #0b0b12;
  box-shadow: 0 8px 22px var(--color-shadow-card-expanded);
}
.sp-notch { position: absolute; top: 5px; left: 50%; transform: translateX(-50%); width: 44px; height: 12px; border-radius: 0 0 8px 8px; background: #0b0b12; z-index: 3; }
.sp-screen {
  position: relative; display: flex; flex-direction: column;
  aspect-ratio: 430 / 932; overflow: hidden; border-radius: 16px;
  background: #fff; color: #14162a; font-family: var(--font-family-system);
  font-size: 6px; line-height: 1.28;
  --color-primary: #e5143c;   /* the app's own red, not the site's teal */
}
.sp-content { flex: 1 1 auto; overflow: hidden; display: flex; flex-direction: column; }
.sp-nav { display: flex; padding: 5px 2px 6px; background: #fff; border-top: 1px solid rgba(0,0,0,.06); box-shadow: 0 -3px 8px rgba(0,0,0,.05); }
.sp-navbtn { flex: 1 1 0; display: flex; flex-direction: column; align-items: center; gap: 2px; color: #9aa0ad; }
.sp-navbtn em { font-style: normal; font-size: 5px; }
.sp-navbtn--on { color: var(--color-primary); }
.sp-navicon { width: 12px; height: 12px; }

/* Before screen */
.sp-tabrow { display: flex; gap: 7px; padding: 12px 8px 6px; background: #14162a; color: #cfd2dc; }
.sp-tab { font-size: 6px; opacity: .8; }
.sp-tab--on { color: var(--color-primary); opacity: 1; font-weight: 700; }
.sp-hero { display: flex; flex-direction: column; justify-content: flex-end; gap: 2px; padding: 8px; height: 46px; }
.sp-hero--promo { background: linear-gradient(120deg,#7a0f22,#c0263f); color: #fff; }
.sp-hero-kick { font-size: 5px; letter-spacing: .06em; opacity: .85; }
.sp-hero strong { font-size: 7px; line-height: 1.15; }
.sp-secttl { margin: 6px 8px 3px; font-size: 6.5px; font-weight: 700; }
.sp-secttl--dark { color: #14162a; }
.sp-prow { display: flex; gap: 5px; padding: 0 8px; }
.sp-poster { flex: 1 1 0; display: flex; flex-direction: column; gap: 2px; }
.sp-poster-art { aspect-ratio: 2/3; border-radius: 3px; }
.sp-poster-rate { color: var(--color-primary); font-weight: 700; font-size: 5.5px; }
.sp-poster-name { color: #5b606c; font-size: 5.5px; }
.sp-ev { flex: 1 1 0; aspect-ratio: 4/3; border-radius: 3px; }

/* After: Home */
.sp-home-head { display: flex; justify-content: space-between; align-items: flex-start; padding: 12px 8px 8px; background: #14162a; color: #fff; }
.sp-home-head strong { font-size: 8px; }
.sp-loc { display: block; font-size: 5.5px; opacity: .7; }
.sp-home-right { display: flex; align-items: center; gap: 5px; }
.sp-badge { padding: 1px 4px; border-radius: 6px; background: var(--color-primary); color: #fff; font-size: 4.5px; }
.sp-avatar { width: 14px; height: 14px; border-radius: 50%; background: linear-gradient(140deg,#f0a020,#c0263f); }
.sp-hero--live { background: linear-gradient(120deg,#1a1c2e,#2a2140); color: #fff; height: 54px; }
.sp-hero-eyebrow { font-size: 4.5px; letter-spacing: .1em; color: #7fe3c8; }
.sp-hero-pill { align-self: flex-start; margin-top: 2px; padding: 1px 4px; border-radius: 6px; background: rgba(127,227,200,.18); color: #7fe3c8; font-size: 4.5px; }
.sp-wg { display: flex; align-items: center; gap: 5px; margin: 6px 8px; padding: 5px 6px; border: 1px solid #e3e5ea; border-radius: 5px; }
.sp-wg-mark { font-size: 6px; font-weight: 800; color: var(--color-primary); }
.sp-wg-mark em { font-style: normal; color: #14162a; }
.sp-wg-copy { font-size: 5.5px; color: #5b606c; line-height: 1.25; }
.sp-egrid { display: grid; grid-template-columns: repeat(3,1fr); gap: 4px; padding: 0 8px 6px; }
.sp-etile { display: flex; flex-direction: column; justify-content: space-between; height: 30px; padding: 4px; border-radius: 4px; color: #fff; }
.sp-etile strong { font-size: 5.5px; white-space: pre-line; line-height: 1.1; }
.sp-etile em { font-style: normal; font-size: 4.5px; opacity: .85; }

/* ══ Pitch: coded before/after with element FLIP ══ */
.pm { display: flex; flex-direction: column; align-items: center; margin: 24px 0 8px; }
.sp--pitch { zoom: 1.5; margin: 16px auto 0; }
.sp-morph { position: relative; flex: 1 1 auto; overflow: hidden; }
.sp-layer { position: absolute; inset: 0; display: flex; flex-direction: column; }
.sp-layer--after { pointer-events: none; }
.sp--after .sp-layer--after { pointer-events: auto; }
.sp--after .sp-layer--before { pointer-events: none; }
.sp-row { transition: transform .55s cubic-bezier(.22,.61,.36,1), opacity .45s ease; }
.sp-layer--before .sp-row { opacity: 1; transform: none; }
.sp-layer--after  .sp-row { opacity: 0; transform: translateY(26px); }
.sp--after .sp-layer--before .sp-row { opacity: 0; transform: translateY(-18px); }
.sp--after .sp-layer--after  .sp-row { opacity: 1; transform: none; }
.sp-navwrap { position: relative; height: 27px; flex: none; }
.sp-navwrap .sp-nav { position: absolute; inset: 0; transition: opacity .4s ease; }
.sp--before .sp-nav--after, .sp--after .sp-nav--before { opacity: 0; }
.pm-cap { margin: 16px auto 0; max-width: 52ch; text-align: center; font-size: var(--text-sm); color: var(--color-text-subtle); line-height: var(--leading-normal); }

/* ══ Ad-tech: coded phones, hero-width ══ */
.shot--ad { width: min(1000px, 92vw); margin-left: 50%; transform: translateX(-50%); margin-top: 32px; margin-bottom: 8px; }
.shot-ad-head { max-width: 66ch; margin: 0 auto 26px; text-align: center; }
.shot-ad-head strong { display: block; font-family: var(--font-family-heading); font-size: var(--text-4xl); font-weight: var(--weight-semibold); }
.shot-ad-head span { font-size: var(--text-lg); color: var(--color-text-subtle); }
.shot-ad-stage { display: flex; justify-content: center; align-items: flex-start; gap: 30px; }
.ap { display: flex; flex-direction: column; align-items: center; gap: 16px; margin: 0; }
.ap-body { position: relative; width: 160px; zoom: 1.6; padding: 5px; border-radius: 22px; background: #0b0b12; box-shadow: 0 10px 26px var(--color-shadow-card-expanded); }
.ap-screen { position: relative; display: flex; flex-direction: column; aspect-ratio: 430/932; overflow: hidden; border-radius: 18px; background: #fff; color: #14162a; font-family: var(--font-family-system); font-size: 6px; line-height: 1.3; --color-primary: #e5143c; }
.ap-cap { max-width: 260px; font-size: var(--text-sm); color: var(--color-text-subtle); text-align: center; line-height: var(--leading-snug); }
.ap-status { display: flex; justify-content: space-between; padding: 9px 8px 4px; font-size: 6px; font-weight: 600; }
.ap-status-r { letter-spacing: 1px; }
.ap-dim { opacity: .6; }

/* splash */
.ap-splash-veil { position: absolute; inset: 0; background: linear-gradient(160deg,#2b2d3a,#4a4d5e); }
.ap-splash-bar { position: relative; display: flex; gap: 3px; padding: 10px 10px 0; }
.ap-splash-bar span { flex: 1; height: 2px; border-radius: 2px; background: rgba(255,255,255,.3); }
.ap-splash-bar span.on { background: #fff; }
.ap-splash-top { position: relative; display: flex; justify-content: space-between; align-items: center; padding: 8px 10px; color: #fff; }
.ap-splash-top strong { font-size: 7px; }
.ap-x { font-size: 9px; opacity: .9; }
.ap-splash-card { position: relative; margin: 8px 12px; padding: 8px; border-radius: 6px; background: #fff; display: flex; flex-direction: column; }
.ap-splash-hd { display: flex; justify-content: space-between; gap: 6px; }
.ap-splash-hd p { margin: 0; font-size: 7.5px; font-weight: 700; line-height: 1.2; }
.ap-scheme { display: flex; }
.ap-scheme i { width: 10px; height: 10px; border-radius: 50%; background: #eb5c2e; }
.ap-scheme i.b { background: #f5a623; margin-left: -5px; mix-blend-mode: multiply; }
.ap-splash-fig { height: 96px; margin: 8px 0; border-radius: 5px; background: linear-gradient(160deg,#f0c05a,#c98a2a); }
.ap-splash-hash { font-size: 5.5px; color: #5b606c; margin-bottom: 6px; }
.ap-cta { padding: 5px; border-radius: 5px; background: #2f6bff; color: #fff; text-align: center; font-size: 7px; font-weight: 700; }
.ap-cta--sm { padding: 3px 7px; font-size: 6px; }

/* echo */
.ap-h2-head { padding: 4px 8px 6px; }
.ap-h2-head strong { display: block; font-size: 9px; }
.ap-tabs { display: flex; gap: 7px; padding: 0 8px 6px; border-bottom: 1px solid #eee; }
.ap-tab { font-size: 6px; color: #7a808c; }
.ap-tab--on { color: #14162a; font-weight: 700; border-bottom: 2px solid var(--color-primary); padding-bottom: 2px; }
.ap-h2-grid { display: flex; gap: 4px; padding: 7px 8px; }
.ap-h2-tile { flex: 1; height: 32px; border-radius: 4px; padding: 4px; color: #fff; display: flex; flex-direction: column; justify-content: space-between; }
.ap-h2-tile strong { font-size: 5.5px; }
.ap-h2-tile em { font-style: normal; font-size: 4.5px; opacity: .85; }
.ap-echo { display: flex; gap: 6px; margin: 2px 8px 7px; padding: 6px; border-radius: 5px; background: linear-gradient(120deg,#a3184e,#c0286a); color: #fff; }
.ap-echo-card { width: 34px; height: 24px; border-radius: 3px; background: linear-gradient(135deg,#1c3a5a,#2c6a4a); }
.ap-echo-copy { display: flex; flex-direction: column; gap: 2px; }
.ap-echo-copy strong { font-size: 7px; }
.ap-echo-copy em { font-style: normal; font-size: 5px; opacity: .9; }
.ap-echo-cta { align-self: flex-start; margin-top: 2px; padding: 2px 6px; border-radius: 6px; background: #fff; color: #a3184e; font-size: 5px; font-weight: 700; }
.ap-h2-sec { display: flex; justify-content: space-between; padding: 2px 8px 4px; }
.ap-h2-sec strong { font-size: 7px; }
.ap-h2-sec em { font-style: normal; font-size: 5.5px; color: var(--color-primary); }
.ap-h2-row { display: flex; gap: 5px; padding: 0 8px 7px; }
.ap-h2-show { position: relative; flex: 1; aspect-ratio: 3/4; border-radius: 4px; background: linear-gradient(150deg,#2a86c0,#f0b400); }
.ap-h2-show em { position: absolute; top: 3px; left: 3px; padding: 0 3px; border-radius: 2px; background: rgba(0,0,0,.5); color: #fff; font-style: normal; font-size: 4px; }

/* sponsored */
.ap-sp-head { display: flex; align-items: center; gap: 5px; padding: 8px; }
.ap-sp-av { width: 16px; height: 16px; border-radius: 50%; background: linear-gradient(140deg,#f0b400,#c0263f); }
.ap-sp-head strong { display: block; font-size: 6.5px; }
.ap-sp-head em { font-style: normal; font-size: 5px; color: #7a808c; }
.ap-follow { margin-left: auto; padding: 2px 7px; border: 1px solid #2f6bff; border-radius: 5px; color: #2f6bff; font-size: 5.5px; font-weight: 700; }
.ap-sp-social { display: flex; gap: 10px; padding: 4px 8px; color: #5b606c; font-size: 6px; }
.ap-sp-art { position: relative; height: 96px; margin: 0 0 2px; background: linear-gradient(150deg,#5ec0e0,#f04ea0 60%,#f0b400); display: flex; align-items: center; justify-content: center; }
.ap-tag { position: absolute; top: 4px; right: 4px; padding: 1px 4px; border-radius: 3px; background: var(--color-primary); color: #fff; font-size: 4px; font-weight: 700; }
.ap-play { width: 18px; height: 18px; border-radius: 50%; background: rgba(255,255,255,.85); color: #14162a; display: grid; place-items: center; font-size: 7px; }
.ap-sp-cta { display: flex; flex-direction: column; gap: 4px; padding: 6px 8px; }
.ap-sp-cta > strong { font-size: 7.5px; }
.ap-sp-cta-row { display: flex; align-items: center; gap: 5px; }
.ap-sp-brand { width: 12px; height: 12px; border-radius: 3px; background: #14162a; }
.ap-sp-cta-row em { font-style: normal; font-size: 5px; color: #7a808c; }
.ap-sp-cta-row .ap-cta { margin-left: auto; }
.ap-sp-peek { padding: 6px 8px; border-top: 1px solid #eee; background: #fbf3ea; }
.ap-sp-peek strong { font-size: 7px; }

/* Watch Guide */
.tk-guide {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 20px;
  align-items: start;
}

.tk-guide-prefs h5 {
  margin: 12px 0 6px;
  font-size: var(--text-2xs);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wider);
  opacity: 0.55;
}

.tk-guide-prefs h5:first-child { margin-top: 0; }

.tk-guide-head { padding: 12px 12px 8px; }
.tk-guide-head strong { display: block; font-size: var(--text-3xl); }
.tk-guide-head span   { font-size: var(--text-2xs); opacity: 0.6; }

.tk-guide-shelf {
  flex: 1 1 auto;
  overflow-y: auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 0 12px 12px;
  align-content: start;
}

.tk-title {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0 0 6px;
  border: none;
  background: none;
  color: inherit;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
}

.tk-title-art {
  height: 70px;
  border-radius: 6px;
  margin-bottom: 4px;
  background: linear-gradient(150deg, var(--color-primary), var(--color-primitive-purple-600));
  opacity: 0.55;
}

.tk-title--on .tk-title-art { opacity: 1; }
.tk-title-name { font-size: 10px; font-weight: var(--weight-semibold); }
.tk-title-meta { font-size: 8px; opacity: 0.6; }

.tk-title-where {
  margin-top: 3px;
  padding: 3px 6px;
  border-radius: 5px;
  background: var(--color-primary);
  color: #fff;
  font-size: 8px;
}

.tk-guide-empty { padding: 16px; font-size: 10px; grid-column: 1 / 3; opacity: 0.7; }

/* Ad rules */
.tk-ads-stage {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 20px;
  align-items: start;
}

.tk-ad {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  margin: 8px 0;
  border-radius: 8px;
  border: 1px dashed var(--color-primitive-purple-600);
  background: rgba(124, 92, 252, 0.1);
  font-size: 9px;
}

.tk-ad em { font-style: normal; opacity: 0.6; }
.tk-ad--splash { height: 96px; align-items: flex-start; }

.tk-ads-clean {
  margin: 24px 0;
  text-align: center;
  font-size: 10px;
  opacity: 0.45;
}

.tk-ads-rule {
  margin: 0 0 8px;
  font-size: var(--text-4xl);
  font-weight: var(--weight-bold);
  line-height: var(--leading-tight);
  color: var(--color-text-primary);
}

.tk-ads-body {
  margin: 0 0 12px;
  font-size: var(--text-lg);
  line-height: var(--leading-relaxed);
  color: var(--color-text-primary);
}

.tk-ads-list { margin: 0; padding: 0; list-style: none; }

.tk-ads-list li {
  padding: 8px 0;
  border-top: 1px solid var(--color-border-card);
  font-size: var(--text-base);
}

.tk-ads-list strong { display: block; }
.tk-ads-list span   { opacity: 0.62; }

/* Ticketing card */
.tk-card-scrim {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(180deg,
    rgba(8, 10, 26, 0.25) 0%, rgba(8, 10, 26, 0.45) 42%, rgba(8, 10, 26, 0.9) 100%);
  z-index: 0;
}

.tk-card-face,
.rv-card-face,
.go-card-face {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 20px;
  text-align: center;
  color: var(--color-text-on-primary);
  pointer-events: none;
  z-index: 1;
}

/* Ticketing rides a busy film — poster layout, bottom-weighted */
.tk-card-face {
  justify-content: flex-end;
  gap: 10px;
  text-shadow: 0 1px 12px rgba(8, 10, 26, 0.55);
}

.tk-card-count {
  margin: 0;
  font-family: var(--font-family-primary);
  font-size: var(--text-md);
  line-height: var(--leading-snug);
  opacity: 0.82;
}

.tk-card-count strong {
  background: none;
  -webkit-text-fill-color: currentColor;
  font-weight: var(--weight-bold);
}

.tk-card-title {
  margin: 0;
  font-family: var(--font-family-primary);
  font-size: var(--text-6xl);
  font-weight: var(--weight-extrabold);
  line-height: var(--leading-tight);
  white-space: pre-line;
}

.tk-card-tabs { display: flex; gap: 14px; opacity: 0.75; }

.tk-card-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  font-size: 8px;
}

.tk-card-tab em { font-style: normal; }
.tk-card-tab--on { opacity: 1; color: #ff6b7f; }

/* ═══ Study: ratings and reviews in nine seconds ═══ */

/* Distribution chart */
.rv-chart-title {
  margin: 0 0 10px;
  font-size: var(--text-base);
  font-weight: var(--weight-semibold);
  color: var(--color-text-primary);
}

.rv-plot {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 2px;
  height: 190px;
  padding-bottom: 26px;
  border-bottom: 1px solid var(--color-border-card);
}

.rv-bar-slot {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  cursor: default;
}

.rv-bar {
  width: 68%;
  border-radius: 4px 4px 0 0;
  background: var(--color-primary);
  transition: height 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.rv-bar--gap {
  background: repeating-linear-gradient(45deg,
    var(--color-primary) 0 3px, transparent 3px 6px);
  opacity: 0.7;
}

.rv-bar-slot--hover .rv-bar { filter: brightness(1.15); }

.rv-bar-x,
.rv-bar-half {
  position: absolute;
  bottom: -20px;
  font-size: var(--text-2xs);
  color: var(--color-text-primary);
  opacity: 0.55;
}

.rv-bar-half { bottom: -33px; opacity: 0.8; }

.rv-tip {
  position: absolute;
  bottom: 100%;
  white-space: nowrap;
  padding: 4px 8px;
  border-radius: 6px;
  background: var(--color-text-primary);
  color: var(--color-bg-body);
  font-size: var(--text-2xs);
  z-index: 2;
}

.rv-legend {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  margin-top: 26px;
  font-size: var(--text-sm);
  color: var(--color-text-primary);
  opacity: 0.7;
}

.rv-legend span { display: inline-flex; align-items: center; gap: 6px; }

.rv-key {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  background: var(--color-primary);
}

.rv-key--gap {
  background: repeating-linear-gradient(45deg,
    var(--color-primary) 0 2px, transparent 2px 4px);
}

/* The four takes */
.rv-takes { display: grid; gap: 14px; }

.rv-take {
  padding: 16px 18px;
  border-radius: 12px;
  border: 1px solid var(--color-border-card);
  background: var(--color-surface-card);
}

.rv-take--final { border-color: var(--color-primary); }

.rv-take-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.rv-take-head h5 { margin: 0; font-size: var(--text-xl); }

.rv-take-val {
  font-family: var(--font-family-mono);
  font-size: var(--text-5xl);
  font-weight: var(--weight-bold);
  color: var(--color-primary);
}

.rv-take-ctl { position: relative; margin-bottom: 10px; }

.rv-take-verdict {
  margin: 0;
  font-size: var(--text-base);
  line-height: var(--leading-relaxed);
  color: var(--color-text-primary);
  opacity: 0.72;
}

.rv-hearts { display: flex; gap: 6px; color: #e0455f; }
.rv-hearts--ten { gap: 3px; }

.rv-heartbtn {
  border: none;
  background: none;
  padding: 2px;
  cursor: pointer;
  color: inherit;
  line-height: 0;
}

.rv-heart { display: block; }

.rv-range { width: 100%; accent-color: #e0455f; }

.rv-range--plain {
  -webkit-appearance: none;
  appearance: none;
  height: 3px;
  border-radius: 2px;
  background: linear-gradient(90deg, #e0455f 0 60%, var(--color-text-muted) 60%);
}

.rv-range--plain::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 3px;
  height: 3px;
  background: transparent;
}

.rv-range--final { height: 22px; }

.rv-ticks {
  display: flex;
  justify-content: space-between;
  padding: 0 8px;
  margin-top: -4px;
}

.rv-ticks span {
  width: 1px;
  height: 5px;
  background: var(--color-text-muted);
}

/* The form — rebuilt from the shipped screen, authored at 1px = 1dp */
.rv-form,
.rv-summary { --b: #0377fe; --r: #e8364e; }
.rv-summary { --b: #3e6eea; }

.rv-form .pf-body,
.rv-summary .pf-body { width: 374px; zoom: 0.78; }

/* Status bar sits beside the notch, so no safe area here */
.rv-form .pf-screen,
.rv-summary .pf-screen {
  padding-top: 0;
  background: #fff;
  color: #1c1c1c;
  font-size: 14px;
  line-height: 1.35;
}

.rv-fm-status,
.rv-sm-status {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 22px 0;
  font-size: 12px;
  font-weight: var(--weight-semibold);
}

.rv-fm-status-r,
.rv-sm-status-r { font-size: 10px; letter-spacing: 1px; }

.rv-fm-bar {
  position: relative;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 16px 13px;
  border-bottom: 1px solid #ececec;
  text-align: center;
}

.rv-fm-bar strong { display: block; font-size: 18px; font-weight: var(--weight-regular); }
.rv-fm-bar em { font-style: normal; font-size: 12px; color: #8b8b8b; }

.rv-fm-x {
  position: absolute;
  top: 50%;
  right: 14px;
  transform: translateY(-50%);
  padding: 4px;
  border: 0;
  background: none;
  font-size: 15px;
  color: #3a3a3a;
  cursor: pointer;
}

.rv-fm-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 0 16px 16px;
}

.rv-fm-film { padding: 26px 0 2px; text-align: center; }

.rv-fm-poster {
  display: block;
  width: 136px;
  height: 184px;
  margin: 0 auto 12px;
  border-radius: 4px;
  background:
    linear-gradient(0deg, rgba(0, 0, 0, 0.55) 0 28%, transparent 62%),
    radial-gradient(120% 80% at 72% 76%, #f0a24d 0%, rgba(240, 162, 77, 0) 55%),
    linear-gradient(158deg, #cbb79c 0%, #8b6a49 34%, #2f2016 100%);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.22);
}

.rv-fm-watched { margin: 0; font-size: 14px; color: #9a9a9a; }
.rv-fm-name { margin: 7px 0 0; font-size: 14px; font-weight: var(--weight-bold); }

.rv-fm-sec { padding-top: 26px; }

.rv-fm-sec h4 {
  margin: 0;
  font-size: 17px;
  font-weight: var(--weight-bold);
  letter-spacing: -0.2px;
}

.rv-fm-sec h4 em {
  margin-left: 5px;
  font-style: normal;
  font-size: 12px;
  font-weight: var(--weight-regular);
  color: #8b8b8b;
}

.rv-fm-sub { margin: 5px 0 0; font-size: 13px; color: #8b8b8b; }

.rv-fm-slider {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 30px;
}

.rv-fm-cue {
  position: absolute;
  top: -18px;
  left: 0;
  right: 46px;
  text-align: center;
  font-size: 11px;
  letter-spacing: 1.2px;
  color: #a8a8a8;
}

.rv-fm-rail { position: relative; flex: 1 1 auto; height: 26px; }

.rv-fm-rail::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 4px;
  margin-top: -2px;
  border-radius: 2px;
  background: #ccc;
}

.rv-fm-fill {
  position: absolute;
  top: 50%;
  left: 0;
  width: calc(13px + (100% - 26px) * var(--v) / 100);
  height: 4px;
  margin-top: -2px;
  border-radius: 2px;
  background: var(--r);
}

.rv-fm-ticks {
  position: absolute;
  top: 50%;
  left: 13px;
  right: 13px;
  display: flex;
  justify-content: space-between;
  margin-top: -1px;
}

.rv-fm-ticks span { width: 1px; height: 2px; background: rgba(255, 255, 255, 0.85); }

.rv-fm-thumb {
  position: absolute;
  top: 50%;
  left: calc(13px + (100% - 26px) * var(--v) / 100);
  transform: translate(-50%, -50%);
  color: var(--r);
  pointer-events: none;
}

.rv-fm-range {
  position: absolute;
  inset: -8px 0;
  width: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.rv-fm-pct {
  flex: 0 0 auto;
  min-width: 38px;
  text-align: right;
  font-size: 17px;
  font-weight: var(--weight-bold);
}

.rv-fm-tags { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 16px; }

.rv-fm-tag {
  padding: 7px 14px;
  border-radius: 100px;
  border: 1px solid #d8d8d8;
  background: #fff;
  font-family: inherit;
  font-size: 13px;
  color: #3a3a3a;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.rv-fm-tag:hover { border-color: var(--b); }
.rv-fm-tag--on { background: var(--b); border-color: var(--b); color: #fff; }

.rv-fm-text {
  width: 100%;
  margin-top: 14px;
  padding: 6px 0 10px;
  border: 0;
  border-bottom: 1px solid #d8d8d8;
  background: none;
  font-family: inherit;
  font-size: 14px;
  color: inherit;
  resize: none;
  outline: none;
}

.rv-fm-text::placeholder { color: #b5b5b5; }

.rv-fm-matter { padding: 56px 0 8px; text-align: center; color: #9a9a9a; }
.rv-fm-matter p { margin: 7px 0 0; font-size: 13px; }
.rv-fm-matter-h { font-family: var(--font-family-primary); font-style: italic; font-size: 18px; }

.rv-fm-foot {
  flex: 0 0 auto;
  display: flex;
  gap: 10px;
  padding: 14px 12px 16px;
  border-top: 1px solid #ececec;
}

.rv-fm-submit,
.rv-fm-ghost {
  flex: 1 1 auto;
  padding: 13px 0;
  border-radius: 4px;
  border: 1px solid transparent;
  font-family: inherit;
  font-size: 15px;
  font-weight: var(--weight-medium);
  cursor: pointer;
}

.rv-fm-submit { background: var(--b); color: #fff; }
.rv-fm-submit:disabled { background: #e6f1ff; color: #fff; cursor: not-allowed; }

.rv-fm-ghost { flex: 0 0 40%; background: #fff; border-color: var(--b); color: var(--b); }
.rv-fm-ghost:disabled { border-color: #dbe6f7; color: #b7cdf1; cursor: not-allowed; }

.rv-fm-done {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 100%;
  text-align: center;
  color: #6b6b6b;
}

.rv-fm-done .rv-fm-heart { color: var(--r); animation: card-enter 0.5s ease; }

.rv-fm-donetime {
  margin: 0;
  font-family: var(--font-family-mono);
  font-size: 30px;
  font-weight: var(--weight-bold);
  color: #1c1c1c;
}

.rv-fm-donetext { margin: 0; font-size: 13px; line-height: var(--leading-relaxed); }
.rv-fm-done .rv-fm-ghost { flex: 0 0 auto; margin-top: 8px; padding: 10px 28px; }

.rv-fm-watch {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 14px 0 0;
  font-size: var(--text-sm);
  color: var(--color-text-subtle);
}

.rv-fm-watch b { font-family: var(--font-family-mono); font-size: var(--text-md); color: var(--color-primary); }
/* Tag mining */
.rv-mine-count { font-size: var(--text-base); opacity: 0.62; }

.rv-mine-cols {
  display: grid;
  grid-template-columns: 1fr 200px;
  gap: 18px;
  align-items: start;
}

.rv-mine-review {
  margin: 0 0 8px;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--color-surface-hover);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  opacity: 0.18;
  transform: translateY(4px);
  transition: opacity 0.35s ease, transform 0.35s ease;
}

.rv-mine-review--on { opacity: 1; transform: none; }

.rv-mine-tags { display: flex; flex-direction: column; gap: 6px; }

.rv-mine-tag {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 6px;
  font-size: var(--text-sm);
}

.rv-mine-tag em { font-style: normal; font-family: var(--font-family-mono); }
.rv-mine-tag b  { opacity: 0.5; font-weight: var(--weight-medium); }

.rv-mine-bar {
  height: 6px;
  border-radius: 3px;
  background: var(--color-primary);
  transition: width 0.35s ease;
}

.rv-mine-empty { font-size: var(--text-sm); opacity: 0.5; }

/* Benchmark */
.rv-bm {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
}

.rv-bm-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px;
  border-radius: 12px;
  border: 1px solid var(--color-border-card);
  background: var(--color-surface-card);
  color: var(--color-text-primary);
  font-family: var(--font-family-primary);
  text-align: left;
  cursor: pointer;
}

.rv-bm-card--on { border-color: var(--color-primary); }
.rv-bm-card h5  { margin: 4px 0 0; font-size: var(--text-lg); }
.rv-bm-who      { font-size: var(--text-sm); opacity: 0.55; }

.rv-bm-took {
  margin: 6px 0 0;
  font-size: var(--text-base);
  line-height: var(--leading-relaxed);
  opacity: 0.78;
}

.rv-bm-preview {
  display: flex;
  align-items: flex-end;
  height: 40px;
  margin-bottom: 4px;
}

.rv-bm-row { display: flex; align-items: center; gap: 3px; }
.rv-bm-row--wrap { flex-wrap: wrap; }

.rv-bm-star { color: var(--color-text-muted); font-size: 15px; }
.rv-bm-star--on { color: #f0a020; }

.rv-bm-pip {
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: var(--color-text-muted);
}

.rv-bm-pip--on { background: var(--color-primary); }

.rv-bm-graph { display: flex; align-items: flex-end; gap: 2px; height: 38px; }

.rv-bm-graph i {
  width: 6px;
  border-radius: 2px 2px 0 0;
  background: var(--color-primary);
  opacity: 0.75;
}

.rv-bm-chip {
  padding: 3px 8px;
  border-radius: 100px;
  border: 1px solid var(--color-border-card);
  font-size: var(--text-2xs);
}

.rv-bm-slider { position: relative; width: 100%; color: #e0455f; }

.rv-bm-track {
  display: block;
  height: 3px;
  border-radius: 2px;
  background: linear-gradient(90deg, currentColor 0 62%, var(--color-text-muted) 62%);
}

.rv-bm-thumb { position: absolute; left: 58%; top: -8px; }

/* Trust weighting */
.rv-trust-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 14px;
}

.rv-trust-score {
  font-size: var(--text-10xl);
  font-weight: var(--weight-bold);
  line-height: 1;
  background: var(--gradient-brand);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  transition: opacity 0.2s ease;
}

.rv-trust-caption { font-size: var(--text-base); opacity: 0.62; }

.rv-trust-toggles { display: grid; gap: 8px; margin-bottom: 16px; }

.rv-toggle {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--color-border-card);
  background: var(--color-surface-card);
  color: var(--color-text-primary);
  font-family: var(--font-family-primary);
  text-align: left;
  cursor: pointer;
}

.rv-toggle--on { border-color: var(--color-primary); }

.rv-toggle-switch {
  flex: 0 0 34px;
  height: 20px;
  margin-top: 1px;
  border-radius: 100px;
  background: var(--color-text-muted);
  position: relative;
  transition: background 0.2s ease;
}

.rv-toggle-switch::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.2s ease;
}

.rv-toggle--on .rv-toggle-switch { background: var(--color-primary); }
.rv-toggle--on .rv-toggle-switch::after { transform: translateX(14px); }

.rv-toggle-copy { display: flex; flex-direction: column; gap: 2px; }
.rv-toggle-copy strong { font-size: var(--text-lg); }
.rv-toggle-copy em { font-style: normal; font-size: var(--text-base); opacity: 0.62; }

.rv-trust-list { margin: 0; padding: 0; list-style: none; }

.rv-trust-row {
  display: grid;
  grid-template-columns: 1fr auto auto auto;
  align-items: center;
  gap: 10px;
  padding: 9px 0;
  border-top: 1px solid var(--color-border-card);
  font-size: var(--text-base);
  transition: opacity 0.25s ease;
}

.rv-trust-row--cut { opacity: 0.35; text-decoration: line-through; }
.rv-trust-row--heavy .rv-trust-pct { font-weight: var(--weight-bold); }

.rv-trust-badge {
  padding: 2px 8px;
  border-radius: 100px;
  background: var(--color-primitive-alpha-teal-10);
  color: var(--color-primary);
  font-size: var(--text-2xs);
  white-space: nowrap;
}

.rv-trust-badge--none {
  background: transparent;
  border: 1px solid var(--color-border-card);
  color: var(--color-text-primary);
  opacity: 0.5;
}

.rv-trust-pct { font-family: var(--font-family-mono); }
.rv-trust-weight { font-family: var(--font-family-mono); color: var(--color-primary); }

/* Given / when / then */
.rv-story-title {
  margin: 0 0 12px;
  font-size: var(--text-3xl);
  font-weight: var(--weight-semibold);
  color: var(--color-text-primary);
}

.rv-story-list { margin: 0 0 12px; padding: 0; list-style: none; display: grid; gap: 6px; }

.rv-story-cond {
  display: grid;
  grid-template-columns: 54px 1fr 18px;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid var(--color-border-card);
  background: var(--color-surface-card);
  color: var(--color-text-primary);
  font-family: var(--font-family-primary);
  font-size: var(--text-base);
  text-align: left;
  cursor: pointer;
  opacity: 0.55;
}

.rv-story-cond--on { opacity: 1; border-color: var(--color-primary); }

.rv-story-key {
  font-family: var(--font-family-mono);
  font-size: var(--text-2xs);
  letter-spacing: var(--tracking-wide);
  color: var(--color-primary);
}

.rv-story-mark { text-align: right; }

.rv-story-then {
  display: grid;
  grid-template-columns: 54px 1fr;
  gap: 10px;
  padding: 14px;
  border-radius: 10px;
  background: var(--color-surface-hover);
  font-size: var(--text-lg);
  line-height: var(--leading-relaxed);
  color: var(--color-text-primary);
}

.rv-story-then--on {
  background: var(--color-primitive-alpha-teal-10);
  box-shadow: inset 0 0 0 1px var(--color-primary);
}

/* Detail-page summary — rebuilt from the shipped screen */
.rv-sm-nav {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px 14px;
}

.rv-sm-nav strong { flex: 1 1 auto; font-size: 18px; font-weight: var(--weight-regular); }
.rv-sm-navicon { flex: 0 0 auto; }

.rv-sm-offers {
  flex: 0 0 auto;
  display: flex;
  gap: 10px;
  padding: 0 16px 14px;
  overflow-x: auto;
  border-bottom: 1px solid #ececec;
}

.rv-sm-offer {
  flex: 0 0 auto;
  width: 300px;
  padding: 9px 14px;
  border-radius: 4px;
  border: 1px dashed #e6cf94;
  background: #fff6dd;
  text-align: center;
}

.rv-sm-offer strong { display: block; font-size: 13px; font-weight: var(--weight-medium); }
.rv-sm-offer em { font-style: normal; font-size: 12px; color: #8b8b8b; }

.rv-sm-scroll { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 16px 0 0; }

.rv-sm-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 0 16px;
}

.rv-sm-head h4 { margin: 0; font-size: 18px; font-weight: var(--weight-bold); }
.rv-sm-head a { font-size: 13px; color: var(--b); }

.rv-sm-nudge {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 14px 16px 0;
  padding: 11px 13px;
  border-radius: 4px;
  background: #f2f5f9;
}

.rv-sm-nudge strong { display: block; font-size: 12.5px; font-weight: var(--weight-medium); white-space: nowrap; }
.rv-sm-nudge em { font-style: normal; font-size: 12px; color: #8b8b8b; }

.rv-sm-rate {
  flex: 0 0 auto;
  padding: 7px 13px;
  border-radius: 4px;
  border: 1px solid var(--b);
  background: #fff;
  font-size: 13px;
  color: var(--b);
}

.rv-sm-lead { margin: 14px 16px 0; font-size: 13px; color: #8b8b8b; }

.rv-sm-chips { display: flex; gap: 9px; padding: 12px 16px 0; overflow-x: auto; }

.rv-sm-chip {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  border-radius: 100px;
  border: 1px solid #d8d8d8;
  background: #fff;
  font-family: inherit;
  font-size: 13px;
  color: #3a3a3a;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.rv-sm-chip i {
  padding: 1px 6px;
  border-radius: 3px;
  background: #eee;
  font-style: normal;
  font-size: 11px;
  color: #6b6b6b;
}

.rv-sm-chip:hover { border-color: var(--b); }
.rv-sm-chip--on { background: var(--b); border-color: var(--b); color: #fff; }
.rv-sm-chip--on i { background: rgba(255, 255, 255, 0.25); color: #fff; }

.rv-sm-rail {
  display: flex;
  gap: 12px;
  padding: 14px 16px 0;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
}

.rv-sm-card {
  flex: 0 0 auto;
  width: 300px;
  padding: 13px;
  border-radius: 4px;
  border: 1px solid #e6e6e6;
  scroll-snap-align: center;
}

.rv-sm-card header { display: flex; align-items: center; gap: 10px; }

.rv-sm-av {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(150deg, #d9dee8, #aeb7c6);
}

.rv-sm-by { flex: 1 1 auto; min-width: 0; }
.rv-sm-by strong { display: block; font-size: 14px; font-weight: var(--weight-medium); }
.rv-sm-by em { font-style: normal; font-size: 12px; color: #8b8b8b; }

.rv-sm-score {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 14px;
  font-weight: var(--weight-medium);
}

.rv-sm-heart { color: var(--r); }
.rv-sm-tags { margin: 12px 0 0; font-size: 14px; font-weight: var(--weight-bold); }
.rv-sm-text { margin: 6px 0 0; font-size: 13px; line-height: var(--leading-normal); color: #4a4a4a; }
.rv-sm-text a { color: var(--b); }

.rv-sm-card footer {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 12px;
  font-size: 12px;
  color: #8b8b8b;
}

.rv-sm-card footer span { display: inline-flex; align-items: center; gap: 6px; }
.rv-sm-card footer em { margin-left: auto; font-style: normal; }
.rv-sm-card footer b { font-weight: var(--weight-regular); }

.rv-sm-empty { margin: 0; padding: 28px 0; font-size: 13px; color: #8b8b8b; }

.rv-sm-cast {
  margin: 18px 0 0;
  padding: 16px 16px 0;
  border-top: 1px solid #ececec;
  font-size: 18px;
  font-weight: var(--weight-bold);
}

/* Next section, peeking under the fold as it does on the real page */
.rv-sm-crew { display: flex; gap: 18px; padding: 14px 16px 0; }
.rv-sm-crew span { flex: 0 0 auto; width: 62px; }

.rv-sm-crew i {
  display: block;
  width: 62px;
  height: 62px;
  margin-bottom: 6px;
  border-radius: 50%;
  background: linear-gradient(150deg, #dde1e9, #b3bccb);
}

.rv-sm-crew b { display: block; font-size: 12px; font-weight: var(--weight-medium); text-align: center; }

.rv-sm-foot { flex: 0 0 auto; padding: 12px 16px 16px; border-top: 1px solid #ececec; }

.rv-sm-book {
  display: block;
  padding: 13px 0;
  border-radius: 4px;
  background: var(--b);
  color: #fff;
  font-size: 15px;
  font-weight: var(--weight-medium);
  text-align: center;
}
/* Reviews card */
.rv-card-slider { display: flex; align-items: center; gap: 8px; width: 78%; color: #ff9db0; }

.rv-card-track {
  position: relative;
  flex: 1 1 auto;
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.25);
}

.rv-card-fill {
  position: absolute;
  inset: 0 auto 0 0;
  border-radius: 2px;
  background: currentColor;
}

.rv-card-thumb { position: absolute; top: -9px; transform: translateX(-50%); }

.rv-card-pct {
  font-style: normal;
  font-family: var(--font-family-mono);
  font-size: var(--text-md);
  opacity: 0.85;
}

.rv-card-title {
  margin: 0;
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: var(--text-7xl);
  font-weight: var(--weight-extrabold);
  line-height: var(--leading-tight);
  letter-spacing: -0.01em;
  white-space: pre-line;
}

/* ═══ Study: Group Optimiser ═══ */

/* The before */
.go-pain-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.go-pain-n { font-size: var(--text-xl); color: var(--color-text-primary); }
.go-pain-n strong { font-size: var(--text-6xl); }

.go-step {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid var(--color-border-card);
  background: var(--color-surface-card);
  color: var(--color-text-primary);
  font-size: var(--text-3xl);
  line-height: 1;
  cursor: pointer;
}

.go-step:disabled { opacity: 0.35; cursor: not-allowed; }

.go-sheets {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: 8px;
  margin-bottom: 16px;
}

.go-sheet {
  padding: 8px;
  border-radius: 8px;
  border: 1px solid var(--color-border-card);
  background: var(--color-surface-card);
  animation: card-enter 0.35s ease;
}

.go-sheet-name {
  display: block;
  margin-bottom: 5px;
  font-size: var(--text-2xs);
  opacity: 0.6;
}

.go-sheet-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; }

.go-sheet-grid i {
  height: 6px;
  border-radius: 1px;
  background: var(--color-text-muted);
}

.go-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
}

.go-tiles--4 { grid-template-columns: repeat(2, 1fr); margin-top: 14px; }

.go-tile {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--color-border-card);
  background: var(--color-surface-card);
  color: var(--color-text-primary);
  font-family: var(--font-family-primary);
  text-align: left;
  cursor: default;
}

.go-tile strong { font-size: var(--text-6xl); line-height: 1.1; }
.go-tile span   { font-size: var(--text-sm); opacity: 0.62; }

.go-tile--bad strong { color: #d13d3d; }
.go-tile--good strong { color: #2e9e5b; }
.go-tiles--4 .go-tile { cursor: pointer; }
.go-tile--on { border-color: var(--color-primary); }

/* Stepper */
.go-stepper { display: flex; align-items: center; gap: 6px; margin-bottom: 14px; }

.go-stop {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px 5px 5px;
  border-radius: 100px;
  border: 1px solid var(--color-panel-border);
  background: transparent;
  color: var(--color-panel-text);
  font-family: inherit;
  font-size: var(--text-2xs);
  cursor: pointer;
}

.go-stop i {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--color-panel-border);
  font-style: normal;
}

.go-stop--on { border-color: #0c4a5e; font-weight: var(--weight-semibold); }
.go-stop--on i,
.go-stop--done i { background: #0c4a5e; color: #fff; }

.go-stopbar {
  flex: 1 1 auto;
  height: 2px;
  border-radius: 1px;
  background: var(--color-panel-border);
}

.go-stopbar--on { background: #0c4a5e; }

.go-steplead { margin: 0 0 10px; font-size: var(--text-sm); opacity: 0.7; }

.go-mini-form { display: flex; flex-wrap: wrap; gap: 6px; }

.go-mini-field {
  padding: 7px 10px;
  border-radius: 6px;
  border: 1px solid var(--color-panel-border);
  font-size: var(--text-2xs);
}

.go-mini-field--wide { flex: 1 1 100%; }

.go-mini-check {
  flex: 1 1 100%;
  height: 14px;
  border-radius: 3px;
  background: var(--color-panel-surface);
}

.go-mini-table { display: grid; gap: 4px; }

.go-mini-row {
  height: 18px;
  border-radius: 3px;
  background: var(--color-panel-surface);
}

.go-mini-row--head { background: #0c4a5e; opacity: 0.85; }

.go-mini-confirm { display: grid; gap: 8px; }
.go-mini-plans { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }

.go-mini-plan {
  height: 44px;
  border-radius: 6px;
  border: 1px solid var(--color-panel-border);
}

.go-mini-plan--on { border-color: #0c4a5e; background: rgba(12, 74, 94, 0.08); }

.go-mini-aml { height: 14px; border-radius: 3px; background: var(--color-panel-surface); }

.go-mini-cta {
  height: 28px;
  width: 120px;
  border-radius: 6px;
  background: #0c4a5e;
}

/* Preferences */
.go-prefs { display: grid; gap: 10px; }
.go-pref { display: grid; gap: 6px; }

.go-rec {
  margin-left: 8px;
  padding: 1px 7px;
  border-radius: 100px;
  background: var(--color-primitive-alpha-teal-10);
  color: var(--color-primary);
  font-style: normal;
  font-size: var(--text-2xs);
  font-weight: var(--weight-medium);
}

.go-pref-why {
  margin: 0 0 0 14px;
  padding-left: 14px;
  border-left: 2px solid var(--color-border-card);
  font-size: var(--text-base);
  line-height: var(--leading-relaxed);
  color: var(--color-text-primary);
  opacity: 0.68;
}

.go-pref-why--on { border-left-color: var(--color-primary); }

/* Netting table */
.go-table { width: 100%; border-collapse: collapse; font-size: var(--text-sm); }

.go-table th {
  padding: 6px 8px;
  border-bottom: 1px solid var(--color-panel-border);
  font-size: var(--text-2xs);
  font-weight: var(--weight-semibold);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
  text-align: left;
  opacity: 0.6;
}

.go-table td {
  padding: 8px;
  border-bottom: 1px solid var(--color-panel-border-subtle);
  vertical-align: middle;
}

.go-table strong { display: block; font-weight: var(--weight-semibold); }
.go-num { text-align: right; font-family: var(--font-family-mono); }
.go-neg { color: #d13d3d; }
.go-pos { color: #2e9e5b; }
.go-ird { font-size: var(--text-2xs); opacity: 0.5; }

.go-row--out { opacity: 0.38; }

.go-check {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  border: 1px solid var(--color-panel-border);
  background: transparent;
  color: #fff;
  font-size: 11px;
  line-height: 1;
  cursor: pointer;
}

.go-check--on { background: #0c4a5e; border-color: #0c4a5e; }

.go-why {
  margin: 10px 0 0;
  font-size: var(--text-sm);
  line-height: var(--leading-relaxed);
  opacity: 0.7;
}

/* Edge cases */
.go-edge-switches { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.go-edge-stage { display: grid; gap: 10px; }

.go-banner {
  padding: 14px 16px;
  border-radius: 10px;
  border-left: 3px solid var(--color-text-muted);
  background: var(--color-surface-hover);
}

.go-banner--hard { border-left-color: #d13d3d; }
.go-banner--soft { border-left-color: #f0a020; }
.go-banner--ask  { border-left-color: var(--color-primary); }

.go-banner-text {
  margin: 0 0 8px;
  font-size: var(--text-lg);
  line-height: var(--leading-relaxed);
  color: var(--color-text-primary);
}

.go-banner-where,
.go-banner-fix {
  margin: 0;
  font-size: var(--text-base);
  line-height: var(--leading-relaxed);
  color: var(--color-text-primary);
  opacity: 0.68;
}

.go-banner-fix { margin-top: 6px; }
.go-edge-empty { margin: 0; font-size: var(--text-lg); opacity: 0.62; }

/* Payment plans */
.go-plan-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.go-plan {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px;
  border-radius: 12px;
  border: 1px solid var(--color-border-card);
  background: var(--color-surface-card);
  color: var(--color-text-primary);
  font-family: var(--font-family-primary);
  text-align: left;
  cursor: pointer;
}

.go-plan--on { border-color: var(--color-primary); }
.go-plan h5 { margin: 0; font-size: var(--text-xl); }

.go-spark { display: flex; align-items: flex-end; gap: 2px; height: 54px; }

.go-spark i {
  flex: 1;
  min-height: 1px;
  border-radius: 2px 2px 0 0;
  background: var(--color-primary);
  opacity: 0.75;
}

.go-plan--on .go-spark i { opacity: 1; }

.go-spark-x {
  display: flex;
  justify-content: space-between;
  font-size: var(--text-2xs);
  opacity: 0.5;
}

.go-plan-detail { margin-top: 14px; }

.go-plan-blurb {
  margin: 0 0 6px;
  font-size: var(--text-lg);
  line-height: var(--leading-relaxed);
  color: var(--color-text-primary);
}

.go-plan-who { margin: 0; font-size: var(--text-base); opacity: 0.68; }

.go-aml {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--color-surface-hover);
  font-size: var(--text-base);
  line-height: var(--leading-relaxed);
  color: var(--color-text-primary);
}

.go-aml input { margin-top: 3px; accent-color: var(--color-primary); }

/* Deadline board */
.go-status {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 100px;
  font-size: var(--text-2xs);
  white-space: nowrap;
  transition: background 0.3s ease, color 0.3s ease;
}

.go-status--grey  { background: rgba(128, 128, 128, 0.15); }
.go-status--amber { background: rgba(240, 160, 32, 0.18); color: #8a5a00; }
.go-status--blue  { background: rgba(12, 74, 94, 0.12); color: #0c4a5e; }
.go-status--green { background: rgba(46, 158, 91, 0.16); color: #1d6b3c; }

/* Report */
.go-paper {
  max-width: 420px;
  margin: 0 auto;
  padding: 22px 24px;
  border-radius: 4px;
  background: #fff;
  color: #22303a;
  font-family: var(--font-family-system);
  box-shadow: 0 8px 26px var(--color-shadow-card-expanded);
}

.go-paper-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid #0c4a5e;
}

.go-paper-head h5 { margin: 0; font-size: var(--text-md); color: #0c4a5e; }
.go-paper-head span { font-size: var(--text-2xs); opacity: 0.55; }

.go-paper-lead { margin: 10px 0; font-size: var(--text-2xs); line-height: var(--leading-relaxed); }

.go-paper-table { width: 100%; border-collapse: collapse; font-size: var(--text-2xs); }

.go-paper-table td {
  padding: 6px 4px;
  border-bottom: 1px solid #e6ecef;
}

.go-paper-foot {
  margin: 14px 0 0;
  padding-top: 8px;
  border-top: 1px solid #e6ecef;
  font-size: 8px;
  opacity: 0.5;
}

.go-pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 12px;
  font-size: var(--text-sm);
  color: var(--color-text-primary);
}

/* Optimiser card — gross positions resolving to a net */
.go-card-net {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  height: 70px;
}

.go-net-cap {
  font-family: var(--font-family-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.6;
}

.go-net-val {
  font-family: var(--font-family-mono);
  font-size: 28px;
  font-weight: 600;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  color: rgba(255, 255, 255, 0.92);
  transition: color 0.25s ease;
}

.go-net-val--pos { color: #7ce0a3; }
.go-net-val--neg { color: #ff9d9d; }

.go-card-title {
  margin: 0;
  font-family: 'Space Grotesk', sans-serif;
  font-size: var(--text-7xl);
  font-weight: var(--weight-bold);
  line-height: var(--leading-tight);
  letter-spacing: -0.02em;
  white-space: pre-line;
}

.go-card-sub {
  margin: 0;
  font-size: var(--text-md);
  line-height: var(--leading-snug);
  white-space: pre-line;
  opacity: 0.75;
}

/* ── Case-study card heroes (shared shape with .ads-hero-*) ── */
.tk-hero-img,
.rv-hero-img,
.go-hero-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.tk-hero-wrap,
.rv-hero-wrap,
.go-hero-wrap {
  border-radius: 32px;
  overflow: hidden;
  margin-top: 40px;
}

.tk-hero-wrap .cs-hero-video,
.rv-hero-wrap .cs-hero-video,
.go-hero-wrap .cs-hero-video { margin-top: 0; }

.tk-hero-overlay,
.rv-hero-overlay,
.go-hero-overlay {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  overflow: hidden;
}

.tk-fly-overlay,
.rv-fly-overlay,
.go-fly-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.tk-hero-overlay .tk-card-face { padding: 32px; }

/* Inside the app window the mock keeps its own light chrome, whatever the page theme is */
.aw .go-tile {
  background: var(--color-panel-surface);
  border-color: var(--color-panel-border);
  color: var(--color-panel-text);
}

.aw .go-tile--on { border-color: var(--color-primary); }

/* Product mocks don't wear the site's bold-text gradient */
.pf-screen strong,
.pf-screen b,
.sp-screen strong,
.sp-screen b,
.ap-screen strong,
.ap-screen b,
.go-table strong,
.go-paper strong,
.rv-toggle-copy strong,
.rv-mine-tag b {
  background: none;
  -webkit-text-fill-color: currentColor;
  color: inherit;
}

/* ── Mobile ── */
@media (max-width: 768px) {
  .tk-guide,
  .tk-ads-stage,
  .rv-mine-cols { grid-template-columns: 1fr; }

  .tk-loop-row { grid-template-columns: 1fr; }
  .go-plan-cards { grid-template-columns: 1fr; }
  .shot--ad { width: 100%; margin-left: 0; transform: none; }
  .shot-ad-stage { flex-direction: column; align-items: center; gap: 28px; }
  .ap-body { zoom: 1.5; }
  .sp--pitch { zoom: 1.35; }
  .tk-org-meta { flex-direction: column; gap: 8px; }
  .tk-dwell { flex-direction: column; align-items: center; gap: 2px; text-align: center; }
  .rv-plot { height: 150px; }
  .rv-bar-x { font-size: 8px; }
  .go-table { font-size: var(--text-2xs); }
  .aw-nav { display: none; }
  .cs-quote-block { font-size: var(--text-4xl); }

  /* Heroes are laid out at 448px — shrink to the viewport like .ads-hero-wrap */
  .tk-hero-wrap,
  .rv-hero-wrap,
  .go-hero-wrap {
    width:  calc(100vw - 48px) !important;
    height: calc(100vw - 48px) !important;
    max-width: 448px;
    max-height: 448px;
  }

  .tk-card-title,
  .rv-card-title,
  .go-card-title { font-size: var(--text-6xl); }
}
