.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.16fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(1.5rem, 5vw, 5rem);
  padding-block: clamp(2.5rem, 6vw, 5rem);
}

.hero-copy { min-width: 0; text-align: center; }

.hero h1 {
  font-size: clamp(2rem, 1.25rem + 2.35vw, 3.55rem);
  font-weight: 760;
  line-height: 1.08;
  letter-spacing: -.04em;
}

.hero-prefix {
  display: block;
  margin-bottom: .2em;
  font-size: clamp(3.75rem, 2.5rem + 4.5vw, 6.75rem);
  font-weight: 800;
  line-height: .98;
  letter-spacing: -.055em;
}

.hero-ia { color: var(--action); }
.hero-titles { display: grid; margin-inline: auto; max-width: 16ch; color: var(--headline-accent); }
.hero-titles > span { grid-area: 1 / 1; align-self: start; text-wrap: balance; }
.hero-titles > span:last-child { font-size: .84em; line-height: 1.13; }
.hero-titles > [aria-hidden="true"] { visibility: hidden; }
.hero-description { max-width: 39ch; margin: 1.125rem auto 0; color: var(--light-muted); font-size: clamp(1rem, .9rem + .3vw, 1.14rem); }
.hero-actions { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px 22px; margin-top: 1.25rem; }

.hero-demo {
  display: grid;
  grid-template-areas: "phone" "caption" "controls";
  grid-template-columns: minmax(0, 1fr);
  min-width: 0;
  width: min(100%, 34rem);
  justify-self: end;
  scroll-margin-block-start: 1rem;
}

.phone-stage {
  grid-area: phone;
  position: relative;
  display: grid;
  justify-items: center;
  padding: 1.375rem 1rem;
  overflow: hidden;
  border: 1px solid var(--line-dark);
  border-radius: 1.5rem 1.5rem .5rem .5rem;
  background: radial-gradient(ellipse at 50% 0, #366381 0%, var(--brand-raised) 67%, #1d405e 100%);
}

.phone {
  width: min(100%, 20.7rem);
  padding: 0 8px;
  border: 1px solid #90abc1;
  border-radius: 29px;
  background: var(--brand-deep);
  box-shadow: 0 16px 30px #0a233666;
  color: var(--ink);
}

.phone-bezel { display: grid; height: 1.25rem; place-items: center; }
.phone-bezel::before { content: ""; width: 2.25rem; height: 4px; border-radius: 99px; background: #90abc1; }
.phone-footer { display: grid; height: 1rem; place-items: center; }
.phone-footer span { width: 2.75rem; height: 3px; border-radius: 99px; background: #90abc1; }
.phone-screen { border-radius: 1rem; background: #eef4f8; }
.phone-view { min-height: 23rem; }
.phone-view[hidden] { display: none; }

.screen-header {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 59px;
  padding: 10px;
  border-bottom: 1px solid var(--line);
  border-radius: 1rem 1rem 0 0;
  background: var(--white);
  line-height: 1.25;
}

.screen-header > div { flex: 1; min-width: 0; }
.screen-header strong, .screen-header > div span { display: block; }
.screen-header strong { font-size: .875rem; font-weight: 800; }
.screen-header > div span { margin-top: 3px; color: var(--ink-muted); font-size: .75rem; }
.screen-header > svg { width: 1rem; height: 1rem; color: var(--accent-ink); }
.screen-header.operation { background: #e1edf6; }
.screen-avatar { display: grid; flex: none; place-items: center; width: 2rem; height: 2rem; border-radius: .55rem; background: var(--brand); color: var(--cream); font-size: .69rem; font-weight: 800; }
.screen-avatar svg { width: 1.04rem; height: 1.04rem; }
.screen-content { display: grid; gap: 9px; align-content: start; padding: 11px; font-size: .84375rem; line-height: 1.35; }
.screen-content [hidden] { display: none; }
.bubble { width: fit-content; max-width: 92%; padding: 8px 10px; box-shadow: 0 2px 4px #1535540f; }
.bubble strong { display: block; margin-bottom: 3px; color: var(--accent-ink); font-size: .75rem; font-weight: 800; }
.bubble.customer { justify-self: end; border-radius: .75rem .75rem .2rem .75rem; background: var(--question-surface); }
.bubble.assistant { border-radius: .75rem .75rem .75rem .2rem; background: var(--white); }

.rule-card {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 10px;
  border-radius: .65rem;
  background: var(--question-surface);
}

.rule-card strong { display: block; margin-bottom: 3px; font-size: .75rem; font-weight: 800; }
.rule-card svg, .screen-result svg { width: 1rem; height: 1rem; color: var(--accent-ink); }
.screen-sheet { padding-inline: 10px; border-radius: .65rem; background: var(--white); }
.sheet-title { padding-block: 9px; font-size: .75rem; font-weight: 800; }
.schedule-row { display: grid; grid-template-columns: 2rem 1fr auto; align-items: center; gap: 7px; padding-block: 9px; border-top: 1px solid var(--line); font-weight: 650; }
.schedule-row time { font-weight: 800; font-variant-numeric: tabular-nums; }
.schedule-row small { display: block; margin-top: 2px; color: var(--ink-muted); font-weight: 600; font-size: .75rem; }
.schedule-row.unavailable { color: var(--ink-muted); }
.schedule-row.selected { color: var(--accent-ink); }
.schedule-row svg { width: .95rem; height: .95rem; }
.screen-result { display: flex; align-items: center; gap: 6px; min-height: 31px; padding: 6px 9px; border-radius: .4rem; background: #dbeaf5; color: var(--brand-deep); font-size: .75rem; font-weight: 800; }
.quote-sheet > div { display: flex; justify-content: space-between; gap: 8px; padding-block: 7px; }
.quote-sheet > div > :last-child { text-align: right; font-variant-numeric: tabular-nums; }
.quote-sheet .quote-total { padding-block: 9px; border-top: 1px solid var(--line); color: var(--accent-ink); }

.hero-demo-caption {
  grid-area: caption;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 3px 9px;
  padding: 7px 1px 2px;
  color: var(--light-muted);
  font-size: .75rem;
  line-height: 1.45;
}

.story-indicator:not([hidden]) { display: inline-flex; align-items: center; gap: .45rem; font-weight: 750; }
.story-ticks { display: flex; align-items: center; gap: 3px; }
.story-ticks span { width: 6px; height: 2px; background: #b4cada; }
.story-ticks [aria-current="step"] { background: var(--action); }
.demo-controls:not([hidden]) { grid-area: controls; display: flex; justify-content: space-between; align-items: center; gap: 4px 8px; padding-block-start: .3rem; }
.story-options, .playback-options { display: flex; align-items: center; gap: 3px; }
.demo-controls button { min-height: 44px; border: 1px solid transparent; border-radius: .45rem; background: transparent; font-size: .84375rem; font-weight: 750; cursor: pointer; }
.story-options button { padding-inline: .625rem; color: var(--light-muted); }
.story-options button[aria-pressed="true"] { background: var(--action); color: var(--brand-deep); }
.playback-button { display: grid; flex: none; min-width: 44px; place-items: center; }
.playback-button svg { width: 1rem; height: 1rem; }
.demo-controls button[hidden] { display: none; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

@media (hover: hover) {
  .demo-controls button:hover { border-color: var(--control-border-dark); }
}

@media (prefers-reduced-motion: no-preference) {
  .hero-titles > .demo-enter { animation: demo-reveal 180ms var(--ease-out) both; }
  .phone-view.demo-enter { animation: demo-reveal 155ms var(--ease-out) both; }
  .bubble.demo-enter { animation: demo-message 145ms var(--ease-out) both; }
  .screen-content :not(.bubble).demo-enter { animation: demo-reveal 140ms var(--ease-out) both; }
  @keyframes demo-reveal { from { opacity: .4; } to { opacity: 1; } }
  @keyframes demo-message { from { opacity: .4; transform: translateY(5px); } to { opacity: 1; transform: none; } }
}

@media (max-width: 54rem) {
  .hero { grid-template-columns: minmax(0, 1fr); padding-block: 2.5rem; gap: 1.75rem; }
  .hero-demo { justify-self: center; }
  .hero-description { margin-top: 1rem; }
  .hero-actions { margin-top: 1.125rem; }
}

@media (max-width: 37.5rem) {
  .hero { padding-block: 1.75rem 1.625rem; }
  .hero h1 { font-size: clamp(1.75rem, 1.05rem + 3.1vw, 2.45rem); }
  .hero-prefix { font-size: clamp(3.35rem, 2.4rem + 4.75vw, 4.7rem); }
  .hero-actions .button { min-height: 48px; }
  .phone-stage { padding: .875rem .65rem; }
  .story-options button { padding-inline: clamp(.3rem, 2vw, .625rem); font-size: .8125rem; }
}

@media (max-width: 21rem) {
  .phone-view { min-height: 24.25rem; }
  .hero-demo-caption { min-height: 2.8rem; align-content: start; }
  .demo-controls:not([hidden]) { flex-wrap: wrap; gap: 3px; }
  .story-options, .playback-options { gap: 0; }
  .demo-controls button { font-size: .75rem; }
  .story-options button { min-width: 44px; padding-inline: 1px; }
}
