/* ==========================================================================
   guides.css - card-based guide index + guide navigation helpers
   Mobile-first. Reuses existing theme variables where available, with
   fallbacks so it works even if a variable name differs in your theme.css.
   Link this AFTER page.css, or paste its contents into page.css.
   ========================================================================== */

/* ---- Landing intro ------------------------------------------------------ */
.guide-intro {
    max-width: 44rem;
    margin: 0 auto 2.25rem;
}
.guide-intro .lede {
    margin: 0;
}

/* ---- Card grid ---------------------------------------------------------- */
.guide-cards {
    list-style: none;
    margin: 0 auto 2rem;
    padding: 0;
    max-width: 60rem;
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    counter-reset: none;
}

@media (min-width: 720px) {
    .guide-cards {
        grid-template-columns: repeat(3, 1fr);
        gap: 1.25rem;
    }
}

.guide-cards > li {
    display: flex;
}

/* ---- Individual card ---------------------------------------------------- */
.guide-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    width: 100%;
    padding: 1.35rem 1.35rem 1.5rem;
    border-radius: var(--radius, 16px);
    text-decoration: none;
    color: inherit;
    background: var(--surface, rgba(255, 255, 255, 0.03));
    border: 1px solid var(--border, rgba(255, 255, 255, 0.09));
    transition: transform 0.18s ease, border-color 0.18s ease,
    background 0.18s ease, box-shadow 0.18s ease;
    -webkit-tap-highlight-color: transparent;
}

.guide-card:hover,
.guide-card:focus-visible {
    transform: translateY(-3px);
    border-color: var(--accent, #8bbf5f);
    background: var(--surface-hover, rgba(139, 191, 95, 0.06));
    box-shadow: 0 12px 30px -18px rgba(0, 0, 0, 0.7);
    outline: none;
}

.guide-card:active {
    transform: translateY(-1px);
}

/* Top row: number + time estimate */
.guide-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.guide-card-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 999px;
    font-family: "Space Grotesk", system-ui, sans-serif;
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--bg, #0e0f0d);
    background: var(--accent, #8bbf5f);
    line-height: 1;
}

.guide-card-time {
    font-family: "JetBrains Mono", ui-monospace, monospace;
    font-size: 0.72rem;
    letter-spacing: 0.02em;
    color: var(--muted, #a8b69a);
    padding: 0.2rem 0.5rem;
    border: 1px solid var(--border, rgba(255, 255, 255, 0.12));
    border-radius: 999px;
}

.guide-card-icon {
    color: var(--accent, #8bbf5f);
    margin-top: 0.15rem;
}

.guide-card h2 {
    font-family: "Space Grotesk", system-ui, sans-serif;
    font-size: 1.18rem;
    line-height: 1.2;
    margin: 0.1rem 0 0;
}

.guide-card p {
    margin: 0;
    font-size: 0.92rem;
    line-height: 1.5;
    color: var(--muted, #a8b69a);
    flex: 1;
}

.guide-card-go {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin-top: 0.35rem;
    font-family: "Space Grotesk", system-ui, sans-serif;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--accent, #8bbf5f);
}
.guide-card-go svg {
    transition: transform 0.18s ease;
}
.guide-card:hover .guide-card-go svg,
.guide-card:focus-visible .guide-card-go svg {
    transform: translateX(3px);
}

/* ---- Index note spacing ------------------------------------------------- */
.guide-index-note {
    max-width: 60rem;
    margin: 0 auto 2rem;
}
.guide-index-note a {
    color: var(--accent, #8bbf5f);
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* ---- Breadcrumb back-link in hero --------------------------------------- */
.guide-crumb {
    display: inline-block;
    margin-bottom: 0.9rem;
    font-family: "JetBrains Mono", ui-monospace, monospace;
    font-size: 0.78rem;
    letter-spacing: 0.02em;
    color: var(--muted, #a8b69a);
    text-decoration: none;
    transition: color 0.15s ease;
}
.guide-crumb:hover {
    color: var(--accent, #8bbf5f);
}

/* ---- "Next step" CTA at the end of each guide --------------------------- */
.guide-next-cta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 0.5rem;
    padding: 1.1rem 1.3rem;
    border-radius: var(--radius, 16px);
    text-decoration: none;
    color: inherit;
    background: var(--surface, rgba(255, 255, 255, 0.03));
    border: 1px solid var(--border, rgba(255, 255, 255, 0.09));
    transition: transform 0.18s ease, border-color 0.18s ease,
    background 0.18s ease;
}
.guide-next-cta:hover,
.guide-next-cta:focus-visible {
    transform: translateY(-2px);
    border-color: var(--accent, #8bbf5f);
    background: var(--surface-hover, rgba(139, 191, 95, 0.06));
    outline: none;
}
.guide-next-label {
    display: block;
    font-family: "JetBrains Mono", ui-monospace, monospace;
    font-size: 0.72rem;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: var(--muted, #a8b69a);
    margin-bottom: 0.2rem;
}
.guide-next-title {
    display: block;
    font-family: "Space Grotesk", system-ui, sans-serif;
    font-weight: 600;
    font-size: 1.02rem;
    line-height: 1.25;
}
.guide-next-cta > svg {
    flex: none;
    color: var(--accent, #8bbf5f);
    transition: transform 0.18s ease;
}
.guide-next-cta:hover > svg,
.guide-next-cta:focus-visible > svg {
    transform: translateX(4px);
}

/* ==========================================================================
   Tabs - used in Guide 1 for the with/without DeviceAuth compose routes.
   One panel is always visible; JS (main.js) toggles aria-selected + hidden.
   Falls back gracefully: with no JS, the first panel stays shown.
   ========================================================================== */
.tabs {
    margin: 1.1rem 0 1.25rem;
}

.tab-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 0.85rem;
}

.tab-btn {
    flex: 1 1 auto;
    min-width: max-content;
    padding: 0.6rem 0.95rem;
    border-radius: 999px;
    border: 1px solid var(--border, rgba(255, 255, 255, 0.12));
    background: var(--surface, rgba(255, 255, 255, 0.03));
    color: var(--muted, #a8b69a);
    font-family: "Space Grotesk", system-ui, sans-serif;
    font-weight: 600;
    font-size: 0.86rem;
    line-height: 1.1;
    cursor: pointer;
    transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
    -webkit-tap-highlight-color: transparent;
}

.tab-btn:hover {
    color: var(--text, #eaf0e4);
    border-color: var(--accent, #8bbf5f);
}

.tab-btn[aria-selected="true"] {
    color: var(--bg, #0e0f0d);
    background: var(--accent, #8bbf5f);
    border-color: var(--accent, #8bbf5f);
}

.tab-btn:focus-visible {
    outline: 2px solid var(--accent, #8bbf5f);
    outline-offset: 2px;
}

.tab-panel[hidden] {
    display: none;
}

.tab-lead {
    margin: 0 0 0.75rem;
    font-size: 0.92rem;
    line-height: 1.5;
    color: var(--muted, #a8b69a);
}
.tab-lead a {
    color: var(--accent, #8bbf5f);
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* ==========================================================================
   Screenshots - state figures (icon + modal pairs) and standalone shots.
   CSS enforces consistent sizing so slightly-mismatched source files still
   render uniformly. Drop images in assets/screens/ at roughly the same
   aspect ratio and these rules handle the rest.
   ========================================================================== */

/* A labelled state block: colored status dot + heading, then the figure. */
.state-block {
    margin: 1.5rem 0;
    padding: 1.15rem 1.25rem 1.35rem;
    border-radius: var(--radius, 12px);
    border: 1px solid var(--hair, #2a3320);
    background: var(--ink-2, #121710);
}
.state-block + .state-block {
    margin-top: 1rem;
}

.state-head {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.35rem;
}
.state-dot {
    width: 0.7rem;
    height: 0.7rem;
    border-radius: 50%;
    flex: none;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.04);
}
.state-dot.red    { background: #c53132; }
.state-dot.yellow { background: #d8a24a; }
.state-dot.green  { background: #8bbf5f; }

.state-head h3 {
    font-family: var(--font-display, "Space Grotesk", sans-serif);
    font-weight: 600;
    font-size: 1.05rem;
    letter-spacing: -0.01em;
    margin: 0;
    color: var(--paper, #eef3e6);
}
.state-block > p {
    color: var(--paper-dim, #a8b69a);
    font-size: 0.95rem;
    margin: 0.35rem 0 0.9rem;
}

/* Icon + modal pair: small icon left, larger modal right. Stacks on mobile. */
.state-figs {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
    margin: 0;
}
@media (min-width: 620px) {
    .state-figs {
        grid-template-columns: 92px 1fr;
        align-items: start;
        gap: 1rem;
    }
}

.state-figs figure {
    margin: 0;
}
.state-figs figcaption {
    font-family: var(--font-mono, monospace);
    font-size: 0.72rem;
    letter-spacing: 0.02em;
    color: var(--paper-dim, #a8b69a);
    margin-top: 0.4rem;
    text-align: center;
}

/* Shared frame around every screenshot for a consistent look. */
.shot {
    display: block;
    width: 100%;
    border-radius: 8px;
    border: 1px solid var(--hair, #2a3320);
    background: #0a0d07;
    box-shadow: 0 12px 30px -20px #000;
}

/* The icon shot: small, roughly square, scaled uniformly regardless of
   the source file's exact pixel dimensions. */
.shot-icon {
    width: 100%;
    max-width: 92px;
    aspect-ratio: 1 / 1;
    object-fit: contain;
    padding: 8px;
}
@media (max-width: 619px) {
    .shot-icon {
        max-width: 76px;
        margin: 0 auto;
    }
}

/* The modal shot: whole image scaled to fit, never cropped. Capped height
   keeps rows even; click to open the full-size lightbox. */
.shot-modal {
    max-height: 260px;
    object-fit: contain;
    object-position: center;
    padding: 8px;
    cursor: zoom-in;
}

/* Standalone wide screenshot (e.g. the logs/console shot). */
.shot-wide {
    max-height: 420px;
    object-fit: contain;
    object-position: top center;
    padding: 8px;
    margin: 1rem 0 0.5rem;
    cursor: zoom-in;
}
.shot-wide-caption {
    font-family: var(--font-mono, monospace);
    font-size: 0.72rem;
    color: var(--paper-dim, #a8b69a);
    margin: 0 0 1rem;
}

/* Any zoomable screenshot gets a subtle hover cue. */
.shot-modal:hover,
.shot-wide:hover {
    border-color: var(--toad-deep, #3d5a28);
}

/* ---- Lightbox overlay --------------------------------------------------- */
.lightbox {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 4vmin;
    background: rgba(6, 8, 5, 0.82);
    backdrop-filter: blur(4px);
    cursor: zoom-out;
}
.lightbox.open {
    display: flex;
}
.lightbox img {
    max-width: 96vw;
    max-height: 92vh;
    border-radius: 10px;
    border: 1px solid var(--hair, #2a3320);
    box-shadow: 0 30px 80px -30px #000;
    background: #0a0d07;
}
.lightbox-close {
    position: absolute;
    top: max(1rem, 3vmin);
    right: max(1rem, 3vmin);
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 1px solid var(--hair, #2a3320);
    background: var(--ink-2, #121710);
    color: var(--paper, #eef3e6);
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
    transition: border-color 0.15s ease, color 0.15s ease;
}
.lightbox-close:hover {
    border-color: var(--toad, #699445);
    color: var(--toad-bright, #8bbf5f);
}
@media (prefers-reduced-motion: reduce) {
    .lightbox { backdrop-filter: none; }
}

/* ==========================================================================
   Screenshot row - a set of app screens shown side by side (e.g. the
   in-headset pairing flow). Stacks on mobile, evens out with contain.
   ========================================================================== */
.shot-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.85rem;
    margin: 1.25rem 0 0.5rem;
}
@media (min-width: 620px) {
    .shot-row.cols-3 { grid-template-columns: repeat(3, 1fr); }
    .shot-row.cols-2 { grid-template-columns: repeat(2, 1fr); }
}
.shot-row figure { margin: 0; }
.shot-row figcaption {
    font-family: var(--font-mono, monospace);
    font-size: 0.72rem;
    letter-spacing: 0.02em;
    color: var(--paper-dim, #a8b69a);
    margin-top: 0.4rem;
    text-align: center;
}

/* App-screen shot: portrait-friendly, whole image, click to enlarge. */
.shot-screen {
    max-height: 300px;
    object-fit: contain;
    object-position: center;
    padding: 8px;
    cursor: zoom-in;
}
.shot-screen:hover { border-color: var(--toad-deep, #3d5a28); }