/* Home demo: a paid booking moves, then a query lists unpaid fees.
   Static markup shows the first result. .hd-run enables the timeline; .play shows a result. */

.hero-home {
    --hd-ink: var(--bg-dark);
    padding: 7.25rem 0 4.5rem;
}

.hero-home .hero-copy {
    max-width: 820px;
    margin: 0 auto 2rem;
    text-align: center;
}

.hero-home h1 {
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    line-height: 1.02;
    letter-spacing: -0.04em;
    max-width: none;
    margin-bottom: 1.5rem;
}

.hero-home .hero-subtitle {
    margin: 0 auto 1.5rem;
    max-width: 60ch;
    text-wrap: balance;
}

.hero-home .hero-cta {
    justify-content: center;
}

.home-demo {
    margin: 0;
}

.demo-caption {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem 1.5rem;
    flex-wrap: wrap;
    max-width: 1120px;
    margin: 0.75rem auto 0;
    color: var(--text-muted);
    font-size: 0.8125rem;
}

.demo-caption button[hidden] {
    display: none;
}

.hd-paused *,
.hd-paused *::before,
.hd-paused *::after {
    animation-play-state: paused !important;
}

/* ---------- The browser, split in two ---------- */
.hd {
    position: relative;
    max-width: 1120px;
    margin: 0 auto;
}

.hd-window {
    padding: 0 6px 6px;
    border-radius: var(--radius-xl);
    background: #e6e9ed;
    border: 1px solid var(--border);
    color: var(--text);
    text-align: start;
}

.hd-tabs {
    display: flex;
    align-items: center;
    gap: 6px;
    height: 34px;
    padding: 0 8px;
}

.hd-dots {
    display: inline-flex;
    gap: 6px;
    margin-inline-end: 10px;
}

.hd-dots i {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #c9cfd6;
}

.hd-tab {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 210px;
    height: 26px;
    padding: 0 12px;
    border-radius: 8px;
    background: white;
    font-size: 12px;
    font-weight: 500;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
}

.hd-fav {
    flex-shrink: 0;
    width: 14px;
    height: 14px;
    border-radius: 4px;
    background: var(--primary);
}

.hd-gpt-logo {
    flex-shrink: 0;
    width: 15px;
    height: 15px;
}

.hd-body {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(0, 0.8fr);
    grid-template-rows: minmax(0, 1fr);
    gap: 6px;
    height: 480px;
}

.hd-pane {
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
    border-radius: 10px;
    overflow: hidden;
    background: white;
    border: 1px solid var(--border-light);
}

.hd-url {
    flex-shrink: 0;
    margin: 8px 10px;
    padding: 4px 12px;
    border-radius: 999px;
    background: var(--bg-alt);
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hd-url b {
    display: none;
    font-weight: 600;
    color: var(--text);
}

.hd-url b.cur {
    display: inline;
}

.hd-app-body {
    flex: 1;
    min-height: 0;
    display: grid;
    grid-template-columns: 120px minmax(0, 1fr);
    border-top: 1px solid var(--border-light);
}

/* ---------- Side menu ---------- */
.hd-side {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 16px 10px;
    background: #fafbfc;
    border-inline-end: 1px solid var(--border-light);
}

.hd-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 8px 16px;
    font-family: var(--font-display);
    font-size: 13px;
    font-weight: 700;
    color: var(--heading);
}

.hd-logo::before {
    content: '';
    width: 14px;
    height: 14px;
    border-radius: 4px;
    background: var(--primary);
}

.hd-side i {
    font-style: normal;
    font-size: 12.5px;
    color: var(--text-muted);
    padding: 7px 10px;
    border-radius: 7px;
    transition: background 0.3s, color 0.3s;
}

.hd-side i.cur {
    color: var(--accent);
    font-weight: 600;
    background: var(--primary-subtle);
}

/* ---------- Screens ---------- */
.hd-main {
    position: relative;
    min-width: 0;
    background: var(--bg-warm);
    overflow: hidden;
}

.hd-scene {
    position: absolute;
    inset: 22px 24px;
    display: flex;
    flex-direction: column;
    opacity: 0;
    visibility: hidden;
    transform: translateY(14px) scale(0.985);
    transition: opacity 0.45s ease, transform 0.55s cubic-bezier(0.22, 1, 0.36, 1), visibility 0.45s;
}

.hd-scene.on {
    opacity: 1;
    visibility: visible;
    transform: none;
}

.hd-top {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}

.hd-top strong {
    font-family: var(--font-display);
    font-size: 17px;
    color: var(--heading);
}

.hd-chip {
    font-size: 11px;
    font-weight: 600;
    color: var(--accent);
    background: var(--primary-subtle);
    border-radius: 999px;
    padding: 3px 10px;
}

.hd-sum {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
    padding: 12px 16px;
    border-radius: 10px;
    background: var(--hd-ink);
    color: #cbd5e1;
    font-size: 12.5px;
    transition: opacity 0.4s, transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.hd-sum b {
    font-family: var(--font-display);
    font-size: 20px;
    color: white;
    font-variant-numeric: tabular-nums;
}

/* Fees: the query shows the unpaid members and their outstanding total. */
.hd-table {
    background: white;
    border: 1px solid var(--border-light);
    border-radius: 10px;
    overflow: hidden;
    transition: opacity 0.3s, transform 0.3s;
}

.hd-row {
    display: grid;
    grid-template-columns: 1.4fr 1fr 90px 60px;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    font-size: 12.5px;
    border-top: 1px solid var(--border-light);
    transition: background 0.4s, opacity 0.4s, box-shadow 0.4s;
}

.hd-row:first-child {
    border-top: none;
}

.hd-row span:nth-child(2) {
    color: var(--text-muted);
}

.hd-row em {
    font-style: normal;
    text-align: end;
}

.hd-row b {
    text-align: end;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.hd-head {
    padding-block: 8px;
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-light);
    background: var(--bg-warm);
}

.hd-head b,
.hd-head em {
    font-weight: 500;
}

.hd-row u {
    text-decoration: none;
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 9px;
    border-radius: 999px;
    color: var(--text-muted);
    background: var(--bg-alt);
    transition: background 0.35s, color 0.35s, transform 0.35s;
}

.hd-due u {
    color: #b91c1c;
    background: #fee2e2;
}

.hd-run [data-scene="fees"]:not(.play) .hd-table {
    opacity: 0;
    transform: translateY(8px);
}

.hd-run .hd-scene:not(.play) .hd-sum {
    opacity: 0;
    transform: translateY(12px);
}

.hd-run .hd-scene.play .hd-sum {
    transition-delay: 0.15s;
}

/* Bookings: the reservation moves one hour later and keeps its payment. */
.hd-grid {
    flex: 1;
    min-height: 0;
    display: grid;
    grid-template-columns: 46px repeat(4, minmax(0, 1fr));
    grid-template-rows: 22px repeat(5, minmax(0, 1fr));
    gap: 6px;
    background-image: linear-gradient(var(--border-light) 1px, transparent 1px);
    background-size: 100% calc((100% - 28px) / 5 + 1.2px);
    background-position: 0 28px;
}

.hd-court {
    grid-column: var(--c);
    grid-row: 1;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-align: center;
}

.hd-hour {
    grid-column: 1;
    grid-row: var(--r);
    font-size: 10.5px;
    color: var(--text-light);
    font-variant-numeric: tabular-nums;
}

.hd-bk,
.hd-ghost {
    grid-column: var(--c);
    grid-row: var(--r) / span var(--n, 1);
    border-radius: 8px;
}

.hd-bk {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 2px;
    padding: 0 10px;
    min-width: 0;
    background: white;
    border: 1px solid var(--border-light);
    border-inline-start: 3px solid var(--primary-light);
}

.hd-bk b,
.hd-bk i {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hd-bk b {
    font-size: 11.5px;
    color: var(--heading);
}

.hd-bk i {
    font-style: normal;
    font-size: 10.5px;
    color: var(--text-muted);
}

.hd-bk-alt {
    border-inline-start-color: var(--text-light);
    background: var(--bg-alt);
}

.hd-move {
    position: relative;
    z-index: 2;
    border-color: var(--primary);
    border-inline-start-color: var(--primary);
    background: var(--primary-subtle);
}

.hd-ghost {
    border: 1.5px dashed var(--border);
    opacity: 0;
    transition: opacity 0.4s;
}

.hd-run [data-scene="bookings"]:not(.play) .hd-move {
    transform: translateY(calc(-100% - 6px));
    background: white;
    border-color: var(--border-light);
    border-inline-start-color: var(--primary-light);
}

.hd-run [data-scene="bookings"].play .hd-move {
    animation: hdMove 0.65s cubic-bezier(0.65, 0, 0.35, 1) both;
    transition: background 0.25s, border-color 0.25s;
}

.hd-run [data-scene="bookings"].play .hd-ghost {
    opacity: 1;
    transition-delay: 0.2s;
}

@keyframes hdMove {
    0% { transform: translateY(calc(-100% - 6px)); }
    100% { transform: none; }
}

/* ---------- ChatGPT ----------
   Drawn as ChatGPT draws itself: its system font, the name with the model
   menu, grey bubbles for the user, plain text for the answers, the call to
   an app as a chip and the round composer with the black button. */
.hd-gpt {
    font-family: ui-sans-serif, -apple-system, system-ui, 'Segoe UI', Helvetica, Arial, sans-serif;
}

.hd-gpt-head {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 12px 18px;
    border-top: 1px solid var(--border-light);
    font-size: 16px;
    font-weight: 500;
    color: #0d0d0d;
}

.hd-chev {
    width: 14px;
    height: 14px;
    margin-inline-start: -4px;
    fill: none;
    stroke: #5d5d5d;
    stroke-width: 1.6;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.hd-gpt-head .hd-gpt-logo {
    width: 20px;
    height: 20px;
}

.hd-log {
    flex: 1;
    min-height: 0;
    overflow: hidden;
    transition: opacity 0.4s;
}

.hd-scroll {
    padding: 18px;
    transition: transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}

.hd-turn {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
}

.hd-me {
    align-self: flex-end;
    max-width: 85%;
    margin: 0;
    padding: 8px 14px;
    border-radius: 18px;
    background: #f4f4f4;
    font-size: 13.5px;
    line-height: 1.45;
    color: #0d0d0d;
}

.hd-tool {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    padding: 4px 10px;
    border: 1px solid #e5e5e5;
    border-radius: 999px;
    font-size: 12px;
    color: #5d5d5d;
}

.hd-tool .hd-fav {
    width: 13px;
    height: 13px;
}

.hd-tool b {
    font-weight: 600;
    color: var(--text);
}

.hd-dots-run {
    display: none;
    gap: 3px;
}

.hd-dots-run i {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--text-light);
    animation: hdDot 1s infinite;
}

.hd-dots-run i:nth-child(2) { animation-delay: 0.15s; }
.hd-dots-run i:nth-child(3) { animation-delay: 0.3s; }

@keyframes hdDot {
    0%, 60%, 100% { opacity: 0.35; }
    30% { opacity: 1; }
}

.hd-tick {
    color: var(--success);
    font-weight: 700;
}

.hd-run .hd-tool:not(.done) .hd-dots-run {
    display: inline-flex;
}

.hd-run .hd-tool:not(.done) .hd-tick {
    display: none;
}

.hd-say {
    margin: 0;
    font-size: 13.5px;
    line-height: 1.55;
    color: #0d0d0d;
}

.hd-compose {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 10px 12px 12px;
    padding: 8px 8px 8px 12px;
    border-radius: 28px;
    border: 1px solid #e5e5e5;
}

.hd-plus {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    fill: none;
    stroke: #5d5d5d;
    stroke-width: 1.6;
    stroke-linecap: round;
}

.hd-input {
    flex: 1;
    min-width: 0;
    font-size: 13.5px;
    color: #0d0d0d;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hd-ph {
    color: #8f8f8f;
}

.hd-typed:not(:empty) ~ .hd-ph {
    display: none;
}

.hd-caret {
    display: none;
    width: 1.5px;
    height: 15px;
    margin-inline-start: 1px;
    vertical-align: -3px;
    background: var(--text);
    animation: hdBlink 1s step-end infinite;
}

.hd-compose.typing .hd-caret {
    display: inline-block;
}

@keyframes hdBlink {
    50% { opacity: 0; }
}

.hd-send {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    flex-shrink: 0;
    border-radius: 50%;
    background: #0d0d0d;
    transition: transform 0.2s;
}

.hd-send svg {
    width: 14px;
    height: 14px;
    fill: none;
    stroke: white;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* ---------- Run state: what the timeline reveals ---------- */
.hd-run .hd-turn {
    display: none;
}

.hd-run .hd-turn.on {
    display: flex;
}

.hd:not(.hd-run) .hd-turn + .hd-turn {
    display: none;
}

.hd-run .hd-turn .hd-me,
.hd-run .hd-turn .hd-tool,
.hd-run .hd-turn .hd-say {
    display: none;
}

.hd-run .hd-turn .on {
    display: block;
    animation: hdRise 0.4s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.hd-run .hd-turn .hd-tool.on {
    display: inline-flex;
}

@keyframes hdRise {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: none; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
    .hd-body {
        grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
    }

    .hd-app-body {
        grid-template-columns: minmax(0, 1fr);
    }

    .hd-side {
        display: none;
    }
}

@media (max-width: 768px) {
    .hero-home {
        padding: 5.5rem 0 2.5rem;
    }

    .hero-home .hero-copy {
        margin-bottom: 1.5rem;
    }

    .hero-home h1 {
        margin-bottom: 1rem;
    }

    .hero-home .hero-label {
        font-size: 0.8125rem;
    }

    .hero-home .hero-cta {
        gap: 0.75rem;
    }

    .hero-home .hero-cta .btn {
        font-size: 0.9375rem;
    }

    /* One tab under the other: the ask, then the screen it changes. */
    .hd-gpt {
        order: -1;
    }

    .hd-tab {
        width: auto;
        flex: 1;
        min-width: 0;
    }

    .hd-tabs .hd-dots {
        display: none;
    }

    .hd-body {
        grid-template-columns: minmax(0, 1fr);
        grid-template-rows: 140px 330px;
        height: auto;
    }

    .hd-scene {
        inset: 12px;
    }

    .hd-gpt .hd-url,
    .hd-compose {
        display: none;
    }

    .hd-gpt-head {
        padding: 9px 12px 0;
        border: 0;
        font-size: 14px;
    }

    .hd-log {
        mask-image: none;
        -webkit-mask-image: none;
    }

    .hd-scroll {
        padding: 10px 12px;
    }

    .hd-turn,
    .hd-turn + .hd-turn {
        gap: 6px;
        margin: 0;
    }

    .hd-tool,
    .hd-run .hd-turn .hd-tool.on {
        display: none;
    }

    .hd-me {
        max-width: 100%;
        padding: 7px 10px;
    }

    .hd-top {
        gap: 6px;
        margin-bottom: 8px;
    }

    .hd-top strong {
        font-size: 15px;
    }

    .hd-chip {
        display: none;
    }

    .hd-url {
        font-size: 10.5px;
    }

    .hd-row {
        grid-template-columns: minmax(0, 1.3fr) 76px 46px;
        padding: 9px 12px;
    }

    .hd-row span:nth-child(2) {
        display: none;
    }

    /* Show the two courts involved in the example at a readable width. */
    .hd-grid {
        grid-template-columns: 36px repeat(2, minmax(0, 1fr));
        grid-template-rows: 22px repeat(4, minmax(0, 1fr));
        background-size: 100% calc((100% - 28px) / 4 + 1.5px);
    }

    .hd-grid [style*="--c:4"],
    .hd-grid [style*="--c:5"],
    .hd-grid [style*="--r:6"] {
        display: none;
    }

    .hd-bk {
        padding: 0 8px;
    }
}

.hd-booking-result {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-top: 10px;
    font-size: 13px;
    color: var(--accent);
    transition: opacity 0.25s;
}

.hd-run .hd-scene:not(.play) .hd-booking-result {
    opacity: 0;
}
