/* ==========================================================================
   How to use Quietly — page styles
   Reuses .browser-mockup, .option, .ai-dot, .hero-dot-* and .showcase-replay-btn
   from styles.css; everything below is scoped to this page.
   ========================================================================== */

.ht-hero {
    position: relative;
    overflow: hidden;
    padding: 6.6rem 0 4.2rem;
    background:
        radial-gradient(1200px 520px at 78% 12%, rgba(0, 85, 255, 0.13), transparent 58%),
        radial-gradient(900px 480px at 8% 92%, rgba(56, 189, 248, 0.1), transparent 55%),
        linear-gradient(180deg, #f3f7ff 0%, #fbfcff 46%, #ffffff 100%);
}

.ht-hero .container {
    position: relative;
    z-index: 1;
}

/* ---- Intro copy ---- */
.ht-intro {
    max-width: 46rem;
    margin: 0 auto 1.6rem;
    text-align: center;
}

.ht-title {
    margin-bottom: 0.85rem;
    color: var(--text);
    font-size: clamp(2.1rem, 4.4vw, 3.3rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.06;
    text-wrap: balance;
}

.ht-title .highlight::after {
    bottom: 0.02em;
    height: 0.18em;
    background: linear-gradient(90deg, rgba(0, 85, 255, 0.42), rgba(0, 170, 255, 0.18));
    border-radius: 3px;
    opacity: 1;
}

.ht-lead {
    color: var(--text-light);
    font-size: clamp(1.02rem, 1.5vw, 1.18rem);
    line-height: 1.55;
    text-wrap: pretty;
}

/* ---- Demo shell ---- */
.ht-demo {
    --ht-vh: 318px;
    --ht-gutter: 1.4rem;
    max-width: 800px;
    margin: 0 auto;
}

.ht-stage {
    position: relative;
}

.ht-stage::before {
    content: '';
    position: absolute;
    inset: -6% -4% auto;
    height: 72%;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(0, 85, 255, 0.13) 0%, rgba(0, 85, 255, 0.05) 45%, transparent 70%);
    filter: blur(30px);
    pointer-events: none;
}

.ht-mockup {
    position: relative;
    border-radius: 18px;
    border: 1px solid rgba(148, 163, 184, 0.32);
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.95) inset,
        0 26px 64px rgba(15, 23, 42, 0.13),
        0 6px 20px rgba(0, 85, 255, 0.07);
    transition: none;
}

.ht-mockup .browser-header {
    background: linear-gradient(180deg, #fbfcfe 0%, #f3f6fb 100%);
}

.ht-mockup .browser-content {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 176px;
    padding: 0;
}

/* ---- Scrolling question viewport ---- */
.ht-viewport {
    position: relative;
    height: var(--ht-vh);
    overflow: hidden;
}

.ht-track {
    display: grid;
    grid-auto-rows: var(--ht-vh);
    transition: transform 1.05s cubic-bezier(0.65, 0, 0.35, 1);
}

.ht-demo.is-q2 .ht-track {
    transform: translateY(calc(-1 * var(--ht-vh)));
}

.ht-slide {
    padding: var(--ht-gutter);
}

.ht-quiz {
    width: 100%;
    max-width: 34rem;
}

.ht-scrollbar {
    position: absolute;
    top: 8px;
    right: 5px;
    bottom: 8px;
    width: 4px;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.16);
    pointer-events: none;
}

.ht-scrollbar::after {
    content: '';
    position: absolute;
    inset: 0 0 auto;
    height: 46%;
    border-radius: 999px;
    background: rgba(100, 116, 139, 0.42);
    transition: transform 1.05s cubic-bezier(0.65, 0, 0.35, 1);
}

.ht-demo.is-q2 .ht-scrollbar::after {
    transform: translateY(118%);
}

/* ---- Quiz typography at the wider size ---- */
/* Question label and the extension's dot indicator share one row, the way the
   overlay sits on a real quiz page. */
.ht-quiz-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.ht-mockup .quiz-label {
    margin-bottom: 0;
    font-size: 0.82rem;
    letter-spacing: 0.03em;
}

.ht-mockup .quiz-prompt {
    margin-bottom: 0.95rem;
    font-size: 0.98rem;
    line-height: 1.45;
    text-wrap: pretty;
}

.ht-mockup .quiz-options {
    gap: 0.5rem;
}

.ht-mockup .option {
    justify-content: flex-start;
    gap: 0.4rem;
    padding: 0.62rem 0.8rem;
    cursor: default;
    font-size: 0.93rem;
    transition: border-color 0.4s ease, background-color 0.4s ease, box-shadow 0.4s ease;
}

.ht-mockup .option:hover {
    border-color: #cbd5e1;
    background: transparent;
}

/* Last step shows the prompt as selected text, the way a real highlight looks
   just before the Ask pill appears. */
.ht-selectable {
    border-radius: 2px;
    transition: background-color 0.4s ease;
}

.ht-demo.is-stuck .ht-selectable {
    background: rgba(0, 85, 255, 0.16);
}

/* ---- The student's pick and Quietly's mark ---- */
.ht-answered {
    border-color: rgba(0, 85, 255, 0.32);
    background: rgba(0, 85, 255, 0.03);
    color: #0f172a;
    font-weight: 600;
}

.ht-demo.is-picked .ht-pick {
    border-color: var(--primary);
    background: rgba(0, 85, 255, 0.05);
    box-shadow: 0 0 0 3px rgba(0, 85, 255, 0.09);
    color: #0f172a;
    font-weight: 600;
}

.ht-mockup .ai-dot {
    opacity: 0;
    transform: scale(0.2);
    animation: none;
    transition: opacity 0.35s ease, transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.ht-demo.is-marked .ht-q1 .ai-dot,
.ht-demo.is-revealed .ht-q2 .ai-dot {
    opacity: 1;
    transform: scale(1);
    animation: pulse-splash 2s infinite 0.6s;
}

/* Verdict chip: "Your pick" swaps to "Match" in the same grid cell, so the
   option never changes width. */
.ht-chip-slot {
    display: grid;
    margin-left: auto;
}

.ht-chip-slot > * {
    grid-area: 1 / 1;
    align-self: center;
    justify-self: end;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.16rem 0.45rem;
    border-radius: 6px;
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.ht-chip-pick {
    border: 1px solid rgba(100, 116, 139, 0.32);
    color: #64748b;
}

.ht-chip-match {
    border: 1px solid rgba(16, 185, 129, 0.35);
    background: rgba(16, 185, 129, 0.08);
    color: #059669;
}

.ht-demo.is-picked .ht-chip-pick { opacity: 1; }
.ht-demo.is-revealed .ht-chip-pick { opacity: 0; }
.ht-demo.is-revealed .ht-chip-match { opacity: 1; }

/* ---- Faux Canvas question rail ---- */
.ht-rail {
    padding: 1.1rem 1rem;
    border-left: 1px solid #eef2f7;
    background: #fbfcfe;
}

.ht-rail-title {
    margin-bottom: 0.7rem;
    color: #94a3b8;
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.09em;
    text-transform: uppercase;
}

.ht-rail-list {
    display: flex;
    flex-direction: column;
    gap: 0.28rem;
    list-style: none;
}

.ht-rail-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.32rem 0.5rem;
    border-radius: 7px;
    color: #64748b;
    font-size: 0.78rem;
    font-weight: 500;
    transition: background-color 0.4s ease, color 0.4s ease;
}

.ht-rail-item::after {
    content: '✓';
    color: #94a3b8;
    font-size: 0.7rem;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.ht-rail-item.is-done::after { opacity: 1; }

.ht-rail-item.is-current {
    background: rgba(0, 85, 255, 0.07);
    color: var(--primary);
    font-weight: 700;
}

/* The rail tracks the scroll: Q4 finishes, Q5 becomes current. */
.ht-demo.is-q2 .ht-rail-item[data-q="4"] { background: transparent; color: #64748b; font-weight: 500; }
.ht-demo.is-q2 .ht-rail-item[data-q="5"] { background: rgba(0, 85, 255, 0.07); color: var(--primary); font-weight: 700; }
.ht-demo.is-q2.is-revealed .ht-rail-item[data-q="5"]::after { opacity: 1; }

/* ---- Dot-state indicator (reuses .hero-dot-toggle / .hero-dot-shortcut) ---- */
.ht-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    flex-shrink: 0;
}

.ht-indicator .hero-dot-toggle {
    padding: 0.3rem 0.55rem;
    border-radius: 8px;
    cursor: default;
    font-size: 0.7rem;
    transition: border-color 0.35s ease, color 0.35s ease;
}

.ht-indicator .hero-dot-shortcut {
    gap: 0.2rem;
    font-size: 0.68rem;
}

.ht-indicator kbd {
    min-width: 1.2rem;
    padding: 0.2rem 0.3rem;
    border-radius: 5px;
    font-size: 0.62rem;
}

.ht-dot-state-off,
.ht-demo.is-dots-off .ht-dot-state-on {
    display: none;
}

.ht-demo.is-dots-off .ht-dot-state-off {
    display: inline;
}

.ht-demo.is-dots-off .hero-dot-toggle {
    color: #64748b;
    border-color: rgba(148, 163, 184, 0.55);
}

/* The shortcut only lights up on the steps where pressing it does something.
   The hint keeps its space reserved so the row never shifts. */
.ht-demo.is-armed .hero-dot-shortcut kbd {
    border-color: rgba(0, 85, 255, 0.45);
    color: var(--primary);
    animation: ht-armed-key 1.9s ease-in-out infinite;
}

@keyframes ht-armed-key {
    0%, 100% { box-shadow: 0 1px 0 rgba(255, 255, 255, 0.9) inset, 0 0 0 0 rgba(0, 85, 255, 0.16); }
    55% { box-shadow: 0 1px 0 rgba(255, 255, 255, 0.9) inset, 0 0 0 5px rgba(0, 85, 255, 0); }
}

.ht-demo.is-hotkey .hero-dot-shortcut kbd {
    border-color: rgba(0, 85, 255, 0.5);
    color: var(--primary);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.9) inset, 0 0 0 3px rgba(0, 85, 255, 0.12);
}

/* ---- "Interactive demo" tooltip, parked beside the frame ---- */
.ht-hint {
    position: absolute;
    top: 4.6rem;
    left: calc(100% + 1.4rem);
    z-index: 3;
    width: 11.5rem;
    padding: 0.75rem 0.85rem;
    border: 1px solid rgba(0, 85, 255, 0.16);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.08);
    text-align: left;
}

.ht-hint::before {
    content: '';
    position: absolute;
    top: 1.3rem;
    left: -5px;
    width: 9px;
    height: 9px;
    border-left: 1px solid rgba(0, 85, 255, 0.16);
    border-bottom: 1px solid rgba(0, 85, 255, 0.16);
    border-radius: 0 0 0 2px;
    background: inherit;
    transform: rotate(45deg);
}

.ht-hint-title {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 0.32rem;
    color: var(--primary);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.ht-hint-title::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    animation: pulse-splash 1.9s infinite;
}

.ht-hint p:not(.ht-hint-title) {
    color: var(--text-light);
    font-size: 0.75rem;
    line-height: 1.5;
}

.ht-hint kbd {
    padding: 0.08rem 0.26rem;
    border: 1px solid rgba(148, 163, 184, 0.5);
    border-radius: 4px;
    background: #fff;
    color: #334155;
    font-family: inherit;
    font-size: 0.92em;
    font-weight: 700;
}

/* ---- Captions and phase rail ---- */
/* Only the active caption sits in flow, so the block hugs the current step
   instead of reserving room for the longest one. min-height keeps the short
   steps from collapsing, so the controls below only move for the long ones. */
.ht-captions {
    position: relative;
    max-width: 44rem;
    min-height: 3.4rem;
    margin: 1.7rem auto 0;
    text-align: center;
}

.ht-caption {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    color: var(--text-light);
    font-size: clamp(1rem, 1.5vw, 1.14rem);
    font-weight: 500;
    line-height: 1.6;
    text-wrap: pretty;
    opacity: 0;
    transform: translateY(6px);
    transition: opacity 0.16s ease, transform 0.16s ease;
}

.ht-caption.is-active {
    position: relative;
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.42s ease 0.08s, transform 0.42s ease 0.08s;
}

.ht-caption strong {
    color: var(--text);
    font-weight: 700;
}

.ht-caption kbd {
    padding: 0.1rem 0.34rem;
    border: 1px solid rgba(148, 163, 184, 0.5);
    border-radius: 5px;
    background: #fff;
    color: #334155;
    font-family: inherit;
    font-size: 0.86em;
    font-weight: 700;
}

.ht-phases {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.4rem 0.5rem;
    margin: 0.75rem 0 0;
    list-style: none;
}

.ht-phase {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.3rem 0.7rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.7);
    color: #94a3b8;
    font-size: 0.78rem;
    font-weight: 600;
    transition: border-color 0.35s ease, color 0.35s ease, background-color 0.35s ease;
}

.ht-phase::before {
    content: '';
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: currentColor;
}

.ht-phase.is-done {
    color: var(--text-light);
}

.ht-phase.is-active {
    border-color: rgba(0, 85, 255, 0.3);
    background: rgba(0, 85, 255, 0.05);
    color: var(--primary);
}

/* ---- Manual pacing controls ---- */
.ht-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.55rem;
    margin-top: 1.1rem;
}

.ht-next-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.62rem 1.15rem;
    border: 1px solid rgba(0, 85, 255, 0.22);
    border-radius: 11px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: var(--primary);
    font-family: inherit;
    font-size: 0.88rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.9) inset, 0 6px 16px rgba(15, 23, 42, 0.05);
    transition: border-color 0.2s ease, background-color 0.2s ease, opacity 0.3s ease;
}

.ht-next-btn svg {
    width: 15px;
    height: 15px;
    transition: transform 0.2s ease;
}

.ht-next-btn:hover {
    border-color: rgba(0, 85, 255, 0.4);
    background: #fff;
}

.ht-next-btn:hover svg {
    transform: translateX(3px);
}

.ht-next-btn:focus-visible {
    outline: 2px solid rgba(0, 85, 255, 0.35);
    outline-offset: 2px;
}

/* .showcase-replay-btn sets display:block, which would otherwise beat [hidden]. */
.ht-next-btn[hidden],
.ht-demo .showcase-replay-btn[hidden] {
    display: none;
}

.ht-demo .showcase-replay-btn {
    margin: 0;
}

.ht-step-count {
    color: #94a3b8;
    font-size: 0.76rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

/* ==========================================================================
   Secondary section — favorite ways to use Quietly
   ========================================================================== */
.ht-plays {
    padding: clamp(3.5rem, 7vw, 5.5rem) 0;
    background: #fff;
}

.ht-section-head {
    max-width: 40rem;
    margin: 0 auto clamp(2rem, 4vw, 3rem);
    text-align: center;
}

.ht-section-head h2 {
    margin-bottom: 0.8rem;
    color: var(--text);
    font-size: clamp(1.7rem, 3.2vw, 2.4rem);
    font-weight: 800;
    letter-spacing: -0.025em;
    line-height: 1.12;
}

.ht-section-head p {
    color: var(--text-light);
    font-size: 1.02rem;
    line-height: 1.6;
}

.ht-play-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr));
    gap: 1rem;
    max-width: 1000px;
    margin: 0 auto;
}

.ht-play {
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: linear-gradient(180deg, #fdfdff 0%, #ffffff 100%);
    transition: border-color 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease;
}

.ht-play:hover {
    border-color: rgba(0, 85, 255, 0.28);
    box-shadow: 0 14px 34px rgba(15, 23, 42, 0.07);
    transform: translateY(-2px);
}

.ht-play-eyebrow {
    margin-bottom: 0.7rem;
    color: var(--primary);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.ht-play h3 {
    margin-bottom: 0.55rem;
    color: var(--text);
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: -0.015em;
    line-height: 1.3;
}

.ht-play p {
    margin-bottom: 0.7rem;
    color: var(--text-light);
    font-size: 0.94rem;
    line-height: 1.6;
}

.ht-play-path {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
    margin: auto 0 0;
    padding-top: 0.5rem;
    color: #64748b;
    font-size: 0.78rem;
    font-weight: 600;
}

.ht-play-path code,
.ht-play-path kbd {
    padding: 0.2rem 0.44rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: #f8fafc;
    color: #334155;
    font-family: inherit;
    font-size: 0.94em;
    font-weight: 600;
}

.ht-play-path span[aria-hidden] {
    color: #cbd5e1;
}

/* Sits on the same baseline as the other cards' chip rows. */
.ht-play-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin: auto 0 0;
    padding: 0.42rem 0.75rem;
    border: 1px solid rgba(0, 85, 255, 0.22);
    border-radius: 9px;
    align-self: flex-start;
    color: var(--primary);
    font-size: 0.82rem;
    font-weight: 600;
    text-decoration: none;
    transition: border-color 0.2s ease, background-color 0.2s ease;
}

.ht-play-link svg {
    width: 14px;
    height: 14px;
    transition: transform 0.2s ease;
}

.ht-play-link:hover {
    border-color: rgba(0, 85, 255, 0.4);
    background: rgba(0, 85, 255, 0.04);
}

.ht-play-link:hover svg {
    transform: translateX(3px);
}

/* ---- Closing rules band ---- */
.ht-closing {
    display: grid;
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
    gap: clamp(1.5rem, 4vw, 3rem);
    align-items: center;
    max-width: 1000px;
    margin: clamp(2rem, 4vw, 3rem) auto 0;
    padding: clamp(1.75rem, 3.5vw, 2.6rem);
    border: 1px solid rgba(0, 85, 255, 0.14);
    border-radius: 20px;
    background:
        radial-gradient(700px 320px at 12% 0%, rgba(0, 85, 255, 0.07), transparent 60%),
        linear-gradient(180deg, #f7f9ff 0%, #ffffff 100%);
}

.ht-closing h2 {
    margin-bottom: 0.7rem;
    color: var(--text);
    font-size: clamp(1.35rem, 2.4vw, 1.8rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.15;
}

.ht-closing p {
    margin-bottom: 1.25rem;
    color: var(--text-light);
    font-size: 0.96rem;
    line-height: 1.6;
}

.ht-closing-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.ht-rules {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    list-style: none;
}

.ht-rules li {
    display: flex;
    gap: 0.7rem;
    color: var(--text);
    font-size: 0.95rem;
    line-height: 1.55;
}

.ht-rules li::before {
    content: '';
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    margin-top: 0.2rem;
    border-radius: 50%;
    background:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230055FF' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12 5 5L19 7'/%3E%3C/svg%3E") center / 11px no-repeat,
        rgba(0, 85, 255, 0.09);
}

/* ==========================================================================
   Responsive
   ========================================================================== */
/* No room beside the frame for the tooltip; the step controls carry the cue. */
@media (max-width: 1180px) {
    .ht-hint {
        display: none;
    }
}

@media (max-width: 900px) {
    .ht-mockup .browser-content {
        grid-template-columns: minmax(0, 1fr);
    }

    .ht-rail {
        display: none;
    }

    .ht-closing {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 768px) {
    .ht-hero {
        padding: 5.6rem 0 3rem;
    }

    .ht-demo {
        --ht-vh: 340px;
        --ht-gutter: 1.1rem;
    }

    .ht-mockup .quiz-prompt {
        font-size: 0.92rem;
    }

    .ht-mockup .option {
        font-size: 0.86rem;
    }

    /* The indicator drops under the label rather than squeezing the row. */
    .ht-quiz-head {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .ht-phases {
        margin-top: 1.2rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .ht-track,
    .ht-scrollbar::after,
    .ht-caption,
    .ht-mockup .ai-dot,
    .ht-mockup .option,
    .ht-rail-item,
    .ht-phase {
        transition: none !important;
    }

    .ht-demo.is-marked .ht-q1 .ai-dot,
    .ht-demo.is-revealed .ht-q2 .ai-dot,
    .ht-demo.is-armed .hero-dot-shortcut kbd {
        animation: none !important;
    }
}
