/* Old Silicon - Clean Light Theme */

:root {
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --bg-tertiary: #e9ecef;
    --text-primary: #212529;
    --text-secondary: #495057;
    --text-muted: #6c757d;
    --accent-primary: #2563eb;
    --accent-hover: #1d4ed8;
    --border-color: #dee2e6;
    --font-body: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-heading: 'acumin-pro', 'Poppins', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-sans: var(--font-body);
    --font-serif: Georgia, 'Times New Roman', serif;
    --max-width: 1200px;
    --content-width: 800px;
}

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    padding: 0;
    font-family: var(--font-sans);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.7;
    min-height: 100vh;
}

/* Headings */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
}

/* Remove scanlines */
.scanlines {
    display: none;
}

/* Container */
.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Header */
.site-header {
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
}

.site-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 1rem;
    padding-bottom: 1rem;
}

.site-logo {
    font-family: var(--font-heading);
    text-decoration: none;
    font-size: 2.25rem;
    font-weight: 300;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.site-logo:hover {
    color: var(--accent-primary);
}

.logo-bracket {
    display: none;
}

.logo-text {
    color: inherit;
}

.site-branding {
    display: flex;
    flex-direction: column;
}

.site-tagline {
    font-size: 0.875rem;
    font-weight: 300;
    color: var(--text-secondary);
    margin: 0;
}

.site-nav {
    display: flex;
    gap: 0.25rem;
}

.site-nav a {
    color: var(--text-secondary);
    text-decoration: none;
    padding: 0.5rem 0.75rem;
    font-size: 0.9rem;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.site-nav a:hover,
.site-nav a.active {
    color: var(--accent-primary);
    background: rgba(37, 99, 235, 0.08);
}

.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
}

.mobile-menu-toggle span {
    width: 24px;
    height: 2px;
    background: var(--text-primary);
    transition: all 0.2s ease;
}

/* Main Content */
.site-main {
    min-height: calc(100vh - 200px);
    padding: 3rem 0;
}

/* Home Hero */
.home-hero {
    text-align: center;
    padding: 4rem 0;
    margin-bottom: 3rem;
    border-bottom: 1px solid var(--border-color);
}

.home-hero h1 {
    font-family: var(--font-heading);
    font-size: clamp(2.5rem, 8vw, 3.5rem);
    font-weight: 700;
    margin: 0 0 1rem;
    color: var(--text-primary);
}

/* Remove glitch effect */
.glitch::before,
.glitch::after {
    display: none;
}

.home-hero .tagline {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin: 0;
    font-style: italic;
}

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

.section-title {
    font-family: var(--font-heading);
    font-size: 1.75rem;
    font-weight: normal;
    margin: 0 0 0.5rem;
    color: var(--text-primary);
}

.title-decoration {
    display: none;
}

.section-intro {
    color: var(--text-secondary);
    margin: 0 0 2rem;
}

.section-link {
    display: inline-block;
    margin-top: 1.5rem;
    color: var(--accent-primary);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
}

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

/* Card Grid */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.card {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
}

.card:hover {
    border-color: var(--accent-primary);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

.card-image {
    aspect-ratio: 16/10;
    overflow: hidden;
    background: var(--bg-tertiary);
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.card:hover .card-image img {
    transform: scale(1.03);
}

.card-content {
    padding: 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-content h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.card-content time {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.card-arrow {
    color: var(--accent-primary);
    font-size: 1.25rem;
    opacity: 0;
    transform: translateX(-10px);
    transition: all 0.3s ease;
}

.card:hover .card-arrow {
    opacity: 1;
    transform: translateX(0);
}

/* Page Headers */
.page-header {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.page-header h1,
.site-main > .container > h1 {
    font-family: var(--font-heading);
    font-size: clamp(1.5rem, 4vw, 2rem);
    font-weight: 300;
    margin: 0 0 0.5rem;
    color: var(--text-primary);
}

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

/* Breadcrumb */
.breadcrumb {
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.breadcrumb a {
    color: var(--accent-primary);
    text-decoration: none;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

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

.breadcrumb .current {
    color: var(--text-muted);
}

.post-date {
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* Prose Content */
.prose {
    max-width: var(--content-width);
}

.prose h1, .prose h2, .prose h3, .prose h4 {
    font-family: var(--font-heading);
    color: var(--text-primary);
    margin-top: 2rem;
    margin-bottom: 1rem;
    font-weight: 300;
}

.prose h2 {
    font-size: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

.prose h3 {
    font-size: 1.25rem;
}

.prose p {
    margin-bottom: 1.25rem;
}

.prose a {
    color: var(--accent-primary);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.prose a:hover {
    color: var(--accent-hover);
}

.prose img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 1.5rem 0;
    border: 1px solid var(--border-color);
    display: block;
}

/* Wide images that expand beyond content container */
.prose figure.full-width {
    max-width: 1200px;
    width: 90vw;
    margin: 1.5rem auto;
}

.prose figure.full-width img {
    width: 100%;
}

/* Floated figures for text wrap */
figure.float-right,
.prose figure.float-right {
    float: right !important;
    margin: 0 0 1em 1.5em !important;
    max-width: 45%;
}

figure.float-left,
.prose figure.float-left {
    float: left !important;
    margin: 0 1.5em 1em 0 !important;
    max-width: 45%;
}

figure.float-right img,
figure.float-left img,
.prose figure.float-right img,
.prose figure.float-left img {
    margin: 0;
    display: block;
    max-width: 100%;
    border: 1px solid var(--border-color);
    border-radius: 8px;
}

figure figcaption,
.prose figure figcaption {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
    text-align: center;
}

/* Content sections - contain floats */
.content-section {
    display: flow-root; /* Creates block formatting context to contain floats */
    margin-bottom: 2rem;
}

.content-section h2 {
    margin-top: 0;
    font-weight: 300;
}

/* When section has floated images, constrain text width */
.content-section .image-group.float-right ~ p,
.content-section .image-group.float-right ~ ul,
.content-section .image-group.float-right ~ ol {
    max-width: 55%;
}

/* Better approach: use CSS to make text wrap properly */
.content-section {
    --image-width: 45%;
}

.content-section .image-group {
    width: var(--image-width);
    max-width: var(--image-width) !important;
}

/* Clear floats on headings (fallback for non-sectioned content) */
.prose h2, .prose h3 {
    clear: both;
}

/* Hero Image */
.hero-image {
    margin: 0 0 2rem 0;
    padding: 0;
}

.hero-image img {
    width: 100%;
    height: auto;
    max-height: 500px;
    object-fit: cover;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    display: block;
}

@media (max-width: 768px) {
    .hero-image img {
        max-height: 300px;
        border-radius: 8px;
    }
}

.prose ul, .prose ol {
    padding-left: 1.5rem;
    margin-bottom: 1.25rem;
}

.prose li {
    margin-bottom: 0.5rem;
}

.prose blockquote {
    margin: 1.5rem 0;
    padding: 1rem 1.5rem;
    background: var(--bg-secondary);
    border-left: 4px solid var(--accent-primary);
    font-style: italic;
    color: var(--text-secondary);
}

.prose table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    font-size: 0.9rem;
}

.prose th, .prose td {
    padding: 0.75rem 1rem;
    text-align: left;
    border: 1px solid var(--border-color);
}

.prose th {
    background: var(--bg-secondary);
    font-weight: 600;
}

.prose code {
    font-family: 'SF Mono', Monaco, 'Courier New', monospace;
    background: var(--bg-secondary);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-size: 0.875em;
}

.prose pre,
.prose .highlight pre {
    background: #1a1a1a !important;
    border: 1px solid #333;
    border-radius: 8px;
    padding: 1rem;
    overflow-x: auto;
    margin: 1.5rem 0;
}

.prose pre code,
.prose .highlight pre code {
    background: none !important;
    padding: 0;
    color: #ffb000 !important;
}

.prose .highlight pre code span {
    color: #ffb000 !important;
}

/* Image Gallery - Masonry Layout */
.gallery-section {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

.gallery-section h2 {
    font-size: 1.5rem;
    margin: 0 0 1.5rem 0;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

.gallery-grid {
    column-count: 3;
    column-gap: 1rem;
}

.gallery-item {
    break-inside: avoid;
    margin-bottom: 1rem;
}

.gallery-item img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.gallery-item img:hover {
    border-color: var(--accent-primary);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

@media (max-width: 900px) {
    .gallery-grid {
        column-count: 2;
    }
}

@media (max-width: 500px) {
    .gallery-grid {
        column-count: 1;
    }
}

/* Page Navigation */
.page-footer {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

.page-nav {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.page-nav a {
    padding: 1rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.2s ease;
}

.page-nav a:hover {
    border-color: var(--accent-primary);
}

.nav-prev {
    text-align: left;
}

.nav-next {
    text-align: right;
}

.nav-label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

.nav-title {
    color: var(--text-primary);
    font-weight: 500;
}

/* Footer */
.site-footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    padding: 2rem 0;
    margin-top: 4rem;
}

.footer-content {
    text-align: center;
}

.terminal-prompt {
    display: none;
}

.site-footer p {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* Responsive */
@media (max-width: 768px) {
    .prose figure.float-right,
    .prose figure.float-left {
        float: none;
        max-width: 100%;
        margin: 1.5rem 0;
    }

    .site-nav {
        position: fixed;
        top: 60px;
        left: 0;
        right: 0;
        background: var(--bg-primary);
        flex-direction: column;
        padding: 1rem;
        border-bottom: 1px solid var(--border-color);
        display: none;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    }

    .site-nav.active {
        display: flex;
    }

    .mobile-menu-toggle {
        display: flex;
    }

    .mobile-menu-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(4px, 4px);
    }

    .mobile-menu-toggle.active span:nth-child(2) {
        opacity: 0;
    }

    .mobile-menu-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(4px, -4px);
    }

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

    .page-nav {
        grid-template-columns: 1fr;
    }

    .nav-next {
        text-align: left;
    }

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

/* Collection Page (Home/List) Styles */
.collection-page {
    padding: 2rem 0;
}

.collection-section {
    margin-bottom: 4rem;
}

.collection-title {
    font-family: var(--font-heading);
    text-align: center;
    font-size: 2rem;
    font-weight: 300;
    margin: 0 0 1.5rem;
    color: var(--text-primary);
}

.collection-intro {
    text-align: center;
    max-width: 900px;
    margin: 0 auto 2.5rem;
    color: var(--text-secondary);
    line-height: 1.7;
}

.collection-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2.5rem;
}

a.collection-item {
    display: block;
    text-align: center;
    background: var(--bg-tertiary);
    border-radius: 12px;
    padding: 1rem 1rem 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    text-decoration: none;
    cursor: pointer;
}

a.collection-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.collection-image-link {
    display: block;
    margin-bottom: 1rem;
}

.collection-image-link img {
    width: 100%;
    height: auto;
    border-radius: 8px;
}

.collection-item-title {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 300;
    margin: 0 0 0.75rem;
}

.collection-item-title {
    color: var(--text-primary);
    transition: color 0.2s ease;
}

a.collection-item:hover .collection-item-title {
    color: var(--accent-primary);
}

.collection-item-desc {
    color: var(--text-secondary) !important;
    font-size: 0.95rem;
    line-height: 1.6;
    margin: 0;
}

/* Compact grid for text-only cards */
.collection-grid-compact {
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
}

.collection-item-compact {
    padding: 1.25rem;
}

.collection-item-compact .collection-item-title {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.collection-item-compact .collection-item-desc {
    font-size: 0.9rem;
}

@media (max-width: 900px) {
    .collection-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 2rem;
    }

    .collection-grid-compact {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 600px) {
    .collection-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .collection-grid-compact {
        grid-template-columns: repeat(2, 1fr);
    }

    .collection-title {
        font-size: 1.5rem;
    }
}

/* Article List (for sections like Technologies) */
.article-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 2rem;
}

.article-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.2s ease;
}

.article-item:hover {
    border-color: var(--accent-primary);
    background: var(--bg-primary);
}

.article-item-content {
    flex: 1;
}

.article-item-content h2 {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 300;
    margin: 0 0 0.5rem;
    color: var(--text-primary);
}

.article-item-content p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin: 0 0 0.5rem;
}

.article-item-content time {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.article-arrow {
    color: var(--accent-primary);
    font-size: 1.5rem;
    margin-left: 1rem;
}
