/* Hero Demo - Multi-scene animated SMS + Display */
/* Total loop: 22 seconds */

/* ============================================
   HERO LAYOUT WITH DEMO
   ============================================ */

.hero--demo {
  padding: var(--space-3xl) 0 var(--space-4xl);
  overflow: hidden;
}

.hero__container {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: var(--space-2xl);
  align-items: center;
}

.hero__content {
  text-align: left;
}

.hero--demo .hero__title {
  font-size: var(--text-4xl);
  margin-bottom: var(--space-lg);
}

.hero--demo .hero__subtitle {
  margin: 0 0 var(--space-xl);
  max-width: none;
}

.hero--demo .hero__actions {
  justify-content: flex-start;
}

/* ============================================
   DEMO CONTAINER
   ============================================ */

.hero__demo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xl);
  position: relative;
}

/* ============================================
   FLOATING SMS BUBBLES
   ============================================ */

.demo-bubbles {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px 0;
  min-width: 180px;
  max-width: 220px;
}

.demo-sms__bubble {
  max-width: 85%;
  padding: 8px 12px;
  border-radius: 16px;
  font-size: 0.75rem;
  line-height: 1.4;
  opacity: 0;
  transform: translateY(10px) scale(0.95);
}

.demo-sms__bubble--out {
  background: #007aff;
  color: white;
  align-self: flex-end;
  text-align: right;
  border-bottom-right-radius: 4px;
}

.demo-sms__bubble--in {
  background: #e5e5ea;
  color: #000;
  align-self: flex-start;
  text-align: left;
  border-bottom-left-radius: 4px;
}

.demo-sms__label {
  display: block;
  font-size: 0.6rem;
  font-weight: 600;
  color: #666;
  margin-bottom: 2px;
}

/* ============================================
   DISPLAY MOCKUP
   ============================================ */

.demo-display {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.demo-display__bezel {
  width: 340px;
  background: #1a1a1a;
  border-radius: 8px;
  padding: 10px;
  box-shadow:
    0 25px 50px -12px rgba(0, 0, 0, 0.25),
    0 0 0 1px rgba(255, 255, 255, 0.1);
}

.demo-display__screen {
  background: #fffbf7;
  border-radius: 4px;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  position: relative;
}

/* ============================================
   DEMO MENU
   ============================================ */

.demo-menu {
  padding: 12px 14px;
  font-family: var(--font-display);
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
}

/* Breakfast without special - shows first, fades when special appears */
.demo-menu--breakfast-plain {
  animation: menu-breakfast-plain 22s linear infinite;
}

/* Breakfast with special - fades in after scene 2 */
.demo-menu--breakfast-special {
  opacity: 0;
  animation: menu-breakfast-special 22s linear infinite;
}

.demo-menu--lunch {
  opacity: 0;
  animation: menu-lunch 22s linear infinite;
  padding: 12px 14px;
}

/* 2-column layout for breakfast with special */
.demo-menu__columns {
  display: flex;
  gap: 10px;
}

.demo-menu__main {
  flex: 1;
  min-width: 0;
}

.demo-menu__header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 8px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--color-border);
}

.demo-menu__title {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-text);
}

.demo-menu__hours {
  font-size: 0.55rem;
  color: var(--color-text-muted);
}

.demo-menu__item {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 4px 0;
  font-size: 0.65rem;
}

.demo-menu__name {
  color: var(--color-text);
}

.demo-menu__price {
  color: var(--color-text-muted);
  font-weight: 500;
}

/* Two-column grid for lunch */
.demo-menu__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 12px;
}

.demo-menu__col {
  min-width: 0;
}

/* Special item - right column (visible variant for crossfade) */
.demo-menu__special--visible {
  width: 90px;
  padding: 8px;
  background: var(--color-accent-light);
  border-radius: 4px;
  align-self: center;
}

.demo-menu__special-label {
  display: block;
  font-size: 0.5rem;
  font-weight: 600;
  color: var(--color-accent);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}

.demo-menu__special-item {
  display: block;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 2px;
}

.demo-menu__special-price {
  font-size: 0.65rem;
  color: var(--color-text-muted);
}

/* 86'd item styling */
.demo-menu__item--86 {
  position: relative;
}

.demo-menu__item--86::after {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  width: 0;
  height: 1px;
  background: rgba(199, 81, 70, 0.6);
  animation: strikethrough 22s linear infinite;
}

.demo-menu__item--86 .demo-menu__name,
.demo-menu__item--86 .demo-menu__price {
  animation: fade-item 22s linear infinite;
}

/* Static strikethrough for breakfast-special menu */
.demo-menu__item--86-static {
  position: relative;
}

.demo-menu__item--86-static::after {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  width: 100%;
  height: 1px;
  background: rgba(199, 81, 70, 0.6);
}

.demo-menu__item--86-static .demo-menu__name,
.demo-menu__item--86-static .demo-menu__price {
  opacity: 0.5;
}

/* ============================================
   ANIMATION KEYFRAMES
   Timeline: 22 seconds total

   Scene 1 (0-6s): 86 the waffles
   - 1s (4.5%): outgoing appears
   - 2.5s (11%): incoming appears
   - 3s (14%): waffles struck through
   - pause until 6s

   Scene 2 (6-12s): Add special
   - 7s (32%): outgoing appears
   - 8.5s (39%): incoming appears
   - 9s (41%): special fades in
   - pause until 12s

   Scene 3 (12-17s): Switch to lunch
   - 13s (59%): outgoing appears
   - 14.5s (66%): incoming appears
   - 15s (68%): menu crossfade
   - lunch holds until 20s (91%)

   Reset (21-22s): Fade out everything
   ============================================ */

/* Scene 1: 86 the waffles */
.demo-sms__bubble--s1-out {
  animation: bubble-s1-out 22s linear infinite;
}

.demo-sms__bubble--s1-in {
  animation: bubble-s1-in 22s linear infinite;
}

@keyframes bubble-s1-out {
  0%, 3% { opacity: 0; transform: translateY(10px) scale(0.95); }
  6%, 91% { opacity: 1; transform: translateY(0) scale(1); }
  95%, 100% { opacity: 0; transform: translateY(0) scale(1); }
}

@keyframes bubble-s1-in {
  0%, 10% { opacity: 0; transform: translateY(10px) scale(0.95); }
  13%, 91% { opacity: 1; transform: translateY(0) scale(1); }
  95%, 100% { opacity: 0; transform: translateY(0) scale(1); }
}

/* Scene 2: Add special */
.demo-sms__bubble--s2-out {
  animation: bubble-s2-out 22s linear infinite;
}

.demo-sms__bubble--s2-in {
  animation: bubble-s2-in 22s linear infinite;
}

@keyframes bubble-s2-out {
  0%, 30% { opacity: 0; transform: translateY(10px) scale(0.95); }
  33%, 91% { opacity: 1; transform: translateY(0) scale(1); }
  95%, 100% { opacity: 0; transform: translateY(0) scale(1); }
}

@keyframes bubble-s2-in {
  0%, 37% { opacity: 0; transform: translateY(10px) scale(0.95); }
  40%, 91% { opacity: 1; transform: translateY(0) scale(1); }
  95%, 100% { opacity: 0; transform: translateY(0) scale(1); }
}

/* Scene 3: Switch menu */
.demo-sms__bubble--s3-out {
  animation: bubble-s3-out 22s linear infinite;
}

.demo-sms__bubble--s3-in {
  animation: bubble-s3-in 22s linear infinite;
}

@keyframes bubble-s3-out {
  0%, 57% { opacity: 0; transform: translateY(10px) scale(0.95); }
  60%, 91% { opacity: 1; transform: translateY(0) scale(1); }
  95%, 100% { opacity: 0; transform: translateY(0) scale(1); }
}

@keyframes bubble-s3-in {
  0%, 64% { opacity: 0; transform: translateY(10px) scale(0.95); }
  67%, 91% { opacity: 1; transform: translateY(0) scale(1); }
  95%, 100% { opacity: 0; transform: translateY(0) scale(1); }
}

/* Strikethrough animation for waffles */
@keyframes strikethrough {
  0%, 12% { width: 0; }
  13.5%, 91% { width: 100%; }
  95%, 100% { width: 0; }
}

@keyframes fade-item {
  0%, 12% { opacity: 1; }
  13.5%, 91% { opacity: 0.5; }
  95%, 100% { opacity: 1; }
}

/* Breakfast plain: visible at start, hidden when special appears, fades back at end */
@keyframes menu-breakfast-plain {
  0%, 38% { opacity: 1; }
  42%, 93% { opacity: 0; }
  97%, 100% { opacity: 1; }
}

/* Breakfast with special: fades in after scene 2, hidden during lunch, stays hidden at reset */
@keyframes menu-breakfast-special {
  0%, 38% { opacity: 0; }
  42%, 66% { opacity: 1; }
  70%, 100% { opacity: 0; }
}

/* Lunch menu */
@keyframes menu-lunch {
  0%, 66% { opacity: 0; }
  70%, 89% { opacity: 1; }
  93%, 100% { opacity: 0; }
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 900px) {
  .hero__container {
    grid-template-columns: 1fr;
    gap: var(--space-2xl);
  }

  .hero__content {
    text-align: center;
  }

  .hero--demo .hero__actions {
    justify-content: center;
  }

  .hero__demo {
    justify-content: center;
  }

  .demo-bubbles {
    min-width: 160px;
    max-width: 200px;
  }

  .demo-display__bezel {
    width: 300px;
  }
}

@media (max-width: 600px) {
  .hero__demo {
    flex-direction: column-reverse;
    align-items: center;
    gap: var(--space-lg);
  }

  .demo-bubbles {
    flex-direction: row;
    flex-wrap: wrap;
    max-width: 100%;
    justify-content: center;
  }

  .demo-display__bezel {
    width: 320px;
  }
}
