/* ronri.xyz — Logic Programming Sandbox */

/* Reset */
* { margin: 0; padding: 0; box-sizing: border-box; }

/* Base */
body {
    background: #0D1117;
    color: #7D8590;
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    line-height: 1.65;
}

/* ─── Terminal Chrome ─── */
.terminal-panel {
    background: #161B22;
    border: 1px solid #21262D;
    border-radius: 8px;
    overflow: hidden;
    text-align: left;
}

.terminal-chrome {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: #0D1117;
}

.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.dot.red { background: #FF5F56; }
.dot.yellow { background: #FFBD2E; }
.dot.green { background: #27C93F; }

.pane-label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.7rem;
    color: #7D8590;
    margin-left: auto;
}

/* ─── Syntax Highlighting ─── */
.prompt { color: #7D8590; }
.syntax-predicate { color: #79C0FF; }
.syntax-variable { color: #FFD93D; }
.syntax-result { color: #3FB950; }
.syntax-operator { color: #D2A8FF; }
.syntax-comment { color: #7D8590; font-style: italic; }

.cursor-blink {
    color: #3FB950;
    animation: blink 1s step-end infinite;
}

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

/* ─── Hero Section ─── */
.hero {
    max-width: 700px;
    margin: 0 auto;
    padding: 5rem 2rem 2rem;
    text-align: center;
}

.hero .terminal-panel {
    margin-bottom: 1.5rem;
}

.terminal-body {
    padding: 1.5rem;
}

.code-line {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1rem;
    line-height: 1.8;
}

.tagline {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 600;
    font-size: 1.2rem;
    color: #E6EDF3;
}

/* ─── Section Headings ─── */
.section-heading {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: 2rem;
    letter-spacing: -0.01em;
    color: #E6EDF3;
    margin-bottom: 1.5rem;
}

/* ─── Interactive Editor ─── */
.editor {
    max-width: 900px;
    margin: 0 auto;
    padding: 3rem 2rem;
}

.split-pane {
    display: flex;
    gap: 0;
    border: 1px solid #21262D;
    border-radius: 8px;
    overflow: hidden;
}

.editor-pane {
    flex: 1;
    background: #161B22;
    min-width: 0;
    overflow: auto;
}

.divider {
    width: 4px;
    background: #21262D;
    cursor: col-resize;
    flex-shrink: 0;
    transition: background 0.15s ease;
}

.divider:hover,
.divider.active {
    background: #79C0FF;
}

.code-area {
    padding: 1rem;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.875rem;
    line-height: 1.6;
    overflow: auto;
}

.code-row {
    white-space: nowrap;
}

.line-number {
    color: #7D8590;
    text-align: right;
    display: inline-block;
    min-width: 3rem;
    padding-right: 1rem;
    user-select: none;
    border-right: 1px solid #21262D;
    margin-right: 0.75rem;
}

.trace-line {
    color: #7D8590;
    padding-left: 1rem;
}

/* ─── Example Programs ─── */
.examples {
    max-width: 900px;
    margin: 0 auto;
    padding: 3rem 2rem;
}

.example-scroll {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    padding-bottom: 1rem;
    scrollbar-width: thin;
    scrollbar-color: #21262D #0D1117;
}

.example-scroll::-webkit-scrollbar {
    height: 6px;
}

.example-scroll::-webkit-scrollbar-track {
    background: #0D1117;
}

.example-scroll::-webkit-scrollbar-thumb {
    background: #21262D;
    border-radius: 3px;
}

.example-card {
    background: #161B22;
    border: 1px solid #21262D;
    border-radius: 8px;
    min-width: 260px;
    overflow: hidden;
    flex-shrink: 0;
    transition: border-color 0.2s ease, transform 0.2s ease;
}

.example-card:hover {
    border-color: #79C0FF;
    transform: translateY(-2px);
}

.example-card.active {
    border-color: #3FB950;
}

.example-body {
    padding: 1rem;
}

.example-title {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 600;
    font-size: 0.9rem;
    color: #E6EDF3;
    margin-bottom: 0.5rem;
}

.example-code {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    line-height: 1.5;
}

.load-btn {
    display: block;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    color: #79C0FF;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-top: 1px solid #21262D;
    transition: background 0.15s ease, color 0.15s ease;
}

.load-btn:hover {
    background: #79C0FF;
    color: #0D1117;
}

/* ─── Documentation ─── */
.docs {
    max-width: 900px;
    margin: 0 auto;
    padding: 3rem 2rem;
}

.doc-list {
    display: flex;
    flex-direction: column;
}

.doc-item {
    border-bottom: 1px solid #21262D;
    cursor: pointer;
    transition: background 0.15s ease;
}

.doc-item:hover {
    background: rgba(22, 27, 34, 0.5);
}

.doc-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 0;
    padding-left: 0.5rem;
    padding-right: 0.5rem;
}

.doc-title {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 600;
    font-size: 1rem;
    color: #79C0FF;
}

.doc-toggle {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1rem;
    color: #7D8590;
    transition: transform 0.2s ease, color 0.2s ease;
    user-select: none;
    width: 1.5rem;
    text-align: center;
}

.doc-item.expanded .doc-toggle {
    color: #79C0FF;
}

.doc-desc {
    font-size: 0.85rem;
    color: #7D8590;
    padding: 0 0.5rem 0.75rem;
}

.doc-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease;
}

.doc-item.expanded .doc-content {
    max-height: 400px;
}

.doc-code-block {
    background: #161B22;
    border: 1px solid #21262D;
    border-radius: 6px;
    margin: 0 0.5rem 1rem;
    padding: 1rem;
}

.doc-code {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    line-height: 1.6;
}

/* ─── Footer ─── */
.footer {
    max-width: 700px;
    margin: 0 auto;
    padding: 3rem 2rem;
}

.footer .terminal-panel {
    margin-bottom: 1rem;
}

.footer-cmd {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9rem;
    padding: 1rem;
}

.footer-row {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 0.5rem 0;
}

.footer-version {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    color: #7D8590;
}

.footer-link {
    font-size: 0.85rem;
    color: #79C0FF;
    text-decoration: none;
    transition: color 0.15s ease;
}

.footer-link:hover {
    color: #E6EDF3;
}

/* ─── Responsive ─── */
@media (max-width: 640px) {
    .split-pane {
        flex-direction: column;
    }
    .divider {
        width: 100%;
        height: 4px;
        cursor: row-resize;
    }
    .section-heading {
        font-size: 1.5rem;
    }
}

/* ─── Fade-in Animation ─── */
.fade-in {
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}
