/* Home page hero and the AI advisor card. Loaded on / only. */
.hero-grid { display: grid; gap: 40px; grid-template-columns: 1fr; align-items: center; }
.hero-grid .adv { order: -1; }
.hero-copy > * { animation: rise .6s var(--ease) both; }
.hero-copy > :nth-child(2) { animation-delay: .06s; }
.hero-copy > :nth-child(3) { animation-delay: .12s; }
.hero-copy > :nth-child(4) { animation-delay: .18s; }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@media (min-width: 960px) {
  .hero-grid { grid-template-columns: 1.05fr .95fr; gap: 56px; }
  .hero-grid .adv { order: 0; }
}
.hero-grid[data-open='true'] { grid-template-columns: 1fr; gap: 0; }
.hero-grid[data-open='true'] .hero-copy { display: none; }

.adv { width: 100%; max-width: 520px; margin-inline: auto; scroll-margin-top: 84px; box-sizing: border-box; }
.adv[data-state='open'] { max-width: none; display: grid; gap: 24px; grid-template-columns: 1fr; align-items: start; }
@media (min-width: 960px) {
  .adv[data-state='open'] { grid-template-columns: 56fr 44fr; }
}
.adv-main { display: flex; flex-direction: column; gap: 14px; min-width: 0; }

.adv-card {
  position: relative; aspect-ratio: 1 / 1; border-radius: 28px; overflow: hidden; cursor: pointer;
  background: #0B1B3F; isolation: isolate;
  box-shadow: 0 0 0 2px rgba(201, 150, 43, .7), var(--shadow-lg);
  transition: box-shadow .35s var(--ease), transform .35s var(--ease);
}
.adv-card:hover, .adv-card:focus-visible {
  box-shadow: 0 0 0 2px var(--gold), 0 0 0 9px rgba(201, 150, 43, .16), 0 0 48px rgba(201, 150, 43, .38), var(--shadow-lg);
}
.adv[data-state='idle'] .adv-card:hover { transform: translateY(-3px); }
.adv[data-state='open'] .adv-card { cursor: default; aspect-ratio: 1 / 1; max-height: 70vh; }
@media (min-width: 960px) {
  .adv[data-state='open'] .adv-card { aspect-ratio: 1 / 1; }
}
.adv-video { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; object-fit: cover; background: #0B1B3F; }
.adv-video[hidden] { display: none; }
.adv-line { opacity: 0; transition: opacity .18s ease; }
.adv-line.is-on { opacity: 1; }
.adv-line { z-index: 1; }
.adv-remote { z-index: 2; }

.adv-card .captions {
  position: absolute; left: 12px; right: 12px; bottom: 12px; z-index: 4; box-sizing: border-box;
  padding: 10px 14px; border-radius: 16px; background: rgba(11, 27, 63, .78); color: #fff;
  backdrop-filter: blur(8px); font-size: .95rem; line-height: 1.4; max-height: 45%; overflow: auto; min-height: 0;
}
.adv-card .captions .who { color: #F3DDA6; font-weight: 700; margin-right: 6px; }
.adv-hint, .adv-hint-touch {
  position: absolute; top: 14px; right: 14px; z-index: 5; padding: 7px 16px; border-radius: 999px;
  background: rgba(255, 255, 255, .94); color: var(--navy); box-shadow: var(--shadow-md);
  font-family: var(--font-head); font-weight: 600; font-size: .85rem;
}
.adv-hint[hidden] { display: none; }
.adv-hint-touch { display: none; }
.adv[data-touch='true'][data-state='idle'] .adv-hint-touch { display: inline-block; }
.adv[data-state='open'] .adv-hint, .adv[data-state='open'] .adv-hint-touch { display: none; }
.adv-finish { position: absolute; inset: 0; z-index: 6; background: rgba(11, 27, 63, .94); color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; text-align: center; padding: 24px; }
.adv-finish[hidden] { display: none; }
.adv-finish h2 { color: #fff; }
.adv-finish .btn-primary { background: #fff; color: var(--navy); border-color: #fff; }

.adv-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; justify-content: space-between; }
.adv-who { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
.adv-who strong { font-family: var(--font-head); color: var(--navy); }
.adv-sub { font-size: .85rem; color: var(--muted); }
.adv[data-state='open'] .adv-sub { display: none; }
.adv-pill { padding: 6px 14px; border-radius: 999px; border: 1px solid var(--gold); background: #FBF4E4; color: var(--ink); font-family: var(--font-head); font-weight: 600; font-size: .8rem; }
.adv-tools { display: none; gap: 8px; }
.adv[data-state='open'] .adv-tools { display: flex; }
.adv-tool { min-height: 38px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line); background: #fff; color: var(--navy); font: inherit; font-weight: 500; cursor: pointer; transition: border-color .2s, transform .15s; }
.adv-tool:hover { border-color: var(--gold); }
.adv-tool:active { transform: scale(.97); }
.adv-end { color: #fff; background: var(--danger); border-color: var(--danger); font-weight: 700; }

.adv-side { display: none; flex-direction: column; gap: 16px; min-width: 0; }
.adv[data-state='open'] .adv-side { display: flex; animation: slideIn .35s var(--ease) both; }
@keyframes slideIn { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@media (min-width: 960px) {
  @keyframes slideIn { from { opacity: 0; transform: translateX(28px); } to { opacity: 1; transform: none; } }
}
.adv-notice { margin: 0; padding: 10px 14px; border-radius: 12px; background: #FBF4E4; border: 1px solid var(--gold); color: var(--ink); }
.adv-notice[hidden] { display: none; }
.adv-side .clip-card {
  max-height: none; overflow: visible; border: 1px solid var(--line); border-top: 3px solid var(--gold);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-md); transition: opacity .25s;
}
.adv-side .clip-card[data-waiting='true'] { opacity: .6; }
.adv-side .clip-card[data-waiting='true'] .clip-actions { pointer-events: none; }
.adv-voice { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.adv-talk {
  display: inline-flex; align-items: center; gap: 12px; min-height: 54px; padding: 0 26px; border-radius: 999px; border: 0;
  background: linear-gradient(180deg, #1D3C7A, var(--navy)); color: #fff; font-family: var(--font-head); font-weight: 600;
  font-size: 1rem; cursor: pointer; user-select: none; touch-action: manipulation; -webkit-user-select: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .18), 0 8px 20px rgba(11, 27, 63, .25);
  transition: transform .15s var(--ease), box-shadow .2s;
}
.adv-talk[hidden] { display: none; }
.adv-talk:active { transform: scale(.97); }
.adv-talk:disabled { opacity: .55; cursor: wait; }
.adv-talk-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 4px rgba(201, 150, 43, .25); }
.adv-talk[data-listening='true'] { background: linear-gradient(180deg, #B83A3A, var(--danger)); }
.adv-talk[data-listening='true'] .adv-talk-dot { background: #fff; animation: pulse 1s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 9px rgba(255, 255, 255, .0); } }
.adv-talk-tap { display: none; }
.adv[data-touch='true'] .adv-talk-hold { display: none; }
.adv[data-touch='true'] .adv-talk-tap { display: inline; }
.adv-interim { flex-basis: 100%; margin: 0; min-height: 1.4em; font-style: italic; color: var(--muted); opacity: .75; }
.adv-reply { flex-basis: 100%; margin: 0; color: var(--ink); font-weight: 500; }
.adv-reply:empty { display: none; }
@media (min-width: 960px) {
  .adv-side .panel-body, .adv-side .panel[data-open='false'] .panel-body { display: block; max-height: 52vh; }
  .adv-side .panel-handle { cursor: default; }
  .adv-side .panel-handle::before { display: none; }
}

/* Home sections */
.step-grid .card { position: relative; }
.faq-teaser { max-width: 44rem; }
/* Open stage is 4:3 but the clips are square: contain, never crop into the face. */
.adv[data-state='open'] .adv-video { object-fit: contain; background: #BCBAB9; }

/* Phones: once the call is open the advisor pins under the header, so he stays in view while the visitor scrolls to answer. */
@media (max-width: 959px) {
  .adv[data-state='open'] .adv-main {
    position: sticky; top: 72px; z-index: 15;
    background: var(--mist); padding-bottom: 10px;
    margin-inline: calc(-1 * var(--gutter)); padding-inline: var(--gutter);
  }
  .adv[data-state='open'] .adv-card { aspect-ratio: auto; height: min(38vh, 100vw); max-height: none; }
  .adv[data-state='open'] .adv-video { object-fit: cover; object-position: 50% 20%; background: #BCBAB9; }
}

/* Phones: the caption must not hide his face on the short card. */
@media (max-width: 959px) {
  .adv-card .captions { background: rgba(11, 27, 63, .5); font-size: .9rem; padding: 8px 12px; max-height: 34%; }
}
