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

:root {
    --text-primary: #c5c8c6;
    --text-secondary: #969896;
    --text-tertiary: #707070;
    --accent-color: #81a2be;
    --accent-hover: #b5bd68;
    --bg-dark: #1d1f21;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'SF Mono', 'Monaco', 'Menlo', 'Consolas', 'Courier New', monospace;
    background: #1e1e1e;
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    cursor: default;
    position: relative;
    font-weight: 400;
    line-height: 1.6;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
}

/* Remove sun glow for Mac terminal look */
body::before,
body::after {
    display: none;
}

.page-container {
    width: 90%;
    max-width: 1200px;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* Page Header - Outside Terminal */
.page-header {
    text-align: left;
    margin-bottom: 0.5rem;
}

.page-header .headline {
    font-size: 2.4rem;
    font-weight: 600;
    letter-spacing: 0;
    margin-bottom: 0.3rem;
    color: #c5c8c6;
    transition: opacity 0.6s ease;
}

.page-header .subtitle {
    font-size: 1.25rem;
    font-weight: 400;
    color: #969896;
    letter-spacing: 0;
    transition: opacity 0.6s ease;
}

.terminal {
    width: 100%;
    background: #1d1f21;
    border-radius: 10px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    position: relative;
    z-index: 10;
}

/* Mac Terminal Header */
.terminal-header {
    background: linear-gradient(to bottom, #3a3a3a 0%, #2b2b2b 100%);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid #1a1a1a;
}

.terminal-buttons {
    display: flex;
    gap: 8px;
    margin-right: auto;
}

.btn {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-close {
    background: #ff5f56;
    border: 0.5px solid #e0443e;
}

.btn-minimize {
    background: #ffbd2e;
    border: 0.5px solid #dea123;
}

.btn-maximize {
    background: #27c93f;
    border: 0.5px solid #1aab2b;
}

.btn:hover {
    opacity: 0.8;
}

.terminal-title {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    color: #8a8a8a;
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.3px;
}

.terminal-content {
    width: 100%;
    position: relative;
    z-index: 1;
    padding: 1.5rem 2rem 2rem 2rem;
    height: 60vh;
    overflow-y: auto;
    background: #1d1f21;
    /* Prevent browser scroll anchoring causing jumps when appending content */
    overflow-anchor: none;
}

.terminal-output {
    margin-bottom: 2rem;
}

/* Prompt Line */
.prompt-line {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    font-weight: 400;
    letter-spacing: 0;
    line-height: 1.6;
}

.prompt-path {
    color: #b5bd68;
    font-weight: 500;
}

.prompt-symbol {
    color: var(--text-secondary);
    margin: 0 0.5rem;
}

.prompt-command {
    color: #81a2be;
}

/* Navigation Links */
.nav-links {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem 1rem;
    margin-bottom: 1rem;
}

.nav-links a {
    color: var(--accent-color);
    text-decoration: none;
    font-size: 1.1rem;
    font-weight: 400;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-block;
    width: fit-content;
    letter-spacing: 0;
    line-height: 1.8;
    padding: 0;
}

.nav-links a:hover {
    color: var(--accent-hover);
    transform: translateX(5px);
}

/* Input Line */
.input-line {
    font-size: 1.1rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    margin-top: 2rem;
    letter-spacing: 0;
    line-height: 1.6;
}

.input-text {
    color: var(--text-primary);
}

.cursor {
    color: var(--text-primary);
    animation: blink 1.2s step-end infinite;
    font-weight: 400;
    margin-left: 1px;
    background: var(--text-primary);
    width: 8px;
    height: 18px;
    display: inline-block;
}

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

/* Command Output */
.command-output {
    /* Remove top margin to prevent visible jump when content starts printing */
    margin: 0 0 3rem 0;
    color: var(--text-secondary);
    font-size: 1rem;
    line-height: 1.6;
    font-weight: 400;
    letter-spacing: 0;
}

.command-output p {
    margin-bottom: 0;
    line-height: 1.6;
    padding: 0;
}

.command-output a {
    color: #8abeb7;
    text-decoration: underline;
    transition: all 0.2s ease;
}

.command-output a:hover {
    color: #b5bd68;
    text-decoration: none;
}

.command-output .section-title {
    color: #81a2be !important;
    font-weight: 500;
    margin-top: 1.5rem;
    margin-bottom: 0;
    font-size: 1rem;
    line-height: 1.6;
}

.command-output ul {
    list-style: disc;
    list-style-position: outside;
    padding-left: 1.8rem;
    margin: 0.6rem 0 0 0; /* add a bit of space above */
}

.command-output ul li {
    padding-left: 0;
    margin: 0;
    line-height: 1.6;
}

.command-output ul li::marker {
    color: var(--accent-color);
}

.command-output i {
    font-style: italic;
    font-weight: 400;
}

.command-output strong {
    font-weight: 600;
}

/* Command History */
.command-history {
    margin-bottom: 1.5rem;
    margin-top: 3rem;
}

.user-command {
    color: var(--text-primary);
}

.error-output {
    color: var(--accent-color);
    margin: 1.5rem 0;
    font-size: 1rem;
    line-height: 1.6;
}

/* Block spacing */
.block {
    margin-bottom: 1.5rem;
}

.block:last-child {
    margin-bottom: 0;
}

/* Selection */
::selection {
    background-color: rgba(129, 162, 190, 0.4);
    color: var(--text-primary);
}

::-moz-selection {
    background-color: rgba(129, 162, 190, 0.4);
    color: var(--text-primary);
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #1d1f21;
}

::-webkit-scrollbar-thumb {
    background: rgba(149, 152, 150, 0.3);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(149, 152, 150, 0.5);
}

/* Responsive Design */
@media (max-width: 1024px) {
    .page-header .headline {
        font-size: 2.2rem;
    }
    
    .page-header .subtitle {
        font-size: 1.15rem;
    }
    
    .prompt-line,
    .input-line {
        font-size: 1rem;
    }
    
    .nav-links a {
        font-size: 1rem;
    }
}

@media (max-width: 768px) {
    body {
        padding: 1rem;
    }
    
    .page-container {
        gap: 1.5rem;
    }
    
    .page-header .headline {
        font-size: 1.9rem;
    }
    
    .page-header .subtitle {
        font-size: 1.05rem;
    }
    
    .terminal {
        border-radius: 8px;
    }
    
    .terminal-content {
        padding: 1rem 1.5rem 1.5rem 1.5rem;
    }
    
    .prompt-line,
    .input-line {
        font-size: 0.95rem;
    }
    
    .nav-links a {
        font-size: 0.95rem;
    }
    
    .command-output {
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .page-header .headline {
        font-size: 1.6rem;
    }
    
    .page-header .subtitle {
        font-size: 0.95rem;
    }
    
    .terminal-title {
        font-size: 11px;
    }
    
    .terminal-content {
        padding: 1rem;
    }
    
    .prompt-line,
    .input-line {
        font-size: 0.9rem;
    }
    
    .prompt-symbol {
        margin: 0 0.3rem;
    }
    
    .nav-links a {
        font-size: 0.9rem;
    }
    
    .command-output {
        font-size: 0.85rem;
    }
}

/* Smooth transitions */
* {
    transition: color 0.2s ease;
}

/* Fix for iOS Safari */
@supports (-webkit-touch-callout: none) {
    body {
        min-height: -webkit-fill-available;
    }
}

/* Ensure content stays at bottom on scroll */
@media (min-height: 900px) {
    .terminal-content {
        min-height: 600px;
    }
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    .cursor {
        animation: none;
        opacity: 1;
    }
}
