/* Royal Capital Solutions, v2: full-width hero
   Desktop: header + cards fill at least 100svh and grow if copy needs it.
   Translucent emerald: a lit disc inside the deep tile gives the reviews
   strip something to bend, the photo does the same for the credential, and
   a soft green light behind the page does it for licensing and the header.

   ┌─────────────── Headline tile ───────────┐┌──── Portrait ────┐
   │                                          ││ photo            │
   │ eyebrow                                  ││                  │
   │ avatars · rating · count (glass link)    ││                  │
   │ H1 line one                              ││ credential glass │
   │ H1 line two (lumen)                      │└──────────────────┘
   │ sentence, actions                        │┌─── Licensing ────┐
   └──────────────────────────────────────────┘└──────────────────┘

   DOM order is headline tile, portrait, licensing. Phones show licensing
   before the portrait so license proof stays above the fold; the portrait
   holds no focusable element, so focus order is unaffected. The sticky bar
   appears once the hero actions scroll away.

   CONTENTS: 1 frame · 2 placement · 3 headline tile · 4 reviews and
   licensing · 5 portrait · 6 phone · 7 sticky bar · 8 reduced transparency ·
   9 slot overlay (review only)
   ============================================================ */

/* 1. FRAME ==================================================== */
:root { --edge: var(--s-3); --hdr-h: 4.5rem; }
.full { padding-inline: var(--edge); }
.hdr.full {
    height: var(--hdr-h); padding-block: 0; display: flex; align-items: center;
    background: rgb(243 244 241 / 0.80);
    -webkit-backdrop-filter: blur(20px) saturate(140%);
    backdrop-filter: blur(20px) saturate(140%);
}
.hdr.full .hdr-in { width: 100%; }

.hx { position: relative; padding: 0 var(--edge) var(--edge); }
/* The light behind the page, from under the header to the end of the hero */
.hx::before {
    content: ""; position: absolute; inset: calc(var(--hdr-h) * -1) 0 0 0; z-index: -1; pointer-events: none;
    background:
        radial-gradient(60rem 42rem at 92% 8%, rgb(91 196 138 / 0.34), transparent 70%),
        radial-gradient(44rem 30rem at 100% 100%, rgb(34 165 91 / 0.42), transparent 70%);
}
.hx-grid { display: grid; gap: var(--edge); grid-template-columns: minmax(0, 1fr); }
:where(.hx) .tile { min-height: 0; }

/* 2. PLACEMENT ================================================ */
@media (min-width: 48rem) {
    .hdr-act .btn-primary { display: inline-flex; }
}

/* Tall tablets: side by side, everything in view */
@media (min-width: 48rem) and (max-width: 63.99rem) and (min-height: 48rem) {
    .hx-grid {
        grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
        grid-template-rows: 1fr auto;
        min-height: min(56rem, calc(100vh - var(--hdr-h) - var(--edge)));
        min-height: min(56rem, calc(100svh - var(--hdr-h) - var(--edge)));
    }
    .hx-a { grid-column: 1; grid-row: 1 / -1; }
    .hx-b, .hx-d { grid-column: 2; }
    .hx-b { min-height: 0; }
}

@media (min-width: 64rem) and (min-height: 36rem) {
    /* Headline left; the portrait takes the height licensing leaves.
       Tiles grow rather than clip the primary action on short screens */
    .hx-grid {
        grid-template-columns: minmax(0, 8.5fr) minmax(0, 3.5fr);
        grid-template-rows: 1fr auto;
        min-height: max(33rem, calc(100vh - var(--hdr-h) - var(--edge)));
        min-height: max(33rem, calc(100svh - var(--hdr-h) - var(--edge)));
    }
    .hx-a { grid-column: 1; grid-row: 1 / -1; }
    .hx-b, .hx-d { grid-column: 2; }
}

/* 3. HEADLINE TILE ============================================
   Open space above one tight group. The disc and grain stay within
   the deep greens so white text holds.                            */
.hx-a {
    gap: var(--s-5); padding: clamp(var(--s-6), 1rem + 2.6vw, 4rem);
    background:
        radial-gradient(40rem 26rem at 88% 0%, rgb(34 165 91 / 0.18), transparent 70%),
        var(--surface-deep);
    box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.14), inset 0 0 0 1px rgb(255 255 255 / 0.05);
}
.hx-a::before {
    content: ""; position: absolute; z-index: -1; pointer-events: none;
    width: max(46rem, 82%); aspect-ratio: 1; top: -34%; right: -18%; border-radius: 50%;
    background: linear-gradient(215deg, rgb(91 196 138 / 0.62), rgb(34 165 91 / 0.20) 46%, rgb(34 165 91 / 0.03) 72%);
}
.hx-a::after {
    content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; opacity: 0.05;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.hx-a > .label { margin-top: auto; min-height: 0; padding: 0; background: none; color: var(--text-lumen); font-size: var(--fs-base); font-weight: 500; }
.hx-a :focus-visible { outline-color: var(--text-lumen); }
.hx-h1 {
    /* scales with the smaller of width and height */
    font-size: clamp(2.5rem, min(7vw, 11vh), 7rem);
    font-size: clamp(2.5rem, min(7vw, 11svh), 7rem);
    font-weight: 500;
    line-height: 0.96;
    letter-spacing: -0.05em;
    text-wrap: balance;
    max-width: 17ch;
}
@media (min-width: 64rem) and (min-height: 50rem) {
    .hx-h1 { font-size: clamp(2.5rem, min(7.4vw, 12.5svh), 8.5rem); }
}
.hx-h1-b { display: block; color: var(--text-lumen); }
.hx-sub { margin-top: calc(var(--s-1) * -1); font-size: clamp(1.0625rem, 0.7rem + 1.1vh, 1.5rem); line-height: 1.5; color: var(--text-on-deep-2); max-width: 50ch; text-wrap: pretty; }
.hx-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2) var(--s-4); margin-top: var(--s-2); }
.hx-actions .btn-ghost { font-weight: 500; color: var(--text-on-deep); }
/* The mint phone icon is for dark tiles only (hero, closing tile). On the pale page and in the white confirmation panel the ghost button keeps the brand green from components.css. */
.hx-a .hx-actions .btn-ghost .ic,
.hm-cta-main > .hx-actions .btn-ghost .ic { color: var(--text-lumen); }

/* 4. REVIEWS AND LICENSING ====================================
   The reviews strip is one link on glass; hide it with `hidden`
   until a real rating exists. Licensing is light glass and holds
   both IDs. Avatars are real reviewers' photos or their initials. */
.hx-proof {
    display: flex; align-items: center; gap: var(--s-3);
    width: fit-content; max-width: 100%; min-height: 3.5rem; padding: var(--s-2) var(--s-4) var(--s-2) var(--s-2);
    border-color: transparent; color: var(--text-on-deep); text-decoration: none;
    background: linear-gradient(135deg, rgb(255 255 255 / 0.18), rgb(255 255 255 / 0.06));
    -webkit-backdrop-filter: blur(16px) saturate(135%);
    backdrop-filter: blur(16px) saturate(135%);
    box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.28), inset 0 0 0 1px rgb(255 255 255 / 0.12), 0 8px 24px rgb(3 20 12 / 0.28);
}
.hx-proof[hidden] { display: none; }
.hx-avatars { display: flex; flex: none; }
.hx-avatars > * {
    display: grid; place-items: center; flex: none; width: 2.25rem; height: 2.25rem; object-fit: cover;
    border-radius: 50%; outline: 2px solid var(--surface-deep);
    background: var(--g-800); color: var(--text-lumen); font-size: var(--fs-xs); font-weight: 600;
}
.hx-avatars > * + * { margin-inline-start: calc(var(--s-2) * -1); }
.hx-proof-rating { font-size: var(--fs-xl); font-weight: 500; letter-spacing: -0.03em; line-height: 1; }
.hx-proof-text { display: grid; justify-items: center; gap: 2px; min-width: 0; text-align: center; }
.hx-stars { display: flex; justify-content: center; gap: 2px; color: var(--text-lumen); }
.hx-stars .ic { width: 1rem; height: 1rem; fill: currentColor; stroke: none; }
.hx-avatars > img { display: block; background: var(--g-800); }
.hx-proof-count { font-size: var(--fs-xs); line-height: 1.3; }
.hx-proof-go { flex: none; margin-inline-start: var(--s-1); color: var(--text-lumen); }
@media (hover: hover) and (pointer: fine) {
    .hx-proof:hover .hx-proof-count { text-decoration: underline; text-underline-offset: 0.25em; text-decoration-thickness: 1px; }
}

.hx-grid .hx-d {
    padding: var(--card-pad);
    background: rgb(255 255 255 / 0.60);
    -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(150%);
    backdrop-filter: blur(var(--glass-blur)) saturate(150%);
    box-shadow: inset 0 0 0 1px var(--glass-light-edge), var(--shadow-1);
}
.hx-trust { display: flex; flex-direction: column; padding: var(--card-pad) var(--card-pad) var(--s-2); background: var(--surface-trust); color: var(--text); }
.hx-trust-label { font-size: var(--fs-xs); font-weight: 600; color: var(--text-2); }
.hx-trust-body { display: grid; gap: var(--s-1); margin-top: auto; padding-top: var(--s-3); }
.hx-trust-ids { display: grid; gap: 2px; }
.hx-trust-id { font-size: var(--fs-sm); letter-spacing: 0; }
.hx-trust-link {
    display: inline-flex; align-items: center; gap: var(--s-1); width: fit-content; min-height: 2.75rem;
    color: var(--text-brand); font-size: var(--fs-xs); font-weight: 600;
    text-underline-offset: 0.25em; text-decoration-thickness: 1px;
}
/* IDs beside the link keep the card short. The link sits on the last ID's
   line; negative margins keep its 44px tap area out of the card's spacing */
.hx-grid .hx-d .hx-trust-body { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 0 var(--s-3); padding-top: var(--s-2); }
.hx-grid .hx-d .hx-trust-link { margin-block: -0.625rem; }

/* 5. PORTRAIT =================================================
   The photo fills the card; the credential is glass over it, 8px
   in so card 20 = glass 12 + 8. No saturation boost: it stains the
   glass where the blue shirt sits behind it. The inline padding
   lines the name up with the licensing label.                    */
.hx-b { justify-content: flex-end; min-height: 26rem; padding: var(--s-2); background: #333333; }
.hx-photo { position: absolute; inset: 0; z-index: -1; overflow: hidden; }
.hx-photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 15%; }
.hx-cred {
    display: grid; gap: var(--s-1); padding: var(--s-4) calc(var(--card-pad) - var(--s-2) - 1px);
    border-color: transparent;
    background: linear-gradient(160deg, rgb(6 42 25 / 0.62), rgb(6 42 25 / 0.82));
    -webkit-backdrop-filter: blur(48px) saturate(100%) brightness(0.8);
    backdrop-filter: blur(48px) saturate(100%) brightness(0.8);
    box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.24), inset 0 0 0 1px rgb(255 255 255 / 0.10);
}
.hx-name { font-size: clamp(1.25rem, 0.8rem + 1vw, 1.625rem); font-weight: 500; letter-spacing: -0.03em; line-height: 1.1; }

/* Menu below 64rem. Closed, the nav stays display: none from components.css */
@media (max-width: 63.99rem) {
    .hdr.full .navgroup.is-open {
        display: block; position: absolute; inset: 100% var(--edge) auto; margin: var(--s-2) 0 0;
        padding: var(--s-2); border-radius: var(--r-card);
        background: var(--surface); box-shadow: var(--shadow-2);
    }
    .navgroup.is-open ul { flex-direction: column; gap: 0; }
    .navgroup.is-open a { display: flex; font-size: var(--fs-base); padding-inline: var(--s-3); }
}

/* 6. PHONE ==================================================== */
@media (max-width: 47.99rem) {
    :root { --hdr-h: 3.75rem; }
    html { scroll-padding-bottom: calc(5.5rem + env(safe-area-inset-bottom, 0px)); }
    .logo img { max-height: 2.125rem; }
    .hdr-act a.btn-icon { display: none; }
    .hx { padding-bottom: calc(var(--edge) + 4.5rem + env(safe-area-inset-bottom, 0px)); }
    .hx-a { gap: var(--s-3); padding: var(--s-4); }
    .hx-a::before { opacity: 0.42; }
    .hx-a > .label { margin-top: 0; }
    .hx-h1 { margin-top: var(--s-1); font-size: clamp(2.25rem, 9.6vw, 2.75rem); line-height: 1.02; letter-spacing: -0.035em; max-width: none; }
    .hx-sub { font-size: var(--fs-base); }
    .hx-actions { display: grid; gap: 0; margin-top: var(--s-1); }
    .hx-actions .btn-white { width: 100%; justify-content: space-between; min-height: 3.25rem; }
    .hx-actions .btn-ghost { justify-content: center; }
    .hx-proof { width: 100%; gap: var(--s-2); }
    .hx-avatars > * { width: 1.875rem; height: 1.875rem; }
    .hx-proof-go { margin-inline-start: auto; }
    .hx-d { order: 1; }
    .hx-b { order: 2; }
}

/* 7. STICKY BAR (phones) ======================================
   Stays visible without JS; the script adds .is-off while the
   hero actions are on screen.                                  */
.stickybar { display: none; }
@media (max-width: 47.99rem) {
    .stickybar {
        position: fixed; inset: auto 0 0 0; z-index: 40;
        display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-2);
        padding: var(--s-2) max(var(--s-3), env(safe-area-inset-right, 0px)) calc(var(--s-2) + env(safe-area-inset-bottom, 0px)) max(var(--s-3), env(safe-area-inset-left, 0px));
        background: var(--surface); border-top: 1px solid var(--line);
        transition: transform var(--t-ui) var(--ease), visibility var(--t-ui);
    }
    /* is-at-form (js/form.js): the inline form is on screen, so the bar
       would only cover its submit button */
    .stickybar.is-off, .stickybar.is-at-form { transform: translateY(100%); visibility: hidden; }
    .stickybar .btn { padding-inline: var(--s-2); gap: var(--s-2); font-size: var(--fs-xs); }
}
@media (prefers-reduced-motion: reduce) { .stickybar { transition: none; } }
/* Narrow phones: drop the icons so limit-length labels fit */
@media (max-width: 22.5rem) { .stickybar .ic { display: none; } }

/* 8. REDUCED TRANSPARENCY =====================================
   These load after components.css, so its fallback does not win. */
@media (prefers-reduced-transparency: reduce), (prefers-contrast: more) {
    .hdr.full { background: var(--bg); -webkit-backdrop-filter: none; backdrop-filter: none; }
    .hx-proof, .hx-cred { background: var(--surface-deep); -webkit-backdrop-filter: none; backdrop-filter: none; }
    .hx-grid .hx-d { background: var(--surface); -webkit-backdrop-filter: none; backdrop-filter: none; }
    .hx-a::before, .hx-a::after { display: none; }
}

/* 9. SLOT OVERLAY (review only, never shipped) ================ */
.show-slots [data-slot] { outline: 1px dashed rgb(34 165 91 / 0.9); outline-offset: 3px; }
.show-slots [data-slot]::after {
    content: attr(data-slot);
    position: absolute; top: -1.15rem; inset-inline-start: 0; z-index: 6;
    padding: 2px 6px; border-radius: 4px;
    background: var(--signal); color: var(--text);
    font: 500 10px/1.3 var(--font); white-space: nowrap;
    pointer-events: none;
}
.show-slots .hx-photo[data-slot] { outline-offset: -4px; }
.show-slots .hx-photo[data-slot]::after { top: auto; bottom: var(--s-2); inset-inline-start: var(--s-2); }
.show-slots [data-slot]:not(.hx-photo) { position: relative; }
.slot-toggle {
    position: fixed; inset-inline-start: var(--s-4); bottom: var(--s-4); z-index: 60;
    display: inline-flex; align-items: center; gap: var(--s-2);
    min-height: 2.75rem; padding: var(--s-2) var(--s-4);
    border: 1px solid var(--line-strong); border-radius: var(--r-chip);
    background: var(--surface); box-shadow: var(--shadow-2);
    font-size: var(--fs-xs); font-weight: 500;
}
.slot-toggle[aria-pressed="true"]::before { content: ""; width: 0.5rem; height: 0.5rem; border-radius: 50%; background: var(--signal); }
@media (max-width: 47.99rem) { .slot-toggle { inset-inline-start: auto; inset-inline-end: var(--s-3); bottom: 5rem; } }
