/**
 * HTML form code examples bento animation.
 * Scoped to body.pl-landing-time only.
 */
body.pl-landing-time .pl-time-forms-code-stage {
    margin-top: auto;
    flex: 0 0 auto;
    height: 276px;
    min-height: 276px;
    max-height: 276px;
    padding: 14px 14px 0;
    display: flex;
    align-items: stretch;
    background: #fafafa;
    border-color: rgba(0, 0, 0, 0.06);
    overflow: hidden;
}

body.pl-landing-time .pl-forms-code-anim {
    --forms-code-cycle: 9s;
    width: 100%;
    height: 100%;
    min-height: 0;
}

body.pl-landing-time .pl-forms-code-anim__window {
    display: flex;
    flex-direction: column;
    height: 100%;
    border-radius: 12px 12px 0 0;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-bottom: none;
    background: #0b1020;
    box-shadow:
        0 1px 2px rgba(0, 0, 0, 0.04),
        0 12px 28px rgba(0, 0, 0, 0.12);
    overflow: hidden;
    opacity: 0;
    transform: translateY(8px);
    animation: plFormsCodeShellIn var(--forms-code-cycle) cubic-bezier(0.22, 1, 0.36, 1) 1 forwards;
}

body.pl-landing-time .pl-forms-code-anim__chrome {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(255, 255, 255, 0.03);
}

body.pl-landing-time .pl-forms-code-anim__dots {
    display: inline-flex;
    gap: 4px;
}

body.pl-landing-time .pl-forms-code-anim__dots span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
}

body.pl-landing-time .pl-forms-code-anim__dots span:nth-child(1) { background: #ff5f57; }
body.pl-landing-time .pl-forms-code-anim__dots span:nth-child(2) { background: #febc2e; }
body.pl-landing-time .pl-forms-code-anim__dots span:nth-child(3) { background: #28c840; }

body.pl-landing-time .pl-forms-code-anim__file {
    font-size: 9px;
    font-weight: 500;
    color: rgba(226, 232, 240, 0.72);
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

body.pl-landing-time .pl-forms-code-anim__file::after {
    content: "contact.html";
    animation: plFormsCodeFile var(--forms-code-cycle) steps(1, end) 1 forwards;
}

body.pl-landing-time .pl-forms-code-anim__tabs {
    display: flex;
    gap: 4px;
    padding: 6px 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

body.pl-landing-time .pl-forms-code-anim__tab {
    padding: 5px 8px;
    border-radius: 6px 6px 0 0;
    font-size: 8px;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: rgba(226, 232, 240, 0.5);
    border: 1px solid transparent;
    animation: plFormsCodeTab var(--forms-code-cycle) ease 1 forwards;
}

body.pl-landing-time .pl-forms-code-anim__tab--html { animation-name: plFormsCodeTabHtml; }
body.pl-landing-time .pl-forms-code-anim__tab--js { animation-name: plFormsCodeTabJs; }
body.pl-landing-time .pl-forms-code-anim__tab--next { animation-name: plFormsCodeTabNext; }

body.pl-landing-time .pl-forms-code-anim__panels {
    position: relative;
    flex: 1;
    min-height: 0;
    padding: 10px 12px 12px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 8.5px;
    line-height: 1.55;
    color: #e2e8f0;
}

body.pl-landing-time .pl-forms-code-anim__panel {
    position: absolute;
    inset: 10px 12px 12px;
    margin: 0;
    opacity: 0;
    transform: translateY(4px);
    white-space: pre;
    overflow: hidden;
}

body.pl-landing-time .pl-forms-code-anim__panel--html {
    animation: plFormsCodePanelHtml var(--forms-code-cycle) ease 1 forwards;
}

body.pl-landing-time .pl-forms-code-anim__panel--js {
    animation: plFormsCodePanelJs var(--forms-code-cycle) ease 1 forwards;
}

body.pl-landing-time .pl-forms-code-anim__panel--next {
    animation: plFormsCodePanelNext var(--forms-code-cycle) ease 1 forwards;
}

body.pl-landing-time .pl-forms-code-anim__panel em {
    color: #a78bfa;
    font-style: normal;
}

body.pl-landing-time .pl-forms-code-anim__panel strong {
    color: #f472b6;
    font-weight: 600;
}

body.pl-landing-time .pl-forms-code-anim__cursor {
    display: inline-block;
    width: 1px;
    height: 0.95em;
    background: #a78bfa;
    vertical-align: text-bottom;
    margin-left: 1px;
    animation: plFormsCodeBlink 1s step-end infinite;
}

@keyframes plFormsCodeShellIn {
    0% { opacity: 0; transform: translateY(8px); }
    4%, 100% { opacity: 1; transform: translateY(0); }
}

@keyframes plFormsCodeFile {
    0%, 30% { content: "contact.html"; }
    33%, 63% { content: "submit.js"; }
    66%, 100% { content: "ContactForm.tsx"; }
}

@keyframes plFormsCodeTabHtml {
    0%, 30% { color: #f8fafc; background: rgba(124, 58, 237, 0.18); border-color: rgba(124, 58, 237, 0.35); }
    31%, 100% { color: rgba(226, 232, 240, 0.5); background: transparent; border-color: transparent; }
}

@keyframes plFormsCodeTabJs {
    0%, 30% { color: rgba(226, 232, 240, 0.5); background: transparent; border-color: transparent; }
    31%, 63% { color: #f8fafc; background: rgba(124, 58, 237, 0.18); border-color: rgba(124, 58, 237, 0.35); }
    64%, 100% { color: rgba(226, 232, 240, 0.5); background: transparent; border-color: transparent; }
}

@keyframes plFormsCodeTabNext {
    0%, 63% { color: rgba(226, 232, 240, 0.5); background: transparent; border-color: transparent; }
    64%, 100% { color: #f8fafc; background: rgba(124, 58, 237, 0.18); border-color: rgba(124, 58, 237, 0.35); }
}

@keyframes plFormsCodePanelHtml {
    0%, 4% { opacity: 0; transform: translateY(4px); }
    8%, 30% { opacity: 1; transform: translateY(0); }
    34%, 100% { opacity: 0; transform: translateY(-4px); }
}

@keyframes plFormsCodePanelJs {
    0%, 30% { opacity: 0; transform: translateY(4px); }
    34%, 63% { opacity: 1; transform: translateY(0); }
    67%, 100% { opacity: 0; transform: translateY(-4px); }
}

@keyframes plFormsCodePanelNext {
    0%, 63% { opacity: 0; transform: translateY(4px); }
    67%, 100% { opacity: 1; transform: translateY(0); }
}

@keyframes plFormsCodeBlink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
    body.pl-landing-time .pl-forms-code-anim__window,
    body.pl-landing-time .pl-forms-code-anim__tab,
    body.pl-landing-time .pl-forms-code-anim__panel {
        animation: none !important;
        opacity: 1;
        transform: none;
    }

    body.pl-landing-time .pl-forms-code-anim__panel:not(.pl-forms-code-anim__panel--html) {
        display: none;
    }
}
