/* Hero live demo — the interactive demo embedded in the hero right column */

.hero-demo {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
}
.hero-demo .vd-frame {
    margin: 0 auto;
}
.hero-demo-cap {
    font-family: var(--font-mono);
    font-size: 0.68rem;
    line-height: 1.5;
    letter-spacing: 0.03em;
    color: var(--text-faint);
    text-align: center;
}
.hero-demo-cap strong { color: var(--accent); font-weight: 600; }
/* ============ Device-framed live demo ============
   Everything inside .vd-screen uses the APP's design language (pure-black
   reading surface, #ff4444 accent, glass pills) — not the marketing
   palette — because it's meant to look like Velo running on a device.
   Driven by demo.js (the app's real engine, bundled via build:demo). */

/* ── Frame: iPhone by default, iPad from 700px up ── */

.vd-frame {
    width: min(100%, 330px);
    margin: 0 auto;
    position: relative;
    background: linear-gradient(150deg, #3c3c42, #1b1b1f 45%, #2e2e34);
    border-radius: 54px;
    padding: 10px;
    box-shadow:
        0 30px 90px rgba(0, 0, 0, 0.55),
        0 0 70px var(--accent-glow),
        inset 0 0 2px 1px rgba(255, 255, 255, 0.14);
}
.vd-screen {
    position: relative;
    overflow: hidden;
    border-radius: 44px;
    background: #000;
    aspect-ratio: 390 / 800;
    isolation: isolate;
    box-shadow: inset 0 0 0 2px #000;
}
.vd-screen.vd-mode-rsvp { cursor: pointer; }
/* Scrim so reader text fades out under the status bar instead of
   colliding with it. Above the reader (10), below the pills (50). */
.vd-screen::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 56px;
    background: linear-gradient(to bottom, #000 30%, rgba(0, 0, 0, 0));
    z-index: 40;
    pointer-events: none;
}
/* ── iOS status bar + Dynamic Island ── */

.vd-statusbar {
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 44px;
    z-index: 55;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 15px 28px 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    pointer-events: none;
}
.vd-sb-icons { display: flex; align-items: center; gap: 5px; }
.vd-sb-signal { width: 16px; height: 11px; }
.vd-sb-wifi { width: 15px; height: 11px; }
.vd-sb-batt {
    position: relative;
    width: 23px;
    height: 11.5px;
    border-radius: 3.5px;
    border: 1px solid rgba(255, 255, 255, 0.45);
    padding: 1.5px;
    display: inline-flex;
}
.vd-sb-batt::after {
    content: '';
    position: absolute;
    right: -3.5px;
    top: 3px;
    width: 1.5px;
    height: 4px;
    border-radius: 0 1px 1px 0;
    background: rgba(255, 255, 255, 0.45);
}
.vd-sb-batt-fill { width: 76%; border-radius: 1.5px; background: #fff; }
.vd-island {
    position: absolute;
    top: 11px;
    left: 50%;
    transform: translateX(-50%);
    width: 28%;
    height: 25px;
    border-radius: 14px;
    background: #060607;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05);
    z-index: 56;
    pointer-events: none;
}
/* ── Chapter progress pill (top, RSVP mode — glass, like the app) ── */

.vd-chapter-pill {
    position: absolute;
    top: 52px;
    left: 50%;
    transform: translateX(-50%);
    width: min(74%, 300px);
    z-index: 50;
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 7px 13px 8px;
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.04);
    -webkit-backdrop-filter: blur(10px) saturate(170%);
    backdrop-filter: blur(10px) saturate(170%);
    border: 0.5px solid rgba(255, 255, 255, 0.18);
    transition: opacity 0.35s ease;
}
.vd-pill-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}
.vd-pill-title {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    font-size: 11px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.65);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.vd-pill-time {
    font-family: 'SF Mono', ui-monospace, 'Geist Mono', monospace;
    font-size: 11px;
    font-weight: 600;
    color: #ff4444;
    flex-shrink: 0;
}
.vd-pill-bar {
    height: 3px;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.08);
    overflow: hidden;
}
.vd-pill-fill {
    height: 100%;
    width: 0;
    border-radius: 2px;
    background: linear-gradient(90deg, #ff4444, #ff6666);
    transition: width 0.2s ease-out;
}
/* ── Reader layer (the app's single-layer word DOM) ── */

.vd-reader {
    position: absolute;
    inset: 0;
    z-index: 10;
    overflow-y: auto;
    padding: 58px 24px 88px;
    scrollbar-width: none;
}
.vd-reader::-webkit-scrollbar { display: none; }
.vd-chapter {
    position: relative;
    font-family: Georgia, 'Iowan Old Style', 'Palatino Linotype', 'Times New Roman', serif;
    font-size: 15px;
    line-height: 1.7;
    color: #f4f4f5;
    max-width: 470px;
    margin: 0 auto;
}
.vd-kicker {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    font-size: 0.67em; /* em so applyMetrics(k) scales it with the chapter */
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.4);
    margin: 0 0 10px;
}
.vd-heading {
    font-size: 1.9em;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: #f4f4f5;
    margin: 0 0 1.1rem;
}
.vd-chapter p { margin: 0 0 1rem; }
/* Kicker/heading fade with the neighbors during mode transitions —
   timing is driven inline by demo.js to match the native choreography. */

.vd-chapter [data-word-index] {
    border-radius: 3px;
    cursor: pointer;
}
.vd-chapter .vd-hl {
    background: rgba(255, 68, 68, 0.55);
    color: #fff;
    box-shadow: 0 0 0 2px rgba(255, 68, 68, 0.55);
}
/* ── RSVP surface + focal marker ── */

.vd-rsvp-host {
    position: absolute;
    inset: 0;
    z-index: 30;
    pointer-events: none;
}
.vd-marker {
    position: absolute;
    left: 40%;   /* ORP column: center − 10% width, like the app */
    top: 45%;
    transform: translate(-50%, -50%);
    width: 3px;
    height: 26%;
    background: linear-gradient(
        to bottom,
        #ff4444 0%,
        rgba(255, 68, 68, 0) 35%,
        rgba(255, 68, 68, 0) 65%,
        #ff4444 100%
    );
    z-index: 28;
    pointer-events: none;
    transition: opacity 0.35s ease;
}
/* ── RSVP controls (glass pill, bottom center) ── */

.vd-controls {
    position: absolute;
    left: 50%;
    bottom: 24px;
    transform: translateX(-50%);
    z-index: 50;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 7px 16px 7px 7px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.05);
    -webkit-backdrop-filter: blur(14px) saturate(170%);
    backdrop-filter: blur(14px) saturate(170%);
    border: 0.5px solid rgba(255, 255, 255, 0.18);
    transition: opacity 0.35s ease;
}
.vd-play {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}
.vd-play:hover { background: rgba(255, 255, 255, 0.18); }
.vd-wpm {
    -webkit-appearance: none;
    appearance: none;
    width: 80px;
    height: 3px;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.14);
    outline: none;
    cursor: pointer;
}
.vd-wpm::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #ff4444;
    box-shadow: 0 0 10px rgba(255, 68, 68, 0.5);
    cursor: pointer;
}
.vd-wpm::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #ff4444;
    border: none;
    cursor: pointer;
}
.vd-wpm-read {
    font-family: 'SF Mono', ui-monospace, 'Geist Mono', monospace;
    font-size: 11px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.85);
    white-space: nowrap;
}
/* ── Mode-switch FAB ── */

.vd-mode-fab {
    position: absolute;
    right: 16px;
    bottom: 24px;
    z-index: 50;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 9px 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.07);
    -webkit-backdrop-filter: blur(14px) saturate(170%);
    backdrop-filter: blur(14px) saturate(170%);
    border: 0.5px solid rgba(255, 255, 255, 0.2);
    color: #f4f4f5;
    cursor: pointer;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.02em;
    transition: background 0.2s ease, opacity 0.35s ease;
}
.vd-mode-fab:hover { background: rgba(255, 255, 255, 0.14); }
/* Phone: icon-only FAB so it doesn't crowd the control pill */
.vd-mode-fab { width: 40px; height: 40px; justify-content: center; padding: 0; }
.vd-mode-fab #vd-fab-label { display: none; }
/* ── Book progress strip (bottom edge, RSVP mode) ── */

.vd-strip {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 3px;
    background: rgba(255, 255, 255, 0.14);
    z-index: 52;
    pointer-events: none;
    transition: opacity 0.35s ease;
}
.vd-strip-fill {
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, #ff4444, #ff6666);
    box-shadow: 0 0 6px rgba(255, 68, 68, 0.5);
    transition: width 0.25s ease-out;
}
/* ── Per-mode chrome visibility ── */

.vd-mode-reader .vd-chapter-pill,
.vd-mode-reader .vd-controls,
.vd-mode-reader .vd-marker,
.vd-mode-reader .vd-strip {
    opacity: 0;
    pointer-events: none;
}
@media (max-width: 1024px){
.hero-demo { max-width: 560px; width: 100%; margin: 0 auto; }
}
/* iPad by default; the frame becomes an iPhone only when the viewport is narrow. */
@media (min-width: 700px) {
  .vd-frame { width: min(100%, 600px); border-radius: 34px; padding: 15px; }
  .vd-screen { border-radius: 18px; aspect-ratio: 3 / 4; }
  .vd-island { display: none; }
  .vd-statusbar { height: 24px; padding: 8px 16px 0; font-size: 11px; font-weight: 500; }
  .vd-chapter-pill { top: 34px; }
  .vd-reader { padding: 52px 64px 80px; }
  .vd-chapter { font-size: 16px; }
  .vd-marker { height: 34%; }
  .vd-wpm { width: 110px; }
  /* Same height as the controls panel (38px play + 7px padding × 2 + 1px border) so the two align. */
  .vd-mode-fab { width: auto; height: 53px; padding: 0 18px; right: 24px; bottom: 24px; box-sizing: border-box; }
  .vd-mode-fab #vd-fab-label { display: inline; }
  /* Controls sit left so the mode switch on the right never crowds them. */
  .vd-controls { left: 24px; right: auto; transform: none; }
}
