body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    padding-bottom: 60px;
}

/* Main content area */
.hero {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.stack {
    width: 100%;
    max-width: 980px;
    display: grid;
    gap: 12px;
}

/* Editor window */
.editor {
    border-radius: 14px;
    background: linear-gradient(180deg, #101823, #0c1219);
    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.45),
        inset 0 1px 0 rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    overflow: hidden;
}

.editor-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: linear-gradient(180deg, #1a2332, #151d28);
    border-bottom: 1px solid rgba(0, 0, 0, 0.3);
}

.dot {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #ff5f56;
    position: relative;
    flex-shrink: 0;
}

.dot::after {
    content: "";
    position: absolute;
    left: 20px;
    top: 0;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #ffbd2e;
}

.dot::before {
    content: "";
    position: absolute;
    left: 40px;
    top: 0;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #27c93f;
}

.editor-title {
    color: var(--muted);
    font:
        500 13px/1.2 system-ui,
        -apple-system,
        Segoe UI,
        Roboto,
        Arial,
        sans-serif;
    opacity: 0.85;
    margin-left: 50px;
}

.editor-content {
    padding: 20px 24px;
    height: 500px;
    overflow-y: auto;
}

/* Terminal window */
.terminal {
    border-radius: 14px;
    background: linear-gradient(180deg, #0b121a, #0a1016);
    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.45),
        inset 0 1px 0 rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    padding: 18px 22px;
    height: 126px;
    overflow-y: auto;
}

.term-title {
    font:
        600 12px/1 system-ui,
        -apple-system,
        Segoe UI,
        Roboto,
        Arial,
        sans-serif;
    color: var(--muted);
    margin-bottom: 12px;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

/* Code styling */
pre {
    margin: 0;
    font-family: var(--mono);
    font-size: 18px;
    line-height: 1.5;
    white-space: pre;
}

.line {
    display: block;
}

.caret {
    display: inline-block;
    width: 2px;
    height: 1em;
    vertical-align: -0.2em;
    background: var(--caret);
    margin-left: 2px;
    animation: blink 1s step-end infinite;
}

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

/* Syntax highlighting */
.kw {
    color: #d2a8ff;
}
.name {
    color: #79c0ff;
}
.mod {
    color: #a5d6ff;
}
.attr {
    color: #91e6b3;
}
.str {
    color: #a6e22e;
}
.param {
    color: #ffdf88;
}
.bool {
    color: #ffae7d;
}

.output {
    color: #c8e6ff;
    margin-top: 4px;
}

/* Mobile optimizations */
@media (max-width: 768px) {
    body {
        padding-bottom: 100px;
    }

    .hero {
        padding: 16px;
        align-items: flex-start;
        padding-top: 24px;
    }

    .stack {
        gap: 10px;
    }

    .editor-header {
        padding: 10px 14px;
    }

    .dot {
        width: 10px;
        height: 10px;
    }

    .dot::after,
    .dot::before {
        width: 10px;
        height: 10px;
    }

    .dot::after {
        left: 16px;
    }

    .dot::before {
        left: 32px;
    }

    .editor-title {
        font-size: 12px;
        margin-left: 42px;
    }

    .editor-content {
        padding: 16px 18px;
        height: 400px;
    }

    .terminal {
        padding: 14px 18px;
        height: 105px;
    }

    pre {
        font-size: 14px;
        line-height: 1.4;
        white-space: pre-wrap;
        word-break: break-word;
        overflow-wrap: anywhere;
    }

    .term-title {
        font-size: 11px;
        margin-bottom: 10px;
    }
}

/* Desktop - ensure centered layout with padding */
@media (min-width: 769px) {
    .hero {
        padding: 40px 24px;
    }

    .editor-content {
        height: 607px;
    }

    .terminal {
        height: 151px;
    }

    pre {
        font-size: 20px;
        line-height: 1.4;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .caret {
        display: none;
    }
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Custom scrollbar for editor */
.editor-content::-webkit-scrollbar {
    width: 8px;
}

.editor-content::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
}

.editor-content::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.editor-content::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.15);
}
