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

body {
    font-family: "Roboto Mono", Consolas, "Courier New",
        monospace;
    background: #0d0d0d;
    color: #e0e0e0;
    line-height: 1.7;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

/* Layout Components */
header {
    display: flex;
    justify-content: center;
    padding: 3rem 2rem;
    width: 100%;
    max-width: 960px;
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

nav .links {
    display: flex;
    justify-content: space-between;
    gap: 2rem;
}

nav .links a {
    text-decoration: none;
    color: inherit;
}

main {
    width: 100%;
    max-width: 960px;
    padding: 0 2rem;
}

/* Hero Section */
.hero {
    text-align: center;
    margin-bottom: 4rem;
    position: relative;
    padding: 2.5rem 2rem;
}

.hero h1 {
    font-size: clamp(2rem, 8vw, 3rem);
    font-weight: 300;
    color: #ffffff;
    margin-bottom: 1.5rem;
    position: relative;
    height: 8rem;
    line-height: 1.2;
    overflow: hidden;
}

.text-wrapper {
    display: inline-block;
    text-align: center;
    max-width: 100%;
}

.hero h1 #hero-text {
    display: inline;
    word-wrap: break-word;
    hyphens: auto;
}

.subtitle {
    display: flex;
    justify-content: center;
    gap: 2rem;
    font-size: clamp(1rem, 1.5vw, 1.3rem);
    color: #666;
    margin-bottom: 3rem;
    flex-wrap: wrap;
}

.subtitle span {
    position: relative;
    padding: 0 1rem;
    transition: color 0.3s ease;
}

.subtitle span:hover {
    color: #a855f7;
    cursor: default;
}

/* Posts Section */
.posts {
    margin-top: 4rem;
}

.post-item {
    display: flex;
    width: 100%;
    justify-content: space-between;
    align-items: center;
    padding: 2rem 1rem;
    border: 2px dashed transparent;
    transition: all 0.4s ease;
    position: relative;
}

.post-item:hover {
    background: rgba(255, 255, 255, 0.01);
    padding-left: 1.2rem;
    border-color: #4ade80;
}

.post-item:hover .post-title a {
    color: #4ade80;
}

.post-title {
    text-decoration: none;
    color: inherit;
    line-height: 2;
    font-weight: 500;
    font-size: clamp(0.9rem, 2vw, 1.3rem);
}

.post-date {
    font-size: clamp(1rem, 2vw, 1.3rem);
    color: #555;
    font-family: inherit;
    white-space: nowrap;
    position: relative;
}

.post-date::before {
    content: "[";
    margin-right: 0.2rem;
}

.post-date::after {
    content: "]";
    margin-left: 0.2rem;
}

/* Footer */
footer {
    max-width: 960px;
    width: 100%;
    font-size: clamp(1rem, 2vw, 1.3rem);
    margin-top: 4rem;
    padding: 3rem 2rem;
    border-top: 1px solid #1a1a1a;
    position: relative;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-text {
    color: #666;
}

.social-links {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 2rem;
}

.social-link {
    color: #555;
    text-decoration: none;
    transition: all 0.3s ease;
    position: relative;
}

.social-link:hover {
    color: #a855f7;
    transform: translateY(-2px);
}

/* Animations */
.cursor {
    display: inline-block;
    width: 2px;
    height: 1.2em;
    background: #a855f7;
    animation: blink 1s infinite;
    margin-left: 3px;
}

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

/* Utility Styles */
::selection {
    background: #a855f7;
    color: #ffffff;
}

::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: #0d0d0d;
}

::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a855f7;
}

/* Article page */

.article-hero {
    margin-bottom: 4rem;
}

.article-hero h1 {
    font-size: clamp(1.5rem, 5vw, 2.5rem);
    font-weight: 400;
    color: #fff;
    margin-bottom: 2rem;
    line-height: 1.3;
}

.article-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 1.5rem;
    font-size: clamp(0.6rem, 8vw, 0.8rem);
    color: #888;
}

.article-date {
    font-size: clamp(1rem, 2vw, 1.4rem);
}

/* Tags */
.tags-container ul {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    list-style: none;
}

.tag {
    border: 1px solid #555;
    padding: 0.2rem 0.8rem;
    border-radius: 1rem;
    font-size: clamp(0.8rem, 2vw, 1.2rem);
    transition: all 0.3s ease;
}

.tag a {
    text-decoration: none;
    color: inherit;
}

.tag:hover {
    background-color: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

/* Article Content */
.article-content {
    width: 100%;
    font-size: clamp(1.1rem, 2.2vw, 1.4rem);
}

.article-content p {
    margin-bottom: 1.5rem;
    color: #c0c0c0;
}

.article-content h1,
.article-content h2,
.article-content h3,
.article-content h4,
.article-content h5,
.article-content h6 {
    color: #fff;
    margin-bottom: 2rem;
}

.article-content h2 {
    font-size: clamp(1.4rem, 3vw, 2rem);
    border-bottom: 1px solid #222;
    padding-bottom: 0.5rem;
}

.article-content a {
    color: #a855f7;
    text-decoration: none;
    border-bottom: 1px dotted #a855f7;
    transition: all 0.3s ease;
}

.article-content a:hover {
    color: #c084fc;
    border-bottom-style: solid;
}

.article-content ul,
.article-content ol {
    padding-left: 1.5rem;
    margin-bottom: 1.5rem;
}

.article-content li {
    margin-bottom: 0.5rem;
}

.article-content blockquote {
    border-left: 3px solid #a855f7;
    padding-left: 1.5rem;
    color: #888;
    font-style: italic;
    margin-bottom: 3rem;
}

:not(pre) > code {
    border: 1px solid #9e9e9e;
    border-radius: 4px;
    padding: 0.2em 0.4em;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
        "Liberation Mono", "Courier New", monospace;
    font-size: 0.9em;
    background-color: #3e3e3e;

    color: #b9b721;
}

.article-content pre {
    width: auto;
    margin-bottom: 3rem;
    position: relative;
}

.article-content code {
    font-family: inherit;
}

/* Copy Code Button */
.copy-code-button {
    position: absolute;
    top: 12px;
    right: 12px;
    padding: 6px 10px;
    background-color: #404040;
    color: #c9d1d9;
    border: 1px solid #555;
    border-radius: 6px;
    font-family: sans-serif;
    font-size: clamp(0.7rem, 1.2vw, 0.9rem);
    cursor: pointer;
    opacity: 0;
    transition: all 0.2s ease;
}

.article-content pre:hover .copy-code-button {
    opacity: 1;
}

.copy-code-button:hover {
    background-color: #586069;
}

.copy-code-button.copied {
    background-color: #2ea043;
    color: white;
}

/* Responsive Design home page */
@media (max-width: 768px) {
    header {
        padding: 2rem 1rem;
    }

    main {
        width: 100%;
        padding: 0 1rem;
    }

    .hero {
        padding: 2rem 1.5rem;
        margin-bottom: 3rem;
    }

    .subtitle {
        gap: 1rem;
    }

    .post-item {
        align-items: flex-start;
        gap: 0.5rem;
    }

    .post-title a {
        max-width: 100%;
    }

    .footer-content {
        flex-direction: column;
        justify-content: center;
        gap: 1rem;
    }

    .social-links {
        justify-content: center;
    }

    footer {
        padding: 2rem 1rem;
    }
}

@media (max-width: 480px) {
    nav span,
    nav a {
        font-size: clamp(0.7rem, 1.5vw, 0.9rem);
    }

    .subtitle {
        margin-bottom: 0;
    }
}

/* Tags Page Specific Styles */
.tag-hero {
    text-align: center;
    margin-bottom: 4rem;
    position: relative;
    padding: 2.5rem 2rem;
}

.tag-hero h1 {
    font-size: clamp(2.5rem, 6vw, 4rem);
    font-weight: 300;
    color: #ffffff;
    margin-bottom: 1.5rem;
    position: relative;
    min-height: 3rem;
}

.subtitle-text {
    font-size: clamp(1.2rem, 3vw, 2rem);
    color: #666;
    margin-bottom: 3rem;
}

/* Tags Page Responsive Design */
@media (max-width: 768px) {
    .tag-hero {
        padding: 2rem 1.5rem;
        margin-bottom: 3rem;
    }

    .tag-hero h1 {
        margin-bottom: 1rem;
    }
}

@media (max-width: 480px) {
    .tag-hero h1 {
        margin-bottom: 0.8rem;
    }
}
