/* ==========================================================================
   MockupForge 3D — extension page
   Loaded after home.css and depends on its tokens. Everything here is either
   a layout this page needs and the lander doesn't, or the install guide
   dialog. No new colours, no new radii: media and cards 14px, buttons 8px,
   purple is still the only interactive accent.
   ========================================================================== */

/* --------------------------------------------------------------------------
   Hero — same asymmetric split as the lander, but the copy column carries
   more text (the honesty note), so it takes more of the width.
   -------------------------------------------------------------------------- */
.ext-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
    gap: clamp(32px, 5vw, 72px);
    align-items: center;
    padding-top: clamp(48px, 7vw, 96px);
}

.download-meta {
    margin-top: 18px;
    color: var(--fg-faint);
    font-size: 0.85rem;
    font-family: var(--mono);
    letter-spacing: 0;
}

/* The single most important paragraph on the page: it is the difference
   between an honest download and a bait-and-switch. Given a left rule and a
   raised surface so it reads as a notice, not body copy to skim past. */
.honesty {
    margin-top: 24px;
    padding: 16px 18px;
    border-left: 2px solid var(--accent);
    border-radius: 0 var(--r-card) var(--r-card) 0;
    background: var(--accent-soft);
    color: var(--fg-dim);
    font-size: 0.92rem;
    max-width: 58ch;
}

/* The hero image is the extension's own popup, captured at 3x from a loaded
   build. It is 300 CSS pixels wide in reality, so it is deliberately not blown
   up to fill the column: a browser popup shown at 900px reads as a fake. */
.popup-shot {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
}

.popup-shot img {
    width: min(340px, 100%);
    border-radius: var(--r-card);
    border: 1px solid var(--line-strong);
    box-shadow: 0 30px 70px -30px rgba(0, 0, 0, 0.9), 0 0 70px -30px var(--accent-glow);
}

.popup-shot figcaption,
.settings-shot figcaption {
    color: var(--fg-faint);
    font-size: 0.82rem;
    text-align: center;
    max-width: 40ch;
}

.settings-shot {
    margin-top: clamp(32px, 4vw, 48px);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
}

.settings-shot img {
    width: min(420px, 100%);
    border-radius: var(--r-card);
    border: 1px solid var(--line);
}

.settings-shot figcaption { max-width: 52ch; }

/* --------------------------------------------------------------------------
   Capture modes
   -------------------------------------------------------------------------- */
.mode-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
}

.mode-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-top-color: var(--glass-border-top);
    border-radius: var(--r-card);
    padding: clamp(22px, 2.4vw, 30px);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

@media (prefers-reduced-transparency: reduce) {
    .mode-card { background: var(--ink-card); backdrop-filter: none; -webkit-backdrop-filter: none; }
}

.mode-card h3 { font-size: 1.15rem; }
.mode-card p { color: var(--fg-dim); margin-top: 10px; font-size: 0.95rem; }

.preset-list {
    list-style: none;
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid var(--line);
    font-family: var(--mono);
    font-size: 0.8rem;
    color: var(--fg-faint);
    letter-spacing: 0;
}

.preset-list li { padding: 3px 0; }

.shortcut-row {
    margin-top: 20px;
    color: var(--fg-dim);
    font-size: 0.92rem;
}

kbd {
    display: inline-block;
    font-family: var(--mono);
    font-size: 0.78rem;
    line-height: 1;
    padding: 4px 7px;
    margin: 0 1px;
    color: var(--fg);
    background: var(--ink-card);
    border: 1px solid var(--line-strong);
    border-bottom-width: 2px;
    border-radius: 5px;
}

/* --------------------------------------------------------------------------
   Install steps — numbered, because the order genuinely matters here
   -------------------------------------------------------------------------- */
.install-steps {
    list-style: none;
    counter-reset: step;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
}

.install-steps li {
    counter-increment: step;
    padding-top: 42px;
    position: relative;
}

.install-steps li::before {
    content: counter(step);
    position: absolute;
    top: 0;
    left: 0;
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--accent-soft);
    border: 1px solid var(--accent);
    color: var(--accent);
    font-family: var(--mono);
    font-size: 0.8rem;
}

.install-steps h3 { font-size: 1.02rem; }
.install-steps p { color: var(--fg-dim); margin-top: 8px; font-size: 0.92rem; }

.install-cta {
    margin-top: clamp(28px, 3vw, 40px);
    padding-top: 26px;
    border-top: 1px solid var(--line);
}

code {
    font-family: var(--mono);
    font-size: 0.86em;
    color: var(--fg);
    background: rgba(255, 255, 255, 0.06);
    border-radius: 5px;
    padding: 2px 6px;
    letter-spacing: 0;
}

/* --------------------------------------------------------------------------
   Permissions — a definition list, not a table: two of the five need a
   paragraph of explanation and a table would force them into one line.
   -------------------------------------------------------------------------- */
.perm-list { display: grid; gap: 2px; }

.perm-row {
    display: grid;
    grid-template-columns: 190px minmax(0, 1fr);
    gap: 24px;
    padding: 20px 0;
    border-top: 1px solid var(--line);
}

.perm-row:last-child { border-bottom: 1px solid var(--line); }

.perm-row dt {
    font-family: var(--mono);
    font-size: 0.88rem;
    color: var(--fg);
    letter-spacing: 0;
}

.perm-row dd { color: var(--fg-dim); font-size: 0.94rem; }

.perm-tag {
    display: inline-block;
    margin-left: 8px;
    padding: 2px 7px;
    border-radius: 5px;
    background: var(--accent-soft);
    color: var(--accent);
    font-family: var(--font);
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    vertical-align: 1px;
}

/* --------------------------------------------------------------------------
   Limits
   -------------------------------------------------------------------------- */
.limit-list { list-style: none; display: grid; gap: 14px; max-width: 78ch; }

.limit-list li {
    position: relative;
    padding-left: 22px;
    color: var(--fg-dim);
    font-size: 0.95rem;
}

.limit-list li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.62em;
    width: 8px;
    height: 1px;
    background: var(--fg-faint);
}

.limit-list strong { color: var(--fg); font-weight: 600; }

.closer-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

/* --------------------------------------------------------------------------
   Install guide dialog
   -------------------------------------------------------------------------- */
.guide {
    /* The UA stylesheet centres a modal dialog with `inset: 0; margin: auto`,
       but only while both are left alone. Setting an explicit width and
       max-height here is enough to knock it back into the top-left, so both
       are restated rather than relied on. */
    inset: 0;
    margin: auto;
    width: min(640px, calc(100vw - 32px));
    max-height: min(84vh, 780px);
    padding: 0;
    border: 1px solid var(--line-strong);
    border-radius: var(--r-card);
    background: var(--ink-raised);
    color: var(--fg);
    overflow: hidden;
}

.guide::backdrop {
    background: rgba(5, 6, 10, 0.72);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.guide-inner { display: flex; flex-direction: column; max-height: inherit; }

.guide-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 22px 24px 16px;
    border-bottom: 1px solid var(--line);
}

.guide-head h2 { font-size: 1.2rem; }

.guide-close {
    background: none;
    border: none;
    color: var(--fg-dim);
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: var(--r-btn);
}

.guide-close:hover { color: var(--fg); background: rgba(255, 255, 255, 0.06); }

.guide-body { padding: 22px 24px; overflow-y: auto; }

.guide-body h3 {
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--fg-faint);
    margin-top: 26px;
}

.guide-body h3:first-child { margin-top: 0; }

.guide-body ol { margin: 12px 0 0; padding-left: 20px; }

.guide-body li {
    color: var(--fg-dim);
    font-size: 0.93rem;
    margin-bottom: 9px;
    padding-left: 4px;
}

.guide-body li::marker { color: var(--accent); font-family: var(--mono); font-size: 0.85rem; }

.guide-body p { color: var(--fg-dim); font-size: 0.93rem; margin-top: 12px; }

.guide-body strong { color: var(--fg); font-weight: 600; }

.guide-foot {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 24px 20px;
    border-top: 1px solid var(--line);
    background: var(--ink);
}

/* --------------------------------------------------------------------------
   Scroll reveal for the blocks this page adds.
   :where() keeps this at zero specificity for the same reason home.css does:
   a plainly written `.install-steps li` (0,2,0) would outrank `.is-in`
   (0,1,0) and those elements would never come back.
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: no-preference) {
    .js-reveal :where(
        .mode-card,
        .shortcut-row,
        .install-steps li,
        .install-cta,
        .perm-row,
        .limit-list li,
        .closer-actions
    ) {
        opacity: 0;
        transform: translateY(16px);
    }
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 1000px) {
    .ext-hero { grid-template-columns: 1fr; }
    /* Copy first, popup screenshot second — the headline and the download
       button should be what you land on, not a screenshot of the popup. The
       single column follows DOM order, so this needs no `order` at all. */
    .perm-row { grid-template-columns: 1fr; gap: 8px; }
}

@media (max-width: 720px) {
    .guide { width: 100vw; max-width: 100vw; max-height: 92vh; border-radius: var(--r-card) var(--r-card) 0 0; }
    .guide-foot { flex-direction: column; align-items: stretch; }
    .guide-foot .btn { justify-content: center; }
}
