.sc-figure {
    margin: 0;
    position: relative;
}

.sc-stage {
    --sc-a:      var(--cyan, #00f0ff);
    --sc-b:      var(--red, #ff3366);
    --sc-h:      clamp(420px, 60vh, 660px);
    --sc-ink:    #0a0510;
    --sc-mono:   'Fira Code', 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

    position: relative;
    width: 100%;
    height: var(--sc-h);
    overflow: hidden;
    border-radius: 20px;
    isolation: isolate;
    background:
        radial-gradient(ellipse at 50% 26%, rgba(29, 15, 46, .95) 0%, rgba(10, 5, 16, 1) 72%);
    border: 1px solid rgba(255, 255, 255, .07);
    box-shadow:
        0 22px 46px rgba(0, 0, 0, .5),
        inset 0 1px 0 rgba(255, 255, 255, .05);
    touch-action: pan-y;
}

.sc-stage canvas {
    display: block;
    width: 100%;
    height: 100%;
}
.sc-stage--design canvas { cursor: grab; }
.sc-stage--design canvas:active,
.sc-stage--design.is-grabbing canvas { cursor: grabbing; }

body.pg-web .hero-scene              { cursor: grab; }
body.pg-web .hero-scene.is-grabbing  { cursor: grabbing; }
.sc-stage--hero                      { pointer-events: none; }

@media (pointer: coarse) {
    body.pg-web .hero-scene { cursor: auto; }
}
.sc-stage canvas:focus-visible { outline: 1px solid currentColor; outline-offset: -6px; }
.sc-veil {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 2;
    background:
        radial-gradient(ellipse at center, rgba(0, 0, 0, 0) 44%, rgba(0, 0, 0, .55) 100%);
}

.sc-veil::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    box-shadow: inset 0 0 90px -30px color-mix(in srgb, var(--sc-a) 55%, transparent);
}
.sc-corners {
    position: absolute;
    inset: 14px;
    pointer-events: none;
    z-index: 3;
}

.sc-corners::before,
.sc-corners::after {
    content: '';
    position: absolute;
    width: 26px;
    height: 26px;
    border: 1px solid color-mix(in srgb, var(--sc-a) 60%, transparent);
    opacity: .55;
}

.sc-corners::before {
    top: 0; left: 0;
    border-right: none;
    border-bottom: none;
    border-radius: 8px 0 0 0;
}

.sc-corners::after {
    right: 0; bottom: 0;
    border-left: none;
    border-top: none;
    border-radius: 0 0 8px 0;
}

.sc-tag {
    position: absolute;
    z-index: 4;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 16px;
    border-radius: 999px;
    font-family: var(--sc-mono);
    font-size: .72rem;
    letter-spacing: .14em;
    text-transform: uppercase;
    white-space: nowrap;
    color: var(--sc-a);
    background: color-mix(in srgb, var(--sc-a) 6%, rgba(6, 8, 16, .62));
    border: 1px solid color-mix(in srgb, var(--sc-a) 28%, transparent);
    -webkit-backdrop-filter: blur(6px);
            backdrop-filter: blur(6px);
    pointer-events: none;
    transition: opacity .4s ease;
}

.sc-tag--tr { top: 18px; right: 18px; }
.sc-tag--bl { left: 18px; bottom: 18px; }

.sc-tag .sc-pulse {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--sc-a);
    box-shadow: 0 0 10px var(--sc-a);
    animation: sc-blink 2.4s ease-in-out infinite;
}

@keyframes sc-blink {
    0%, 100% { opacity: .35; }
    50%      { opacity: 1; }
}
.sc-stage.is-grabbing .sc-tag { opacity: 0; }

@media (pointer: coarse) {
    .sc-stage--design canvas { cursor: auto; }
    .sc-tag--bl              { display: none; }
}

.sc-loading {
    position: absolute;
    inset: 0;
    z-index: 5;
    display: grid;
    place-items: center;
    margin: 0;
    font-family: var(--sc-mono);
    font-size: .78rem;
    letter-spacing: .14em;
    color: color-mix(in srgb, var(--sc-a) 75%, #ffffff);
    background: color-mix(in srgb, var(--sc-ink) 96%, transparent);
    transition: opacity .6s ease;
}

.sc-stage.is-ready .sc-loading {
    opacity: 0;
    pointer-events: none;
}

.sc-loading .sc-dots {
    animation: sc-blink 1.2s steps(4) infinite;
}

.sc-fallback {
    position: absolute;
    inset: 0;
    z-index: 6;
    display: none;
    place-items: center;
    margin: 0;
    padding: 28px;
    text-align: center;
    line-height: 1.7;
    color: var(--muted, #a99bbd);
    background: color-mix(in srgb, var(--sc-ink) 96%, transparent);
}

.sc-stage.is-fallback .sc-fallback { display: grid; }
.sc-stage.is-fallback .sc-loading  { display: none; }
.sc-stage.is-fallback canvas       { visibility: hidden; }

.sc-caption {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 8px 22px;
    margin-top: 20px;
    color: var(--muted, #a99bbd);
    font-size: .95rem;
    line-height: 1.7;
}

.sc-caption b {
    color: #fff;
    font-weight: 600;
}

.sc-caption .sc-caption-note {
    font-family: var(--sc-mono);
    font-size: .7rem;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: color-mix(in srgb, var(--sc-a) 70%, #ffffff);
    opacity: .8;
}
body.pg-prog .sc-stage--dev {
    --sc-a: #00f0ff;
    --sc-b: #ff3366;
    --sc-h: clamp(360px, 52vh, 520px);
}
body.pg-web .sc-stage--design {
    --sc-a: #3ce7ff;
    --sc-b: #ff4d9d;
    --sc-h: clamp(360px, 52vh, 520px);
    --sc-ink: #04060e;
}

@media (max-width: 900px) {
    .sc-stage {
        --sc-h: clamp(280px, 40vh, 380px);
        border-radius: 18px;
    }
    body.pg-prog .sc-stage--dev,
    body.pg-web  .sc-stage--design { --sc-h: clamp(300px, 44vh, 400px); }

    .sc-tag {
        font-size: .62rem;
        padding: 7px 11px;
    }
    .sc-tag--bl { display: none; }
    .sc-corners { inset: 10px; }
}

@media (max-width: 520px) {
    .sc-stage { --sc-h: 260px; }
    body.pg-prog .sc-stage--dev,
    body.pg-web  .sc-stage--design { --sc-h: 300px; }
}

@media (prefers-reduced-motion: reduce) {
    .sc-tag .sc-pulse,
    .sc-loading .sc-dots { animation: none; }
}

.hero-scene {
    position: relative;
    width: 100%;
    max-width: calc(var(--nc-w, 420) * 1px);
    aspect-ratio: 1 / 1;
}

@supports not (aspect-ratio: 1 / 1) {
    .hero-scene { height: calc(var(--nc-w, 420) * 1px); }
}

.hero-scene .nc-stage {
    max-width: none;
    height: 100%;
    transition: opacity .9s ease;
}

.sc-stage--hero {
    position: absolute;
    inset: -12%;
    z-index: 2;
    height: auto;
    border: 0;
    border-radius: 4px;
    background: none;
    box-shadow: none;
    opacity: 0;
    transition: opacity .9s ease;
}

.sc-stage--hero.is-ready { opacity: 1; }
.hero-scene.is-cube-off::before { opacity: 0; }
.hero-scene::before {
    content: '';
    position: absolute;
    inset: -6%;
    z-index: 0;
    pointer-events: none;
    transition: opacity .9s ease;
    background: radial-gradient(circle at 50% 48%,
        var(--nc-glow, rgba(0, 240, 255, .14)), transparent 72%);
}
.sc-stage--hero .sc-fallback,
.sc-stage--full .sc-fallback {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
    background: none;
}

.sc-stage--hero.is-fallback .sc-fallback,
.sc-stage--full.is-fallback .sc-fallback { display: block; }

.sc-stage--hero.is-fallback canvas,
.sc-stage--full.is-fallback canvas       { visibility: hidden; }

@media (prefers-reduced-motion: reduce) {
    .sc-stage--hero,
    .hero-scene .nc-stage { transition: none; }
}

.sc-stage--full {
    --sc-pan-x: .315;
    --sc-pan-y: .46;

    position: absolute;
    inset: 0;
    z-index: 1;
    width: auto;
    height: auto;
    max-width: none;
    border: 0;
    border-radius: 0;
    background: none;
    box-shadow: none;
    pointer-events: none;
    opacity: 0;
    transition: opacity 1.1s ease;
}

.sc-stage--full.is-ready { opacity: 1; }
.sc-stage--full::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    background: linear-gradient(to bottom,
        transparent 74%,
        color-mix(in srgb, var(--bg, #0a0510) 70%, transparent) 100%);
}
.sc-stage--full ~ .container .hero-content { position: relative; }

.sc-stage--full ~ .container .hero-content::before {
    content: '';
    position: absolute;
    inset: -34px -44px;
    z-index: -1;
    border-radius: 28px;
    background: color-mix(in srgb, var(--bg, #0a0510) 26%, transparent);
    border: 1px solid rgba(255, 255, 255, .035);
    -webkit-backdrop-filter: blur(26px) saturate(118%);
            backdrop-filter: blur(26px) saturate(118%);
    opacity: 0;
    transition: opacity 1.1s ease;
}

.sc-stage--full.is-ready ~ .container .hero-content::before { opacity: 1; }
@media (max-width: 1024px) {
    .sc-stage--full {
        --sc-pan-x: .5;
        --sc-pan-y: .46;
        inset: 0 0 auto 0;
        height: min(56svh, 520px);
    }
    .sc-stage--full ~ .container .hero-content::before { display: none; }

    .sc-stage--full::after {
        background: linear-gradient(to bottom,
            transparent 58%,
            color-mix(in srgb, var(--bg, #0a0510) 88%, transparent) 100%);
    }
}

@supports not (height: 1svh) {
    @media (max-width: 1024px) {
        .sc-stage--full { height: min(56vh, 520px); }
    }
}

@media (prefers-reduced-motion: reduce) {
    .sc-stage--full { transition: none; }
}

@media (min-width: 1025px) and (max-width: 1100px) { body.pg-web .hero-split { --nc-w: 400; } }
@media (min-width: 1101px) and (max-width: 1200px) { body.pg-web .hero-split { --nc-w: 430; } }
@media (min-width: 1201px) and (max-width: 1300px) { body.pg-web .hero-split { --nc-w: 430; } }
@media (min-width: 1301px) and (max-width: 1400px) { body.pg-web .hero-split { --nc-w: 560; } }
@media (min-width: 1401px) and (max-width: 1599px) { body.pg-web .hero-split { --nc-w: 620; } }
@media (min-width: 1600px)                         { body.pg-web .hero-split { --nc-w: 720; } }
@media (max-width: 1024px)                         { body.pg-web .hero-split { --nc-w: 470; } }
@media (max-width: 768px)                          { body.pg-web .hero-split { --nc-w: 380; } }
@media (max-width: 480px)                          { body.pg-web .hero-split { --nc-w: 330; } }
@media (max-width: 360px)                          { body.pg-web .hero-split { --nc-w: 300; } }


/* Inline scenes: the model sits on the page, without its own frame or backdrop */
.sc-stage--inline {
    background: none;
    border: 0;
    box-shadow: none;
    border-radius: 0;
    margin-inline: auto;
    max-width: 820px;
}

.sc-stage--inline .sc-veil,
.sc-stage--inline .sc-corners { display: none; }

.sc-holder { margin-top: 8px; }

.sc-caption--inline {
    max-width: 820px;
    margin: 14px auto 0;
    justify-content: center;
    text-align: center;
    gap: 6px 14px;
    font-size: .9rem;
}
@media (max-width: 900px) {
    .sc-caption--inline { max-width: 100%; font-size: .85rem; margin-top: 12px; }
    .sc-caption--inline .sc-caption-note { display: none; }
}

/* The section that holds an inline scene does not need full section padding
   above the stage: the block above it already provides the rhythm. */
.sc-section { padding-bottom: 56px; }
.sc-section .sc-stage--inline { margin-top: 24px; }

@media (max-width: 900px) {
    .sc-stage--inline { max-width: 100%; }
    .sc-section { padding-bottom: 36px; }
    .sc-section .sc-stage--inline { margin-top: 16px; }
}
