/* ==========================================================================
   DANYLO VORVUL — Cyberpunk Brutalist Stylesheet
   Consciousness rendered in concrete, code, and controlled chaos
   ========================================================================== */

/* --- Custom Properties --- */
:root {
    --bg-deep: #0a0a0f;
    --bg-surface: #111118;
    --bg-indigo: #1a1a3e;
    --text-primary: #d4d4d8;
    --text-warm: #e0dfd6;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;
    --accent-cyan: #00e5ff;
    --accent-teal: #0ff0b3;
    --accent-amber: #ff8f00;
    --accent-orange: #e65100;
    --accent-magenta: #ff0080;
    --font-mono: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --max-width: 820px;
    --nav-height: 60px;
}

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

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

body {
    font-family: var(--font-body);
    background-color: var(--bg-deep);
    color: var(--text-primary);
    line-height: 1.7;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

/* --- Scrollbar --- */
::-webkit-scrollbar {
    width: 6px;
}
::-webkit-scrollbar-track {
    background: var(--bg-deep);
}
::-webkit-scrollbar-thumb {
    background: var(--accent-cyan);
    border-radius: 0;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--accent-teal);
}

/* --- Scan-line Overlay --- */
.scanlines {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(0, 0, 0, 0.03) 2px,
        rgba(0, 0, 0, 0.03) 4px
    );
}

/* --- Noise Overlay --- */
.noise {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9998;
    opacity: 0.035;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
    background-repeat: repeat;
    background-size: 256px 256px;
}

/* --- Glitch Effect --- */
@keyframes glitch {
    0%, 100% { text-shadow: 2px 0 var(--accent-cyan), -2px 0 var(--accent-magenta); }
    20% { text-shadow: -3px 0 var(--accent-cyan), 3px 0 var(--accent-magenta); }
    40% { text-shadow: 3px 0 var(--accent-magenta), -3px 0 var(--accent-cyan); }
    60% { text-shadow: -2px 0 var(--accent-cyan), 2px 0 var(--accent-amber); }
    80% { text-shadow: 2px 0 var(--accent-amber), -2px 0 var(--accent-magenta); }
}

@keyframes glitch-clip {
    0% { clip-path: inset(40% 0 61% 0); }
    20% { clip-path: inset(92% 0 1% 0); }
    40% { clip-path: inset(43% 0 1% 0); }
    60% { clip-path: inset(25% 0 58% 0); }
    80% { clip-path: inset(54% 0 7% 0); }
    100% { clip-path: inset(58% 0 43% 0); }
}

.glitch {
    position: relative;
    animation: glitch 3s infinite linear alternate;
}

.glitch::before,
.glitch::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.glitch::before {
    color: var(--accent-cyan);
    animation: glitch-clip 2s infinite linear alternate-reverse;
    left: 2px;
    opacity: 0.7;
}

.glitch::after {
    color: var(--accent-magenta);
    animation: glitch-clip 3s infinite linear alternate;
    left: -2px;
    opacity: 0.7;
}

/* --- Typography --- */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-mono);
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 0.75em;
    color: var(--text-warm);
}

h1 { font-size: 2.5rem; letter-spacing: -0.02em; }
h2 { font-size: 1.5rem; letter-spacing: -0.01em; }
h3 { font-size: 1.2rem; }

p {
    margin-bottom: 1.2em;
    color: var(--text-primary);
}

a {
    color: var(--accent-cyan);
    text-decoration: none;
    transition: all 0.15s ease;
}

a:hover {
    text-decoration: underline;
    text-shadow: 0 0 8px rgba(0, 229, 255, 0.4);
}

a:active {
    color: var(--accent-magenta);
    text-shadow: 0 0 12px rgba(255, 0, 128, 0.5);
}

strong {
    color: var(--text-warm);
    font-weight: 600;
}

code {
    font-family: var(--font-mono);
    font-size: 0.9em;
    background: rgba(26, 26, 62, 0.6);
    padding: 0.15em 0.4em;
    color: var(--accent-teal);
}

pre {
    background: var(--bg-indigo);
    border-left: 3px solid var(--accent-cyan);
    padding: 1.25em 1.5em;
    overflow-x: auto;
    margin: 1.5em 0;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    line-height: 1.6;
    color: var(--text-primary);
}

pre code {
    background: none;
    padding: 0;
    color: inherit;
}

blockquote {
    border-left: 3px solid var(--accent-amber);
    padding: 0.5em 1.5em;
    margin: 1.5em 0;
    color: var(--text-secondary);
    font-style: italic;
    background: rgba(26, 26, 62, 0.3);
}

hr {
    border: none;
    border-top: 1px solid var(--text-muted);
    margin: 2.5em 0;
    opacity: 0.3;
}

ul, ol {
    padding-left: 1.5em;
    margin-bottom: 1.2em;
}

li {
    margin-bottom: 0.4em;
}

/* --- Navigation --- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(10, 10, 15, 0.92);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(0, 229, 255, 0.1);
    height: var(--nav-height);
}

.nav-container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
}

.nav-logo {
    font-family: var(--font-mono);
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-warm);
    text-decoration: none;
    letter-spacing: 0.05em;
}

.nav-logo:hover {
    text-decoration: none;
    text-shadow: 0 0 10px rgba(0, 229, 255, 0.5);
}

.logo-bracket {
    color: var(--accent-cyan);
}

.logo-tilde {
    color: var(--accent-amber);
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 1.5rem;
}

.nav-links a {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.15s ease;
    padding: 0.3em 0;
}

.nav-links a:hover {
    color: var(--accent-cyan);
    text-shadow: 0 0 8px rgba(0, 229, 255, 0.4);
    text-decoration: none;
}

/* Mobile nav toggle */
.nav-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    flex-direction: column;
    gap: 4px;
}

.nav-toggle span {
    display: block;
    width: 20px;
    height: 2px;
    background: var(--accent-cyan);
    transition: 0.2s;
}

/* --- Layout --- */
.site-main {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 3rem 1.5rem;
    min-height: calc(100vh - var(--nav-height) - 200px);
}

/* --- Hero (Home) --- */
.hero {
    padding: 4rem 0 3rem;
    border-bottom: 1px solid rgba(0, 229, 255, 0.08);
    margin-bottom: 3rem;
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 0.5rem;
    color: var(--text-warm);
}

.hero-subtitle {
    font-family: var(--font-mono);
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.hero-mission {
    font-size: 1.3rem;
    color: var(--text-warm);
    font-weight: 500;
    margin-bottom: 0;
}

/* --- Sections --- */
.intro-block {
    margin-bottom: 3rem;
    padding-bottom: 3rem;
    border-bottom: 1px solid rgba(0, 229, 255, 0.08);
}

.section-block {
    margin-bottom: 3rem;
    padding-bottom: 3rem;
    border-bottom: 1px solid rgba(0, 229, 255, 0.08);
}

.section-block:last-child {
    border-bottom: none;
}

.section-heading {
    font-family: var(--font-mono);
    font-size: 1.3rem;
    margin-bottom: 1.5rem;
    color: var(--text-warm);
}

.accent-cyan { color: var(--accent-cyan); }
.accent-amber { color: var(--accent-amber); }

/* --- Work Grid --- */
.work-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.work-card {
    padding: 1.5rem;
    background: rgba(26, 26, 62, 0.2);
}

.work-card.border-cyan {
    border-left: 3px solid var(--accent-cyan);
}

.work-card.border-amber {
    border-left: 3px solid var(--accent-amber);
}

.work-card h3 {
    font-size: 1rem;
    margin-bottom: 0.75rem;
    color: var(--accent-cyan);
}

.work-card.border-amber h3 {
    color: var(--accent-amber);
}

.work-card p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 0;
}

/* --- Project List --- */
.project-list {
    list-style: none;
    padding-left: 0;
}

.project-list li {
    padding: 0.75em 0;
    border-bottom: 1px solid rgba(107, 114, 128, 0.15);
    font-size: 0.95rem;
}

.project-list li:last-child {
    border-bottom: none;
}

/* --- Post List --- */
.post-list {
    list-style: none;
    padding-left: 0;
}

.post-item {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 0.6em 0;
    border-bottom: 1px solid rgba(107, 114, 128, 0.15);
    gap: 1rem;
}

.post-item time {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-muted);
    white-space: nowrap;
}

.more-link {
    display: inline-block;
    margin-top: 1rem;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--accent-cyan);
}

/* --- Page Content --- */
.page-content {
    padding: 1rem 0;
}

.page-header {
    margin-bottom: 2.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid rgba(0, 229, 255, 0.08);
}

.page-header h1 {
    margin-bottom: 0.5rem;
}

.page-description {
    font-size: 1.05rem;
    color: var(--text-secondary);
    margin-bottom: 0;
}

.content-body {
    font-size: 1rem;
    line-height: 1.8;
}

.content-body h2 {
    margin-top: 2.5rem;
}

.content-body h3 {
    margin-top: 2rem;
    color: var(--accent-cyan);
}

/* --- Post --- */
.post-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.post-meta time {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--text-muted);
}

.tags {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.tag {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--accent-amber);
    border: 1px solid rgba(255, 143, 0, 0.3);
    padding: 0.15em 0.5em;
}

.post-footer {
    margin-top: 3rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(0, 229, 255, 0.08);
}

.back-link {
    font-family: var(--font-mono);
    font-size: 0.85rem;
}

/* --- Blog Listing --- */
.blog-listing {
    margin-top: 2rem;
}

.blog-entry {
    padding: 1.5rem 0;
    border-bottom: 1px solid rgba(107, 114, 128, 0.15);
}

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

.blog-entry h2 {
    font-size: 1.2rem;
    margin-bottom: 0.3rem;
}

.blog-entry-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.blog-entry-meta time {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-muted);
}

.blog-entry-desc {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 0;
}

/* --- Archives --- */
.archive-search {
    margin-bottom: 2rem;
}

.search-input {
    width: 100%;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    padding: 0.75em 1em;
    background: var(--bg-surface);
    border: 1px solid rgba(0, 229, 255, 0.2);
    color: var(--text-primary);
    outline: none;
    transition: border-color 0.2s;
}

.search-input:focus {
    border-color: var(--accent-cyan);
    box-shadow: 0 0 10px rgba(0, 229, 255, 0.15);
}

.search-input::placeholder {
    color: var(--text-muted);
}

.archive-section {
    margin-bottom: 2.5rem;
}

.archive-list {
    list-style: none;
    padding-left: 0;
}

.archive-item {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 0.5em 0;
    border-bottom: 1px solid rgba(107, 114, 128, 0.1);
    gap: 1rem;
}

.archive-item time {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-muted);
    white-space: nowrap;
}

.archive-item.hidden {
    display: none;
}

/* --- Footer --- */
.site-footer {
    border-top: 1px solid rgba(0, 229, 255, 0.08);
    padding: 2.5rem 0;
    margin-top: 2rem;
}

.footer-container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 1.5rem;
    text-align: center;
}

.footer-links {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.footer-links a {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-secondary);
}

.footer-links a:hover {
    color: var(--accent-cyan);
}

.footer-sep {
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 0.75rem;
}

.footer-meta p {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.3rem;
}

.footer-tagline {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-muted);
    opacity: 0.6;
}

/* --- Responsive --- */
@media (max-width: 768px) {
    h1 { font-size: 1.8rem; }
    .hero h1 { font-size: 2.2rem; }
    .hero { padding: 2rem 0 2rem; }

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

    .nav-links {
        display: none;
        position: absolute;
        top: var(--nav-height);
        left: 0;
        right: 0;
        background: rgba(10, 10, 15, 0.97);
        flex-direction: column;
        padding: 1rem 1.5rem;
        gap: 0.75rem;
        border-bottom: 1px solid rgba(0, 229, 255, 0.1);
    }

    .nav-links.open {
        display: flex;
    }

    .nav-toggle {
        display: flex;
    }

    .post-item {
        flex-direction: column;
        gap: 0.2rem;
    }

    .archive-item {
        flex-direction: column;
        gap: 0.2rem;
    }
}

@media (max-width: 480px) {
    .hero h1 { font-size: 1.8rem; }
    .site-main { padding: 2rem 1rem; }
}
