/* miris.dev - The Developer Workspace */

/* === Reset & Base === */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: #0D1117;
    color: #C9D1D9;
    font-family: 'Inter', -apple-system, sans-serif;
    font-weight: 400;
    font-size: clamp(0.95rem, 1.6vw, 1.05rem);
    line-height: 1.65;
    overflow-x: hidden;
}

/* === Terminal Hero === */
.terminal-hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 24px;
    scroll-snap-align: start;
}

/* === Terminal Window === */
.terminal-window {
    max-width: 640px;
    width: 100%;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
}

.terminal-titlebar {
    background: #21262D;
    height: 32px;
    display: flex;
    align-items: center;
    padding: 0 12px;
    gap: 8px;
}

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

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

.terminal-body {
    background: #161B22;
    padding: 16px;
    min-height: 140px;
    position: relative;
}

.terminal-line {
    font-family: 'Fira Code', monospace;
    font-size: clamp(0.85rem, 1.4vw, 1rem);
    line-height: 1.8;
    white-space: nowrap;
    overflow: hidden;
}

.terminal-line .prompt {
    color: #7EE787;
}

.terminal-line .cmd,
.terminal-line.response span {
    visibility: hidden;
}

.terminal-line .cmd.typed,
.terminal-line.response span.typed {
    visibility: visible;
}

.syntax-green { color: #7EE787; }
.syntax-blue { color: #79C0FF; }
.syntax-orange { color: #FFA657; }
.syntax-purple { color: #D2A8FF; }
.text-primary { color: #C9D1D9; }

.cursor {
    display: inline;
    font-family: 'Fira Code', monospace;
    font-size: clamp(0.85rem, 1.4vw, 1rem);
    color: #C9D1D9;
    animation: blink 1.06s step-end infinite;
    position: absolute;
    visibility: hidden;
}

.cursor.visible {
    visibility: visible;
}

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

/* === Hero Domain & Nav === */
.hero-domain {
    font-family: 'Fira Code', monospace;
    font-weight: 400;
    font-size: clamp(1.8rem, 4vw, 3rem);
    color: #C9D1D9;
    margin-top: 40px;
    text-align: center;
}

.hero-nav {
    display: flex;
    gap: 24px;
    margin-top: 24px;
    flex-wrap: wrap;
    justify-content: center;
}

.nav-cmd {
    font-family: 'Fira Code', monospace;
    font-size: 0.85rem;
    color: #79C0FF;
    text-decoration: none;
    position: relative;
}

.nav-cmd::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 1px;
    background: #79C0FF;
    transition: width 0.3s ease;
}

.nav-cmd:hover::after {
    width: 100%;
}

/* === Workspace Layout === */
.workspace {
    display: flex;
    position: relative;
}

/* === Sidebar === */
.sidebar {
    width: 200px;
    position: sticky;
    top: 0;
    height: 100vh;
    background: #0D1117;
    border-right: 1px solid #21262D;
    padding: 16px;
    flex-shrink: 0;
}

.file-tree {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.tree-item {
    font-family: 'IBM Plex Sans', sans-serif;
    font-weight: 500;
    font-size: 0.8rem;
    color: #8B949E;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    border-radius: 4px;
    text-decoration: none;
    cursor: pointer;
    border-left: 2px solid transparent;
}

.tree-item.indent {
    padding-left: 24px;
}

.tree-item.active {
    color: #C9D1D9;
    border-left-color: #79C0FF;
}

.tree-item:hover {
    color: #C9D1D9;
    background: rgba(33, 38, 45, 0.5);
}

.tree-icon {
    font-size: 0.65rem;
    color: #8B949E;
}

/* === Main Content === */
.main-content {
    flex: 1;
    padding: 40px 32px;
    min-width: 0;
}

.content-section {
    margin-bottom: 60px;
}

.section-title {
    font-family: 'Fira Code', monospace;
    font-weight: 400;
    font-size: 1.2rem;
    color: #8B949E;
    margin-bottom: 24px;
    padding-bottom: 8px;
    border-bottom: 1px solid #21262D;
}

/* === Repo Cards === */
.repo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.repo-card {
    background: #161B22;
    border: 1px solid #21262D;
    border-radius: 6px;
    padding: 20px;
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.repo-card.revealed {
    opacity: 1;
    transform: translateY(0);
}

.repo-name {
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 1.05rem;
    color: #79C0FF;
    margin-bottom: 6px;
}

.repo-desc {
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    font-size: 0.9rem;
    color: #8B949E;
    margin-bottom: 12px;
    line-height: 1.5;
}

.repo-meta {
    display: flex;
    align-items: center;
    gap: 8px;
}

.lang-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

.lang-name {
    font-family: 'Fira Code', monospace;
    font-size: 0.75rem;
    color: #8B949E;
}

.repo-status {
    font-family: 'IBM Plex Sans', sans-serif;
    font-weight: 500;
    font-size: 0.7rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin-left: auto;
    padding: 2px 8px;
    border-radius: 999px;
}

.repo-status.success { background: rgba(126, 231, 135, 0.15); color: #7EE787; }
.repo-status.warning { background: rgba(255, 166, 87, 0.15); color: #FFA657; }
.repo-status.muted { background: rgba(139, 148, 158, 0.15); color: #8B949E; }

/* === Tech Stack Grid === */
.stack-grid {
    display: grid;
    grid-template-columns: repeat(4, 80px);
    gap: 12px;
}

.stack-box {
    width: 80px;
    height: 80px;
    border: 1px solid #21262D;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #161B22;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.stack-box.revealed {
    opacity: 1;
}

.stack-label {
    font-family: 'IBM Plex Sans', sans-serif;
    font-weight: 500;
    font-size: 0.7rem;
    color: #C9D1D9;
    text-align: center;
}

/* === Build Log === */
.build-log {
    border: 1px solid #21262D;
    border-radius: 6px;
    overflow: hidden;
}

.build-row {
    display: grid;
    grid-template-columns: 24px 80px 100px 1fr;
    gap: 12px;
    align-items: center;
    padding: 10px 16px;
    border-bottom: 1px solid #21262D;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.build-row.revealed {
    opacity: 1;
    transform: translateY(0);
}

.build-row.dim {
    opacity: 0;
}

.build-row.dim.revealed {
    opacity: 0.5;
}

.build-row:last-child {
    border-bottom: none;
}

.build-status {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.status-green { background: #7EE787; }
.status-amber { background: #FFA657; }

.build-version {
    font-family: 'Fira Code', monospace;
    font-size: 0.85rem;
    color: #C9D1D9;
}

.build-date {
    font-family: 'Inter', sans-serif;
    font-size: 0.8rem;
    color: #8B949E;
}

.build-msg {
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    color: #8B949E;
}

/* === README === */
.readme-content {
    background: #161B22;
    border: 1px solid #21262D;
    border-radius: 6px;
    padding: 32px;
    max-width: 700px;
}

.readme-h2 {
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 1.3rem;
    color: #C9D1D9;
    margin-top: 24px;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #21262D;
}

.readme-h2:first-child {
    margin-top: 0;
}

.readme-content p {
    margin-bottom: 12px;
    color: #C9D1D9;
}

.readme-list {
    list-style: none;
    margin-bottom: 16px;
    padding-left: 0;
}

.readme-list li {
    position: relative;
    padding-left: 16px;
    margin-bottom: 6px;
    color: #C9D1D9;
}

.readme-list li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.55em;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #79C0FF;
}

.readme-link {
    color: #79C0FF;
    text-decoration: none;
}

.readme-link:hover {
    text-decoration: underline;
}

.readme-code {
    background: #0D1117;
    padding: 12px 16px;
    border-radius: 6px;
    margin-top: 16px;
    font-family: 'Fira Code', monospace;
    font-size: 0.85rem;
}

/* === Responsive === */
@media (max-width: 768px) {
    .sidebar {
        display: none;
    }

    .main-content {
        padding: 24px 16px;
    }

    .repo-grid {
        grid-template-columns: 1fr;
    }

    .stack-grid {
        grid-template-columns: repeat(2, 80px);
    }

    .build-row {
        grid-template-columns: 24px 70px 1fr;
    }

    .build-date {
        display: none;
    }

    .hero-nav {
        flex-direction: column;
        align-items: center;
        gap: 12px;
    }
}
