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

:root {
    --bg-color: #0a0a0a;
    --text-color: #e0e0e0;
    --accent-color: #4a9eff;
    --muted-color: #888888; /* Improved contrast from #6b6b6b for better readability */
    --border-color: #2a2a2a;
    --hover-color: #5aafff;
    --prompt-color: #00ff00;
    --comment-color: #888888; /* Matches muted-color for consistent styling */
}

body {
    font-family: 'Courier New', 'Monaco', 'Menlo', monospace;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    font-size: 16px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

.container {
    max-width: 700px;
    width: 100%;
    margin: 0 auto;
    padding: 2rem 1.5rem;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

/* Navigation */
.nav {
    margin-bottom: 3rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.nav-links {
    display: flex;
    align-items: center;
}

.nav-link {
    color: var(--muted-color);
    text-decoration: none;
    text-transform: lowercase;
    transition: color 0.2s ease;
    font-size: 14px;
    padding: 8px 12px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
}

.nav-link:hover {
    color: var(--text-color);
}

.nav-link:focus,
.nav-link:focus-visible {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
    border-radius: 2px;
}

.nav-link.active {
    color: var(--accent-color);
}

.separator {
    color: var(--muted-color);
    margin: 0 0.5rem;
}

.age-counter {
    color: var(--accent-color);
    font-size: 14px;
    font-family: 'Courier New', monospace;
    font-weight: normal;
}

/* Header */
.header {
    margin-bottom: 3rem;
}

.terminal-info {
    margin-top: 1.5rem;
    font-family: 'Courier New', monospace;
}

.prompt {
    color: var(--prompt-color);
    margin-right: 0.5rem;
    font-weight: bold;
}

.command {
    color: var(--accent-color);
}

.output {
    color: var(--text-color);
    margin-left: 1.5rem;
    margin-top: 0.25rem;
    margin-bottom: 0.5rem;
}

.title {
    font-size: 2.5rem;
    font-weight: normal;
    margin-bottom: 0.5rem;
    color: var(--text-color);
    letter-spacing: -0.02em;
}

.subtitle {
    color: var(--muted-color);
    font-size: 1rem;
    font-weight: normal;
}

/* Sections */
.section {
    margin-bottom: 2.5rem;
}

.section-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.section-title {
    font-size: 1rem;
    font-weight: normal;
    color: var(--accent-color);
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.code-comment {
    color: var(--comment-color);
    font-style: italic;
}

.text-content {
    color: var(--text-color);
}

.text-content p {
    margin-bottom: 1rem;
}

.text-content p:last-child {
    margin-bottom: 0;
}

/* Lists */
.list {
    list-style: none;
    padding-left: 0;
}

.list li {
    margin-bottom: 0.5rem;
    padding-left: 1rem;
    position: relative;
}

.list li::before {
    content: "> ";
    color: var(--accent-color);
    position: absolute;
    left: 0;
}

/* Links */
.link {
    color: var(--accent-color);
    text-decoration: none;
    transition: color 0.2s ease;
}

.link:hover {
    color: var(--hover-color);
    text-decoration: underline;
}

.link:focus,
.link:focus-visible {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
    border-radius: 2px;
}

.links {
    margin-top: 0.5rem;
}

/* External link indicator */
.external-link::after {
    content: " ↗";
    font-size: 0.85em;
    opacity: 0.7;
}

/* Blog section */
.blog-section {
    margin-bottom: 3rem;
}

.blog-post {
    margin-bottom: 2.5rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border-color);
    transition: transform 0.2s ease, border-left-color 0.2s ease;
    padding-left: 1rem;
    border-left: 3px solid transparent;
}

.blog-post:hover {
    transform: translateX(4px);
    border-left-color: var(--accent-color);
}

.blog-post:last-child {
    border-bottom: none;
}

.post-meta {
    display: flex;
    gap: 1rem;
    margin-bottom: 0.75rem;
    font-size: 0.85rem;
}

.post-date {
    color: var(--muted-color);
}

.post-tag {
    color: var(--accent-color);
    text-transform: lowercase;
}

.reading-time {
    color: var(--muted-color);
    font-size: 0.85rem;
}

.post-title {
    font-size: 1.5rem;
    font-weight: normal;
    margin-bottom: 0.75rem;
}

.post-link {
    color: var(--text-color);
    text-decoration: none;
    transition: color 0.2s ease;
}

.post-link:hover {
    color: var(--accent-color);
}

.post-link:focus,
.post-link:focus-visible {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
    border-radius: 2px;
}

.post-excerpt {
    color: var(--muted-color);
    line-height: 1.6;
}

.back-link {
    margin-top: 2rem;
}

/* Footer */
.footer {
    margin-top: auto;
    padding-top: 3rem;
    text-align: left;
}

.footer-content {
    font-family: 'Courier New', monospace;
}

.footer-line {
    margin-bottom: 0.5rem;
}

.footer-output {
    margin-left: 1.5rem;
    color: var(--text-color);
}

.typing-text {
    color: var(--text-color);
}

.cursor-blink {
    display: inline-block;
    color: var(--prompt-color);
    animation: blink 1s infinite;
    margin-left: 0.25rem;
}

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

.footer-text {
    color: var(--muted-color);
    font-size: 0.85rem;
}

/* Responsive */
@media (max-width: 600px) {
    .container {
        padding: 1.5rem 1rem;
    }

    .title {
        font-size: 2rem;
    }

    .post-title {
        font-size: 1.25rem;
    }

    .nav {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .age-counter {
        align-self: flex-end;
    }
    
    .skip-intro-btn {
        top: 0.5rem;
        right: 0.5rem;
        font-size: 12px;
        padding: 6px 12px;
    }
    
    .back-to-top {
        bottom: 1rem;
        right: 1rem;
    }
}

@media (max-width: 400px) {
    .age-counter {
        font-size: 12px;
    }
}

/* Prevent layout shifts during typing */
#cmd-whoami,
#cmd-cat,
#output-whoami,
#title-about,
#title-focus,
#title-contact,
#comment-hello,
#comment-exploring,
#text-about1,
#text-about2,
#text-contact,
#focus-item1,
#focus-item2,
#focus-item3,
#focus-item4,
#focus-item5,
#typing-text {
    display: inline-block;
    min-height: 1.2em;
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* Ensure paragraphs maintain height even when empty */
.text-content p {
    min-height: 1.6em;
}

/* Ensure list items maintain height */
.list li {
    min-height: 1.6em;
}

/* Terminal output should maintain space */
.terminal-line {
    min-height: 1.6em;
}

.output {
    min-height: 1.6em;
}

/* Section titles maintain space */
.section-title {
    min-height: 1.2em;
    display: inline-block;
}

/* Links container */
#links-contact {
    visibility: hidden;
}

#links-contact[style*="display: block"],
#links-contact[style*="display:block"] {
    visibility: visible !important;
}

/* Ensure contact section is always visible */
.section {
    visibility: visible !important;
    display: block !important;
}

/* Selection */
::selection {
    background-color: var(--accent-color);
    color: var(--bg-color);
}

/* Skip to content link - accessible but visually hidden until focused */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--accent-color);
    color: var(--bg-color);
    padding: 8px 16px;
    text-decoration: none;
    z-index: 100;
    border-radius: 0 0 4px 0;
    font-weight: bold;
}

.skip-link:focus {
    top: 0;
}

/* Skip intro button */
.skip-intro-btn {
    position: fixed;
    top: 1rem;
    right: 1rem;
    background: var(--accent-color);
    color: var(--bg-color);
    border: none;
    padding: 8px 16px;
    cursor: pointer;
    font-family: 'Courier New', 'Monaco', 'Menlo', monospace;
    font-size: 14px;
    border-radius: 4px;
    transition: background-color 0.2s ease;
    z-index: 100;
    display: none;
}

.skip-intro-btn:hover {
    background: var(--hover-color);
}

.skip-intro-btn:focus {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
}

/* Back to top button */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: var(--accent-color);
    color: var(--bg-color);
    border: none;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    font-size: 1.5rem;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease, background-color 0.2s ease;
    z-index: 99;
    display: flex;
    align-items: center;
    justify-content: center;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background: var(--hover-color);
}

.back-to-top:focus {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
}

