:root {
    --white: #ffffff;
    --black: #080b12;
    --ink: #111827;
    --muted: #667085;
    --line: rgba(15, 23, 42, 0.10);
    --blue: #2563eb;
    --blue-light: #60a5fa;
    --cyan: #22d3ee;
    --purple: #8b5cf6;
    --green: #22c55e;
    --amber: #f59e0b;
    --radius: 2rem;
    --shadow: 0 28px 70px rgba(15, 23, 42, 0.18);
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: "Inter", system-ui, sans-serif;
    color: var(--ink);
    background: var(--white);
    overflow-x: hidden;
}

.template-section {
    min-height: 100vh;
    padding: 4rem 0;
    display: flex;
    align-items: center;
}

.mini-title {
    display: inline-flex;
    color: var(--blue);
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 999px;
    padding: 0.55rem 0.85rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.75rem;
    margin-bottom: 1.5rem;
}

.fusion-stack-section {
    background:
        radial-gradient(circle at top right, rgba(37, 99, 235, 0.14), transparent 28%),
        radial-gradient(circle at bottom left, rgba(139, 92, 246, 0.08), transparent 30%),
        linear-gradient(180deg, #f8fbff 0%, #ffffff 100%);
}

.stack-layout {
    display: grid;
    grid-template-columns: 0.9fr 1.1fr;
    gap: 2rem;
    align-items: center;
}

.stack-copy {
    position: relative;
    overflow: hidden;
    border-radius: 1.8rem;
    padding: 1.15rem;
    margin: -1.15rem;
}

.constellation-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 72%;
    z-index: 0;
    opacity: 0.92;
    pointer-events: none;
}

.stack-copy span,
.stack-copy h1,
.stack-copy p,
.copy-keywords {
    position: relative;
    z-index: 2;
}

.stack-copy span {
    color: var(--blue);
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.stack-copy h1 {
    color: var(--black);
    /* font-size: clamp(3rem, 5.5vw, 6.1rem); */
    font-size: 51px;
    line-height: 0.88;
    letter-spacing: -0.08em;
    font-weight: 900;
    margin: 1rem 0;
}

.stack-copy p {
    color: var(--muted);
    font-size: 1.15rem;
    line-height: 1.7;
    font-weight: 600;
    max-width: 680px;
}

.copy-keywords {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    margin-top: 1.35rem;
}

.copy-keywords span {
    color: var(--blue);
    background: rgba(239, 246, 255, 0.85);
    border: 1px solid #bfdbfe;
    border-radius: 999px;
    padding: 0.55rem 0.75rem;
    font-size: 0.85rem;
    font-weight: 900;
    text-transform: none;
    letter-spacing: 0;
}

.stack-visual {
    position: relative;
    min-height: 720px;
}

.glass-founder {
    position: absolute;
    width: min(520px, 88%);
    display: flex;
    align-items: center;
    gap: 1rem;
    border-radius: 1.7rem;
    border: 1px solid rgba(255, 255, 255, 0.54);
    background: rgba(255, 255, 255, 0.42);
    backdrop-filter: blur(28px) saturate(1.35);
    -webkit-backdrop-filter: blur(28px) saturate(1.35);
    box-shadow: 0 28px 70px rgba(15, 23, 42, 0.12);
    padding: 1rem;
    z-index: 4;
    transition: transform 0.35s ease, box-shadow 0.35s ease, border-color 0.35s ease, background 0.35s ease, backdrop-filter 0.35s ease;
}

.glass-founder.is-active {
    border-color: rgba(96, 165, 250, 0.85);
    background: rgba(255, 255, 255, 0.68);
    backdrop-filter: blur(24px) saturate(1.45);
    -webkit-backdrop-filter: blur(24px) saturate(1.45);
    box-shadow: 0 30px 85px rgba(37, 99, 235, 0.22);
}

.glass-founder.is-colorized {
    border-color: rgba(255, 255, 255, 0.88);
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(18px) saturate(1.20);
    -webkit-backdrop-filter: blur(18px) saturate(1.20);
    box-shadow: 0 32px 90px rgba(15, 23, 42, 0.18);
}

.photo-shell {
    position: relative;
    width: 138px;
    height: 138px;
    border-radius: 1.3rem;
    overflow: hidden;
    flex-shrink: 0;
    background: #e5e7eb;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35);
}

.photo-shell img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border-radius: inherit;
    object-fit: cover;
}

.photo-base {
    filter: grayscale(100%);
}

.photo-color {
    filter: saturate(1.05) contrast(1.02);
    clip-path: polygon(-30% 0, -30% 0, -30% 0, -30% 0);
    opacity: 0;
}

.photo-shell::before {
    content: "";
    position: absolute;
    inset: -55%;
    z-index: 4;
    background: linear-gradient(135deg, transparent 43%, rgba(255, 255, 255, 0.95) 49%, rgba(96, 165, 250, 0.78) 50%, transparent 57%);
    transform: translate3d(-82%, -82%, 0);
    opacity: 0;
    pointer-events: none;
}

.photo-shell::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 5;
    border-radius: inherit;
    border: 1px solid rgba(96, 165, 250, 0);
    pointer-events: none;
}

.glass-founder.is-photo-compiling .photo-color {
    opacity: 1;
    animation: diagonalColorReveal 1.05s linear forwards;
}

.glass-founder.is-photo-compiling .photo-shell::before {
    opacity: 1;
    animation: diagonalScan 1.05s linear forwards;
}

.glass-founder.is-photo-compiling .photo-shell::after {
    animation: compileBorderPulse 1.05s ease forwards;
}

.glass-founder.is-colorized .photo-color {
    opacity: 1;
    clip-path: polygon(0 0, 128% 0, 100% 128%, 0 100%);
}

.glass-founder.is-colorized .photo-base {
    filter: grayscale(100%) brightness(0.72);
}

.glass-founder span {
    color: var(--blue);
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.78rem;
}

.glass-founder h2 {
    font-size: 2.8rem;
    line-height: 0.9;
    letter-spacing: -0.07em;
    font-weight: 900;
    margin: 0.55rem 0 0.2rem;
}

.glass-founder p {
    color: var(--muted);
    margin: 0;
    font-weight: 900;
}

.glass-stephen {
    top: 8%;
    left: 0;
    transform: rotate(-3deg);
}

.glass-stephen.is-active {
    transform: rotate(-3deg) translateY(-8px) scale(1.02);
}

.glass-loic {
    right: 0;
    top: 34%;
    transform: rotate(4deg);
}

.glass-loic.is-active {
    transform: rotate(4deg) translateY(-8px) scale(1.02);
}

.print-overlay {
    position: absolute;
    left: 50%;
    top: 53%;
    width: min(680px, 92%);
    transform: translate(-50%, -50%) scale(0.96);
    z-index: 8;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.28s ease, transform 0.28s ease;
}

.print-overlay.is-visible {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.print-overlay-inner {
    position: relative;
    overflow: hidden;
    border-radius: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.74);
    background: rgba(255, 255, 255, 0.82);
    backdrop-filter: blur(28px) saturate(1.35);
    -webkit-backdrop-filter: blur(28px) saturate(1.35);
    box-shadow: 0 32px 95px rgba(37, 99, 235, 0.22);
    padding: 1.2rem 1.35rem;
}

.print-overlay-inner::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(115deg, transparent 0%, rgba(96, 165, 250, 0.16) 42%, rgba(34, 211, 238, 0.28) 50%, rgba(96, 165, 250, 0.16) 58%, transparent 100%);
    transform: translateX(-110%);
}

.print-overlay.is-visible .print-overlay-inner::before {
    animation: overlayScan 1.35s ease forwards;
}

.print-label {
    display: inline-flex;
    color: var(--blue);
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 999px;
    padding: 0.35rem 0.55rem;
    font-family: monospace;
    font-weight: 900;
    font-size: 0.78rem;
    margin-bottom: 0.65rem;
}

.print-overlay strong {
    position: relative;
    display: block;
    color: var(--black);
    font-size: clamp(1.35rem, 2.8vw, 2.55rem);
    line-height: 1.02;
    letter-spacing: -0.055em;
    font-weight: 900;
}

.mini-terminal {
    position: absolute;
    left: 8%;
    bottom: 6%;
    width: min(600px, 88%);
    border: 1px solid rgba(15, 23, 42, 0.10);
    background: #080b12;
    border-radius: 1.6rem;
    overflow: hidden;
    box-shadow: var(--shadow);
    z-index: 3;
}

.mini-terminal-top {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: #111827;
    border-bottom: 1px solid rgba(255, 255, 255, 0.10);
    padding: 1rem;
}

.mini-terminal-top span {
    width: 0.75rem;
    height: 0.75rem;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.24);
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.12);
}

.mini-terminal-top span:nth-child(1) {
    background: #ff5f57;
}

.mini-terminal-top span:nth-child(2) {
    background: #ffbd2e;
}

.mini-terminal-top span:nth-child(3) {
    background: #28c840;
}

.mini-terminal-top strong {
    margin-left: auto;
    color: #94a3b8;
    font-family: monospace;
    font-size: 0.85rem;
    font-weight: 700;
}

.mini-terminal-body {
    min-height: 300px;
    display: grid;
    align-content: end;
    gap: 0.75rem;
    padding: 1rem;
}

.terminal-output {
    display: grid;
    gap: 0.55rem;
    max-height: 258px;
    overflow: hidden;
}

.terminal-entry {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.7rem;
    align-items: start;
    color: #cbd5e1;
    font-family: monospace;
    font-size: 0.9rem;
    line-height: 1.45;
    opacity: 0;
    transform: translateY(6px);
    animation: terminalEntry 0.35s ease forwards;
}

.terminal-entry::before {
    content: ">";
    color: var(--green);
    font-weight: 900;
}

.terminal-entry.success::before {
    content: "✓";
    color: var(--cyan);
}

.terminal-entry.warning::before {
    content: "◆";
    color: var(--amber);
}

.terminal-entry.photo::before {
    content: "◩";
    color: var(--blue-light);
}

.terminal-entry.dynamic::before {
    content: "↳";
    color: var(--purple);
}

.terminal-entry strong {
    color: var(--white);
    font-weight: 900;
}

.terminal-entry span {
    color: #93c5fd;
}

.terminal-cursor-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-height: 1.4rem;
    color: #e5e7eb;
    font-family: monospace;
}

.terminal-prompt {
    color: var(--green);
    font-weight: 900;
}

.terminal-current {
    color: #e5e7eb;
}

.cursor {
    width: 0.6rem;
    height: 1.1rem;
    display: inline-block;
    background: var(--cyan);
    animation: blink 0.85s steps(2, start) infinite;
}

.stack-orb {
    position: absolute;
    display: grid;
    place-items: center;
    width: 86px;
    height: 86px;
    border-radius: 50%;
    color: var(--white);
    font-weight: 900;
    background: linear-gradient(135deg, var(--blue), var(--blue-light));
    box-shadow: 0 16px 40px rgba(37, 99, 235, 0.18);
    z-index: 2;
}

.orb-one {
    right: 8%;
    top: 4%;
}

.orb-two {
    left: 8%;
    top: 42%;
    background: linear-gradient(135deg, #64748b, var(--blue));
}

.orb-three {
    right: 0;
    bottom: 18%;
    background: linear-gradient(135deg, var(--amber), var(--blue-light));
}

.orb-four {
    left: 0;
    bottom: 0;
    background: linear-gradient(135deg, var(--cyan), var(--blue));
}

@keyframes diagonalColorReveal {
    0% {
        clip-path: polygon(-30% 0, -30% 0, -30% 0, -30% 0);
    }

    100% {
        clip-path: polygon(0 0, 128% 0, 100% 128%, 0 100%);
    }
}

@keyframes diagonalScan {
    0% {
        transform: translate3d(-82%, -82%, 0);
    }

    100% {
        transform: translate3d(82%, 82%, 0);
    }
}

@keyframes compileBorderPulse {
    0% {
        border-color: rgba(96, 165, 250, 0);
        box-shadow: inset 0 0 0 0 rgba(96, 165, 250, 0);
    }

    35% {
        border-color: rgba(96, 165, 250, 0.95);
        box-shadow: inset 0 0 0 3px rgba(96, 165, 250, 0.18);
    }

    100% {
        border-color: rgba(96, 165, 250, 0);
        box-shadow: inset 0 0 0 0 rgba(96, 165, 250, 0);
    }
}

@keyframes overlayScan {
    0% {
        transform: translateX(-110%);
    }

    100% {
        transform: translateX(110%);
    }
}

@keyframes blink {

    0%,
    45% {
        opacity: 1;
    }

    46%,
    100% {
        opacity: 0;
    }
}

@keyframes terminalEntry {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 1199px) {
    .stack-layout {
        grid-template-columns: 1fr;
    }

    .stack-visual {
        min-height: 760px;
    }
}

@media (max-width: 767px) {
    .template-section {
        padding: 3rem 0;
    }

    .glass-founder {
        position: static;
        width: 100%;
        transform: none;
        margin-bottom: 1rem;
        display: grid;
    }

    .glass-stephen.is-active,
    .glass-loic.is-active {
        transform: translateY(-4px);
    }

    .stack-visual {
        min-height: auto;
    }

    .mini-terminal {
        position: static;
        width: 100%;
    }

    .print-overlay {
        position: static;
        width: 100%;
        transform: none;
        margin-bottom: 1rem;
    }

    .print-overlay.is-visible {
        transform: none;
    }

    .stack-orb {
        display: none;
    }

    .mini-terminal-top strong {
        display: none;
    }

    .photo-shell {
        width: 150px;
        height: 150px;
    }
}