/* Forge VFX product page (/forgevfx). 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: 300;
    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 span {
    font-size: 0.86rem;
    color: var(--muted);
    font-weight: 300;
}

/* ---------- 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: 300;
    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;
}

.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(216, 192, 142, 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(216, 192, 142, 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(216, 192, 142, 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-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: 300;
    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: 300;
}

.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: 300;
    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: 300;
    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: 300;
    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: 300;
    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: 300;
    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: 300;
    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;
    }
}
