/* Sticky bar that ties /demo/* pages back to thatstheproblem.
   Self-contained: loads its own font, defines its own colors,
   does not depend on the parent site's style.css (which demos
   intentionally do NOT inherit — each demo picks its own visual
   system). */

@font-face {
  font-family: "Departure Mono";
  src: url("/assets/DepartureMono-Regular.woff2") format("woff2");
  font-display: swap;
}

/* Bar layout: three regions in a flex row.
   [cycle: ↺ next demo]   [meta: tier · counter · name]   [actions: ▶ try x | ▶ buy →]
   Cycle region collapses to width 0 when a tier has < 2 demos. */
.demo-frame-bar {
  position: sticky;
  top: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 8px 16px;
  background: #0a0a0f;
  color: #e9e9f0;
  font-family: "Departure Mono", ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 13px;
  letter-spacing: 0.02em;
  text-transform: lowercase;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.demo-frame-cycle {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
}

.demo-frame-cycle:empty {
  display: none;
}

.demo-frame-meta {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #b8b8c5;
}

.demo-frame-meta b {
  color: #e9e9f0;
  font-weight: 400;
}

.demo-frame-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.demo-frame-next,
.demo-frame-buy,
.demo-frame-switch {
  display: inline-block;
  text-decoration: none;
  padding: 4px 10px;
  border: 1px solid;
  font-family: inherit;
  font-size: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  white-space: nowrap;
  transition: background 200ms ease, border-color 200ms ease, color 200ms ease,
    text-shadow 200ms ease, box-shadow 200ms ease;
}

/* Cyan = act on the CURRENT tier (cycle within it, buy it). */
.demo-frame-next,
.demo-frame-buy {
  color: #7be8d4;
  border-color: rgba(123, 232, 212, 0.4);
}

.demo-frame-next:hover,
.demo-frame-next:focus-visible,
.demo-frame-buy:hover,
.demo-frame-buy:focus-visible {
  background: rgba(123, 232, 212, 0.08);
  border-color: rgba(123, 232, 212, 0.85);
  text-shadow: 0 0 8px rgba(123, 232, 212, 0.5);
  box-shadow: 0 0 12px rgba(123, 232, 212, 0.18);
  outline: none;
}

/* Pink = explore OTHER tiers. Same visual weight as the cyan actions —
   solid border, soft text-shadow, glow on hover. The two-color split
   makes the bar a continuous upsell hook. */
.demo-frame-switch {
  color: #ff7eb6;
  border-color: rgba(255, 126, 182, 0.4);
  text-shadow: 0 0 6px rgba(255, 126, 182, 0.4);
}

.demo-frame-switch:hover,
.demo-frame-switch:focus-visible {
  background: rgba(255, 126, 182, 0.08);
  border-color: rgba(255, 126, 182, 0.85);
  text-shadow: 0 0 12px rgba(255, 126, 182, 0.85);
  box-shadow: 0 0 12px rgba(255, 126, 182, 0.18);
  outline: none;
}

/* "?" help button — small circular button at the end of actions. Opens
   the orientation overlay anytime. Dim grey at rest so it doesn't compete
   with the cyan/pink action buttons; cyan on hover. */
.demo-frame-help {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 50%;
  background: transparent;
  color: #b8b8c5;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
  transition: background 200ms ease, border-color 200ms ease, color 200ms ease,
    text-shadow 200ms ease;
}

.demo-frame-help:hover,
.demo-frame-help:focus-visible {
  background: rgba(123, 232, 212, 0.08);
  border-color: rgba(123, 232, 212, 0.85);
  color: #7be8d4;
  text-shadow: 0 0 6px rgba(123, 232, 212, 0.5);
  outline: none;
}

@media (max-width: 640px) {
  .demo-frame-bar {
    font-size: 11px;
    padding: 6px 10px;
    gap: 8px;
    flex-wrap: wrap;
  }
  .demo-frame-cycle {
    flex-basis: 100%;
    justify-content: flex-start;
  }
  .demo-frame-meta {
    font-size: 10px;
    flex-basis: 100%;
  }
  .demo-frame-actions {
    flex-basis: 100%;
    justify-content: flex-start;
    gap: 6px;
  }
  .demo-frame-next,
  .demo-frame-buy,
  .demo-frame-switch {
    padding: 3px 8px;
  }
  .demo-frame-help {
    width: 22px;
    height: 22px;
    font-size: 11px;
  }
}

/* ---- One-time orientation overlay ---------------------------------- */

.demo-frame-tour {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Departure Mono", ui-monospace, "SF Mono", Menlo, monospace;
  text-transform: lowercase;
  letter-spacing: 0.02em;
  animation: demo-tour-fade 220ms ease both;
}

@keyframes demo-tour-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

.demo-frame-tour-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(2px);
}

.demo-frame-tour-card {
  position: relative;
  z-index: 1;
  max-width: 480px;
  width: calc(100vw - 32px);
  background: #0a0a0f;
  color: #e9e9f0;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 4px;
  padding: 28px 28px 24px;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.6),
    0 0 0 1px rgba(123, 232, 212, 0.08);
}

.demo-frame-tour-title {
  margin: 0 0 4px;
  font-size: 18px;
  font-weight: 400;
  color: #e9e9f0;
}

.demo-frame-tour-subtitle {
  margin: 0 0 20px;
  font-size: 13px;
  color: #b8b8c5;
}

.demo-frame-tour-rows {
  list-style: none;
  margin: 0 0 24px;
  padding: 0;
  display: grid;
  gap: 14px;
}

.demo-frame-tour-rows li {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 14px;
  align-items: baseline;
  font-size: 12px;
}

.demo-frame-tour-glyph {
  white-space: nowrap;
  font-size: 12px;
}

.demo-frame-tour-glyph.cyan {
  color: #7be8d4;
  text-shadow: 0 0 6px rgba(123, 232, 212, 0.4);
}

.demo-frame-tour-glyph.pink {
  color: #ff7eb6;
  text-shadow: 0 0 6px rgba(255, 126, 182, 0.4);
}

.demo-frame-tour-glyph.dim {
  color: #b8b8c5;
}

.demo-frame-tour-text {
  color: #b8b8c5;
  line-height: 1.5;
}

.demo-frame-tour-close {
  display: inline-block;
  background: transparent;
  color: #7be8d4;
  border: 1px solid rgba(123, 232, 212, 0.4);
  padding: 8px 16px;
  font: inherit;
  font-size: 13px;
  letter-spacing: 0.02em;
  text-transform: lowercase;
  cursor: pointer;
  transition: background 200ms ease, border-color 200ms ease,
    text-shadow 200ms ease, box-shadow 200ms ease;
}

.demo-frame-tour-close:hover,
.demo-frame-tour-close:focus-visible {
  background: rgba(123, 232, 212, 0.08);
  border-color: rgba(123, 232, 212, 0.85);
  text-shadow: 0 0 8px rgba(123, 232, 212, 0.5);
  box-shadow: 0 0 12px rgba(123, 232, 212, 0.18);
  outline: none;
}

@media (max-width: 480px) {
  .demo-frame-tour-card {
    padding: 22px 20px 18px;
  }
  .demo-frame-tour-rows li {
    grid-template-columns: 1fr;
    gap: 4px;
  }
  .demo-frame-tour-title {
    font-size: 16px;
  }
}
