/*
 * Headshot Generator — page styles.
 *
 * Namespace: .hg-* (HeadshotGenerator)
 * Solid --rw-accent CTAs. No gradients. No purple. No `dark:`
 * Tailwind variants — the site themes via CSS variables. Same
 * visual register as the other tool pages in the suite.
 *
 * State machine on <main data-state>:
 *   form     — uploader + scene picker + Generate
 *   loading  — three-stage card while OpenAI churns
 *   result   — variant grid with download buttons
 */

.hg-page { min-height: 60vh; }

/* ─── Hero ────────────────────────────────────────────────────── */

.hg-hero {
    padding: clamp(2.5rem, 6vw, 5rem) 0 clamp(1.25rem, 4vw, 2rem);
    text-align: center;
    background-color: var(--rw-bg);
}

.hg-eyebrow {
    display: inline-block;
    color: var(--rw-accent);
    font-weight: 700;
    letter-spacing: 0.12em;
}

.hg-hero-title {
    font-family: 'Inter Tight', Inter, system-ui, sans-serif;
    font-weight: 800;
    font-size: clamp(2rem, 5vw, 3.4rem);
    line-height: 1.05;
    letter-spacing: -0.02em;
    margin: 1rem auto 1.25rem;
    max-width: 22ch;
    color: var(--rw-text);
}

.hg-hero-sub {
    margin: 0 auto 0.5rem;
    max-width: 40rem;
    color: var(--rw-text-muted);
    font-size: clamp(1rem, 1.2vw, 1.1rem);
    line-height: 1.6;
}

/* ─── Buttons ─────────────────────────────────────────────────── */

.hg-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 1.75rem;
    border: 0;
    border-radius: 0.5rem;
    font-family: inherit;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    text-decoration: none;
    line-height: 1.2;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}

.hg-btn-primary {
    background-color: var(--rw-accent);
    color: var(--rw-white, #ffffff);
    box-shadow: 0 1px 3px rgba(13, 95, 63, 0.15);
}

.hg-btn-primary:hover:not(:disabled) {
    background-color: var(--rw-accent-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(13, 95, 63, 0.25);
    color: var(--rw-white, #ffffff);
}

.hg-btn-primary:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    box-shadow: none;
}

.hg-btn-secondary {
    background-color: transparent;
    border: 1px solid var(--rw-border);
    color: var(--rw-text);
}

.hg-btn-secondary:hover:not(:disabled) {
    border-color: var(--rw-accent);
    color: var(--rw-accent);
}

.hg-btn-tertiary {
    background-color: transparent;
    color: var(--rw-text-muted);
    padding: 0.7rem 1rem;
    font-weight: 500;
}

.hg-btn-tertiary:hover:not(:disabled) {
    color: rgb(220, 38, 38);
}

.hg-btn-lg { padding: 1rem 2rem; font-size: 1.05rem; }
.hg-btn-sm { padding: 0.5rem 0.85rem; font-size: 0.85rem; }

.hg-btn-arrow { transition: transform 0.15s ease; }
.hg-btn:hover:not(:disabled) .hg-btn-arrow { transform: translateX(3px); }

.hg-link { color: var(--rw-accent); text-decoration: underline; text-underline-offset: 2px; }

/* ─── State machine selectors ─────────────────────────────────── */

.hg-page[data-state="form"] .hg-loading,
.hg-page[data-state="form"] .hg-result,
.hg-page[data-state="loading"] .hg-form-state,
.hg-page[data-state="loading"] .hg-result,
.hg-page[data-state="result"] .hg-form-state,
.hg-page[data-state="result"] .hg-loading {
    display: none;
}

/* ─── Sections / step headings ────────────────────────────────── */

.hg-section {
    padding: clamp(1.5rem, 4vw, 2.5rem) 0;
}

.hg-section-eyebrow {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--rw-accent);
    letter-spacing: 0.12em;
}

.hg-section-title {
    margin: 0.4rem 0 1rem;
    font-family: 'Inter Tight', Inter, sans-serif;
    font-size: clamp(1.3rem, 2.4vw, 1.7rem);
    font-weight: 800;
    color: var(--rw-text);
    letter-spacing: -0.01em;
    line-height: 1.25;
}

.hg-step {
    border: 0;
    padding: 0;
    margin: 0 0 2rem;
}

.hg-step-legend {
    padding: 0;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.55rem;
}

.hg-step-num {
    display: inline-block;
    padding: 0.15rem 0.55rem;
    background-color: var(--rw-accent);
    color: var(--rw-white, #ffffff);
    border-radius: 0.4rem;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.05em;
}

.hg-step-label {
    font-size: 1.02rem;
    font-weight: 700;
    color: var(--rw-text);
}

.hg-step-help {
    margin: 0 0 0.85rem;
    color: var(--rw-text-muted);
    font-size: 0.92rem;
    line-height: 1.5;
}

/* ─── Dropzone ────────────────────────────────────────────────── */

.hg-dropzone {
    display: block;
    cursor: pointer;
    padding: 1.5rem;
    border: 2px dashed var(--rw-border);
    border-radius: 1rem;
    background-color: var(--rw-card-bg);
    transition: border-color 0.15s ease, background-color 0.15s ease;
}

.hg-dropzone:hover,
.hg-dropzone--drag {
    border-color: var(--rw-accent);
    background-color: rgba(13, 95, 63, 0.04);
}

.hg-dropzone-empty {
    text-align: center;
    padding: 1.5rem 1rem;
}

.hg-dropzone-icon {
    width: 4rem;
    height: 4rem;
    margin: 0 auto 1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: var(--rw-bg);
    border: 1px solid var(--rw-border);
    border-radius: 50%;
    color: var(--rw-accent);
}

.hg-dropzone-title {
    margin: 0 0 0.4rem;
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--rw-text);
}

.hg-dropzone-sub {
    margin: 0;
    font-size: 0.88rem;
    color: var(--rw-text-muted);
}

.hg-preview-grid {
    display: grid;
    gap: 0.75rem;
    grid-template-columns: repeat(auto-fill, minmax(8rem, 1fr));
}

.hg-preview-tile {
    position: relative;
    aspect-ratio: 4 / 5;
    border-radius: 0.75rem;
    overflow: hidden;
    background-color: var(--rw-bg);
    border: 1px solid var(--rw-border);
}

.hg-preview-tile img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.hg-preview-remove {
    position: absolute;
    top: 0.4rem;
    right: 0.4rem;
    width: 1.65rem;
    height: 1.65rem;
    border-radius: 50%;
    border: 0;
    background-color: rgba(0, 0, 0, 0.65);
    color: #ffffff;
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.15s ease;
}

.hg-preview-remove:hover {
    background-color: rgb(220, 38, 38);
}

/* ─── Quality strip ───────────────────────────────────────────── */

.hg-quality {
    margin-top: 1rem;
    padding: 0.85rem 1rem;
    background-color: var(--rw-bg);
    border: 1px solid var(--rw-border);
    border-radius: 0.6rem;
}

.hg-quality-list {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.hg-quality-item {
    position: relative;
    padding-left: 1.25rem;
    font-size: 0.88rem;
    line-height: 1.5;
    color: var(--rw-text);
}

.hg-quality-item::before {
    position: absolute;
    left: 0;
    top: 0.05rem;
    font-weight: 700;
}

.hg-quality-item--good { color: var(--rw-text); }
.hg-quality-item--good::before { content: "✓"; color: var(--rw-accent); }
.hg-quality-item--info::before { content: "·"; color: var(--rw-text-muted); }
.hg-quality-item--warn::before { content: "!"; color: rgb(202, 138, 4); }

/* ─── Scene picker ────────────────────────────────────────────── */

.hg-scene-grid {
    display: grid;
    gap: 0.85rem;
    grid-template-columns: 1fr;
}

@media (min-width: 720px) {
    .hg-scene-grid { grid-template-columns: repeat(3, 1fr); }
}

.hg-scene-card {
    display: block;
    cursor: pointer;
    padding: 1.1rem 1.15rem;
    background-color: var(--rw-card-bg);
    border: 1px solid var(--rw-border);
    border-radius: 0.85rem;
    transition: border-color 0.15s ease, background-color 0.15s ease, transform 0.15s ease;
}

.hg-scene-card input { position: absolute; opacity: 0; pointer-events: none; }

.hg-scene-card:hover {
    border-color: var(--rw-accent);
    transform: translateY(-1px);
}

.hg-scene-card--selected {
    border-color: var(--rw-accent);
    background-color: rgba(13, 95, 63, 0.06);
}

.hg-scene-card-title {
    display: block;
    font-size: 1rem;
    font-weight: 700;
    color: var(--rw-text);
    margin-bottom: 0.35rem;
}

.hg-scene-card-blurb {
    display: block;
    font-size: 0.88rem;
    color: var(--rw-text-muted);
    line-height: 1.5;
    margin-bottom: 0.75rem;
}

.hg-scene-card-variants {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.hg-scene-card-variants li {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.18rem 0.55rem;
    background-color: var(--rw-bg);
    border: 1px solid var(--rw-border);
    border-radius: 0.4rem;
    color: var(--rw-text-muted);
}

.hg-scene-card--selected .hg-scene-card-variants li {
    border-color: var(--rw-accent);
    color: var(--rw-accent);
}

/* ─── Submit row ──────────────────────────────────────────────── */

.hg-submit-row {
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--rw-border);
}

.hg-error {
    margin-bottom: 1rem;
    padding: 0.75rem 1rem;
    background-color: rgba(220, 38, 38, 0.08);
    border: 1px solid rgba(220, 38, 38, 0.3);
    border-radius: 0.5rem;
    color: var(--rw-text);
    font-size: 0.92rem;
}

.hg-submit-hint {
    margin: 0.7rem 0 0;
    font-size: 0.85rem;
    color: var(--rw-text-muted);
}

/* ─── History rail ────────────────────────────────────────────── */

.hg-history {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--rw-border);
}

.hg-history-head { margin-bottom: 1rem; }

.hg-history-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

.hg-history-link {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.65rem 0.85rem;
    background-color: var(--rw-card-bg);
    border: 1px solid var(--rw-border);
    border-radius: 0.6rem;
    text-decoration: none;
    transition: border-color 0.15s ease, transform 0.15s ease;
}

.hg-history-link:hover {
    border-color: var(--rw-accent);
    transform: translateX(2px);
}

.hg-history-thumb {
    width: 3rem;
    height: 3rem;
    border-radius: 0.5rem;
    object-fit: cover;
    flex-shrink: 0;
    background-color: var(--rw-bg);
    border: 1px solid var(--rw-border);
}

.hg-history-thumb--empty {
    display: inline-block;
}

.hg-history-meta {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.hg-history-pkg {
    font-weight: 600;
    color: var(--rw-text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hg-history-detail {
    font-size: 0.82rem;
    color: var(--rw-text-muted);
}

.hg-history-cta {
    color: var(--rw-text-muted);
    font-size: 1.1rem;
    flex-shrink: 0;
}

/* ─── Loading state ───────────────────────────────────────────── */

.hg-loading {
    padding: clamp(3rem, 8vw, 5rem) 0;
    background-color: var(--rw-bg);
}

.hg-loading-card {
    padding: clamp(1.5rem, 4vw, 2.5rem);
    background-color: var(--rw-card-bg);
    border: 1px solid var(--rw-border);
    border-radius: 1rem;
    text-align: center;
}

.hg-stages {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    align-items: flex-start;
    max-width: 24rem;
    margin: 0 auto 1.25rem;
    text-align: left;
}

.hg-stage {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    color: var(--rw-text-muted);
    font-size: 0.95rem;
    transition: color 0.2s ease;
}

.hg-stage-dot {
    width: 0.7rem;
    height: 0.7rem;
    border-radius: 50%;
    background-color: var(--rw-border);
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.hg-stage--active {
    color: var(--rw-text);
    font-weight: 600;
}

.hg-stage--active .hg-stage-dot {
    background-color: var(--rw-accent);
    animation: hgStagePulse 1.2s ease-in-out infinite;
}

.hg-stage--done { color: var(--rw-text-muted); }
.hg-stage--done .hg-stage-dot { background-color: var(--rw-accent); opacity: 0.6; }

@keyframes hgStagePulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.4); }
}

.hg-loading-note {
    margin: 0;
    font-size: 0.85rem;
    color: var(--rw-text-muted);
}

/* ─── Result ─────────────────────────────────────────────────── */

.hg-result {
    padding: clamp(1.5rem, 4vw, 2.5rem) 0 clamp(2.5rem, 6vw, 4rem);
    background-color: var(--rw-bg);
}

.hg-result-page .hg-result-header {
    padding: clamp(2rem, 5vw, 3rem) 0 1rem;
    background-color: var(--rw-bg);
    border-bottom: 1px solid var(--rw-border);
}

.hg-result-page .hg-result-body {
    padding: clamp(2rem, 5vw, 3rem) 0 clamp(3rem, 6vw, 5rem);
    background-color: var(--rw-bg);
}

.hg-back-link {
    display: inline-block;
    margin-bottom: 1rem;
    color: var(--rw-text-muted);
    font-size: 0.9rem;
    text-decoration: none;
    transition: color 0.15s ease;
}

.hg-back-link:hover { color: var(--rw-accent); }

.hg-result-head { margin-bottom: 1.5rem; }

.hg-result-title {
    margin: 0 0 0.5rem;
    font-family: 'Inter Tight', Inter, sans-serif;
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 800;
    color: var(--rw-text);
    letter-spacing: -0.01em;
}

.hg-result-sub,
.hg-result-meta {
    margin: 0;
    color: var(--rw-text-muted);
    font-size: 0.95rem;
    line-height: 1.55;
}

.hg-variant-grid {
    display: grid;
    gap: 1.25rem;
    grid-template-columns: 1fr;
}

@media (min-width: 720px) {
    .hg-variant-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1100px) {
    .hg-variant-grid { grid-template-columns: repeat(3, 1fr); }
}

.hg-variant-card {
    background-color: var(--rw-card-bg);
    border: 1px solid var(--rw-border);
    border-radius: 0.85rem;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.hg-variant-figure {
    margin: 0;
    aspect-ratio: 4 / 5;
    background-color: var(--rw-bg);
    overflow: hidden;
}

.hg-variant-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.hg-variant-body {
    padding: 1rem 1.1rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.hg-variant-title {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--rw-text);
}

.hg-variant-blurb {
    margin: 0 0 0.5rem;
    font-size: 0.88rem;
    color: var(--rw-text-muted);
    line-height: 1.55;
}

.hg-variant-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin-top: auto;
}

.hg-variant-actions .hg-btn { flex: 1; min-width: 0; justify-content: center; }

.hg-result-footer {
    margin-top: 2rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: space-between;
    align-items: center;
    padding-top: 1.5rem;
    border-top: 1px solid var(--rw-border);
}

/* Set-as-profile-picture button — sits below the download row on
   each variant card. Tertiary tone so it doesn't compete with the
   primary download CTAs visually. */
.hg-btn-avatar {
    width: 100%;
    margin-top: 0.5rem;
    justify-content: center;
}

.hg-btn-avatar:not(:disabled):hover {
    color: var(--rw-accent);
}

/* Soft nudge on legacy single-variant result pages — pre-multi-
   variant generations. Same visual register as a standard card,
   slightly desaturated to read as advisory rather than alarming. */
.hg-legacy-banner {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.85rem 1.1rem;
    background-color: var(--rw-bg);
    border: 1px solid var(--rw-border);
    border-radius: 0.6rem;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}

.hg-legacy-banner > div { flex: 1; min-width: 16rem; }

.hg-legacy-banner-title {
    display: block;
    font-weight: 700;
    color: var(--rw-text);
    font-size: 0.95rem;
}

.hg-legacy-banner-sub {
    margin: 0.2rem 0 0;
    color: var(--rw-text-muted);
    font-size: 0.85rem;
    line-height: 1.5;
}

/* Toast — shared across the result panel for avatar set
   success/failure. Slides up from the bottom-center. */
.hg-toast {
    position: fixed;
    left: 50%;
    bottom: 1.5rem;
    transform: translateX(-50%);
    background-color: var(--rw-text, #0f172a);
    color: var(--rw-card-bg, #ffffff);
    padding: 0.75rem 1.25rem;
    border-radius: 0.5rem;
    font-size: 0.9rem;
    font-weight: 600;
    box-shadow: 0 8px 24px -8px rgba(0, 0, 0, 0.3);
    z-index: 9999;
    max-width: 90%;
    text-align: center;
    animation: hgToastIn 0.18s ease-out;
}

.hg-toast[hidden] { display: none; }

@keyframes hgToastIn {
    from { opacity: 0; transform: translate(-50%, 8px); }
    to   { opacity: 1; transform: translate(-50%, 0); }
}

/* Anon landing — how-it-works grid + CTA row */
.hg-landing-grid{display:grid;grid-template-columns:1fr;gap:1rem;margin-bottom:2rem}
@media (min-width:720px){.hg-landing-grid{grid-template-columns:repeat(3,1fr)}}
.hg-landing-tile{background:var(--rw-card-bg,#fff);border:1px solid var(--rw-border,#e5e7eb);border-radius:1rem;padding:1.5rem}
.dark .hg-landing-tile{border-color:#374151}
.hg-landing-num{display:inline-block;font-family:'Inter Tight','Inter',sans-serif;font-size:1.75rem;font-weight:800;color:var(--rw-accent,#0D5F3F);letter-spacing:-0.04em;margin-bottom:0.5rem}
.hg-landing-title{font-size:1.05rem;font-weight:700;margin:0 0 0.4rem;color:var(--rw-text,#0a0a0a)}
.hg-landing-desc{font-size:0.92rem;color:var(--rw-muted,#6b6b6b);line-height:1.5;margin:0}
.hg-landing-cta-row{display:flex;flex-wrap:wrap;align-items:center;gap:1rem 1.5rem;justify-content:center;margin-top:0.5rem}

/* ─── Anon showcase ────────────────────────────────────────────────
 * Four persuasive sections stacked above the how-it-works grid:
 *   1. Identity-preservation strip — same person, three packages.
 *   2. Before/after sliders        — selfie input → AI output.
 *   3. Scene gallery + lightbox    — bento grid of 9 variant styles.
 *   4. Crop-size proof             — one shot, three surface sizes.
 *
 * Namespace: .hg-showcase-* / .hg-compare-* / .hg-lightbox-* /
 *            .hg-cropproof-*. Theme-aware via --rw-* variables.
 * ──────────────────────────────────────────────────────────────── */

.hg-showcase {
    padding: clamp(2rem, 5vw, 4rem) 0;
}

.hg-showcase + .hg-showcase {
    padding-top: 0;
}

.hg-showcase-head {
    text-align: center;
    margin-bottom: clamp(1.25rem, 3vw, 2rem);
}

.hg-showcase-head .hg-section-eyebrow {
    font-size: 0.72rem;
}

.hg-showcase-title {
    font-family: 'Inter Tight', Inter, system-ui, sans-serif;
    font-weight: 800;
    font-size: clamp(1.5rem, 3.2vw, 2.25rem);
    line-height: 1.15;
    letter-spacing: -0.02em;
    color: var(--rw-text);
    margin: 0.4rem 0 0.5rem;
}

.hg-showcase-sub {
    color: var(--rw-text-muted, var(--rw-muted));
    font-size: clamp(0.95rem, 1.1vw, 1.05rem);
    line-height: 1.55;
    margin: 0 auto;
    max-width: 38rem;
}

/* ─── 1. Identity-preservation strip ─────────────────────────── */

.hg-showcase-identity {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.hg-identity-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 0.75rem;
    align-items: stretch;
}

.hg-identity-row::before {
    content: attr(data-subject);
    grid-column: 1 / -1;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--rw-accent);
    margin-bottom: 0.1rem;
}

.hg-identity-tile {
    position: relative;
    aspect-ratio: 4 / 5;
    overflow: hidden;
    border-radius: 0.85rem;
    border: 1px solid var(--rw-border);
    background-color: var(--rw-card-bg);
    box-shadow: var(--rw-shadow-sm);
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.hg-identity-tile img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}

.hg-identity-tile:hover { transform: translateY(-2px); box-shadow: var(--rw-shadow-md); }
.hg-identity-tile:hover img { transform: scale(1.03); }

.hg-identity-tile-label {
    position: absolute;
    left: 0.6rem;
    bottom: 0.6rem;
    padding: 0.25rem 0.55rem;
    background-color: rgba(0, 0, 0, 0.55);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    border-radius: 0.35rem;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

@media (max-width: 640px) {
    .hg-identity-row { gap: 0.5rem; }
    .hg-identity-tile-label { font-size: 0.62rem; padding: 0.2rem 0.4rem; }
}

/* ─── 2. Before/after compare sliders ────────────────────────── */

.hg-compare-rail {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.25rem;
}

@media (min-width: 720px) {
    .hg-compare-rail { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1024px) {
    .hg-compare-rail { grid-template-columns: repeat(3, 1fr); }
}

.hg-compare {
    --compare-pos: 50%;
    position: relative;
    aspect-ratio: 4 / 5;
    overflow: hidden;
    border-radius: 1rem;
    border: 1px solid var(--rw-border);
    box-shadow: var(--rw-shadow-md);
    background-color: var(--rw-card-bg);
    cursor: ew-resize;
    user-select: none;
    -webkit-user-select: none;
    touch-action: none;
}

.hg-compare-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none;
}

/* The BEFORE layer is clipped from the right edge so dragging
   left reveals more of the AI output behind it. */
.hg-compare-img--before {
    z-index: 2;
    clip-path: inset(0 calc(100% - var(--compare-pos)) 0 0);
}

.hg-compare-handle {
    position: absolute;
    top: 0;
    bottom: 0;
    left: var(--compare-pos);
    width: 2px;
    background-color: rgba(255, 255, 255, 0.92);
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.15), 0 4px 16px rgba(0, 0, 0, 0.25);
    z-index: 3;
    transform: translateX(-1px);
    cursor: ew-resize;
    outline: none;
}

.hg-compare-handle::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 2.4rem;
    height: 2.4rem;
    border-radius: 50%;
    background-color: #fff;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.hg-compare-handle::before {
    content: '⟷';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1;
    color: var(--rw-text);
    font-size: 1rem;
    font-weight: 700;
    line-height: 1;
}

.hg-compare-handle:focus-visible::after {
    box-shadow: 0 0 0 3px var(--rw-accent), 0 4px 16px rgba(0, 0, 0, 0.3);
}

.hg-compare-pill {
    position: absolute;
    top: 0.75rem;
    padding: 0.25rem 0.6rem;
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    border-radius: 0.35rem;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 4;
}

.hg-compare-pill--before {
    left: 0.75rem;
    background-color: rgba(0, 0, 0, 0.55);
    color: #fff;
}

.hg-compare-pill--after {
    right: 0.75rem;
    background-color: var(--rw-accent);
    color: #fff;
}

/* ─── 3. Scene gallery (bento) ───────────────────────────────── */

.hg-showcase-gallery {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}

@media (min-width: 720px) {
    .hg-showcase-gallery {
        grid-template-columns: repeat(4, 1fr);
        grid-auto-rows: 12rem;
        gap: 0.85rem;
    }
    /* Bento: tile-1 spans 2×2 (hero), the rest are 1×1. */
    .hg-showcase-gallery > .hg-showcase-tile:nth-child(1) {
        grid-column: span 2;
        grid-row: span 2;
    }
}

@media (min-width: 1024px) {
    .hg-showcase-gallery { grid-auto-rows: 13rem; }
}

.hg-showcase-tile {
    position: relative;
    overflow: hidden;
    border-radius: 0.85rem;
    border: 1px solid var(--rw-border);
    background-color: var(--rw-card-bg);
    box-shadow: var(--rw-shadow-sm);
    cursor: zoom-in;
    aspect-ratio: 4 / 5;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

@media (min-width: 720px) {
    /* Inside the bento at >720px the tiles fill their grid cell —
       drop the aspect-ratio constraint so the hero tile can be
       wider than tall. */
    .hg-showcase-tile { aspect-ratio: auto; }
}

.hg-showcase-tile img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.5s ease;
}

.hg-showcase-tile:hover {
    transform: translateY(-2px);
    box-shadow: var(--rw-shadow-md);
}

.hg-showcase-tile:hover img,
.hg-showcase-tile:focus-visible img { transform: scale(1.05); }

.hg-showcase-tile:focus-visible {
    outline: 2px solid var(--rw-accent);
    outline-offset: 3px;
}

.hg-showcase-tile-overlay {
    position: absolute;
    inset: auto 0 0 0;
    padding: 1.5rem 0.85rem 0.7rem;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0));
    color: #fff;
    pointer-events: none;
}

.hg-showcase-tile-pkg {
    display: block;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    opacity: 0.85;
}

.hg-showcase-tile-variant {
    display: block;
    font-size: 0.95rem;
    font-weight: 700;
    margin-top: 0.1rem;
}

/* ─── Lightbox (native <dialog>) ─────────────────────────────── */

.hg-lightbox {
    border: 0;
    padding: 0;
    background-color: transparent;
    color: #fff;
    max-width: min(92vw, 64rem);
    max-height: 92vh;
    overflow: visible;
}

.hg-lightbox::backdrop {
    background-color: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.hg-lightbox-figure {
    margin: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.85rem;
}

.hg-lightbox-img {
    max-width: 100%;
    max-height: 80vh;
    border-radius: 0.85rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    background-color: #000;
}

.hg-lightbox-caption {
    color: rgba(255, 255, 255, 0.92);
    font-size: 0.95rem;
    font-weight: 600;
    text-align: center;
    letter-spacing: 0.02em;
}

.hg-lightbox-close,
.hg-lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 2.5rem;
    height: 2.5rem;
    border: 0;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.12);
    color: #fff;
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
    transition: background-color 0.15s ease, transform 0.15s ease;
}

.hg-lightbox-close:hover,
.hg-lightbox-nav:hover {
    background-color: rgba(255, 255, 255, 0.25);
}

.hg-lightbox-close {
    top: -1.5rem;
    right: -1.5rem;
    transform: none;
    font-size: 1.6rem;
}

.hg-lightbox-prev { left: -3.5rem; }
.hg-lightbox-next { right: -3.5rem; }

@media (max-width: 720px) {
    .hg-lightbox-close { top: 0.5rem; right: 0.5rem; }
    .hg-lightbox-prev  { left: 0.5rem; }
    .hg-lightbox-next  { right: 0.5rem; }
}

/* ─── 4. Crop-size proof ─────────────────────────────────────── */

.hg-cropproof {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: center;
    gap: 1.25rem;
}

.hg-cropproof-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.6rem;
}

.hg-cropproof-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.3rem 0.7rem;
    background-color: var(--rw-accent-light);
    color: var(--rw-accent);
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
}

.hg-cropproof-badge-dim {
    color: var(--rw-text-muted, var(--rw-muted));
    font-weight: 500;
    letter-spacing: 0;
}

.hg-cropproof-frame {
    background-color: var(--rw-card-bg);
    border: 1px solid var(--rw-border);
    border-radius: 0.6rem;
    overflow: hidden;
    box-shadow: var(--rw-shadow-md);
}

.hg-cropproof-frame img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Real proportional sizes — capped so the largest fits comfortably
   on a phone too. The square / portrait / portrait-tall hierarchy
   is the whole point of the section: scale the linkedin/resume
   frames RELATIVE to master so the size story reads visually. */
.hg-cropproof-frame--linkedin { width: 7rem; aspect-ratio: 1 / 1; }
.hg-cropproof-frame--resume   { width: 8rem; aspect-ratio: 4 / 5; }
.hg-cropproof-frame--master   { width: 11rem; aspect-ratio: 4 / 5; }

@media (min-width: 720px) {
    .hg-cropproof-frame--linkedin { width: 9rem; }
    .hg-cropproof-frame--resume   { width: 11rem; }
    .hg-cropproof-frame--master   { width: 15rem; }
}

.hg-cropproof-foot {
    width: 100%;
    text-align: center;
    margin-top: 1rem;
    color: var(--rw-text-muted, var(--rw-muted));
    font-size: 0.92rem;
}

.hg-cropproof-foot strong {
    color: var(--rw-accent);
    font-weight: 700;
}

/* ─── FAQ accordion (native <details>) ───────────────────────── */

.hg-faq-list {
    list-style: none;
    margin: 0;
    padding: 0;
    border-top: 1px solid var(--rw-border);
}

.hg-faq-item {
    border-bottom: 1px solid var(--rw-border);
}

.hg-faq-item details {
    /* Keep the open/close marker tight against the question. */
    padding: 0;
}

.hg-faq-item summary {
    list-style: none;
    cursor: pointer;
    padding: 1.1rem 2rem 1.1rem 0.25rem;
    font-family: 'Inter Tight', Inter, sans-serif;
    font-size: clamp(1rem, 1.4vw, 1.1rem);
    font-weight: 600;
    color: var(--rw-text);
    line-height: 1.4;
    position: relative;
    transition: color 0.15s ease;
}

.hg-faq-item summary::-webkit-details-marker { display: none; }
.hg-faq-item summary::marker { content: ''; }

.hg-faq-item summary:hover { color: var(--rw-accent); }
.hg-faq-item summary:focus-visible {
    outline: 2px solid var(--rw-accent);
    outline-offset: 4px;
    border-radius: 0.25rem;
}

/* Custom +/× indicator on the right edge. Rotates when open. */
.hg-faq-item summary::after {
    content: '+';
    position: absolute;
    right: 0.35rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.5rem;
    font-weight: 300;
    color: var(--rw-accent);
    line-height: 1;
    transition: transform 0.18s ease;
}

.hg-faq-item details[open] summary::after {
    transform: translateY(-50%) rotate(45deg);
}

.hg-faq-answer {
    padding: 0 0 1.25rem 0.25rem;
    color: var(--rw-text-muted, var(--rw-muted));
    font-size: clamp(0.95rem, 1.1vw, 1rem);
    line-height: 1.65;
    max-width: 56ch;
}

@media (prefers-reduced-motion: reduce) {
    .hg-faq-item summary,
    .hg-faq-item summary::after {
        transition: none;
    }
}

/* ─── Owner rating widget (result page) ──────────────────────── */

.hg-rating {
    margin: 2rem auto;
    padding: 1.5rem 1.75rem;
    max-width: 36rem;
    text-align: center;
    background-color: var(--rw-card-bg);
    border: 1px solid var(--rw-border);
    border-radius: 1rem;
    box-shadow: var(--rw-shadow-sm);
}

.hg-rating-title {
    font-family: 'Inter Tight', Inter, sans-serif;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--rw-text);
    margin: 0 0 0.35rem;
}

.hg-rating-sub {
    color: var(--rw-text-muted, var(--rw-muted));
    font-size: 0.92rem;
    line-height: 1.5;
    margin: 0 0 1.1rem;
}

.hg-rating-stars {
    display: inline-flex;
    gap: 0.4rem;
    align-items: center;
    justify-content: center;
}

.hg-rating-star {
    background: transparent;
    border: 0;
    padding: 0.25rem;
    cursor: pointer;
    line-height: 0;
    color: var(--rw-border);
    transition: color 0.15s ease, transform 0.12s ease;
}

.hg-rating-star-icon {
    width: 2.1rem;
    height: 2.1rem;
    fill: currentColor;
    stroke: none;
}

.hg-rating-star:focus-visible {
    outline: 2px solid var(--rw-accent);
    outline-offset: 3px;
    border-radius: 0.25rem;
}

/* Active fill state — JS paints .hg-rating-star--filled on stars
   1..N where N is either the hovered or the persisted value. The
   hover preview is also driven by JS so we don't need the
   row-reverse / general-sibling CSS trick that depends on DOM order. */
.hg-rating-star--filled {
    color: var(--rw-accent);
    transform: translateY(-1px);
}

.hg-rating[data-state="saved"] .hg-rating-stars .hg-rating-star {
    cursor: default;
}

.hg-rating-status {
    margin: 0.85rem 0 0;
    color: var(--rw-text-muted, var(--rw-muted));
    font-size: 0.88rem;
    min-height: 1.2em;
}

.hg-rating-status[data-tone="ok"] { color: var(--rw-accent); }
.hg-rating-status[data-tone="error"] { color: rgb(220, 38, 38); }

@media (prefers-reduced-motion: reduce) {
    .hg-rating-star { transition: none; }
    .hg-rating-star:hover,
    .hg-rating-star:focus-visible { transform: none; }
}

/* ─── FAQ accordion (native <details>) ───────────────────────── */

@media (prefers-reduced-motion: reduce) {
    .hg-identity-tile,
    .hg-identity-tile img,
    .hg-showcase-tile,
    .hg-showcase-tile img,
    .hg-lightbox-close,
    .hg-lightbox-nav {
        transition: none;
    }
    .hg-identity-tile:hover,
    .hg-showcase-tile:hover {
        transform: none;
    }
    .hg-identity-tile:hover img,
    .hg-showcase-tile:hover img,
    .hg-showcase-tile:focus-visible img {
        transform: none;
    }
}
