/* Forge VFX product page (forgevfx.org). Builds on the tokens in styles.css. */

.fx {
    --fx-panel: #0a0d17;
    --fx-field: #0f1320;
    --fx-mono: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    padding-bottom: 60px;
}

/* ---------- Hero ---------- */

.fx-hero {
    max-width: 1000px;
    padding: 96px 0 56px;
}

.fx-kicker {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 28px;
}

.fx-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 0 4px var(--accent-soft);
}

.fx-title {
    font-size: 1rem;
    font-weight: 500;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: var(--accent);
    margin: 0 0 18px;
}

.fx-headline {
    font-size: clamp(2.3rem, 5.6vw, 4.1rem);
    font-weight: 300;
    line-height: 1.04;
    letter-spacing: -0.035em;
    color: var(--text);
    margin-bottom: 26px;
    text-wrap: balance;
}

.fx-sub {
    font-size: 1.15rem;
    font-weight: 400;
    line-height: 1.65;
    color: var(--muted);
    max-width: 640px;
    margin-bottom: 34px;
}

/* ---------- Screenshots ---------- */

.fx-shot {
    margin: 0;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid var(--stroke-strong);
    background: #0b0e16;
    box-shadow: 0 50px 100px -40px rgba(0, 0, 0, 0.95);
}

.fx-shot img {
    display: block;
    width: 100%;
    height: auto;
}

.fx-shot--hero {
    position: relative;
    box-shadow: 0 60px 140px -50px rgba(0, 0, 0, 1), 0 0 0 1px rgba(255, 255, 255, 0.04);
}

/* ---------- Numbers ---------- */

.fx-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    margin: 72px 0 40px;
    border-top: 1px solid var(--stroke);
    border-bottom: 1px solid var(--stroke);
}

.fx-stats > div {
    padding: 30px 24px 28px;
    border-left: 1px solid var(--stroke);
}

.fx-stats > div:first-child {
    border-left: 0;
    padding-left: 0;
}

.fx-stats strong {
    display: block;
    font-size: 2.3rem;
    font-weight: 300;
    letter-spacing: -0.03em;
    color: var(--text);
    line-height: 1.1;
    margin-bottom: 8px;
    font-variant-numeric: tabular-nums;
}

.fx-stats small {
    font-size: 0.9rem;
    color: var(--muted);
    margin-left: 4px;
    letter-spacing: 0;
}

.fx-stats > div > span {
    font-size: 0.86rem;
    color: var(--muted);
    font-weight: 400;
}

/* ---------- Sections ---------- */

.fx-section {
    padding: 110px 0 0;
}

.fx-section-head {
    max-width: 700px;
    margin-bottom: 48px;
}

.fx-h2 {
    text-wrap: balance;
    font-size: clamp(1.9rem, 4vw, 2.8rem);
    font-weight: 300;
    line-height: 1.1;
    letter-spacing: -0.03em;
    color: var(--text);
    margin: 0 0 20px;
}

.fx-lede {
    font-size: 1.08rem;
    font-weight: 400;
    line-height: 1.7;
    color: var(--muted);
}

.fx-footnote {
    font-size: 0.82rem;
    color: var(--faint);
    margin-top: 18px;
    max-width: 680px;
}

/* ---------- Generate demo ---------- */

.fx-demo {
    display: grid;
    grid-template-columns: 380px 1fr;
    gap: 20px;
    align-items: stretch;
}

/* Without this the log's nowrap line sets the column's minimum width and,
   once the grid is one column, pushes the page sideways on phones and tablets. */
.fx-demo > * {
    min-width: 0;
}

.fx-panel {
    display: flex;
    flex-direction: column;
    background: var(--fx-panel);
    border: 1px solid var(--stroke-strong);
    border-radius: 14px;
    padding: 20px 20px 18px;
}

.fx-panel-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text);
    padding-bottom: 14px;
    margin-bottom: 14px;
    border-bottom: 1px solid var(--stroke);
}

.fx-panel-tag {
    font-size: 0.66rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--accent);
    border: 1px solid rgba(var(--accent-rgb), 0.35);
    border-radius: 999px;
    padding: 2px 9px;
}

.fx-fields {
    display: grid;
    gap: 6px;
    margin: 0 0 16px;
}

.fx-fields > div,
.fx-fields-row > div {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    font-size: 0.82rem;
}

.fx-fields-row {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px !important;
}

.fx-fields-row > div {
    background: var(--fx-field);
    border: 1px solid var(--stroke);
    border-radius: 7px;
    padding: 7px 10px;
}

.fx-fields > div:not(.fx-fields-row) {
    background: var(--fx-field);
    border: 1px solid var(--stroke);
    border-radius: 7px;
    padding: 7px 10px;
}

.fx-fields dt {
    color: var(--faint);
}

.fx-fields dd {
    margin: 0;
    color: var(--text);
    font-variant-numeric: tabular-nums;
    text-align: right;
}

.fx-label {
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--faint);
    margin-bottom: 8px;
}

.fx-prompt {
    flex: 1;
    min-height: 168px;
    background: var(--fx-field);
    border: 1px solid var(--stroke);
    border-radius: 9px;
    padding: 12px 14px;
    font-size: 0.86rem;
    line-height: 1.6;
    color: var(--text);
    transition: border-color 0.3s var(--ease);
}

.fx-demo.is-typing .fx-prompt {
    border-color: rgba(var(--accent-rgb), 0.55);
}

.fx-caret {
    display: inline-block;
    width: 1.5px;
    height: 1.05em;
    margin-left: 1px;
    vertical-align: -0.15em;
    background: var(--accent);
    opacity: 0;
}

.fx-demo.is-typing .fx-caret {
    opacity: 1;
    animation: fx-blink 1s steps(1) infinite;
}

@keyframes fx-blink {
    50% { opacity: 0; }
}

.fx-generate {
    margin-top: 14px;
    height: 42px;
    border-radius: 9px;
    border: 1px solid var(--stroke-strong);
    background: rgba(255, 255, 255, 0.06);
    color: var(--text);
    font-family: var(--font);
    font-size: 0.92rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s var(--ease), transform 0.15s var(--ease), border-color 0.2s var(--ease);
}

.fx-generate:hover {
    background: rgba(255, 255, 255, 0.1);
}

.fx-demo.is-pressed .fx-generate {
    transform: scale(0.97);
    background: var(--accent-soft);
    border-color: var(--accent);
}

.fx-demo.is-generating .fx-generate {
    color: var(--accent);
    border-color: rgba(var(--accent-rgb), 0.5);
}

.fx-progress {
    height: 3px;
    margin-top: 14px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.06);
    overflow: hidden;
}

.fx-progress span {
    display: block;
    height: 100%;
    width: 0;
    background: var(--accent);
    transition: width 0.25s linear;
}

.fx-log {
    display: block;
    margin-top: 10px;
    font-family: var(--fx-mono);
    font-size: 0.72rem;
    color: var(--faint);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.fx-demo.is-done .fx-log {
    color: var(--accent);
}

/* Output */
.fx-output {
    display: flex;
    flex-direction: column;
}

.fx-output-frame {
    --denoise: 0;
    position: relative;
    flex: 1;
    min-width: 0;
    min-height: 0;
    aspect-ratio: 908 / 642;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid var(--stroke-strong);
    background: #07080d;
}

.fx-output-frame video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* Starts as a dim blur and resolves as denoising steps complete. */
    filter: blur(calc((1 - var(--denoise)) * 28px)) brightness(calc(0.15 + var(--denoise) * 0.85)) saturate(calc(0.3 + var(--denoise) * 0.7));
    transform: scale(calc(1.08 - var(--denoise) * 0.08));
    transition: filter 0.3s linear, transform 0.3s linear;
}

.fx-noise {
    position: absolute;
    inset: -50%;
    pointer-events: none;
    opacity: calc(0.55 * (1 - var(--denoise)));
    background-image: 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='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.9 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    mix-blend-mode: overlay;
    animation: fx-grain 0.5s steps(4) infinite;
    transition: opacity 0.3s linear;
}

@keyframes fx-grain {
    0%   { transform: translate(0, 0); }
    25%  { transform: translate(-4%, 3%); }
    50%  { transform: translate(3%, -5%); }
    75%  { transform: translate(-2%, -2%); }
    100% { transform: translate(0, 0); }
}

.fx-replay {
    position: absolute;
    right: 14px;
    bottom: 14px;
    height: 34px;
    padding: 0 14px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    background: rgba(5, 7, 15, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: var(--text);
    font-family: var(--font);
    font-size: 0.8rem;
    cursor: pointer;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s var(--ease);
}

.fx-demo.is-done .fx-replay {
    opacity: 1;
    pointer-events: auto;
}

.fx-output-meta {
    display: flex;
    justify-content: space-between;
    padding: 12px 4px 0;
    font-size: 0.72rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--faint);
}

.fx-demo.is-done #fx-state {
    color: var(--accent);
}

/* Clip in context */
.fx-context {
    display: grid;
    grid-template-columns: 1.3fr 1fr;
    gap: 48px;
    align-items: center;
    margin-top: 72px;
}

.fx-context-text h3 {
    font-size: 1.35rem;
    font-weight: 400;
    color: var(--text);
    letter-spacing: -0.015em;
    margin-bottom: 14px;
}

.fx-context-text p {
    color: var(--muted);
    font-weight: 400;
    line-height: 1.7;
    margin-bottom: 22px;
}

.fx-list {
    list-style: none;
    margin: 0 0 22px;
    border-top: 1px solid var(--stroke);
}

.fx-list li {
    display: grid;
    grid-template-columns: 76px 1fr;
    gap: 12px;
    padding: 11px 0;
    border-bottom: 1px solid var(--stroke);
    font-size: 0.9rem;
    color: var(--text);
    font-weight: 400;
}

.fx-list span {
    font-size: 0.72rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--faint);
    padding-top: 3px;
}

.fx-context-text .fx-note {
    font-size: 0.85rem;
    color: var(--faint);
}

/* ---------- Split feature sections ---------- */

.fx-split {
    display: grid;
    grid-template-columns: 1fr 1.45fr;
    gap: 64px;
    align-items: center;
}

.fx-split--flip .fx-split-text {
    order: 2;
}

.fx-points {
    list-style: none;
    margin: 26px 0 0;
    border-top: 1px solid var(--stroke);
}

.fx-points li {
    padding: 13px 0 13px 24px;
    border-bottom: 1px solid var(--stroke);
    position: relative;
    font-size: 0.94rem;
    font-weight: 400;
    color: var(--text);
}

.fx-points li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 1.35em;
    width: 11px;
    height: 1px;
    background: var(--accent);
}

.fx-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 26px;
}

.fx-tags span {
    font-size: 0.8rem;
    color: var(--muted);
    border: 1px solid var(--stroke);
    border-radius: 999px;
    padding: 5px 12px;
}

/* ---------- Deliver ---------- */

.fx-codecs {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    margin-top: 32px;
    border-top: 1px solid var(--stroke);
}

.fx-codecs > div {
    padding: 20px 20px 0 0;
}

.fx-codecs strong {
    display: block;
    font-weight: 500;
    color: var(--text);
    margin-bottom: 4px;
}

.fx-codecs span {
    font-size: 0.84rem;
    color: var(--faint);
}

/* ---------- Engine ---------- */

.fx-engine-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 48px;
    align-items: start;
}

.fx-spec {
    margin: 0;
    border-top: 1px solid var(--stroke);
}

.fx-spec > div {
    display: grid;
    grid-template-columns: 130px 1fr;
    gap: 20px;
    padding: 15px 0;
    border-bottom: 1px solid var(--stroke);
}

.fx-spec dt {
    font-size: 0.74rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--faint);
    padding-top: 3px;
}

.fx-spec dd {
    margin: 0;
    font-size: 0.94rem;
    font-weight: 400;
    color: var(--text);
    line-height: 1.6;
}

.fx-perf {
    background: var(--surface);
    border: 1px solid var(--stroke);
    border-radius: var(--r-lg);
    padding: 28px;
}

.fx-perf-title {
    font-size: 0.74rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--faint);
    margin-bottom: 24px;
}

.fx-bar-row {
    display: grid;
    grid-template-columns: 56px 1fr 74px;
    align-items: center;
    gap: 14px;
    margin-bottom: 14px;
    font-size: 0.85rem;
    color: var(--muted);
}

.fx-bar-row b {
    font-weight: 500;
    color: var(--text);
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.fx-bar {
    height: 8px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    overflow: hidden;
}

.fx-bar i {
    display: block;
    height: 100%;
    width: var(--v);
    border-radius: 8px;
    background: var(--accent);
}

.fx-bar-row:first-of-type .fx-bar i {
    background: var(--faint);
}

.fx-perf-note {
    margin-top: 22px;
    font-size: 0.86rem;
    font-weight: 400;
    line-height: 1.65;
    color: var(--muted);
}

/* ---------- Open source ---------- */

.fx-open-inner {
    text-align: center;
    max-width: 720px;
    margin: 0 auto;
    padding: 72px 0 0;
    border-top: 1px solid var(--stroke);
}

.fx-open .fx-lede {
    margin: 0 auto 36px;
}

.fx-roadmap {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1px;
    background: var(--stroke);
    border: 1px solid var(--stroke);
    border-radius: var(--r-lg);
    overflow: hidden;
    margin-bottom: 36px;
    text-align: left;
}

.fx-roadmap > div {
    background: #070913;
    padding: 20px 22px;
    font-size: 0.9rem;
    font-weight: 400;
    color: var(--text);
    line-height: 1.55;
}

.fx-roadmap span {
    display: block;
    font-size: 0.7rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 8px;
}

/* ---------- FAQ ---------- */

.fx-faq {
    max-width: 760px;
}

.fx-faq details {
    border-bottom: 1px solid var(--stroke);
}

.fx-faq details:first-of-type {
    border-top: 1px solid var(--stroke);
}

.fx-faq summary {
    list-style: none;
    cursor: pointer;
    padding: 20px 36px 20px 0;
    position: relative;
    font-size: 1.02rem;
    color: var(--text);
}

.fx-faq summary::-webkit-details-marker {
    display: none;
}

.fx-faq summary::after {
    content: '+';
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    font-weight: 400;
    font-size: 1.3rem;
    color: var(--faint);
    transition: transform 0.3s var(--ease);
}

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

.fx-faq details p {
    padding: 0 0 22px;
    color: var(--muted);
    font-weight: 400;
    line-height: 1.7;
    max-width: 640px;
}

/* ---------- Responsive ---------- */

@media (max-width: 1000px) {
    .fx-demo,
    .fx-context,
    .fx-split,
    .fx-engine-grid {
        grid-template-columns: 1fr;
    }

    .fx-split--flip .fx-split-text {
        order: 0;
    }

    .fx-split,
    .fx-context {
        gap: 36px;
    }

    .fx-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .fx-stats > div:nth-child(3) {
        border-left: 0;
        padding-left: 0;
    }

    .fx-stats > div:nth-child(n + 3) {
        border-top: 1px solid var(--stroke);
    }
}

@media (max-width: 640px) {
    .fx-hero {
        padding-top: 56px;
    }

    .fx-section {
        padding-top: 80px;
    }

    .fx-codecs,
    .fx-roadmap {
        grid-template-columns: 1fr 1fr;
    }

    .fx-roadmap {
        grid-template-columns: 1fr;
    }

    .fx-spec > div {
        grid-template-columns: 1fr;
        gap: 4px;
    }

    .fx-stats strong {
        font-size: 1.9rem;
    }

    .fx-stats > div {
        padding: 22px 14px 20px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .fx-noise {
        animation: none;
    }
}

/* ---------- Motion-era refinements ---------- */

.fx-hero {
    max-width: none;
}

.fx-display {
    font-size: clamp(2.7rem, 7.4vw, 6.6rem);
    margin-bottom: 34px;
}

/* A slow, warm light behind the hero screenshot. */
.fx-stage {
    position: relative;
    perspective: 1600px;
}

.fx-stage::before {
    content: '';
    position: absolute;
    left: 8%;
    right: 8%;
    top: 12%;
    bottom: -6%;
    z-index: -1;
    background:
        radial-gradient(45% 60% at 28% 55%, rgba(232, 150, 70, 0.28), transparent 70%),
        radial-gradient(45% 60% at 74% 45%, rgba(110, 90, 220, 0.26), transparent 70%);
    filter: blur(60px);
    animation: fx-breathe 12s ease-in-out infinite alternate;
    pointer-events: none;
}

@keyframes fx-breathe {
    from { transform: translate3d(-2%, 1%, 0) scale(0.96); opacity: 0.75; }
    to   { transform: translate3d(2%, -1%, 0) scale(1.04); opacity: 1; }
}

.statement--fx {
    padding: 130px 0 20px;
}

.fx-shot--wide {
    overflow: hidden;
}

@media (prefers-reduced-motion: reduce) {
    .fx-stage::before {
        animation: none;
    }
}

/* The prompt box keeps its final height from the start (see .fx-prompt-ghost). */
.fx-prompt {
    position: relative;
}

.fx-prompt-ghost {
    visibility: hidden;
}

.fx-prompt-live {
    position: absolute;
    inset: 0;
    padding: 12px 14px;
}

/* ---------- Theme: the app's own palette (Forge VFX Source/Utils/UIColors.hpp) ---------- */

body.theme-forge {
    --bg:            #0d0d11;
    --accent:        #00ffd8;                  /* UIColors::Accent */
    --accent-rgb:    0, 255, 216;
    --accent-soft:   rgba(0, 255, 216, 0.10);
    --accent-bright: #73ffe8;                  /* UIColors::AccentBright */
    --surface:       rgba(255, 255, 255, 0.03);
    --surface-hover: rgba(255, 255, 255, 0.05);
    --stroke:        rgba(255, 255, 255, 0.08);
    --stroke-strong: rgba(255, 255, 255, 0.16);
    --muted:         #b9bec9;
    --faint:         #8b909c;
    background-color: #0d0d11;
}

.theme-forge .fx {
    --fx-panel: #1f1f24;                       /* UIColors::BackgroundMain */
    --fx-field: #26262e;                       /* UIColors::BackgroundSurface */
}

/* The app's window backdrop: a faint accent glow from the upper left, deep blue-slate
   from the lower right, over graphite, with a canvas dot grid fading out from the top. */
.forge-backdrop {
    position: fixed;
    inset: 0;
    z-index: -2;
    overflow: hidden;
    background:
        radial-gradient(1200px 820px at 6% -8%, rgba(0, 255, 216, 0.085), transparent 62%),
        radial-gradient(70% 34% at 50% 116%, rgba(0, 255, 190, 0.09), transparent 72%),
        radial-gradient(1300px 900px at 102% 108%, rgba(36, 48, 77, 0.6), transparent 66%),
        linear-gradient(180deg, #111116 0%, #0d0d11 60%, #0a0a0d 100%);
}

.forge-backdrop::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(circle, rgba(255, 255, 255, 0.075) 1px, transparent 1.3px);
    background-size: 32px 32px;
    -webkit-mask-image: radial-gradient(ellipse 75% 60% at 45% 22%, #000 10%, transparent 75%);
    mask-image: radial-gradient(ellipse 75% 60% at 45% 22%, #000 10%, transparent 75%);
}

/* One slow cyan light drifting across the canvas. */
.forge-backdrop::after {
    content: '';
    position: absolute;
    left: -15vmax;
    top: -30vmax;
    width: 70vmax;
    height: 70vmax;
    background: radial-gradient(circle, rgba(0, 255, 216, 0.06), transparent 60%);
    animation: forge-drift 28s ease-in-out infinite alternate;
}

@keyframes forge-drift {
    to { transform: translate3d(40vmax, 30vmax, 0); }
}

.theme-forge nav {
    background: rgba(13, 13, 17, 0.72);
}

.theme-forge nav a[href="https://forgevfx.org/"] {
    color: var(--accent);
}

.theme-forge .btn--primary {
    background: var(--accent);
    border-color: var(--accent);
    color: #00231e;
    box-shadow: 0 12px 34px -14px rgba(0, 255, 216, 0.6);
}

.theme-forge .btn--primary:hover {
    background: var(--accent-bright);
    border-color: var(--accent-bright);
}

.theme-forge .fx-stage::before {
    background:
        radial-gradient(45% 60% at 30% 55%, rgba(0, 255, 216, 0.18), transparent 70%),
        radial-gradient(45% 60% at 72% 45%, rgba(60, 90, 170, 0.32), transparent 70%);
}

.theme-forge .fx-dot {
    animation: fx-pulse 2.6s ease-out infinite;
}

@keyframes fx-pulse {
    0%   { box-shadow: 0 0 0 0 rgba(0, 255, 216, 0.45); }
    70%  { box-shadow: 0 0 0 9px rgba(0, 255, 216, 0); }
    100% { box-shadow: 0 0 0 0 rgba(0, 255, 216, 0); }
}

.theme-forge .fx-bar-row:last-of-type .fx-bar i {
    background: linear-gradient(90deg, rgba(0, 255, 216, 0.45), var(--accent));
    box-shadow: 0 0 18px rgba(0, 255, 216, 0.4);
}

.theme-forge :is(.fx-panel, .fx-perf)::after {
    background: radial-gradient(520px circle at var(--mx, 50%) var(--my, 50%), rgba(0, 255, 216, 0.07), transparent 45%);
}

.theme-forge .fx-shot {
    border-color: rgba(0, 255, 216, 0.14);
}

@media (prefers-reduced-motion: reduce) {
    .forge-backdrop::after,
    .theme-forge .fx-dot {
        animation: none;
    }
}

/* Embers canvas (scripts/forge-embers.js) */
.forge-embers {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

/* ======================================================================
   v2: pipeline demo, memory story, compare sliders, generation families
   ====================================================================== */

/* ---------- Demo panel additions ---------- */

.fx-source {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px;
    margin-bottom: 12px;
    background: var(--fx-field);
    border: 1px solid var(--stroke);
    border-radius: 9px;
}

.fx-source img {
    width: 64px;
    height: 48px;
    object-fit: cover;
    border-radius: 5px;
    flex-shrink: 0;
}

.fx-source span {
    font-size: 0.78rem;
    color: var(--muted);
    line-height: 1.4;
}

.fx-source b {
    display: block;
    font-weight: 500;
    color: var(--text);
}

.fx-stages {
    display: grid;
    gap: 10px;
    margin-top: 14px;
}

.fx-stage-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 4px 10px;
    font-size: 0.78rem;
}

.fx-stage-row strong {
    font-weight: 500;
    color: var(--text);
}

.fx-stage-row em {
    font-style: normal;
    color: var(--faint);
    margin-left: 6px;
}

.fx-stage-status {
    color: var(--faint);
    font-variant-numeric: tabular-nums;
}

.fx-stage-row.is-active .fx-stage-status,
.fx-stage-row.is-done .fx-stage-status {
    color: var(--accent);
}

.fx-stage-bar {
    grid-column: 1 / -1;
    height: 3px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.06);
    overflow: hidden;
}

.fx-stage-bar i {
    display: block;
    height: 100%;
    width: 0;
    background: var(--accent);
    transition: width 0.2s linear;
}

.fx-vram {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid var(--stroke);
}

.fx-vram-head {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--faint);
    margin-bottom: 8px;
}

.fx-vram-head span:last-child {
    text-transform: none;
    letter-spacing: 0;
    color: var(--muted);
    font-variant-numeric: tabular-nums;
}

.fx-demo.is-done .fx-vram-head span:last-child {
    color: var(--accent);
}

.fx-vram-track {
    position: relative;
    height: 8px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.06);
    overflow: hidden;
}

.fx-vram-track i {
    display: block;
    height: 100%;
    width: 5%;
    border-radius: 8px;
    background: linear-gradient(90deg, rgba(var(--accent-rgb), 0.5), var(--accent));
    transition: width 0.35s var(--ease);
}

/* 1 GB ticks across the 8 GB card */
.fx-vram-track::after {
    content: '';
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(90deg, transparent 0 calc(12.5% - 1px), rgba(0, 0, 0, 0.55) calc(12.5% - 1px) 12.5%);
}

.fx-output-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 18px;
    margin-top: 14px;
}

.fx-output-links a {
    font-size: 0.85rem;
    color: var(--text);
    text-decoration: none;
    border-bottom: 1px solid rgba(var(--accent-rgb), 0.5);
}

.fx-output-links a:hover {
    color: var(--accent);
}

/* ---------- Pipeline cards ---------- */

.fx-pipeline {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1px;
    background: var(--stroke);
    border: 1px solid var(--stroke);
    border-radius: var(--r-lg);
    overflow: hidden;
}

.fx-pipeline > div {
    position: relative;
    background: #101014;
    padding: 26px 26px 24px;
}

.fx-pipeline .fx-step {
    font-size: 0.72rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--accent);
}

.fx-pipeline h3 {
    font-size: 1.15rem;
    font-weight: 500;
    color: var(--text);
    margin: 10px 0 6px;
}

.fx-pipeline p {
    font-size: 0.92rem;
    color: var(--muted);
    line-height: 1.6;
    margin: 0;
}

.fx-pipeline .fx-time {
    display: block;
    margin-top: 14px;
    font-size: 0.8rem;
    color: var(--faint);
    font-variant-numeric: tabular-nums;
}

/* ---------- Compare slider ---------- */

.fx-compare {
    --pos: 50%;
    position: relative;
    margin: 0;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid var(--stroke-strong);
    background: #0b0e16;
    user-select: none;
    -webkit-user-select: none;
    touch-action: pan-y;
}

.fx-compare-a {
    position: relative;
}

.fx-compare img {
    display: block;
    width: 100%;
    height: auto;
    pointer-events: none;
}

.fx-compare-b {
    position: absolute;
    inset: 0;
    clip-path: inset(0 0 0 var(--pos));
}

.fx-compare-b img {
    height: 100%;
    object-fit: cover;
}

.fx-compare-label {
    position: absolute;
    top: 14px;
    padding: 5px 11px;
    border-radius: 999px;
    background: rgba(5, 7, 12, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    font-size: 0.7rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--text);
    pointer-events: none;
}

.fx-compare-a .fx-compare-label { left: 14px; }
.fx-compare-b .fx-compare-label { right: 14px; }

/* The seam and its handle follow --pos. */
.fx-compare-seam {
    position: absolute;
    top: 0;
    bottom: 0;
    left: var(--pos);
    width: 2px;
    margin-left: -1px;
    background: var(--accent);
    box-shadow: 0 0 14px rgba(var(--accent-rgb), 0.6);
    pointer-events: none;
}

.fx-compare-seam::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    border: 1px solid var(--accent);
    background-color: rgba(5, 7, 12, 0.7);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 7l-5 5 5 5M15 7l5 5-5 5'/%3E%3C/svg%3E");
    background-position: center;
    background-size: 20px;
    background-repeat: no-repeat;
}

.fx-compare input[type="range"] {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    opacity: 0;
    cursor: ew-resize;
}

.fx-compare input[type="range"]:focus-visible + .fx-compare-seam::after {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
}

.fx-compare-modes {
    display: inline-flex;
    gap: 4px;
    padding: 4px;
    margin-bottom: 16px;
    border: 1px solid var(--stroke);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.03);
}

.fx-compare-modes button {
    font-family: var(--font);
    font-size: 0.8rem;
    color: var(--muted);
    background: transparent;
    border: 0;
    border-radius: 999px;
    padding: 6px 14px;
    cursor: pointer;
    transition: background 0.25s var(--ease), color 0.25s var(--ease);
}

.fx-compare-modes button[aria-pressed="true"] {
    background: var(--accent-soft);
    color: var(--accent);
}

.fx-compare-caption {
    margin-top: 12px;
    font-size: 0.82rem;
    color: var(--faint);
}

/* ---------- Memory story ---------- */

.fx-memory {
    display: grid;
    grid-template-columns: 1fr 1.15fr;
    gap: 56px;
    align-items: start;
}

.fx-memory-figure {
    position: relative;
    padding: 30px;
    background: var(--surface);
    border: 1px solid var(--stroke);
    border-radius: var(--r-lg);
}

.fx-mem-big {
    display: flex;
    align-items: baseline;
    gap: 14px;
    margin-bottom: 6px;
}

.fx-mem-big strong {
    font-size: clamp(3rem, 6vw, 4.6rem);
    font-weight: 300;
    letter-spacing: -0.04em;
    line-height: 1;
    color: var(--text);
}

.fx-mem-big > span {
    font-size: 1rem;
    color: var(--muted);
}

.fx-mem-caption {
    font-size: 0.9rem;
    color: var(--muted);
    margin-bottom: 28px;
}

.fx-mem-scale {
    display: grid;
    gap: 14px;
}

.fx-mem-row {
    display: grid;
    grid-template-columns: 150px 1fr 64px;
    gap: 14px;
    align-items: center;
    font-size: 0.84rem;
    color: var(--muted);
}

.fx-mem-row b {
    font-weight: 500;
    color: var(--text);
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.fx-mem-row .fx-bar i {
    background: rgba(255, 255, 255, 0.22);
}

.fx-mem-row.is-card .fx-bar i {
    background: rgba(255, 255, 255, 0.38);
}

.fx-mem-row.is-peak .fx-bar i {
    background: linear-gradient(90deg, rgba(var(--accent-rgb), 0.45), var(--accent));
    box-shadow: 0 0 18px rgba(var(--accent-rgb), 0.4);
}

.fx-mem-row.is-peak span,
.fx-mem-row.is-peak b {
    color: var(--accent);
}

.fx-mem-note {
    margin-top: 24px;
    padding-top: 18px;
    border-top: 1px solid var(--stroke);
    font-size: 0.86rem;
    color: var(--muted);
    line-height: 1.65;
}

.fx-techniques {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1px;
    background: var(--stroke);
    border: 1px solid var(--stroke);
    border-radius: var(--r-lg);
    overflow: hidden;
}

.fx-techniques > div {
    position: relative;
    background: #101014;
    padding: 22px 24px 20px;
}

.fx-techniques h3 {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text);
    margin: 0 0 6px;
}

.fx-techniques p {
    font-size: 0.88rem;
    color: var(--muted);
    line-height: 1.6;
    margin: 0;
}

.fx-techniques .fx-num {
    display: block;
    font-size: 0.72rem;
    letter-spacing: 0.14em;
    color: var(--accent);
    margin-bottom: 10px;
    font-variant-numeric: tabular-nums;
}

/* ---------- Depth section ---------- */

.fx-depth {
    display: grid;
    grid-template-columns: 1.35fr 1fr;
    gap: 48px;
    align-items: center;
}

.fx-depth-strip {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-top: 18px;
}

.fx-depth-strip figure {
    margin: 0;
}

.fx-depth-strip img {
    display: block;
    width: 100%;
    aspect-ratio: 3 / 2;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--stroke);
}

.fx-depth-strip figcaption {
    margin-top: 6px;
    font-size: 0.72rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--faint);
}

/* ---------- Generation families ---------- */

.fx-families {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1px;
    background: var(--stroke);
    border: 1px solid var(--stroke);
    border-radius: var(--r-lg);
    overflow: hidden;
}

.fx-families > div {
    position: relative;
    background: #101014;
    padding: 24px 22px 22px;
}

.fx-families h3 {
    font-size: 1.02rem;
    font-weight: 500;
    color: var(--text);
    margin: 0 0 6px;
}

.fx-families p {
    font-size: 0.86rem;
    color: var(--muted);
    line-height: 1.55;
    margin: 0 0 12px;
}

.fx-families small {
    display: block;
    font-size: 0.74rem;
    color: var(--faint);
    line-height: 1.5;
}

.fx-families h3::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    margin-right: 10px;
    vertical-align: 0.15em;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 10px rgba(var(--accent-rgb), 0.6);
}

.theme-forge :is(.fx-techniques > div, .fx-families > div, .fx-pipeline > div)::after {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 50%), rgba(0, 255, 216, 0.06), transparent 45%);
    opacity: 0;
    transition: opacity 0.5s var(--ease);
}

.theme-forge :is(.fx-techniques > div, .fx-families > div, .fx-pipeline > div):hover::after {
    opacity: 1;
}

/* ---------- Responsive ---------- */

@media (max-width: 1000px) {
    .fx-memory,
    .fx-depth {
        grid-template-columns: 1fr;
        gap: 36px;
    }

    .fx-families {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 760px) {
    .fx-pipeline,
    .fx-techniques,
    .fx-families {
        grid-template-columns: 1fr;
    }

    .fx-mem-row {
        grid-template-columns: 110px 1fr 54px;
    }
}

/* ---------- v2 layout helpers ---------- */

.fx-label-note {
    text-transform: none;
    letter-spacing: 0;
    color: var(--faint);
    opacity: 0.8;
}

/* The generated clip is 4:3. */
.fx-output-frame.fx-output-frame--43 {
    aspect-ratio: 4 / 3;
}

.fx-section--tight {
    padding-top: 56px;
}

.fx-h3 {
    font-size: clamp(1.4rem, 2.6vw, 1.9rem);
    font-weight: 300;
    letter-spacing: -0.025em;
    line-height: 1.15;
    color: var(--text);
    margin: 0 0 16px;
}

.fx-split--compare {
    margin-top: 72px;
    grid-template-columns: 1fr 1.35fr;
}

.fx-travel {
    margin-top: 56px;
}

.fx-families {
    grid-template-columns: repeat(3, 1fr);
}

.fx-codecs {
    grid-template-columns: repeat(5, 1fr);
}

@media (max-width: 1000px) {
    .fx-split--compare {
        grid-template-columns: 1fr;
    }

    .fx-families {
        grid-template-columns: repeat(2, 1fr);
    }

    .fx-codecs {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 760px) {
    .fx-families {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .fx-codecs {
        grid-template-columns: 1fr 1fr;
    }
}
