/* "How it works": tabbed steps with phone screens (see index.html #how-it-works) */
.how-section { background: var(--white); }
.how-tabs { max-width: 980px; margin: 0 auto; }

.how-tablist {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}
.how-tabs:not([data-enhanced]) .how-tablist { display: none; }
.how-tab {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: var(--sand);
  border: 1.5px solid var(--border);
  border-radius: 14px;
  font: inherit;
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--ink-soft);
  cursor: pointer;
  text-align: left;
  transition: border-color .15s, background .15s, color .15s;
}
.how-tab:hover { border-color: var(--teal-500); }
.how-tab[aria-selected="true"] { background: #eaf5fc; border-color: var(--coral); color: var(--ink); }
.how-tab .how-num { background: #c8ced4; }
.how-tab[aria-selected="true"] .how-num { background: var(--coral); }
.how-tab .short { display: none; }
.how-tab:focus-visible { outline: 3px solid rgba(58,168,230,.45); outline-offset: 2px; }

.how-num {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--coral);
  color: var(--white);
  font-weight: 800;
  font-size: 0.9rem;
}

.how-panel {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 48px;
  align-items: center;
  background: var(--sand);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 36px 40px;
  margin-bottom: 20px;
}
.how-panel[hidden] { display: none; }
.how-copy h3 { font-size: 1.5rem; color: var(--teal-900); margin-bottom: 12px; }
.how-copy p { color: var(--ink-soft); font-size: 1rem; margin: 0 0 14px; }
.how-copy .how-note { font-weight: 600; color: var(--ink); }
.how-copy .btn { margin-top: 8px; }

.how-media { display: flex; gap: 24px; justify-content: center; align-items: flex-start; }
.how-phone { margin: 0; width: 230px; flex: none; }
.phone-frame {
  aspect-ratio: 540 / 1174;
  border: 7px solid var(--teal-900);
  border-radius: 32px;
  overflow: hidden;
  background: var(--teal-900);
  box-shadow: var(--shadow);
  line-height: 0;
}
.phone-frame video, .phone-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  background: #fff;
}
.phone-frame video { background: #000; }
.how-phone figcaption { margin-top: 12px; font-size: 0.82rem; color: var(--ink-soft); text-align: center; line-height: 1.4; }

/* One more menu link ("How It Works") needs a little more room on mid-size screens. */
.main-nav a { white-space: nowrap; }
@media (min-width: 901px) and (max-width: 1180px) {
  .main-nav { gap: 16px; }
  .main-nav a { font-size: 0.86rem; }
  .header-phone { display: none; }
  .logo-text { font-size: 1rem; }
}

@media (max-width: 800px) {
  .how-panel { grid-template-columns: 1fr; gap: 28px; padding: 28px 22px; }
  .how-copy { text-align: center; }
  .how-copy h3 { font-size: 1.3rem; }
}
@media (max-width: 640px) {
  .how-tablist { gap: 6px; }
  .how-tab { flex-direction: column; gap: 6px; padding: 10px 4px; text-align: center; font-size: 0.78rem; }
  .how-tab .long { display: none; }
  .how-tab .short { display: inline; }
  .how-phone { width: min(60vw, 230px); }
  .how-media-two { gap: 14px; }
  .how-media-two .how-phone { width: min(42vw, 190px); }
}

/* ---- Animated phone demos (steps 1 and 2): real screens, a tap indicator, an iPhone status bar ---- */
.phone-frame.demo { position: relative; background: #fbf7f0; }
.demo-status {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 6.6%;
  z-index: 5;
  background: #fbf7f0;
  color: #121316;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 6.5%;
  line-height: 1;
}
.ds-time { font-size: 11px; font-weight: 700; width: 40px; }
.ds-pill { width: 31%; height: 16px; border-radius: 10px; background: #000; }
.ds-icons { display: flex; align-items: center; gap: 4px; width: 40px; justify-content: flex-end; fill: currentColor; }
.ds-signal { width: 13px; height: 8px; }
.ds-wifi { width: 12px; height: 8px; }
.ds-battery { width: 20px; height: 9px; }
.demo-view { position: absolute; top: 6.6%; left: 0; right: 0; bottom: 0; overflow: hidden; background: #f7f8fa; }
.demo-stage { position: relative; width: 100%; aspect-ratio: 700 / 1520; }
.d-layer { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: fill; }
.d-a { z-index: 1; } .d-b { z-index: 2; } .d-c { z-index: 3; } .d-d { z-index: 4; }
.d-tap {
  position: absolute;
  z-index: 6;
  width: 11%;
  aspect-ratio: 1;
  margin: -5.5% 0 0 -5.5%;
  border-radius: 50%;
  background: rgba(70, 76, 84, 0.38);
  border: 1.5px solid rgba(255, 255, 255, 0.7);
  opacity: 0;
  pointer-events: none;
}

/* Poster (no animation) state shows the last screen of each demo. */
[data-demo="upload"] .d-b, [data-demo="upload"] .d-c, [data-demo="upload"] .d-d { opacity: 1; }


[data-demo="upload"].is-playing .d-b { animation: upl-b 9s ease-in-out infinite; }
[data-demo="upload"].is-playing .d-c { animation: upl-c 9s ease-in-out infinite; }
[data-demo="upload"].is-playing .d-d { animation: upl-d 9s ease-in-out infinite; }
[data-demo="upload"].is-playing .t1 { animation: utap-1 9s ease-out infinite; }
[data-demo="upload"].is-playing .t2 { animation: utap-2 9s ease-out infinite; }
@keyframes upl-b { 0%, 10% { transform: translateY(100%); } 20%, 94% { transform: translateY(0); } 100% { transform: translateY(100%); } }
@keyframes upl-c { 0%, 29% { opacity: 0; } 33%, 92% { opacity: 1; } 97%, 100% { opacity: 0; } }
@keyframes upl-d { 0%, 62% { opacity: 0; } 67%, 90% { opacity: 1; } 96%, 100% { opacity: 0; } }
@keyframes utap-1 { 0%, 25% { opacity: 0; transform: scale(.5); } 26% { opacity: 1; transform: scale(.7); } 32% { opacity: 0; transform: scale(1.5); } 100% { opacity: 0; } }
@keyframes utap-2 { 0%, 55% { opacity: 0; transform: scale(.5); } 56% { opacity: 1; transform: scale(.7); } 62% { opacity: 0; transform: scale(1.5); } 100% { opacity: 0; } }

@media (max-width: 640px) {
  .ds-time { font-size: 10px; }
}

/* Auto-advance: a thin progress bar fills along the active tab, then the next step opens. */
.how-tab { position: relative; overflow: hidden; }
.how-progress {
  display: none;
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 3px;
  background: var(--coral);
  transform: scaleX(0);
  transform-origin: left;
  animation: how-progress var(--dur, 10s) linear forwards;
  animation-play-state: paused;
}
.how-tabs[data-auto="on"] .how-tab[aria-selected="true"] .how-progress { display: block; }
.how-tabs[data-auto="on"][data-run="1"] .how-tab[aria-selected="true"] .how-progress { animation-play-state: running; }
@keyframes how-progress { to { transform: scaleX(1); } }
