/* Split hero with step-based Alice demo */

.page-e2e .hero-masthead {
  background-color: #fff;
  background-image:
    linear-gradient(
      90deg,
      rgba(255, 255, 255, 0.94) 0%,
      rgba(255, 255, 255, 0.72) 35%,
      rgba(255, 255, 255, 0.18) 58%,
      transparent 72%
    ),
    url('/static/images/hero-background.png');
  background-size: cover;
  background-position: center bottom;
  background-repeat: no-repeat;
}

.page-e2e .hero-masthead nav {
  background: transparent;
  border-bottom: none;
}

.hero--split {
  text-align: left;
  padding: 80px 0 56px;
  background: transparent;
}

.hero--stacked {
  text-align: center;
  overflow: visible;
}

.hero--stacked .hero-h1-line {
  white-space: normal;
}

.hero--stacked .hero-split {
  grid-template-columns: 1fr;
  gap: 56px;
  justify-items: center;
}

.hero--stacked .hero-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 1100px;
}

.hero--stacked .hero-sub {
  margin-left: auto;
  margin-right: auto;
}

.hero--stacked .hero-demo-cta {
  margin-left: auto;
  margin-right: auto;
}

.hero--stacked .hero-visual {
  width: min(100%, 420px);
  align-items: center;
}

.hero--stacked .hero-step-caption {
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 20px;
}

.hero--stacked .hero-step-caption__copy {
  text-align: center;
}

@media (min-width: 1025px) {
  .hero--stacked {
    padding-top: 64px;
    padding-bottom: 48px;
  }

  .hero--stacked .hero-split {
    gap: 32px;
  }

  .hero--stacked .hero-visual {
    position: relative;
    width: 100%;
    max-width: 100%;
    flex-direction: column;
    align-items: center;
    gap: 0;
  }

  .hero--stacked .hero-demo-frame {
    flex-shrink: 0;
    margin: 0 auto;
    position: relative;
    z-index: 2;
  }

  .hero--stacked .hero-step-arrow {
    display: block;
    position: absolute;
    left: -86px;
    top: 0;
    width: 84px;
    height: 58px;
    color: var(--ink-soft);
    opacity: 0.7;
    pointer-events: none;
    z-index: 3;
    overflow: visible;
  }

  .hero--stacked .hero-step-caption {
    position: absolute;
    top: 0;
    right: 0;
    left: auto;
    width: min(280px, calc(50vw - 220px));
    max-width: 280px;
    margin-top: 0;
    align-items: flex-start;
    text-align: left;
    gap: 16px;
    min-height: auto;
    z-index: 3;
    overflow: visible;
  }

  .hero--stacked .hero-step-caption__copy {
    flex: none;
    min-height: auto;
    text-align: left;
  }

  .hero--stacked .hero-step-caption__text {
    font-size: 15px;
    line-height: 1.45;
  }

  .hero--stacked .hero-step-caption__controls {
    align-self: flex-start;
  }
}

.page-e2e .hero-masthead:has(.hero--stacked) {
  background-image:
    linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.94) 0%,
      rgba(255, 255, 255, 0.78) 38%,
      rgba(255, 255, 255, 0.28) 62%,
      transparent 82%
    ),
    url('/static/images/hero-background.png');
}

.hero--split::before {
  display: none;
}

.hero-visual::before {
  display: none;
}

.hero-split {
  display: grid;
  grid-template-columns: minmax(0, 1.22fr) minmax(0, 0.78fr);
  gap: 48px 56px;
  align-items: center;
  position: relative;
  z-index: 1;
}

.hero-content .eyebrow {
  margin-bottom: 24px;
  text-transform: none;
  letter-spacing: 0.02em;
  font-size: 13px;
}

.hero-content .eyebrow--backed-by {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.hero-content .eyebrow__yc-logo {
  display: block;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.hero-logo-block {
  margin-top: 24px;
  padding-top: 0;
}

.hero-logo-block__label {
  margin: 0 0 16px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--ink-mute);
  text-align: center;
}

.hero-logo-block__label-caps {
  text-transform: uppercase;
}

.hero-logo-block__grid {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero-logo-block__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 12px 44px;
  width: min(920px, 100%);
}

.hero-logo-block__item {
  flex: 0 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 72px;
  height: 32px;
}

.hero-logo-block__item img {
  max-height: 22px;
  max-width: 120px;
  width: auto;
  height: auto;
  object-fit: contain;
  filter: grayscale(1);
  opacity: 0.68;
}

.hero-logo-block__item.hero-logo-block__item--stasis img {
  height: 16px;
  max-height: 16px;
  max-width: 72px;
  width: auto;
}

.hero-logo-block__item.hero-logo-block__item--bluechew img {
  height: 22px;
  max-height: 22px;
  max-width: 120px;
  width: auto;
}

.hero-logo-block__text {
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink-soft);
  letter-spacing: -0.01em;
  white-space: nowrap;
  opacity: 0.72;
}

.hero-logo-block__text--seed {
  font-family: 'DM Sans', sans-serif;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 13px;
}

.hero-logo-block__text--thesis {
  font-family: 'DM Sans', sans-serif;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 13px;
}

@media (max-width: 640px) {
  .hero-logo-block__row {
    width: 100%;
    gap: 10px 24px;
  }
}

.hero--split h1 {
  margin: 0 0 24px;
  max-width: none;
  font-size: clamp(40px, 3.8vw, 54px);
  line-height: 1.08;
}

.hero--split.hero--stacked h1 {
  font-size: clamp(52px, 5.5vw, 72px);
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: -0.04em;
  text-wrap: balance;
}

.hero-h1-line {
  white-space: nowrap;
}

.hero--split .hero-sub {
  margin: 0 0 32px;
  max-width: 52ch;
  font-size: 17px;
}

.hero--split .hero-demo-cta {
  margin: 0;
  width: fit-content;
}

@media (max-width: 640px) {
  .hero--split .hero-demo-cta {
    flex-direction: column;
    gap: 24px;
  }
}

.hero-visual {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0;
  width: 100%;
}

.hero-step-caption {
  position: relative;
  width: 100%;
  min-height: 4.5em;
  margin-top: 28px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}

.hero-step-arrow {
  display: none;
}

.hero-step-caption__copy {
  flex: 1;
  min-width: 0;
  position: relative;
  min-height: 4.5em;
}

.hero-step-caption__controls {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
  opacity: 0.4;
  transition: opacity 0.2s ease;
}

.hero-step-caption:hover .hero-step-caption__controls,
.hero-step-caption:focus-within .hero-step-caption__controls {
  opacity: 0.85;
}

.hero-demo-ctrl {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--ink-mute);
  cursor: pointer;
  transition: color 0.2s, opacity 0.2s;
}

.hero-demo-ctrl svg:not(.hero-demo-ctrl__ring) {
  width: 11px;
  height: 11px;
}

.hero-demo-ctrl:hover:not(:disabled) {
  color: var(--ink-soft);
}

.hero-demo-ctrl:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.hero-demo-ctrl--play.is-paused .hero-demo-ctrl__icon--pause {
  display: none;
}

.hero-demo-ctrl--play:not(.is-paused) .hero-demo-ctrl__icon--play {
  display: none;
}

.hero-demo-ctrl--next .hero-demo-ctrl__ring {
  position: absolute;
  inset: 0;
  width: 26px;
  height: 26px;
}

.hero-demo-ctrl--next .hero-demo-ctrl__ring-track,
.hero-demo-ctrl--next .hero-demo-ctrl__ring-fill {
  stroke-width: 1.25;
}

.hero-demo-ctrl--next .hero-demo-ctrl__ring-track {
  opacity: 0.15;
}

.hero-demo-ctrl--next .hero-demo-ctrl__icon--next {
  position: relative;
  z-index: 1;
}

.hero-demo-ctrl--next .hero-demo-ctrl__ring-fill {
  transition: stroke-dashoffset 0.08s linear;
}

.hero-experience-demo.demo-paused .hero-demo-panel.active,
.hero-experience-demo.demo-paused .hero-demo-panel.active * {
  animation-play-state: paused !important;
}

.hero-step-caption__text {
  display: none;
  margin: 0;
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink-soft);
  animation: hero-caption-in 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.hero-step-caption__text.active {
  display: block;
}

.hero-step-caption__text strong {
  font-weight: 600;
  color: var(--ink);
}

@keyframes hero-caption-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero-demo-frame {
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
  overflow: visible;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.hero-experience-demo {
  position: relative;
  width: 100%;
  max-width: 280px;
  margin: 0 auto;
}

/* Shared phone shell — fixed size, no jumping */
.phone--hero-demo {
  width: 280px;
  height: 560px;
  margin: 0 auto;
}

.phone--hero-demo .phone-screen {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.phone--hero-demo .phone-statusbar {
  flex-shrink: 0;
  height: 44px;
  padding: 16px 24px 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  font-weight: 600;
  color: var(--ink);
  background: #fff;
  position: relative;
  z-index: 3;
}

.phone--hero-demo .phone-statusbar-icons {
  display: flex;
  gap: 4px;
  align-items: center;
}

.phone--hero-demo .phone-urlbar {
  flex-shrink: 0;
  padding: 2px 10px 6px;
  background: #fff;
  border-bottom: 1px solid var(--rule-soft);
}

.phone--hero-demo .phone-urlbar__field {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 0;
  height: 24px;
  padding: 0 10px;
  background: #f2f2f7;
  border-radius: 7px;
}

.phone--hero-demo .phone-urlbar__lock {
  flex-shrink: 0;
  color: var(--ink-mute);
}

.phone--hero-demo .phone-urlbar__text {
  min-width: 0;
  font-size: 10px;
  font-weight: 500;
  color: var(--ink-soft);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hero-demo-panels {
  position: relative;
  flex: 1;
  min-height: 0;
}

.hero-demo-panel {
  display: none;
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.hero-demo-panel.active {
  display: flex;
  flex-direction: column;
  animation: hero-panel-in 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes hero-panel-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* PDP panel — scrollable product page */
.hero-demo-panel[data-hero-panel="0"] {
  background: #fff;
}

.hero-phone-scroll {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}

.pdp-mock--hero {
  width: 100%;
  padding: 0;
  box-shadow: none;
  border-radius: 0;
}

.pdp-mock--hero .pdp-product {
  padding: 16px 10px 12px;
}

.pdp-mock--hero .pdp-buybox {
  padding: 0 10px 12px;
}

.pdp-mock--hero .pdp-cta-row {
  padding: 0 10px 10px;
}

.pdp-mock--hero .pdp-guarantee-widget {
  margin: 0 10px 14px;
}

.pdp-mock--hero .cw-guarantee-card {
  max-width: none;
  width: 100%;
  padding: 2px 0;
  font-size: 11px;
}

.pdp-mock--hero .cw-guarantee-card__title {
  font-size: 10px;
  line-height: 1.3;
}

.pdp-mock--hero .cw-guarantee-card__learn {
  font-size: 9px;
}

.pdp-mock--hero .cw-guarantee-card__live,
.pdp-mock--hero .cw-guarantee-card__footer {
  font-size: 8px;
}

.pdp-mock--hero .cw-guarantee-card__mark {
  height: 12px;
}

.pdp-mock--hero .cw-guarantee-card__brand-text {
  font-size: 9px;
}

.pdp-mock--hero .cw-guarantee-card__wordmark {
  height: 22px;
}

.pdp-mock--hero .cw-guarantee-card__desc {
  font-size: 11px;
}

.pdp-mock--hero .cw-guarantee-card__step-label {
  font-size: 9px;
}

/* SMS panel — fills phone screen */
.hero-demo-panel[data-hero-panel="1"] {
  background: #fff;
}

.hero-demo-panel[data-hero-panel="1"] .phone-header {
  text-align: left;
}

.hero-demo-panel[data-hero-panel="1"] .phone-messages {
  flex: 1;
  min-height: 0;
  background: #fff;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  text-align: left;
}

.hero-demo-panel[data-hero-panel="1"] .phone-day-label {
  align-self: center;
  text-align: center;
}

.hero-demo-panel[data-hero-panel="1"] .msg-bubble {
  text-align: left;
  max-width: 78%;
}

.hero-demo-panel[data-hero-panel="1"] .msg-bubble.received {
  background: #e9e9eb;
  color: #000;
  align-self: flex-start;
}

.hero-demo-panel[data-hero-panel="1"] .msg-bubble.sent {
  background: #007aff;
  color: #fff;
  align-self: flex-end;
}

/* Portal panel — inside phone */
.hero-demo-panel[data-hero-panel="2"] {
  background: var(--surface);
}

.cust-portal--hero {
  width: 100%;
  height: 100%;
  flex: 1;
  min-height: 0;
  border-radius: 0;
  box-shadow: none;
  display: flex;
  flex-direction: column;
}

.cust-portal--hero .cust-portal-placeholder,
.cust-portal--hero .cust-portal-live {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.cust-portal--hero .sol-portal--hero {
  width: 100%;
  flex: 1;
  min-height: 0;
  border-radius: 0;
  box-shadow: none;
  display: flex;
  flex-direction: column;
  position: relative;
}

.cust-portal--hero .sol-portal-header {
  padding: 16px 18px 12px;
  flex-shrink: 0;
}

.cust-portal--hero .sol-portal-brand__alice {
  height: 16px;
  max-width: 68px;
}

.cust-portal--hero .sol-portal-brand__companion-mark {
  height: 18px;
}

.cust-portal--hero .sol-portal-brand__companion-text {
  font-size: 12px;
}

.cust-portal--hero .sol-portal-greeting {
  font-size: 12px;
}

.cust-portal--hero .sol-portal-hero {
  padding: 18px 18px 16px;
  flex-shrink: 0;
}

.cust-portal--hero .sol-portal-eyebrow {
  font-size: 8px;
}

.cust-portal--hero .sol-portal-headline {
  font-size: 17px;
  line-height: 1.25;
  max-width: 16em;
}

.cust-portal--hero .sol-portal-metrics {
  padding: 12px 18px 14px;
  gap: 10px;
  flex-shrink: 0;
  align-content: start;
}

.cust-portal--hero .sol-portal-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 16px;
}

.cust-portal--hero .sol-portal-panel {
  margin: 0 18px 12px;
  padding: 12px 14px;
  background: #fff;
  border: 1px solid var(--rule-soft);
  border-radius: 12px;
}

.cust-portal--hero .sol-portal-panel__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.cust-portal--hero .sol-portal-panel__label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-mute);
}

.cust-portal--hero .sol-portal-panel__meta {
  font-size: 10px;
  color: var(--ink-mute);
}

.cust-portal--hero .sol-portal-week {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.cust-portal--hero .sol-portal-day {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 6px 2px;
  border-radius: 8px;
}

.cust-portal--hero .sol-portal-day.is-today {
  background: rgba(214, 232, 245, 0.45);
}

.cust-portal--hero .sol-portal-day__label {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--ink-mute);
}

.cust-portal--hero .sol-portal-day.is-today .sol-portal-day__label {
  color: var(--ink);
}

.cust-portal--hero .sol-portal-day__squares {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.cust-portal--hero .sol-portal-square {
  display: block;
  width: 11px;
  height: 11px;
  border-radius: 2px;
  border: 1px solid rgba(212, 165, 116, 0.35);
  background: transparent;
}

.cust-portal--hero .sol-portal-square.is-filled {
  background: linear-gradient(135deg, #d4a574, #8b5a3c);
  border-color: transparent;
}

.cust-portal--hero .sol-portal-square.is-filled.is-night {
  background: linear-gradient(135deg, #5c4a72, #2d2438);
}

.cust-portal--hero .sol-portal-log {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cust-portal--hero .sol-portal-log__item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.cust-portal--hero .sol-portal-log__squares {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex-shrink: 0;
  padding-top: 2px;
}

.cust-portal--hero .sol-portal-log__copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.cust-portal--hero .sol-portal-log__copy strong {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
}

.cust-portal--hero .sol-portal-log__copy span {
  font-size: 11px;
  line-height: 1.35;
  color: var(--ink-mute);
}

.cust-portal--hero .sol-portal-metric {
  padding: 12px 14px;
}

.cust-portal--hero .sol-portal-metric-label {
  font-size: 9px;
}

.cust-portal--hero .sol-portal-metric-val {
  font-size: 16px;
}

.cust-portal--hero .sol-portal-skeleton-line {
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(90deg, #ece9e4 0%, #f5f3ef 50%, #ece9e4 100%);
  background-size: 200% 100%;
  animation: hero-portal-shimmer 1.2s ease-in-out infinite;
}

.cust-portal--hero .sol-portal-skeleton-line--brand {
  width: 120px;
}

.cust-portal--hero .sol-portal-skeleton-line--short {
  width: 56px;
}

.cust-portal--hero .sol-portal-skeleton-line--xs {
  width: 88px;
  height: 8px;
  margin-bottom: 8px;
}

.cust-portal--hero .sol-portal-hero--skeleton .sol-portal-skeleton-line:not(.sol-portal-skeleton-line--xs) {
  width: 100%;
  max-width: 220px;
}

.cust-portal--hero .sol-portal-skeleton-metric {
  min-height: 58px;
  border-radius: 8px;
  background: linear-gradient(90deg, #ece9e4 0%, #f5f3ef 50%, #ece9e4 100%);
  background-size: 200% 100%;
  animation: hero-portal-shimmer 1.2s ease-in-out infinite;
}

.cust-portal--hero .sol-portal-skeleton-panel {
  margin: 0 18px 12px;
  min-height: 72px;
  border-radius: 12px;
  background: linear-gradient(90deg, #ece9e4 0%, #f5f3ef 50%, #ece9e4 100%);
  background-size: 200% 100%;
  animation: hero-portal-shimmer 1.2s ease-in-out infinite;
}

.cust-portal--hero .sol-portal-skeleton-panel--tall {
  min-height: 112px;
}

/* Sleep streak celebration popup */
.sol-streak-popup {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px 16px;
  background:
    radial-gradient(ellipse 80% 60% at 50% 35%, rgba(88, 104, 168, 0.35), transparent 70%),
    rgba(12, 16, 32, 0.52);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
}

.sol-streak-popup__card {
  width: 100%;
  max-width: 250px;
  padding: 22px 18px 18px;
  border-radius: 18px;
  text-align: center;
  background:
    radial-gradient(ellipse 90% 70% at 50% 0%, rgba(110, 130, 200, 0.28), transparent 55%),
    linear-gradient(165deg, #1a2240 0%, #12182e 48%, #0e1324 100%);
  border: 1px solid rgba(168, 184, 232, 0.22);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.04) inset,
    0 18px 40px rgba(8, 10, 24, 0.45);
  transform: translateY(16px) scale(0.92);
  opacity: 0;
}

.sol-streak-popup__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 6px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, rgba(200, 214, 255, 0.22), rgba(80, 100, 180, 0.12) 70%);
  box-shadow: 0 0 24px rgba(140, 160, 230, 0.35);
}

.sol-streak-popup__count {
  font-family: 'DM Sans', sans-serif;
  font-size: 48px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.04em;
  color: #dce6ff;
  text-shadow: 0 0 28px rgba(160, 184, 255, 0.45);
}

.sol-streak-popup__label {
  margin-top: 4px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #9aafd8;
}

.sol-streak-popup__week {
  margin: 14px 8px 0;
}

.sol-streak-popup__days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
  margin-bottom: 6px;
}

.sol-streak-popup__days span {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: rgba(154, 170, 200, 0.4);
}

.sol-streak-popup__days span.is-lit {
  color: #c5d4f5;
}

.sol-streak-popup__bar {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
  height: 5px;
}

.sol-streak-popup__bar span {
  position: relative;
  border-radius: 999px;
  background: rgba(90, 105, 140, 0.35);
}

.sol-streak-popup__bar span.is-filled {
  background: linear-gradient(90deg, #7b93d8, #b8c8f0);
  box-shadow: 0 0 8px rgba(140, 168, 240, 0.45);
}

.sol-streak-popup__bar span.is-current::after {
  content: '';
  position: absolute;
  top: 50%;
  right: -1px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #eef2ff;
  box-shadow: 0 0 10px rgba(200, 220, 255, 0.8);
  transform: translate(50%, -50%);
}

.sol-streak-popup__headline {
  margin: 16px 0 0;
  font-family: 'DM Sans', sans-serif;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #c5d6ff;
  text-shadow: 0 0 20px rgba(130, 160, 240, 0.35);
}

.sol-streak-popup__body {
  margin: 6px 6px 0;
  font-size: 12px;
  line-height: 1.4;
  color: rgba(210, 220, 245, 0.78);
}

.sol-streak-popup__cta {
  display: block;
  margin: 14px 0 0;
  padding: 11px 16px;
  border-radius: 10px;
  background: linear-gradient(135deg, #8ea4e8, #6b84d4);
  color: #0e1324;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  box-shadow: 0 0 20px rgba(120, 150, 230, 0.4);
}

.hero-demo-panel.demo-streak-ready .sol-streak-popup,
.hero-experience-demo#experience-demo.demo-streak-ready .sol-streak-popup {
  visibility: visible;
  pointer-events: auto;
  animation: sol-streak-backdrop-in 0.4s ease-out forwards;
}

.hero-demo-panel.demo-streak-ready .sol-streak-popup__card,
.hero-experience-demo#experience-demo.demo-streak-ready .sol-streak-popup__card {
  animation: sol-streak-card-in 0.55s cubic-bezier(0.22, 1, 0.36, 1) 0.08s forwards;
}

.hero-demo-panel.demo-streak-ready .sol-streak-popup__icon,
.hero-experience-demo#experience-demo.demo-streak-ready .sol-streak-popup__icon {
  animation: sol-streak-glow 2.4s ease-in-out 0.6s infinite;
}

.hero-demo-panel.demo-streak-ready .sol-streak-popup__bar span.is-filled,
.hero-experience-demo#experience-demo.demo-streak-ready .sol-streak-popup__bar span.is-filled {
  animation: sol-streak-seg-in 0.35s ease-out both;
}

.hero-demo-panel.demo-streak-ready .sol-streak-popup__bar span.is-filled:nth-child(1),
.hero-experience-demo#experience-demo.demo-streak-ready .sol-streak-popup__bar span.is-filled:nth-child(1) { animation-delay: 0.35s; }
.hero-demo-panel.demo-streak-ready .sol-streak-popup__bar span.is-filled:nth-child(2),
.hero-experience-demo#experience-demo.demo-streak-ready .sol-streak-popup__bar span.is-filled:nth-child(2) { animation-delay: 0.45s; }
.hero-demo-panel.demo-streak-ready .sol-streak-popup__bar span.is-filled:nth-child(3),
.hero-experience-demo#experience-demo.demo-streak-ready .sol-streak-popup__bar span.is-filled:nth-child(3) { animation-delay: 0.55s; }
.hero-demo-panel.demo-streak-ready .sol-streak-popup__bar span.is-filled:nth-child(4),
.hero-experience-demo#experience-demo.demo-streak-ready .sol-streak-popup__bar span.is-filled:nth-child(4) { animation-delay: 0.65s; }

.hero-demo-panel.demo-streak-done .sol-streak-popup,
.hero-experience-demo#experience-demo.demo-streak-done .sol-streak-popup {
  visibility: visible;
  pointer-events: none;
  animation: sol-streak-backdrop-out 0.4s ease-in forwards;
}

.hero-demo-panel.demo-streak-done .sol-streak-popup__card,
.hero-experience-demo#experience-demo.demo-streak-done .sol-streak-popup__card {
  animation: sol-streak-card-out 0.4s ease-in forwards;
}

.hero-demo-panel.demo-streak-done .sol-streak-popup__icon,
.hero-experience-demo#experience-demo.demo-streak-done .sol-streak-popup__icon {
  animation: none;
}

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

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

@keyframes sol-streak-card-in {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes sol-streak-card-out {
  from {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  to {
    opacity: 0;
    transform: translateY(10px) scale(0.96);
  }
}

@keyframes sol-streak-glow {
  0%, 100% { box-shadow: 0 0 18px rgba(140, 160, 230, 0.3); }
  50% { box-shadow: 0 0 28px rgba(170, 190, 255, 0.55); }
}

@keyframes sol-streak-seg-in {
  from {
    transform: scaleX(0.2);
    opacity: 0.4;
  }
  to {
    transform: scaleX(1);
    opacity: 1;
  }
}

@keyframes hero-portal-shimmer {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

/* Hero demo animation overrides */
.hero-experience-demo#experience-demo .demo-reveal,
.hero-experience-demo#experience-demo .demo-message {
  opacity: 0;
}

.hero-experience-demo#experience-demo .cust-portal-live {
  display: none;
}

.hero-experience-demo#experience-demo .cust-portal-placeholder {
  display: none;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

/* Portal: show skeleton while loading, live when ready */
.hero-experience-demo#experience-demo.demo-dashboard-loading .cust-portal-placeholder,
.hero-demo-panel.demo-dashboard-loading .cust-portal-placeholder {
  display: flex;
}

.hero-experience-demo#experience-demo.demo-dashboard-ready .cust-portal-placeholder,
.hero-demo-panel.demo-dashboard-ready .cust-portal-placeholder {
  display: none;
}

.hero-experience-demo#experience-demo.demo-dashboard-ready .cust-portal-live,
.hero-demo-panel.demo-dashboard-ready .cust-portal-live {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  animation: demo-portal-flash 0.9s ease-out;
}

.hero-demo-panel.demo-active .demo-reveal,
.hero-experience-demo#experience-demo.demo-active .demo-reveal {
  animation: demo-rise 0.55s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.hero-demo-panel.demo-active .demo-reveal[data-demo-delay="0"],
.hero-experience-demo#experience-demo.demo-active .demo-reveal[data-demo-delay="0"] { animation-delay: 0ms; }
.hero-demo-panel.demo-active .demo-reveal[data-demo-delay="1"],
.hero-experience-demo#experience-demo.demo-active .demo-reveal[data-demo-delay="1"] { animation-delay: 320ms; }
.hero-demo-panel.demo-active .demo-reveal[data-demo-delay="2"],
.hero-experience-demo#experience-demo.demo-active .demo-reveal[data-demo-delay="2"] { animation-delay: 640ms; }
.hero-demo-panel.demo-active .demo-reveal[data-demo-delay="3"],
.hero-experience-demo#experience-demo.demo-active .demo-reveal[data-demo-delay="3"] { animation-delay: 960ms; }
.hero-demo-panel.demo-active .demo-reveal[data-demo-delay="4"],
.hero-experience-demo#experience-demo.demo-active .demo-reveal[data-demo-delay="4"] { animation-delay: 1280ms; }

.hero-demo-panel.demo-phone-ready,
.hero-experience-demo#experience-demo.demo-phone-ready {
  animation: demo-phone-in 0.6s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.hero-demo-panel .demo-message.demo-visible,
.hero-experience-demo#experience-demo .demo-message.demo-visible {
  animation: demo-msg-in 0.42s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.hero-demo-panel.demo-dashboard-ready .demo-portal-block,
.hero-experience-demo#experience-demo.demo-dashboard-ready .demo-portal-block {
  opacity: 0;
  animation: demo-rise 0.55s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.hero-demo-panel.demo-dashboard-ready .demo-portal-block[data-demo-delay="0"],
.hero-experience-demo#experience-demo.demo-dashboard-ready .demo-portal-block[data-demo-delay="0"] { animation-delay: 150ms; }
.hero-demo-panel.demo-dashboard-ready .demo-portal-block[data-demo-delay="1"],
.hero-experience-demo#experience-demo.demo-dashboard-ready .demo-portal-block[data-demo-delay="1"] { animation-delay: 450ms; }
.hero-demo-panel.demo-dashboard-ready .demo-portal-block[data-demo-delay="2"],
.hero-experience-demo#experience-demo.demo-dashboard-ready .demo-portal-block[data-demo-delay="2"] { animation-delay: 750ms; }
.hero-demo-panel.demo-dashboard-ready .demo-portal-block[data-demo-delay="3"],
.hero-experience-demo#experience-demo.demo-dashboard-ready .demo-portal-block[data-demo-delay="3"] { animation-delay: 1050ms; }

@media (max-width: 1024px) {
  .hero-split {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .hero-h1-line {
    white-space: normal;
  }

  .hero--split h1 {
    font-size: clamp(36px, 8vw, 48px);
  }

  .hero--split.hero--stacked h1 {
    font-size: clamp(44px, 8vw, 60px);
    font-weight: 700;
  }
}

@media (max-width: 640px) {
  .page-e2e .hero-masthead {
    background-image:
      linear-gradient(
        180deg,
        rgba(255, 255, 255, 0.92) 0%,
        rgba(255, 255, 255, 0.75) 45%,
        rgba(255, 255, 255, 0.35) 70%,
        transparent 100%
      ),
      url('/static/images/hero-background.png');
    background-position: center bottom;
  }

  .hero--split {
    padding: 64px 0 56px;
  }

  .hero-step-caption__text {
    max-width: none;
    font-size: 15px;
  }

  .hero-step-caption__controls {
    margin-left: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-demo-panel {
    animation: none;
  }

  .hero-experience-demo .demo-reveal,
  .hero-experience-demo .demo-message,
  .hero-demo-panel .demo-portal-block {
    opacity: 1 !important;
    animation: none !important;
    transform: none !important;
  }

  .hero-experience-demo#experience-demo .cust-portal-live,
  .hero-demo-panel .cust-portal-live {
    display: flex !important;
  }

  .hero-experience-demo#experience-demo .cust-portal-placeholder,
  .hero-demo-panel .cust-portal-placeholder {
    display: none !important;
  }

  .sol-streak-popup,
  .sol-streak-popup__card,
  .sol-streak-popup__icon,
  .sol-streak-popup__bar span.is-filled {
    animation: none !important;
  }

  .hero-demo-panel.demo-streak-ready .sol-streak-popup,
  .hero-experience-demo#experience-demo.demo-streak-ready .sol-streak-popup {
    opacity: 1;
    visibility: visible;
  }

  .hero-demo-panel.demo-streak-ready .sol-streak-popup__card,
  .hero-experience-demo#experience-demo.demo-streak-ready .sol-streak-popup__card {
    opacity: 1;
    transform: none;
  }
}
