/* ---------------------------------------------------------
   Tokens — Rozie Synopsis design system (magenta / navy / ink)
--------------------------------------------------------- */
:root {
  /* Surfaces */
  --bg: #f6f7fa;
  --surface: #ffffff;
  --surface-sunken: #eff0f2;
  --shell: #061940;
  --accent-wash: #fff3f6;

  /* Ink */
  --ink: #0f1522;
  --ink-secondary: #4a4f5a;
  --ink-tertiary: #666b75;
  --ink-disabled: #a9aeb8;

  /* Actions */
  --magenta: #d6006e;
  --magenta-hover: #a80057;
  --navy: #052c6d;
  --hint: #1b5fae;

  /* Events = magenta / live family */
  --events: #d6006e;
  --events-bg: #fff3f6;
  --events-border: #fdcdd9;
  --events-mark: #e45388;

  /* Exhibitors = hint blue / info family */
  --exhibitors: #052c6d;
  --exhibitors-bg: #eef5fe;
  --exhibitors-border: #c8defb;
  --exhibitors-mark: #0f72ce;

  /* Feedback */
  --warning: #a54b08;
  --warning-bg: #fdf5ec;
  --warning-border: #fbe7ce;

  --radius-pill: 999px;
  --radius-lg: 1.25rem;
  --radius-card: 0.75rem;
  --ease: cubic-bezier(0.32, 0.72, 0, 1);
  --ease-soft: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-pop: cubic-bezier(0.34, 1.56, 0.64, 1);
  --shadow-card: 0 4px 20px rgba(33, 33, 33, 0.12);
  --shadow-ambient: 0 24px 56px -20px rgba(6, 25, 64, 0.28);
}
@media (max-width: 720px) {
  :root { --radius-card: 1rem; }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
/* Until a category is picked, the library and footer aren't on the page
   at all, so there's nothing below the check-in screen to scroll to.
   Unlike locking overflow, this never clips the check-in screen itself
   on short viewports (landscape phones, small tablets). */
html.scroll-locked #library,
html.scroll-locked .footer { display: none; }

html.overlay-open,
html.overlay-open body { overflow: hidden; }

h1, h2, h3, h4 {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0;
  color: var(--ink);
}

p { margin: 0; color: var(--ink-secondary); }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.9em;
  color: var(--magenta);
}

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---------------------------------------------------------
   Grain overlay
--------------------------------------------------------- */
.grain {
  position: fixed;
  inset: 0;
  z-index: 60;
  pointer-events: none;
  opacity: 0.015;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------------------------------------------------------
   Access gate
--------------------------------------------------------- */
.gate {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  background: radial-gradient(circle at 50% 20%, rgba(214, 0, 110, 0.05), transparent 55%), var(--bg);
}

.gate-card {
  width: 100%;
  max-width: 24rem;
  padding: 2rem 1.75rem;
  border-radius: var(--radius-lg);
  background: var(--surface);
  text-align: center;
  box-shadow: var(--shadow-ambient);
}

.gate-logo {
  display: block;
  height: 2.6rem;
  width: auto;
  margin: 0 auto 1.25rem;
}

.gate-card h1 {
  font-size: 1.4rem;
  margin-bottom: 0.5rem;
}

.gate-card p {
  font-size: 0.88rem;
  margin-bottom: 1.25rem;
}

#gate-form { display: flex; flex-direction: column; gap: 0.65rem; }

#gate-input {
  width: 100%;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(15, 21, 34, 0.14);
  background: var(--surface);
  color: var(--ink);
  font-family: 'JetBrains Mono', monospace;
  font-size: 1rem;
  letter-spacing: 0.04em;
  text-align: center;
  outline: none;
  transition: box-shadow 0.3s var(--ease), border-color 0.3s var(--ease);
}
#gate-input::placeholder { color: var(--ink-tertiary); }
#gate-input:focus { border-color: var(--magenta); box-shadow: 0 0 0 3px rgba(214, 0, 110, 0.18); }
#gate-form .btn { justify-content: center; }
#gate-form .btn:disabled { opacity: 0.7; cursor: progress; }

.gate-error {
  font-size: 0.8rem;
  color: #b3261e;
  margin-top: -0.15rem;
}

.gate-note {
  margin-top: 1.25rem;
  font-size: 0.75rem;
  line-height: 1.5;
  color: var(--ink-tertiary);
  text-align: center;
  text-wrap: balance;
}
.gate-note i { vertical-align: -0.12em; margin-right: 0.2rem; }

/* ---------------------------------------------------------
   Buttons
--------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0.5rem 0.5rem 1.3rem;
  border-radius: var(--radius-pill);
  font-weight: 600;
  font-size: 0.92rem;
  white-space: nowrap;
  border: none;
  transition: transform 0.4s var(--ease), box-shadow 0.4s var(--ease);
}
.btn:active { transform: scale(0.98); }

.btn-primary {
  background: var(--magenta);
  color: #fff;
}
.btn-primary:hover {
  background: var(--magenta-hover);
  box-shadow: 0 12px 28px -10px rgba(214, 0, 110, 0.45);
}

.btn-navy {
  background: var(--navy);
  color: #fff;
  padding: 0.65rem 1.2rem;
}
.btn-navy:hover { background: #0a3d8f; }
.btn-navy:disabled { background: var(--ink-disabled); cursor: not-allowed; }

.btn-outline {
  background: var(--surface);
  color: var(--navy);
  padding: 0.6rem 1.1rem;
  box-shadow: inset 0 0 0 1.5px rgba(5, 44, 109, 0.22);
}
.btn-outline:hover { box-shadow: inset 0 0 0 1.5px var(--navy); }

.btn-sm { padding: 0.5rem 0.95rem; font-size: 0.82rem; gap: 0.4rem; }

.btn-text {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.55rem 0.25rem;
  border: none;
  background: none;
  color: var(--ink-secondary);
  font-size: 0.86rem;
  font-weight: 600;
}
.btn-text:hover { color: var(--ink); }

.btn-icon {
  width: 2rem; height: 2rem;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.2);
  display: grid;
  place-items: center;
  transition: transform 0.4s var(--ease);
}
.btn-primary:hover .btn-icon {
  transform: translate(2px, 2px) rotate(-45deg);
}

.link-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--magenta);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s var(--ease);
}
.link-btn:hover { border-color: var(--magenta); }
.link-btn.disabled { pointer-events: none; opacity: 0.5; }

/* ---------------------------------------------------------
   Nav — full-width pinned bar (never lets content show through)
--------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
}

.nav {
  display: flex;
  justify-content: center;
  background: rgba(246, 247, 250, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(15, 21, 34, 0.06);
}

.nav-inner {
  width: 100%;
  max-width: 78rem;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.6rem 1.5rem;
}
@media (max-width: 720px) { .nav-inner { padding: 0.55rem 1.1rem; } }

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.nav-logo {
  height: 2.6rem;
  width: auto;
  display: block;
}
@media (max-width: 720px) { .nav-logo { height: 2.1rem; } }

/* ---------------------------------------------------------
   Utility bar — secondary row pinned under the main nav
--------------------------------------------------------- */
/* Hidden on the initial badge screen — it only pops in once the user
   has scanned through to the category cards (item 3). */
.utility-bar {
  display: none;
  justify-content: center;
  background: var(--surface);
  border-bottom: 1px solid rgba(15, 21, 34, 0.06);
}
.utility-bar.is-visible { display: flex; }

.utility-bar-inner {
  width: 100%;
  max-width: 78rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: clamp(0.25rem, 1.6vw, 1.75rem);
  padding: 0.3rem 1.5rem;
}
@media (max-width: 720px) {
  .utility-bar-inner { padding: 0.3rem 0.75rem; justify-content: space-between; gap: 0.25rem; }
}

.utility-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.7rem;
  border: none;
  background: none;
  border-radius: var(--radius-pill);
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--ink-secondary);
  white-space: nowrap;
  transition: background 0.3s var(--ease), color 0.3s var(--ease);
}
.utility-link i { font-size: 0.9rem; }
.utility-link:hover { background: var(--surface-sunken); color: var(--ink); }
.utility-link.is-disabled { opacity: 0.4; cursor: not-allowed; }
.utility-link.is-disabled:hover { background: none; color: var(--ink-secondary); }
@media (max-width: 720px) {
  .utility-link span { display: none; }
  .utility-link { padding: 0.6rem; }
  .utility-link i { font-size: 1.15rem; }
}

/* ---------------------------------------------------------
   Layout helpers
--------------------------------------------------------- */
main, .footer { max-width: 100rem; margin: 0 auto; padding: 0 1.5rem; }
@media (max-width: 720px) { main, .footer { padding: 0 1.1rem; } }

/* ---------------------------------------------------------
   Hero — badge check-in
--------------------------------------------------------- */
.hero {
  position: relative;
  /* Fills exactly the viewport below the sticky header (--header-h is
     kept in sync from app.js), and grows past it if content needs to. */
  min-height: calc(100vh - var(--header-h, 0px));
  min-height: calc(100dvh - var(--header-h, 0px));
  padding: calc(2.3rem + 10px) 1.5rem 0.75rem;
  max-width: 78rem;
  margin: 0 auto;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  text-align: center;
}
@media (max-width: 720px) { .hero { padding: 2.5rem 1.1rem 1rem; } }

/* Once the user has scrolled into the library, the hero collapses to
   nothing — there's no gap above the library left to scroll back up
   into, so the one-way gate (item 3 from the previous round) needs no
   scroll-position correction and can't jitter. Restored by "Home". */
.hero.is-collapsed {
  min-height: 0;
  height: 0;
  padding: 0;
  margin: 0;
  overflow: hidden;
}

.hero-glow {
  position: absolute;
  top: -14rem; left: 50%;
  width: 64rem; height: 42rem;
  transform: translateX(-50%);
  background:
    radial-gradient(ellipse 42% 55% at 32% 40%, rgba(214, 0, 110, 0.07), transparent 60%),
    radial-gradient(ellipse 42% 55% at 68% 45%, rgba(27, 95, 174, 0.07), transparent 60%);
  pointer-events: none;
  z-index: 0;
}

.hero-copy {
  position: relative;
  top: 10px;
  z-index: 1;
  max-width: 42rem;
  margin: 0 auto;
  transition: opacity 0.3s var(--ease-soft), transform 0.3s var(--ease-soft), max-height 0.3s var(--ease-soft);
}
/* Once a badge is picked the title fades (keeping its space, so nothing
   jumps) to make room for the attendee walking to the centre. */
.hero.is-scanning .hero-copy,
.hero.is-welcoming .hero-copy { opacity: 0; pointer-events: none; }
.hero.is-open .hero-copy {
  opacity: 0;
  transform: translateY(-6px);
  pointer-events: none;
  /* Reclaim its vertical space for the locked scenes below — the
     category grid especially needs the room (item 3). */
  max-height: 0;
  margin: 0;
  overflow: hidden;
}

.hero-copy h1 {
  font-size: clamp(1.9rem, 3.4vw, 2.8rem);
  line-height: 1.06;
  margin-bottom: 0.4rem;
  white-space: nowrap;
}

.hero-copy p {
  font-size: 1.25rem;
  max-width: 42ch;
  margin: 0 auto;
}
@media (max-width: 620px) {
  .hero-copy h1 { font-size: 1.5rem; margin-bottom: 0.5rem; }
  .hero-copy p { font-size: 0.98rem; }
}

/* ---------------------------------------------------------
   Scene stack — badges, welcome, categories crossfade in the
   same box so switching states never jumps the layout.
--------------------------------------------------------- */
.scene-stack {
  position: relative;
  z-index: 1;
  display: grid;
  align-content: center;
  width: 100%;
  max-width: 74rem;
  margin: 0 auto;
  flex: 1;
  min-height: 0;
  padding: 0.5rem 0;
}
@media (max-width: 720px) {
  .scene-stack { padding: 0.4rem 0; }
}

.check-in-stage,
.welcome-scene,
.hero-pillars {
  grid-area: 1 / 1;
  width: 100%;
}

/* Scene 1: two badges */
.check-in-stage {
  /* Sits at the top of the shared scene cell rather than stretching
     to fill it — pulls the badges up, closer to the title above,
     instead of centering in the full flexed height (item 2). Nudged
     up further with a negative margin, scoped to just this scene so
     the welcome text and category cards keep their own positioning. */
  align-self: start;
  margin-top: calc(-2.75rem - 40px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: calc(0.3rem + 20px);
  opacity: 1;
  transition: opacity 0.4s var(--ease-soft);
}
@media (max-width: 620px) {
  .check-in-stage { gap: 1.1rem; }
}
.hero.is-welcoming .check-in-stage,
.hero.is-open .check-in-stage {
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
  transition: opacity 0.4s var(--ease-soft), visibility 0s linear 0.4s;
}

.badge-row {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: clamp(3rem, 10vw, 7rem);
}
@media (max-width: 620px) {
  .badge-row { gap: 1rem; }
}

.badge-trigger {
  border: none;
  background: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease);
}
.badge-trigger.is-dimmed {
  opacity: 0.18;
  transform: scale(0.94);
  pointer-events: none;
}

.badge-scene {
  position: relative;
  transform-origin: top center;
  animation: lanyardSwing 4.5s ease-in-out infinite;
}
/* The attendee sits between the badges, so Exhibitors is the 3rd child */
.badge-trigger:nth-child(3) .badge-scene { animation-delay: -1.4s; }
.badge-trigger.is-scanning .badge-scene { animation-play-state: paused; }
@keyframes lanyardSwing {
  0%, 100% { transform: rotate(-3deg); }
  50% { transform: rotate(3deg); }
}
@media (prefers-reduced-motion: reduce) {
  .badge-scene { animation: none; }
}

.lanyard {
  width: 32px;
  height: 72px;
  margin: 0 auto;
  border-radius: 6px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35);
}
.badge-trigger[data-pillar="events"] .lanyard { background: var(--events); }
.badge-trigger[data-pillar="exhibitors"] .lanyard { background: var(--exhibitors); }
@media (max-width: 620px) {
  .lanyard { width: 28px; height: 110px; }
}

.badge-card {
  position: relative;
  z-index: 1;
  width: clamp(260px, 29vw, 360px);
  margin: -8px auto 0;
  padding: 4rem 2rem 1.5rem;
  border-radius: 1.8rem;
  background: var(--surface);
  box-shadow: var(--shadow-ambient);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.55rem;
  transition: box-shadow 0.3s var(--ease);
}
@media (max-width: 620px) {
  .badge-card {
    width: clamp(140px, 40vw, 260px);
    padding: 1.75rem 1.4rem 1.45rem;
    border-radius: 1.3rem;
    gap: 0.5rem;
  }
}
/* Smallest phones (320–380px): both badges side by side still fit. */
@media (max-width: 380px) {
  .hero { padding-left: 0.25rem; padding-right: 0.25rem; }
  /* The subtitle wraps to two lines here, so drop the lanyards clear of it. */
  .check-in-stage { margin-top: calc(-2.75rem - 6px); }
  .badge-card { width: clamp(120px, 40vw, 260px); padding: 1.5rem 1rem 1.25rem; }
}
.badge-trigger.is-scanning .badge-card { animation: badgeGlow 0.9s ease-in-out; }
.badge-trigger[data-pillar="events"].is-scanning .badge-card { --glow: var(--events-bg); }
.badge-trigger[data-pillar="exhibitors"].is-scanning .badge-card { --glow: var(--exhibitors-bg); }
@keyframes badgeGlow {
  0%, 100% { box-shadow: var(--shadow-ambient); }
  50% { box-shadow: 0 0 0 5px var(--glow, var(--events-bg)), var(--shadow-ambient); }
}

.badge-hole {
  position: absolute;
  top: -9px; left: 50%;
  transform: translateX(-50%);
  width: 18px; height: 18px;
  border-radius: var(--radius-pill);
  background: var(--bg);
  box-shadow: inset 0 0 0 1px rgba(15, 21, 34, 0.1);
  z-index: 2;
}

.badge-kicker {
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-tertiary);
  margin-top: 0.4rem;
  line-height: 1.15;
  text-align: center;
}
.badge-trigger[data-pillar="events"] .badge-kicker { color: var(--events); }
.badge-trigger[data-pillar="exhibitors"] .badge-kicker { color: var(--exhibitors); }
@media (max-width: 620px) {
  .badge-kicker { font-size: 0.78rem; margin-top: 0.15rem; }
}

.badge-mark { width: 27%; margin: 0.2rem 0; }
.badge-mark img { width: 100%; height: auto; }

.badge-name {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: -0.005em;
  color: var(--ink-secondary);
}
@media (max-width: 620px) {
  .badge-name { font-size: 0.56rem; }
}

.badge-code {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 18px;
  margin-top: 0.4rem;
  opacity: 0.4;
}
.badge-code span { width: 3px; background: var(--ink); border-radius: 1px; }
@media (max-width: 620px) {
  .badge-code { height: 11px; margin-top: 0.15rem; }
}
.badge-code span:nth-child(3n) { height: 100%; }
.badge-code span:nth-child(3n + 1) { height: 60%; }
.badge-code span:nth-child(3n + 2) { height: 80%; }

.badge-tagline {
  margin-top: 0.6rem;
  padding-top: 0.6rem;
  border-top: 1px solid rgba(15, 21, 34, 0.08);
  width: 100%;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  text-align: center;
  color: var(--ink-tertiary);
}
.badge-trigger[data-pillar="events"] .badge-tagline { color: var(--events); }
.badge-trigger[data-pillar="exhibitors"] .badge-tagline { color: var(--exhibitors); }
@media (max-width: 620px) {
  .badge-tagline { font-size: 0.6rem; margin-top: 0.4rem; padding-top: 0.4rem; }
}

.scan-line {
  position: absolute;
  left: 10%; right: 10%; top: 6%;
  height: 3px;
  border-radius: var(--radius-pill);
  opacity: 0;
  z-index: 3;
  pointer-events: none;
}
.badge-trigger[data-pillar="events"] .scan-line { background: linear-gradient(90deg, transparent, var(--events), transparent); box-shadow: 0 0 14px 2px rgba(214, 0, 110, 0.45); }
.badge-trigger[data-pillar="exhibitors"] .scan-line { background: linear-gradient(90deg, transparent, var(--exhibitors), transparent); box-shadow: 0 0 14px 2px rgba(27, 95, 174, 0.45); }
.badge-trigger.is-scanning .scan-line { animation: scanSweep 0.9s ease-in-out forwards; }
@keyframes scanSweep {
  0% { top: 6%; opacity: 0; }
  12% { opacity: 1; }
  88% { opacity: 1; }
  100% { top: 92%; opacity: 0; }
}

.scan-check {
  position: absolute;
  bottom: 6%; left: 50%;
  transform: translate(-50%, 8px) scale(0.5);
  opacity: 0;
  z-index: 3;
  font-size: 1.9rem;
  pointer-events: none;
}
.badge-trigger[data-pillar="events"] .scan-check { color: var(--events); }
.badge-trigger[data-pillar="exhibitors"] .scan-check { color: var(--exhibitors); }
.badge-trigger.is-scanning .scan-check { animation: checkPop 0.9s ease-out forwards; }
@keyframes checkPop {
  0%, 78% { opacity: 0; transform: translate(-50%, 8px) scale(0.5); }
  90% { opacity: 1; transform: translate(-50%, 0) scale(1.15); }
  100% { opacity: 1; transform: translate(-50%, 0) scale(1); }
}
@media (prefers-reduced-motion: reduce) {
  .scan-line, .scan-check { animation: none !important; opacity: 0 !important; }
}

/* Scene 2: welcome entrance */
.welcome-scene {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 1.35rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s var(--ease-soft);
}
.hero.is-welcome-visible .welcome-scene {
  opacity: 1;
  pointer-events: auto;
}

.welcome-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.5rem 1.1rem;
  border-radius: var(--radius-pill);
  background: var(--accent-wash);
  color: var(--magenta);
  font-size: 0.85rem;
  font-weight: 700;
}

.welcome-scene h2 {
  font-size: clamp(2.4rem, 5vw, 3.6rem);
  max-width: 18ch;
  line-height: 1.1;
}
.welcome-scene p { font-size: 1.25rem; color: var(--ink-secondary); }

@keyframes sceneRise {
  from { opacity: 0; transform: translateY(18px); filter: blur(6px); }
  to { opacity: 1; transform: translateY(0); filter: blur(0); }
}
.hero.is-welcome-visible .welcome-tag { animation: sceneRise 0.7s var(--ease-soft) both; }
.hero.is-welcome-visible .welcome-scene h2 { animation: sceneRise 0.7s var(--ease-soft) 0.1s both; }
.hero.is-welcome-visible .welcome-scene p { animation: sceneRise 0.7s var(--ease-soft) 0.2s both; }
@media (prefers-reduced-motion: reduce) {
  .hero.is-welcome-visible .welcome-tag,
  .hero.is-welcome-visible .welcome-scene h2,
  .hero.is-welcome-visible .welcome-scene p { animation: none; }
}

/* Scene 3: category list, scoped to the selected pillar */
.hero-pillars {
  align-self: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.1rem;
  opacity: 0;
  pointer-events: none;
  /* Hidden cards must also leave the keyboard tab order. */
  visibility: hidden;
  transition: opacity 0.5s var(--ease-soft), visibility 0s linear 0.5s;
}
/* The hero fills exactly the space under the header, so centering the
   cards here centers them in the visible whitespace on every screen. */
.hero.is-open:not(.is-collapsed) { padding-top: 1rem; }
.hero.is-open .hero-pillars {
  opacity: 1;
  pointer-events: auto;
  visibility: visible;
  transition: opacity 0.5s var(--ease-soft), visibility 0s;
}
.hero.is-scrolled-past .hero-pillars {
  opacity: 0;
  transform: translateY(-10px);
  transition: opacity 0.6s var(--ease-soft), transform 0.6s var(--ease-soft);
}

.category-grid {
  display: none;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.3rem;
  width: 100%;
  max-width: 64rem;
  margin: 0 auto;
}
.hero[data-pillar="events"] .category-grid[data-pillar="events"],
.hero[data-pillar="exhibitors"] .category-grid[data-pillar="exhibitors"] {
  display: grid;
}
@media (max-width: 620px) {
  .category-grid { gap: 0.8rem; max-width: 26rem; }
}

.category-card {
  position: relative;
  aspect-ratio: 1 / 0.44;
  overflow: hidden;
  border: none;
  border-radius: var(--radius-lg);
  padding: 1.5rem 1.8rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  text-align: left;
  background: var(--surface);
  box-shadow: var(--shadow-card);
  opacity: 0;
  transform: translateY(14px) scale(0.96);
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.hero.is-open .category-card {
  animation: cardRiseUp 0.5s var(--ease-soft) forwards;
  animation-delay: var(--card-delay, 0s);
}
@keyframes cardRiseUp { to { opacity: 1; transform: translateY(0) scale(1); } }
@media (prefers-reduced-motion: reduce) {
  .category-card { animation: none !important; transform: none !important; opacity: 1; }
}
.category-card:hover,
.category-card:focus-visible {
  transform: translateY(-4px);
  box-shadow: 0 16px 32px -12px rgba(6, 25, 64, 0.18);
}

.category-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 0.4rem; }

/* Rounded-square "squircle" icon with a warm brand gradient — the
   light, app-icon-style treatment replacing the heavier solid-pill /
   tinted-card look. */
.category-card-icon {
  width: 3rem; height: 3rem;
  flex-shrink: 0;
  border-radius: 30%;
  display: grid;
  place-items: center;
  font-size: 1.3rem;
  color: #fff;
  transition: transform 0.3s var(--ease);
}
.category-grid[data-pillar="events"] .category-card-icon { background: linear-gradient(135deg, var(--events) 0%, #ff8a4c 100%); }
.category-grid[data-pillar="exhibitors"] .category-card-icon { background: linear-gradient(135deg, var(--exhibitors) 0%, #5ec6ff 100%); }
.category-card:hover .category-card-icon { transform: scale(1.08); }

.category-card-body h3 {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--ink);
  line-height: 1.25;
  margin-bottom: 0.3rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.category-card-body p {
  font-size: 0.86rem;
  color: var(--ink-secondary);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.category-card-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.86rem;
  font-weight: 700;
}
.category-grid[data-pillar="events"] .category-card-cta { color: var(--events); }
.category-grid[data-pillar="exhibitors"] .category-card-cta { color: var(--exhibitors); }
.category-card-cta i { transition: transform 0.3s var(--ease); }
.category-card:hover .category-card-cta i { transform: translateX(3px); }

/* Phones: one full-width row per category (icon left, text right) so
   titles never get cut off in a cramped two-column grid. */
@media (max-width: 620px) {
  .category-grid { grid-template-columns: 1fr; gap: 0.7rem; }
  .category-card {
    aspect-ratio: auto;
    display: grid;
    grid-template-columns: auto 1fr;
    column-gap: 0.9rem;
    align-items: start;
    padding: 1rem 1.1rem;
    border-radius: 1.2rem;
  }
  .category-card-top { display: contents; }
  .category-card-icon { grid-column: 1; grid-row: 1 / span 3; width: 2.4rem; height: 2.4rem; font-size: 1.1rem; }
  .category-card .tag { grid-column: 2; justify-self: start; margin-bottom: 0.3rem; }
  .category-card-body, .category-card-cta { grid-column: 2; }
  .category-card-body h3 { font-size: 0.98rem; margin-bottom: 0.15rem; }
  .category-card-body p { font-size: 0.78rem; -webkit-line-clamp: 2; }
  .category-card-cta { font-size: 0.76rem; margin-top: 0.45rem; }
}

.tag {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.55rem;
  border-radius: var(--radius-pill);
  font-size: 0.64rem;
  font-weight: 700;
}
.tag-soft { background: #c9d8f3; color: #3262b1; }
.tag-soon { background: var(--warning-bg); color: var(--warning); }

/* ---------------------------------------------------------
   Library
--------------------------------------------------------- */
.library { padding: 2.5rem 1.5rem 1.5rem; max-width: 100rem; margin: 0 auto; }
/* main already provides the side gutter on small screens. */
@media (max-width: 720px) { .library { padding: 1.75rem 0 1rem; } }

.library-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.25rem;
}
.library-head h2 { font-size: clamp(1.4rem, 2.6vw, 1.85rem); margin-bottom: 0.3rem; }
.library-head p { font-size: 0.92rem; }

/* Distinguished on purpose (item 4) — once a pillar is chosen, this is
   the only way back to the other one without returning to the badges. */
.switch-pillar-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.1rem;
  border: none;
  border-radius: var(--radius-pill);
  background: var(--ink);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 700;
  flex-shrink: 0;
  transition: transform 0.3s var(--ease), background 0.3s var(--ease);
}
.switch-pillar-btn i { font-size: 1rem; }
.switch-pillar-btn:hover { background: var(--navy); transform: translateY(-2px); }
@media (max-width: 560px) {
  .library-head { flex-direction: column; align-items: flex-start; }
  .switch-pillar-btn { width: 100%; justify-content: center; }
}

.library-controls {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(15, 21, 34, 0.08);
}

/* Chips always get their own row, so they're free to wrap onto a
   second line without stranding the toggle/search row next to them
   (item 7 — that misalignment was the root cause of the odd-looking
   search bar). */
.library-controls-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.chip {
  padding: 0.42rem 0.9rem;
  border-radius: var(--radius-pill);
  border: none;
  background: var(--surface);
  box-shadow: var(--shadow-card);
  color: var(--ink-secondary);
  font-size: 0.78rem;
  font-weight: 600;
  transition: all 0.3s var(--ease);
}
.chip:hover { color: var(--ink); }
.chip.active {
  background: var(--navy);
  color: #fff;
}

.view-toggle {
  display: inline-flex;
  padding: 0.2rem;
  border-radius: var(--radius-pill);
  background: var(--surface);
  box-shadow: var(--shadow-card);
  flex-shrink: 0;
}
.view-btn {
  width: 2rem; height: 1.9rem;
  border: none;
  background: none;
  border-radius: var(--radius-pill);
  display: grid;
  place-items: center;
  color: var(--ink-tertiary);
  font-size: 0.95rem;
  transition: background 0.3s var(--ease), color 0.3s var(--ease);
}
.view-btn.active { background: var(--navy); color: #fff; }

/* Groups */
.demo-group { margin-bottom: 2.25rem; }

.group-header {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  margin-bottom: 0.9rem;
  padding-left: 0.7rem;
  border-left: 3px solid var(--ink-disabled);
}
.demo-group[data-category="events"] .group-header { border-left-color: var(--events); }
.demo-group[data-category="exhibitors"] .group-header { border-left-color: var(--exhibitors); }
.group-header h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--ink);
}
.group-header .group-caption {
  font-size: 0.76rem;
  color: var(--ink-tertiary);
}
.group-count {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  color: var(--ink-tertiary);
}
.group-header { flex-wrap: wrap; row-gap: 0.15rem; }
.group-count::before { content: "|"; margin-right: 0.6rem; color: var(--ink-disabled); }

.demo-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
}
@media (max-width: 1400px) { .demo-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 860px) { .demo-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .demo-grid { grid-template-columns: 1fr; } }

.demo-card { outline: none; }

.card-shell {
  height: 100%;
  border-radius: var(--radius-card);
  background: var(--surface);
  box-shadow: var(--shadow-card);
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease);
  cursor: pointer;
  overflow: hidden;
}
.demo-card:hover .card-shell,
.demo-card:focus-visible .card-shell {
  transform: translateY(-3px);
  box-shadow: 0 16px 34px rgba(33, 33, 33, 0.16);
}
.demo-card.is-coming-soon .card-shell { cursor: default; }

.frame-screen {
  position: relative;
  aspect-ratio: 16 / 9;
  display: grid;
  place-items: center;
  overflow: hidden;
}
.frame-screen::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.5), transparent 45%);
}
/* That highlight was designed for the flat gradient placeholder — on a
   real thumbnail image it just looks like a stray translucent smudge,
   so skip it once there's an actual photo underneath. */
.frame-screen:has(.frame-thumb)::before {
  display: none;
}
.frame-thumb {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.play-icon {
  position: relative;
  z-index: 1;
  width: 2.4rem; height: 2.4rem;
  display: grid;
  place-items: center;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.88);
  color: var(--navy);
  font-size: 0.95rem;
  transition: transform 0.35s var(--ease), background 0.35s var(--ease), color 0.35s var(--ease);
}
.demo-card:hover .play-icon { transform: scale(1.08); background: var(--navy); color: #fff; }

/* "Not ready yet" cards get a centered pill in the middle of the
   thumbnail — reads at a glance without crowding a corner. */
.coming-soon-badge {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  max-width: 85%;
  padding: 0.6rem 1.1rem;
  border-radius: var(--radius-pill);
  background: #ffffff;
  color: var(--navy);
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 0.92rem;
  font-weight: 800;
  text-align: center;
  line-height: 1.25;
  box-shadow: 0 6px 18px -4px rgba(5, 44, 109, 0.3);
}
.coming-soon-badge i { font-size: 1.05rem; color: var(--magenta); flex-shrink: 0; }
@media (max-width: 560px) {
  .coming-soon-badge { font-size: 0.74rem; padding: 0.45rem 0.8rem; gap: 0.3rem; }
  .coming-soon-badge i { font-size: 0.85rem; }
}

.card-body { padding: 1.1rem 1.1rem 1rem; }
.card-body-top { display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap; margin-bottom: 0.4rem; }
.card-body h4 {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--ink);
  margin-bottom: 0.25rem;
}
.card-body p {
  font-size: 0.86rem;
  line-height: 1.45;
  margin-bottom: 0.8rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  color: var(--ink-tertiary);
}
.card-meta i { font-size: 0.85rem; transition: transform 0.3s var(--ease); }
.demo-card:hover .card-meta i { transform: translate(2px, -2px); }

.demo-card[hidden] { display: none; }

/* ---------------------------------------------------------
   Footer
--------------------------------------------------------- */
.footer { padding: 2rem 1.5rem 2.5rem; border-top: 1px solid rgba(15, 21, 34, 0.08); }
.footer-inner { display: flex; flex-direction: column; gap: 0.4rem; }
.footer-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.35rem;
}
.footer-brand .nav-logo { height: 1.6rem; }
.footer p { font-size: 0.8rem; color: var(--ink-tertiary); }
.footer-site-link { color: var(--magenta); font-weight: 600; }
.footer-site-link:hover { color: var(--magenta-hover); }

/* ---------------------------------------------------------
   Modal
--------------------------------------------------------- */
/* Flex + auto margins (not grid centering) so a panel taller than the
   screen, e.g. on a landscape phone, scrolls instead of being cut off. */
.modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  padding: 1.5rem;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(6, 25, 64, 0.6);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.modal-panel {
  position: relative;
  width: 100%;
  /* Narrow the 16:9 video on short screens (laptops, landscape iPads) so
     the reactions and "What's next" fit without scrolling. ~24rem is
     the panel's non-video height plus the modal's padding. */
  max-width: clamp(28rem, calc((100vh - 24rem) * 16 / 9 + 1rem), 52rem);
  max-width: clamp(28rem, calc((100dvh - 24rem) * 16 / 9 + 1rem), 52rem);
  margin: auto;
  border-radius: var(--radius-lg);
  padding: 0.5rem;
  background: var(--surface);
  box-shadow: var(--shadow-ambient);
  animation: modalIn 0.4s var(--ease-soft);
}
@media (max-width: 620px) {
  .modal { padding: 0.75rem; }
  .modal-close { top: 0.85rem !important; right: 0.85rem !important; }
}
@keyframes modalIn {
  from { opacity: 0; transform: translateY(18px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@media (prefers-reduced-motion: reduce) {
  .modal-panel { animation: none; }
}

.modal-close {
  position: absolute;
  top: -0.8rem; right: -0.8rem;
  width: 2.2rem; height: 2.2rem;
  border-radius: var(--radius-pill);
  border: none;
  background: var(--surface);
  color: var(--ink);
  display: grid;
  place-items: center;
  font-size: 1.05rem;
  z-index: 2;
  box-shadow: var(--shadow-card);
  transition: transform 0.3s var(--ease);
}
.modal-close:hover { transform: scale(1.08); }

.modal-frame {
  border-radius: calc(var(--radius-lg) - 0.35rem);
  overflow: hidden;
  background: #000;
}
.modal-media {
  position: relative;
  aspect-ratio: 16 / 9;
  background: var(--shell);
}
.modal-media iframe,
.modal-media video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
  background: #000;
}

.modal-info {
  padding: 1.15rem 1.1rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.modal-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}
.modal-info h3 { font-size: 1.12rem; margin-bottom: 0.3rem; }
.modal-info p { font-size: 0.86rem; }
.modal-open-link { font-size: 0.76rem; flex-shrink: 0; margin-top: 0.2rem; }
@media (max-width: 620px) {
  .modal-heading { flex-direction: column; gap: 0.5rem; }
}

/* Reactions */
.reaction-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.6rem 1rem;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-card);
  background: var(--surface-sunken);
}
.reaction-prompt { font-size: 0.84rem; font-weight: 700; color: var(--ink); }
.reaction-buttons { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.reaction-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 2.5rem;
  padding: 0.45rem 0.9rem;
  border: none;
  border-radius: var(--radius-pill);
  background: var(--surface);
  box-shadow: inset 0 0 0 1px rgba(15, 21, 34, 0.1);
  color: var(--ink-secondary);
  font-size: 0.82rem;
  font-weight: 600;
  transition: background 0.25s var(--ease), color 0.25s var(--ease), box-shadow 0.25s var(--ease), transform 0.25s var(--ease-pop);
}
.reaction-btn i { font-size: 1.05rem; }
.reaction-btn:hover { color: var(--ink); box-shadow: inset 0 0 0 1px rgba(15, 21, 34, 0.25); }
.reaction-btn:active { transform: scale(0.94); }
.reaction-btn.active {
  background: var(--accent-wash);
  color: var(--magenta);
  box-shadow: inset 0 0 0 1.5px var(--magenta);
}
.reaction-count {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.74rem;
  padding-left: 0.1rem;
}

/* Post-demo next steps */
.next-steps {
  padding-top: 1rem;
  border-top: 1px solid rgba(15, 21, 34, 0.08);
}
.next-steps-title {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-tertiary);
  margin-bottom: 0.65rem;
}
.next-steps-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
}
.watch-next {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-left: auto;
  max-width: 100%;
  padding: 0.5rem 0.6rem 0.5rem 0.95rem;
  border: none;
  border-radius: var(--radius-pill);
  background: none;
  box-shadow: inset 0 0 0 1px rgba(15, 21, 34, 0.12);
  color: var(--ink);
  font-size: 0.84rem;
  text-align: left;
  transition: box-shadow 0.25s var(--ease);
}
.watch-next:hover { box-shadow: inset 0 0 0 1.5px var(--navy); }
.watch-next-label { color: var(--ink-tertiary); font-weight: 600; flex-shrink: 0; }
.watch-next-title { font-weight: 700; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.watch-next i { font-size: 1.6rem; color: var(--navy); flex-shrink: 0; }
@media (max-width: 620px) {
  .next-steps-actions > * { width: 100%; justify-content: center; }
  .watch-next { margin-left: 0; justify-content: space-between; }
}

/* ---------------------------------------------------------
   Demo finder entry points
--------------------------------------------------------- */
.guide-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  max-width: 100%;
  padding: 0.55rem 1.1rem 0.55rem 0.55rem;
  border: none;
  border-radius: var(--radius-pill);
  background: var(--surface);
  box-shadow: var(--shadow-card);
  color: var(--ink-secondary);
  font-size: 0.9rem;
  text-align: left;
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.guide-cta strong { color: var(--navy); }
.guide-cta:hover { transform: translateY(-2px); box-shadow: 0 14px 30px -12px rgba(6, 25, 64, 0.25); }
.guide-cta-icon {
  width: 2.1rem; height: 2.1rem;
  flex-shrink: 0;
  border-radius: var(--radius-pill);
  display: grid;
  place-items: center;
  background: var(--navy);
  color: #fff;
  font-size: 1.05rem;
}
.guide-cta > .ph-arrow-right { color: var(--navy); transition: transform 0.3s var(--ease); }
.guide-cta:hover > .ph-arrow-right { transform: translateX(3px); }
@media (max-width: 620px) {
  .guide-cta { font-size: 0.8rem; }
}

.library-head-actions { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.guide-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.1rem;
  border: none;
  border-radius: var(--radius-pill);
  background: var(--surface);
  box-shadow: inset 0 0 0 1.5px rgba(5, 44, 109, 0.22);
  color: var(--navy);
  font-size: 0.85rem;
  font-weight: 700;
  transition: box-shadow 0.3s var(--ease), transform 0.3s var(--ease);
}
.guide-btn i { font-size: 1rem; }
.guide-btn:hover { box-shadow: inset 0 0 0 1.5px var(--navy); transform: translateY(-2px); }
@media (max-width: 560px) {
  .library-head-actions { width: 100%; }
  .library-head-actions > * { flex: 1 1 auto; width: auto; justify-content: center; white-space: nowrap; padding: 0.6rem 0.85rem; font-size: 0.8rem; }

  /* Phones: one swipeable row of chips, and sort + layout side by side,
     so the first demos show without scrolling past the controls. */
  .library-controls { gap: 0.65rem; }
  .chips {
    flex-wrap: nowrap;
    overflow-x: auto;
    margin: 0 -1.1rem;
    padding: 0.35rem 1.1rem 0.5rem;
    scrollbar-width: none;
    scroll-padding-inline: 1.1rem;
  }
  .chips::-webkit-scrollbar { display: none; }
  .chip { flex-shrink: 0; white-space: nowrap; }
  .sort-btn { padding: 0.42rem 0.75rem; white-space: nowrap; }
}

/* Sort: by category or most popular */
.sort-toggle {
  display: inline-flex;
  padding: 0.2rem;
  border-radius: var(--radius-pill);
  background: var(--surface);
  box-shadow: var(--shadow-card);
}
.sort-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.42rem 0.9rem;
  border: none;
  border-radius: var(--radius-pill);
  background: none;
  color: var(--ink-secondary);
  font-size: 0.78rem;
  font-weight: 600;
  transition: background 0.3s var(--ease), color 0.3s var(--ease);
}
.sort-btn.active { background: var(--navy); color: #fff; }

/* Card reaction count, beside the duration */
.card-meta-left { display: inline-flex; align-items: center; gap: 0.75rem; }
.card-reactions { display: inline-flex; align-items: center; gap: 0.25rem; color: var(--magenta); }
.card-reactions:empty { display: none; }
.card-reactions i { font-size: 0.8rem; }

/* ---------------------------------------------------------
   Demo finder dialog
--------------------------------------------------------- */
.guide {
  position: fixed;
  inset: 0;
  z-index: 85;
  display: flex;
  padding: 1.5rem;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.guide-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(6, 25, 64, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.guide-panel {
  position: relative;
  width: 100%;
  max-width: 44rem;
  margin: auto;
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-ambient);
  animation: modalIn 0.4s var(--ease-soft);
  display: flex;
  flex-direction: column;
}
@media (prefers-reduced-motion: reduce) {
  .guide-panel { animation: none; }
}
.guide-top {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.1rem 1.25rem 0;
}
.guide-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--magenta);
}
.guide-progress { display: flex; gap: 0.3rem; margin-left: auto; }
.guide-progress span {
  width: 1.6rem; height: 0.3rem;
  border-radius: var(--radius-pill);
  background: var(--surface-sunken);
  transition: background 0.3s var(--ease);
}
.guide-progress span.done { background: var(--navy); }
.guide-close {
  width: 2.4rem; height: 2.4rem;
  flex-shrink: 0;
  border: none;
  border-radius: var(--radius-pill);
  background: var(--surface-sunken);
  color: var(--ink);
  display: grid;
  place-items: center;
  font-size: 1.05rem;
}
.guide-progress[hidden] + .guide-close { margin-left: auto; }

.guide-body { padding: 1rem 1.25rem 0.5rem; }
.guide-body h2 {
  font-size: clamp(1.3rem, 2.4vw, 1.6rem);
  line-height: 1.2;
  margin-bottom: 0.35rem;
  outline: none;
}
.guide-lead { font-size: 0.9rem; margin-bottom: 1.1rem; }

.guide-options { display: grid; gap: 0.6rem; }
.guide-options-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.guide-options-row { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 560px) {
  .guide-options-grid { grid-template-columns: 1fr; }
  .guide-options-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.guide-option {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-height: 3.1rem;
  padding: 0.7rem 2.2rem 0.7rem 0.9rem;
  border: none;
  border-radius: var(--radius-card);
  background: var(--surface);
  box-shadow: inset 0 0 0 1px rgba(15, 21, 34, 0.12);
  color: var(--ink);
  font-size: 0.88rem;
  font-weight: 600;
  text-align: left;
  transition: box-shadow 0.2s var(--ease), background 0.2s var(--ease), opacity 0.2s var(--ease);
}
.guide-options-row .guide-option { justify-content: center; text-align: center; padding: 0.7rem; }
.guide-option > .ph:first-child { font-size: 1.2rem; color: var(--navy); flex-shrink: 0; }
.guide-option:hover:not(:disabled) { box-shadow: inset 0 0 0 1.5px rgba(5, 44, 109, 0.45); }
.guide-option.selected { background: #f1f5fc; box-shadow: inset 0 0 0 2px var(--navy); }
.guide-option:disabled { opacity: 0.45; cursor: not-allowed; }
.guide-option-check {
  position: absolute;
  top: 50%; right: 0.75rem;
  transform: translateY(-50%) scale(0.6);
  opacity: 0;
  color: var(--navy);
  font-size: 1.1rem;
  transition: opacity 0.2s var(--ease), transform 0.2s var(--ease-pop);
}
.guide-options-row .guide-option-check { top: 0.4rem; right: 0.4rem; transform: scale(0.6); font-size: 0.9rem; }
.guide-option.selected .guide-option-check { opacity: 1; transform: translateY(-50%) scale(1); }
.guide-options-row .guide-option.selected .guide-option-check { transform: scale(1); }

.guide-notes-label {
  display: block;
  margin: 1.2rem 0 0.4rem;
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--ink);
}
.guide-notes-label span { font-weight: 500; color: var(--ink-tertiary); }
.guide-notes {
  width: 100%;
  padding: 0.75rem 0.9rem;
  border: 1px solid rgba(15, 21, 34, 0.16);
  border-radius: var(--radius-card);
  font-family: inherit;
  font-size: 0.9rem;
  color: var(--ink);
  resize: vertical;
}
.guide-notes::placeholder { color: var(--ink-tertiary); }
.guide-notes:focus { outline: none; border-color: var(--navy); box-shadow: 0 0 0 3px rgba(5, 44, 109, 0.14); }

.guide-picks { display: grid; gap: 0.65rem; }
.guide-pick {
  display: grid;
  grid-template-columns: 7.5rem minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.9rem;
  padding: 0.55rem 0.75rem 0.55rem 0.55rem;
  border-radius: var(--radius-card);
  box-shadow: inset 0 0 0 1px rgba(15, 21, 34, 0.1);
}
.guide-pick-thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: 0.55rem;
  overflow: hidden;
}
.guide-pick-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.guide-pick-body h3 { font-size: 0.98rem; margin-bottom: 0.15rem; }
.guide-pick-body p { font-size: 0.8rem; color: var(--ink-tertiary); }
.guide-pick .btn { white-space: nowrap; }
.guide-pick-time { font-family: 'JetBrains Mono', monospace; font-size: 0.72rem; opacity: 0.8; }
.guide-pick-soon { font-size: 0.75rem; font-weight: 700; color: var(--warning); white-space: nowrap; }
@media (max-width: 560px) {
  .guide-pick { grid-template-columns: 5.5rem minmax(0, 1fr); }
  .guide-pick .btn, .guide-pick-soon { grid-column: 1 / -1; justify-content: center; }
}

.guide-cta-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.9rem;
  margin-top: 1rem;
  padding: 1rem 1.1rem;
  border-radius: var(--radius-card);
  background: var(--accent-wash);
}
.guide-cta-box strong { display: block; color: var(--ink); font-size: 0.95rem; }
.guide-cta-box span { font-size: 0.82rem; color: var(--ink-secondary); }
.guide-cta-box .btn span { color: inherit; font-size: inherit; }

.guide-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.9rem 1.25rem 1.2rem;
}
.guide-footer .btn { gap: 0.45rem; }

@media (max-width: 560px) {
  .guide { padding: 0; }
  .guide-panel { min-height: 100%; border-radius: 0; margin: 0; }
  .guide-body { flex: 1; }
  .guide-footer {
    position: sticky;
    bottom: 0;
    background: var(--surface);
    border-top: 1px solid rgba(15, 21, 34, 0.08);
    padding-bottom: calc(1rem + env(safe-area-inset-bottom));
  }
}

/* ---------------------------------------------------------
   Next-steps bar (after the first demo)
--------------------------------------------------------- */
.next-bar {
  position: fixed;
  left: 50%;
  bottom: 1rem;
  z-index: 70;
  transform: translateX(-50%);
  width: min(52rem, calc(100% - 2rem));
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.7rem 0.7rem 0.7rem 1.2rem;
  border-radius: var(--radius-pill);
  background: var(--shell);
  color: #fff;
  box-shadow: var(--shadow-ambient);
  animation: barIn 0.45s var(--ease-soft);
}
@keyframes barIn {
  from { opacity: 0; transform: translate(-50%, 16px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}
@media (prefers-reduced-motion: reduce) {
  .next-bar { animation: none; }
}
.next-bar-text { flex: 1; min-width: 0; font-size: 0.86rem; color: rgba(255, 255, 255, 0.78); }
.next-bar-text strong { color: #fff; }
.next-bar-actions { display: flex; gap: 0.5rem; flex-shrink: 0; }
.next-bar .btn-outline { background: transparent; color: #fff; box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, 0.35); }
.next-bar .btn-outline:hover { box-shadow: inset 0 0 0 1.5px #fff; }
.next-bar-close {
  width: 2.2rem; height: 2.2rem;
  flex-shrink: 0;
  border: none;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  display: grid;
  place-items: center;
}
html.has-next-bar .library { padding-bottom: 6rem; }
html.has-next-bar .toast { bottom: 6.5rem; }
@media (max-width: 720px) {
  .next-bar {
    flex-wrap: wrap;
    border-radius: var(--radius-lg);
    bottom: calc(0.75rem + env(safe-area-inset-bottom));
    padding: 0.9rem;
    gap: 0.65rem;
  }
  .next-bar-text { flex-basis: calc(100% - 3rem); }
  .next-bar-text span { display: block; }
  .next-bar-close { order: 2; }
  .next-bar-actions { order: 3; width: 100%; }
  .next-bar-actions > * { flex: 1 1 0; justify-content: center; }
  html.has-next-bar .library { padding-bottom: 10rem; }
  html.has-next-bar .toast { bottom: 10.5rem; }
}
/* Narrow phones: both buttons can't share a row without spilling out,
   so they stack, and the bar keeps only its short headline. */
@media (max-width: 480px) {
  .next-bar-text span { display: none; }
  .next-bar-text { align-self: center; }
  .next-bar-actions { flex-wrap: wrap; }
  .next-bar-actions > * { flex: 1 1 100%; }
  html.has-next-bar .library { padding-bottom: 11rem; }
  html.has-next-bar .toast { bottom: 11.5rem; }
}

/* ---------------------------------------------------------
   Short landscape screens (phones turned sideways): compact the
   check-in so the badges fit without a long scroll.
--------------------------------------------------------- */
@media (max-height: 520px) and (orientation: landscape) {
  .hero { padding-top: 0.75rem; }
  .hero-copy h1 { font-size: 1.5rem; }
  .hero-copy p { font-size: 0.9rem; }
  .check-in-stage { margin-top: 0; }
  .lanyard { height: 28px; width: 24px; }
  .badge-card { width: 200px; padding: 1rem 1rem 0.8rem; gap: 0.3rem; border-radius: 1.1rem; }
  .badge-kicker { font-size: 0.85rem; margin-top: 0.2rem; }
  .badge-mark { width: 20%; }
  .badge-name { font-size: 0.65rem; }
  .badge-code { height: 10px; margin-top: 0.1rem; }
  .badge-tagline { font-size: 0.58rem; margin-top: 0.3rem; padding-top: 0.3rem; }
  .hero-pillars { align-self: start; margin-top: 0; }
  .category-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); max-width: none; gap: 0.6rem; }
  .category-card { aspect-ratio: auto; min-height: 9rem; padding: 0.8rem; }
  .category-card-icon { width: 2rem; height: 2rem; font-size: 0.95rem; }
  .category-card-body h3 { font-size: 0.85rem; }
  .category-card-body p { font-size: 0.7rem; -webkit-line-clamp: 2; }
  .category-card-cta { font-size: 0.72rem; }
  .welcome-scene h2 { font-size: 1.8rem; }
  .welcome-scene { gap: 0.75rem; }
  /* Keep the demo finder's Back/Next in reach while its options scroll. */
  .guide { padding: 0.75rem; }
  .guide-footer {
    position: sticky;
    bottom: -0.75rem;
    background: var(--surface);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    box-shadow: 0 -1px 0 rgba(15, 21, 34, 0.08);
  }
}

/* Tall portrait tablets (iPad, iPad Pro): center the title and badges
   together instead of leaving a large gap between them. */
@media (orientation: portrait) and (min-width: 700px) and (min-height: 1000px) {
  .hero { justify-content: center; }
  .scene-stack { flex: 0 0 auto; }
  .check-in-stage { margin-top: 2.5rem; }
}

/* ---------------------------------------------------------
   Toast
--------------------------------------------------------- */
.toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  z-index: 90;
  padding: 0.7rem 1.2rem;
  border-radius: var(--radius-pill);
  background: var(--navy);
  color: #fff;
  font-size: 0.83rem;
  box-shadow: var(--shadow-ambient);
  opacity: 0;
  transition: opacity 0.35s var(--ease), transform 0.35s var(--ease);
  pointer-events: none;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ---------------------------------------------------------
   Scroll reveal
--------------------------------------------------------- */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  filter: blur(4px);
  transition: opacity 0.7s var(--ease-soft), transform 0.7s var(--ease-soft), filter 0.7s var(--ease-soft);
}
.reveal.in-view {
  opacity: 1;
  transform: translateY(0);
  filter: blur(0);
}
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; filter: none; transition: none; }
}

/* ---------------------------------------------------------
   Touch screens: give the small library controls a finger-
   sized hit area (about 40px) without changing the desktop look.
--------------------------------------------------------- */
@media (pointer: coarse) {
  .chip, .sort-btn { min-height: 2.5rem; }
  .view-btn { width: 2.5rem; height: 2.3rem; }
  .modal-open-link { display: inline-flex; align-items: center; min-height: 2.5rem; }
}

/* ---------------------------------------------------------
   Demo assistant (chat)
--------------------------------------------------------- */
.chat-launcher {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 72;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.8rem 1.15rem;
  border: none;
  border-radius: var(--radius-pill);
  background: var(--navy);
  color: #fff;
  font-size: 0.9rem;
  font-weight: 700;
  box-shadow: var(--shadow-ambient);
  transition: transform 0.3s var(--ease), bottom 0.3s var(--ease);
}
.chat-launcher i { font-size: 1.1rem; color: #ffb3d4; }
.chat-launcher:hover { transform: translateY(-2px); }
.chat-launcher[hidden], html.chat-open .chat-launcher { display: none; }
html.has-next-bar .chat-launcher { bottom: 6rem; }

.chat {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 75;
  width: min(25rem, calc(100vw - 2.5rem));
  height: min(40rem, calc(100vh - 2.5rem));
  height: min(40rem, calc(100dvh - 2.5rem));
  display: flex;
  flex-direction: column;
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-ambient), 0 0 0 1px rgba(15, 21, 34, 0.06);
  overflow: hidden;
  animation: modalIn 0.3s var(--ease-soft);
}
.chat[hidden] { display: none; }
@media (prefers-reduced-motion: reduce) { .chat { animation: none; } }

.chat-head {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.85rem 0.75rem 0.85rem 1rem;
  border-bottom: 1px solid rgba(15, 21, 34, 0.08);
}
.chat-avatar {
  width: 2.2rem; height: 2.2rem;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border-radius: 30%;
  background: linear-gradient(135deg, var(--magenta) 0%, #ff8a4c 100%);
  color: #fff;
}
.chat-head-text { flex: 1; min-width: 0; }
.chat-head h2 { font-size: 0.95rem; line-height: 1.2; }
.chat-head p { font-size: 0.72rem; color: var(--ink-tertiary); }
.chat-icon-btn {
  width: 2.25rem; height: 2.25rem;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border: none;
  border-radius: var(--radius-pill);
  background: none;
  color: var(--ink-secondary);
  font-size: 1.05rem;
}
.chat-icon-btn:hover { background: var(--surface-sunken); color: var(--ink); }

.chat-log {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.chat-msg {
  max-width: 88%;
  padding: 0.65rem 0.85rem;
  border-radius: 1rem;
  font-size: 0.86rem;
  line-height: 1.5;
}
.chat-msg p + p, .chat-msg p + ul, .chat-msg ul + p { margin-top: 0.5rem; }
.chat-msg ul { padding-left: 1.1rem; display: grid; gap: 0.2rem; }
.chat-msg strong { color: inherit; font-weight: 700; }
.chat-msg.is-user {
  align-self: flex-end;
  background: var(--navy);
  color: #fff;
  border-bottom-right-radius: 0.3rem;
  white-space: pre-wrap;
}
.chat-msg.is-bot {
  align-self: flex-start;
  background: var(--surface-sunken);
  color: var(--ink);
  border-bottom-left-radius: 0.3rem;
}
.chat-msg.is-error { background: var(--warning-bg); color: var(--warning); }
.chat-msg.is-typing { display: inline-flex; gap: 0.3rem; padding: 0.8rem 0.9rem; }
.chat-msg.is-typing span {
  width: 0.4rem; height: 0.4rem;
  border-radius: 50%;
  background: var(--ink-tertiary);
  animation: chatDot 1.2s infinite ease-in-out;
}
.chat-msg.is-typing span:nth-child(2) { animation-delay: 0.15s; }
.chat-msg.is-typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes chatDot { 0%, 80%, 100% { opacity: 0.25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }

.chat-starters { display: flex; flex-wrap: wrap; gap: 0.45rem; }
.chat-starter {
  padding: 0.5rem 0.8rem;
  border: none;
  border-radius: var(--radius-pill);
  background: var(--surface);
  box-shadow: inset 0 0 0 1px rgba(5, 44, 109, 0.22);
  color: var(--navy);
  font-size: 0.78rem;
  font-weight: 600;
  text-align: left;
}
.chat-starter:hover { box-shadow: inset 0 0 0 1.5px var(--navy); }

.chat-demos { display: grid; gap: 0.45rem; margin-top: 0.6rem; }
.chat-demo {
  display: grid;
  grid-template-columns: 3.6rem minmax(0, 1fr);
  grid-template-areas: "thumb text" "thumb action";
  column-gap: 0.65rem;
  row-gap: 0.25rem;
  align-items: center;
  padding: 0.5rem;
  border: none;
  border-radius: var(--radius-card);
  background: var(--surface);
  box-shadow: 0 1px 3px rgba(15, 21, 34, 0.1);
  color: var(--ink);
  text-align: left;
  transition: box-shadow 0.2s var(--ease);
}
.chat-demo:hover { box-shadow: 0 0 0 1.5px var(--navy); }
.chat-demo-thumb {
  grid-area: thumb;
  align-self: start;
  aspect-ratio: 4 / 3;
  border-radius: 0.5rem;
  overflow: hidden;
}
.chat-demo-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.chat-demo-text { grid-area: text; display: grid; gap: 0.1rem; min-width: 0; }
.chat-demo-text strong { font-size: 0.82rem; }
.chat-demo-text span { font-size: 0.74rem; color: var(--ink-secondary); line-height: 1.35; }
.chat-demo-action {
  grid-area: action;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--navy);
}
.chat-demo-time { font-family: 'JetBrains Mono', monospace; font-weight: 500; color: var(--ink-tertiary); }
.chat-cta { margin-top: 0.65rem; }

.chat-form {
  display: flex;
  align-items: flex-end;
  gap: 0.5rem;
  margin: 0 0.75rem;
  padding: 0.4rem 0.4rem 0.4rem 0.9rem;
  border-radius: 1.4rem;
  background: var(--surface-sunken);
}
.chat-form:focus-within { box-shadow: 0 0 0 1.5px var(--navy); }
.chat-form textarea {
  flex: 1;
  min-height: 2.25rem;
  max-height: 7.5rem;
  padding: 0.5rem 0;
  border: none;
  background: none;
  resize: none;
  overflow-y: hidden;
  font: inherit;
  font-size: 0.88rem;
  line-height: 1.4;
  color: var(--ink);
  outline: none;
}
.chat-send {
  width: 2.3rem; height: 2.3rem;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border: none;
  border-radius: 50%;
  background: var(--magenta);
  color: #fff;
  font-size: 1rem;
}
.chat-send:disabled { opacity: 0.45; }
.chat-note {
  padding: 0.5rem 1rem 0.75rem;
  font-size: 0.66rem;
  color: var(--ink-tertiary);
  text-align: center;
}

/* Phones: icon-only launcher above the next-steps bar, full-screen chat. */
@media (max-width: 720px) {
  html.has-next-bar .chat-launcher { bottom: 10.5rem; }
}
@media (max-width: 560px) {
  .chat-launcher { right: 1rem; bottom: calc(1rem + env(safe-area-inset-bottom)); padding: 0.9rem; }
  .chat-launcher span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  html.has-next-bar .chat-launcher { bottom: 11.5rem; }
  .chat { inset: 0; width: 100%; height: 100%; border-radius: 0; padding-bottom: env(safe-area-inset-bottom); }
  html.chat-open { overflow: hidden; }
  .chat-msg { max-width: 92%; }
}

/* ---------------------------------------------------------
   List view — a plain list: one row per demo, divider lines,
   no card surfaces or thumbnails.
--------------------------------------------------------- */
.list-icon { display: none; }
.library.view-list .demo-grid { grid-template-columns: 1fr; gap: 0; border-top: 1px solid rgba(15, 21, 34, 0.1); }
.library.view-list .card-shell {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 0.85rem 0.6rem;
  border-radius: 0;
  background: none;
  box-shadow: none;
  border-bottom: 1px solid rgba(15, 21, 34, 0.1);
  overflow: visible;
}
.library.view-list .demo-card:hover .card-shell,
.library.view-list .demo-card:focus-visible .card-shell {
  transform: none;
  box-shadow: none;
  background: rgba(5, 44, 109, 0.04);
}
.library.view-list .demo-card:focus-visible .card-shell { outline: 2px solid var(--navy); outline-offset: -2px; }
.library.view-list .card-frame-wrap { display: none; }
.library.view-list .list-icon {
  width: 2rem; height: 2rem;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(5, 44, 109, 0.08);
  color: var(--navy);
  font-size: 0.8rem;
}
.library.view-list .demo-card.is-empty .list-icon { background: var(--surface-sunken); color: var(--ink-tertiary); }
.library.view-list .demo-card:hover .list-icon { background: var(--navy); color: #fff; }
.library.view-list .card-body {
  flex: 1;
  min-width: 0;
  padding: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 5.5rem;
  grid-template-areas: "title tags meta" "desc tags meta";
  column-gap: 1.25rem;
  align-items: center;
}
.library.view-list .card-body h4 { grid-area: title; font-size: 0.95rem; margin: 0; }
.library.view-list .card-body p { grid-area: desc; margin: 0.1rem 0 0; font-size: 0.82rem; -webkit-line-clamp: 1; }
.library.view-list .card-body-top { grid-area: tags; margin: 0; justify-content: flex-end; }
.library.view-list .card-meta { grid-area: meta; justify-content: flex-end; gap: 0.75rem; }
.library.view-list .card-meta > i { display: none; }
@media (max-width: 560px) {
  .library.view-list .card-shell { align-items: flex-start; padding: 0.85rem 0.25rem; }
  .library.view-list .card-body {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "title meta" "desc desc" "tags tags";
    column-gap: 0.75rem;
  }
  .library.view-list .card-body p { -webkit-line-clamp: 2; }
  .library.view-list .card-body-top { justify-content: flex-start; margin-top: 0.4rem; }
  .library.view-list .card-meta { justify-content: flex-end; }
}
.list-only { display: none; }
.library.view-list .list-only { display: inline-flex; }

.library.view-list .card-only { display: none; }
/* Coming soon sits next to the title in list view, and those rows go last. */
.card-body h4 .tag { margin-left: 0.4rem; vertical-align: 2px; font-size: 0.62rem; }
/* In every category, demos you can watch come first and coming-soon
   ones go last, in both card and list view. */
.demo-card.is-soon { order: 1; }

/* ---------------------------------------------------------
   Filter by: experience, popularity, event phase
--------------------------------------------------------- */
.library-controls-row { align-items: flex-end; }
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.6rem 0.75rem;
}
.filter-label {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 2.4rem;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--ink);
}
.filter-label i { font-size: 1rem; color: var(--navy); }
.filter-field { display: grid; gap: 0.25rem; }
.filter-field > span {
  padding-left: 0.85rem;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-tertiary);
}
.filter-field select {
  appearance: none;
  -webkit-appearance: none;
  min-height: 2.4rem;
  padding: 0.5rem 2.1rem 0.5rem 0.85rem;
  border: none;
  border-radius: var(--radius-pill);
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 256 256'%3E%3Cpath fill='%23052c6d' d='M216.5 96.5l-80 80a12 12 0 0 1-17 0l-80-80a12 12 0 0 1 17-17L128 151l71.5-71.5a12 12 0 0 1 17 17z'/%3E%3C/svg%3E") no-repeat right 0.85rem center;
  box-shadow: var(--shadow-card);
  color: var(--ink);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
}
.filter-field select.is-set {
  background-color: var(--navy);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 256 256'%3E%3Cpath fill='%23ffffff' d='M216.5 96.5l-80 80a12 12 0 0 1-17 0l-80-80a12 12 0 0 1 17-17L128 151l71.5-71.5a12 12 0 0 1 17 17z'/%3E%3C/svg%3E");
  color: #fff;
}
.filter-field select:focus-visible { outline: 2px solid var(--navy); outline-offset: 2px; }
.filter-clear {
  min-height: 2.4rem;
  padding: 0 0.25rem;
  border: none;
  background: none;
  color: var(--magenta);
  font-size: 0.8rem;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.filter-empty {
  padding: 2.5rem 1rem;
  text-align: center;
  display: grid;
  justify-items: center;
  gap: 0.8rem;
}
.filter-empty[hidden] { display: none; }
@media (max-width: 560px) {
  .library-controls-row { flex-wrap: wrap; }
  .filter-bar { display: grid; grid-template-columns: 1fr 1fr; width: 100%; }
  .filter-label, .filter-field:first-of-type { grid-column: 1 / -1; }
  .filter-field select { width: 100%; }
  .filter-clear { grid-column: 1 / -1; justify-self: start; min-height: auto; }
}

/* Chat bubbles: paragraphs inherit the bubble's text colour. */
.chat-msg p, .chat-msg li { color: inherit; }

/* ---------------------------------------------------------
   Check-in attendee: stands between the badges thinking (glancing
   from one to the other, blinking, tapping a foot). Once a badge is
   picked they smile, walk to the centre and show it off.
--------------------------------------------------------- */
.badge-person {
  --skin: #e9b48f;
  --skin-shade: #d79a72;
  --hair: #3b2a20;
  --jacket: #737985;
  --jacket-shade: #50555e;
  --pants: #2a2f3b;
  --wear: var(--events);
  position: relative;
  top: 10px;
  z-index: 2;
  width: 180px;
  flex-shrink: 0;
  align-self: flex-end;
  container-type: inline-size;
}
.badge-person[data-pillar="exhibitors"] { --wear: var(--exhibitors); }
.person-motion { position: relative; animation: personBreathe 3.4s ease-in-out infinite; transform-origin: 50% 100%; }
.badge-person svg { display: block; width: 100%; height: auto; overflow: visible; }
.badge-person svg * { transform-box: view-box; }

.person-shadow { fill: rgba(15, 21, 34, 0.12); }
.person-skin, .person-neck { fill: var(--skin); }
.person-neck { fill: var(--skin-shade); }
.person-ear-shade { fill: var(--skin-shade); }
.person-hair { fill: var(--hair); }
.person-jacket { fill: var(--jacket); }
.person-lapel { fill: var(--jacket-shade); }
.person-shirt { fill: #fff; }
.person-button { fill: var(--jacket-shade); }
.person-trousers { fill: var(--jacket); }
.person-trouser-crease { fill: none; stroke: var(--jacket-shade); stroke-width: 1.4; stroke-linecap: round; opacity: 0.7; }
.person-shoe { fill: #8a1c4a; }
.person-earring, .person-necklace { fill: #f2b632; }

.person-sleeve { fill: none; stroke: var(--jacket); stroke-width: 14; stroke-linecap: round; stroke-linejoin: round; }
.person-eye { fill: #fff; }
.person-pupils { fill: #1d1d27; }
.person-glint { fill: #fff; }
.person-nose { fill: none; stroke: var(--skin-shade); stroke-width: 2; stroke-linecap: round; }
.person-brow { fill: #2a1d18; stroke: none; stroke-width: 0; stroke-linecap: round; transition: transform 0.4s var(--ease-soft); }
.person-brow { transform: translateY(-0.6px); }
.person-brow-right { transform: translateY(-1.3px) rotate(-3deg); transform-origin: 108px 53px; }
.person-cheek { fill: #f08a8a; opacity: 0; transition: opacity 0.4s ease; }
.person-mouth { fill: none; stroke: #b8405e; stroke-width: 2.4; stroke-linecap: round; transition: opacity 0.25s ease; }
.person-mouth-smile { fill: #c2416b; opacity: 0; transition: opacity 0.25s ease; }
.person-thought circle { fill: #c3c9d6; animation: personThought 1.8s ease-in-out infinite; }
.person-thought circle:nth-child(2) { animation-delay: 0.25s; }
.person-thought circle:nth-child(3) { animation-delay: 0.5s; }
.person-thought, .person-arm-hip, .person-arm-think, .person-arms-hold { transition: opacity 0.3s ease; }
.person-arms-hold { opacity: 0; }
.person-strap { fill: none; stroke: var(--wear); stroke-width: 2.4; stroke-linecap: round; stroke-dasharray: 60; stroke-dashoffset: 60; opacity: 0; }

/* Idle: look from badge to badge, blink, sway, tap a foot */
.person-head, .person-head-back { transform-origin: 100px 92px; animation: personLook 5s ease-in-out infinite; transition: transform 0.5s var(--ease-soft); }
.person-pupils { animation: personPupils 5s ease-in-out infinite; }
.person-eyes { transform-origin: 100px 62px; animation: personBlink 4.2s infinite; }
.person-figure { transform-origin: 100px 377px; animation: personSway 5s ease-in-out infinite; }
.person-foot-tap { transform-origin: 104px 375px; animation: personTap 1.1s ease-in-out infinite; }

@keyframes personLook {
  0%, 14% { transform: rotate(-6deg); }
  36%, 64% { transform: rotate(6deg); }
  86%, 100% { transform: rotate(-6deg); }
}
/* --look-* are set from where each badge actually sits (app.js), always
   with an upward lean so she reads as looking up at them. */
@keyframes personPupils {
  0%, 14% { transform: translate(var(--look-lx, -2.2px), var(--look-ly, -2px)); }
  36%, 64% { transform: translate(var(--look-rx, 2.2px), var(--look-ry, -2px)); }
  86%, 100% { transform: translate(var(--look-lx, -2.2px), var(--look-ly, -2px)); }
}
@keyframes personBlink { 0%, 92%, 100% { transform: scaleY(1); } 95% { transform: scaleY(0.1); } }
@keyframes personSway { 0%, 100% { transform: rotate(-1.2deg); } 50% { transform: rotate(1.2deg); } }
@keyframes personTap { 0%, 60%, 100% { transform: rotate(0); } 30% { transform: rotate(-9deg); } }
@keyframes personThought { 0%, 100% { opacity: 0.3; } 50% { opacity: 1; } }
@keyframes personBreathe { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-2px); } }
@keyframes personHop {
  0% { transform: translateY(0); }
  30% { transform: translateY(-14px); }
  55% { transform: translateY(0); }
  72% { transform: translateY(-5px); }
  100% { transform: translateY(0); }
}

/* The badge they show off: built from the picked badge's details,
   sized relative to the figure (cqw) so it reads once they're scaled up. */
.person-worn-badge {
  position: absolute;
  left: 50%;
  top: 29.9%;
  width: 30cqw;
  transform: translateX(-50%) scale(0.6);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1cqw;
  padding: 3.6cqw 2.4cqw 2.8cqw;
  border-radius: 3.6cqw;
  background: #fff;
  box-shadow: 0 6px 18px -6px rgba(6, 25, 64, 0.35);
  text-align: center;
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.45s var(--ease-pop);
}
.pwb-hole { width: 4.5cqw; height: 1.6cqw; border-radius: 99px; background: #e6e8ee; margin-bottom: 0.4cqw; }
.pwb-kicker { white-space: nowrap; font-size: 3.4cqw; font-weight: 800; letter-spacing: 0.02em; line-height: 1.1; text-transform: uppercase; color: var(--wear); }
.person-worn-badge img { width: 8.5cqw; height: auto; }
.pwb-name { font-size: 2.6cqw; font-weight: 600; color: var(--ink-secondary); }
.pwb-code { display: flex; align-items: flex-end; gap: 0.6cqw; height: 2.4cqw; }
.pwb-code span { width: 0.6cqw; background: var(--ink); border-radius: 1px; }
.pwb-code span:nth-child(3n) { height: 100%; }
.pwb-code span:nth-child(3n + 1) { height: 60%; }
.pwb-code span:nth-child(3n + 2) { height: 80%; }
.pwb-tagline {
  width: 100%;
  padding-top: 1.1cqw;
  border-top: 1px solid #eceef3;
  font-size: 2.5cqw;
  font-weight: 800;
  line-height: 1.2;
  text-transform: uppercase;
  color: var(--wear);
}

/* Picked a badge: stop thinking and smile */
.badge-person.is-happy .person-head,
.badge-person.is-happy .person-head-back,
.badge-person.is-happy .person-pupils,
.badge-person.is-happy .person-figure,
.badge-person.is-happy .person-foot-tap { animation: none; transform: none; }
.badge-person.is-happy .person-brow-right { transform: none; }
.badge-person.is-happy .person-brow { transform: translateY(-1px); }
.badge-person.is-happy .person-mouth-think { opacity: 0; }
.badge-person.is-happy .person-mouth-smile { opacity: 1; }
.badge-person.is-happy .person-cheek { opacity: 0.4; }
.badge-person.is-happy .person-thought,
.badge-person.is-happy .person-arm-think { opacity: 0; }
/* Badge on: lanyard draws, arms hold the badge, a happy hop */
.badge-person.is-wearing .person-arm-hip { opacity: 0; }
.badge-person.is-wearing .person-arms-hold { opacity: 1; }
.badge-person.is-wearing .person-strap { opacity: 1; stroke-dashoffset: 0; transition: stroke-dashoffset 0.45s ease; }
.badge-person.is-wearing .person-worn-badge { opacity: 1; transform: translateX(-50%) scale(1); }
.badge-person.is-wearing .person-motion { animation: personHop 0.8s var(--ease-soft) 0.1s; }

/* The badge not picked steps out of the way; the picked one's strap
   hides while it flies onto the attendee. */
.badge-trigger.is-dimmed { opacity: 0 !important; transform: translateY(24px) scale(0.92) !important; transition: opacity 0.4s ease, transform 0.5s var(--ease-soft); }
.badge-trigger.is-chosen { position: relative; z-index: 3; } /* flies in front of the attendee */
.badge-trigger.is-chosen .badge-scene { animation-play-state: paused; }
.badge-trigger.is-chosen .lanyard { opacity: 0; transition: opacity 0.25s ease; }

@media (prefers-reduced-motion: reduce) {
  .person-motion, .person-head, .person-pupils, .person-eyes, .person-figure, .person-foot-tap, .person-thought circle { animation: none !important; }
}

/* ---------------------------------------------------------
   Memoji-style character: big rounded head, glossy eyes behind
   glasses, smooth clay-like shading lit from the upper left.
--------------------------------------------------------- */
.person-shadow { fill: rgba(15, 21, 34, 0.28); }
.person-shadow-core { fill: rgba(15, 21, 34, 0.35); }
.person-skin { fill: url(#p-skin); }
.person-neck { fill: url(#p-neck); }
.person-hair { fill: url(#p-hair); }
.person-hair-sheen { fill: none; stroke: rgba(255, 236, 214, 0.2); stroke-width: 1.8; stroke-linecap: round; }
.person-hair-part { fill: none; stroke: #0d0908; stroke-width: 1.2; stroke-linecap: round; }
.person-jacket { fill: url(#p-jacket); }
.person-jacket-shade { fill: rgba(30, 33, 40, 0.28); }
.person-lapel { fill: url(#p-lapel); }
.person-lapel-edge { fill: none; stroke: rgba(255, 255, 255, 0.18); stroke-width: 1; }
.person-collar-shadow { fill: none; stroke: rgba(10, 20, 45, 0.3); stroke-width: 3; }
.person-shirt { fill: url(#p-shirt); }
.person-fold { fill: none; stroke: rgba(5, 14, 36, 0.32); stroke-width: 1.6; stroke-linecap: round; }
.person-trousers { fill: url(#p-trousers); }
.person-button { fill: #0b1a3c; stroke: rgba(255, 255, 255, 0.25); stroke-width: 0.6; }
.person-shoe { fill: url(#p-shoe); }
.person-shoe-shine { fill: none; stroke: rgba(255, 255, 255, 0.45); stroke-width: 1.4; stroke-linecap: round; }
.person-earring, .person-necklace { fill: url(#p-gold); }
.person-sleeve-l { stroke: url(#p-sleeve-l); }
.person-sleeve-r { stroke: url(#p-sleeve-r); }
.person-eye { fill: url(#p-sclera); }
.person-iris { fill: url(#p-iris); }
.person-pupil { fill: #120c08; }
.person-glint { fill: #fff; }
.person-lid { fill: none; stroke: #241611; stroke-width: 1.1; stroke-linecap: round; }
.person-collar { stroke: rgba(10, 14, 24, 0.12); stroke-width: 0.8; }
.person-watch { fill: url(#p-watch); stroke: #5d6573; stroke-width: 0.8; }
.person-face-shade { fill: rgba(150, 80, 45, 0.22); }
.person-face-light { fill: rgba(255, 255, 255, 0.3); }
.person-hairline-shadow { fill: none; stroke: rgba(120, 60, 35, 0.3); stroke-width: 3; }
.person-glasses rect, .person-glasses path { fill: none; stroke: #16171b; stroke-width: 1.3; stroke-linecap: round; }
.person-glasses rect { fill: url(#p-lens); }
.person-lens-glare { fill: none; stroke: rgba(255, 255, 255, 0.4); stroke-width: 1; stroke-linecap: round; }
.person-nose-light { fill: rgba(255, 255, 255, 0.55); }
.person-chin-shadow { fill: rgba(110, 55, 30, 0.45); }
.person-cheek { fill: url(#p-blush); opacity: 0.55; }
.badge-person.is-happy .person-cheek { opacity: 1; }
.person-mouth { stroke: #b85565; stroke-width: 1.4; }
.person-mouth-smile { fill: url(#p-lips); }
.person-teeth { fill: #fff; opacity: 0; transition: opacity 0.25s ease; }
.badge-person.is-happy .person-teeth { opacity: 0.95; }

@media (prefers-reduced-motion: reduce) {
  .badge-scene { animation: none !important; }
}

/* Room between the badges on tablets and laptops */
.badge-row { align-items: flex-end; }
@media (min-width: 901px) {
  .badge-row { gap: clamp(2.5rem, 5vw, 5rem); }
}
@media (max-width: 900px) and (min-width: 621px) {
  .badge-row { gap: clamp(1rem, 3vw, 2rem); }
  .badge-card { width: clamp(200px, 28vw, 260px); }
  .badge-person { width: 126px; }
}
/* Phones: the attendee stands below the badges, looking up at them */
@media (max-width: 620px) {
  .badge-row { display: grid; grid-template-columns: repeat(2, auto); justify-content: center; align-items: end; row-gap: 0.25rem; }
  .badge-person { grid-column: 1 / -1; grid-row: 2; justify-self: center; width: 94px; }
}
@media (max-height: 520px) and (orientation: landscape) {
  .badge-person { width: 94px; }
}

/* ---------------------------------------------------------
   Welcome screen: "Trusted by" logos drifting behind the text,
   rows alternating direction, at 50% opacity.
--------------------------------------------------------- */
.logo-marquee {
  /* An opaque page-colour backdrop gives the logos' multiply blend
     something to blend with, so their white tiles disappear. */
  background: var(--bg);
  position: fixed;
  top: var(--header-h, 0px);
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-evenly;
  overflow: hidden;
  pointer-events: none;
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.6s var(--ease-soft), visibility 0s linear 0.6s;
}
.hero.is-welcome-visible .logo-marquee {
  visibility: visible;
  opacity: 1;
  transition: opacity 0.6s var(--ease-soft), visibility 0s;
}
.logo-row { overflow: hidden; padding-left: 2rem; }
.logo-track {
  display: flex;
  width: max-content;
  gap: 2.5rem;
  background: var(--bg); /* the moving track is its own blend group */
  animation: logoDrift 70s linear infinite;
  animation-play-state: paused;
}
.logo-row.is-reverse .logo-track { animation-direction: reverse; }
.hero.is-welcoming .logo-track { animation-play-state: running; }
.logo-track img {
  height: 92px;
  width: auto;
  mix-blend-mode: multiply; /* drops the logos' white tiles */
  opacity: 0.6;
}
/* Featured logos a little larger; Google Public Sector Summit largest */
.logo-track img.is-featured { height: 110px; margin-block: -9px; }
.logo-track img.is-hero { height: 132px; margin-block: -20px; }
@keyframes logoDrift { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@media (max-width: 620px) {
  .logo-track { gap: 1.5rem; }
  .welcome-scene::before { inset: -1rem -1.5rem; }
  .logo-track img { height: 64px; }
  .logo-track img.is-featured { height: 76px; margin-block: -6px; }
  .logo-track img.is-hero { height: 92px; margin-block: -14px; }
}
@media (prefers-reduced-motion: reduce) {
  .logo-track { animation: none; }
}
/* Keep the welcome text readable over the logos */
/* align-self keeps the box (and so the backdrop) hugging the text
   instead of stretching over the logo rows. */
.welcome-scene { position: relative; z-index: 1; isolation: isolate; align-self: center; }
.welcome-scene::before {
  content: "";
  position: absolute;
  inset: -3rem -5rem;
  z-index: -1;
  background: radial-gradient(closest-side, var(--bg) 60%, rgba(246, 247, 250, 0));
}

/* Demos a visitor was just recommended or watched, highlighted for a
   moment when the finder or assistant brings them into the library. */
.demo-card.is-spotlight .card-shell { box-shadow: 0 0 0 3px var(--magenta), var(--shadow-card); }
.demo-card.is-spotlight-pulse .card-shell { animation: spotlightPulse 1.1s ease-in-out 3; }
.library.view-list .demo-card.is-spotlight .card-shell { background: var(--accent-wash); box-shadow: inset 3px 0 0 var(--magenta); }
@keyframes spotlightPulse { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }
@media (prefers-reduced-motion: reduce) { .demo-card.is-spotlight-pulse .card-shell { animation: none; } }

/* "Your Personalized Picks" sits just left of the card/list toggle */
.library-controls-end { display: flex; align-items: center; gap: 0.6rem; margin-left: auto; }
@media (max-width: 560px) {
  .library-controls-end { width: 100%; justify-content: space-between; margin-left: 0; }
  .library-controls-end .guide-btn { flex: 1; justify-content: center; }
}

/* Back from the library to the category cards */
.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.6rem;
  padding: 0.35rem 0.1rem;
  border: none;
  background: none;
  color: var(--ink-secondary);
  font-size: 0.85rem;
  font-weight: 700;
}
.back-btn i { transition: transform 0.25s var(--ease); }
.back-btn:hover { color: var(--ink); }
.back-btn:hover i { transform: translateX(-3px); }
@media (pointer: coarse) { .back-btn { min-height: 2.5rem; } }
