@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600&family=IBM+Plex+Mono:wght@300;400;500&display=swap');

:root {
    /* Palette inspired by Betuel opacity & Rootkid rawness */
    --bg-color: #f4f4f4;
    /* Off-white "paper" feel */
    --text-color: #0a0a0a;
    /* Near black */
    --accent-color: #0055D4;
    /* Deep Blue */
    --secondary-text: #555555;
    /* Technical gray */
    --border-color: #d1d1d1;

    /* Typography */
    --font-main: 'Inter', system-ui, -apple-system, sans-serif;
    --font-code: 'IBM Plex Mono', 'Courier New', monospace;

    /* Spacing */
    --grid-gap: 20px;
    --page-padding: 40px;

    /* Animation */
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-main);
    -webkit-font-smoothing: antialiased;
    font-size: 16px;
    line-height: 1.4;
    overflow-x: hidden;
}

/* --- Layout --- */

.container {
    max-width: 920px;
    margin: 0 auto;
    padding: var(--page-padding);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* --- Header --- */

.site-header nav {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding-bottom: 60px;
}

.back-nav {
    font-family: var(--font-code);
    font-size: 0.8rem;
    text-transform: uppercase;
    text-decoration: none;
    color: var(--secondary-text);
    display: inline-block;
    margin-bottom: 16px;
    transition: color 0.3s var(--ease-out);
}

.back-nav:hover {
    color: var(--accent-color);
}

.back-logo {
    opacity: 0.4;
    transition: opacity 0.3s var(--ease-out);
    animation: subtle-pulse 3s ease-in-out infinite;
}

.back-logo .logo-pixel {
    width: 32px;
    height: 32px;
}

.back-logo:hover {
    opacity: 1;
    animation: none;
}

@keyframes subtle-pulse {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.6; }
}

.logo {
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    position: relative;
    z-index: 10;
}

.logo-pixel {
    display: block;
    width: 32px;
    height: 32px;
    image-rendering: pixelated;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.nav-right a {
    font-family: var(--font-code);
    font-size: 0.85rem;
    color: var(--text-color);
    text-decoration: none;
    text-transform: uppercase;
    position: relative;
    transition: color 0.2s ease;
}

.nav-right a::before {
    content: '';
    display: none;
}

.nav-right a:hover {
    color: #000;
}

.nav-right a:hover::before {
    display: none;
}

/* --- Intro Section --- */

.intro {
    margin: 10vh 0 8vh 0;
    max-width: 600px;
}

.intro p {
    font-family: var(--font-main);
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--text-color);
}

/* --- Hero --- */

.hero {
    margin-bottom: 0;
}

.home-name {
    font-size: 1.4rem;
    font-weight: 500;
    letter-spacing: -0.02em;
    margin-bottom: 12px;
}

.home-subtitle {
    font-family: var(--font-code);
    font-size: 0.8rem;
    color: var(--secondary-text);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-bottom: 20px;
}

.home-about {
    font-family: var(--font-main);
    font-size: 0.95rem;
    line-height: 1.7;
    color: var(--secondary-text);
    margin-bottom: 20px;
}

.home-links {
    display: flex;
    align-items: center;
    gap: 8px;
}

.home-links a {
    font-family: var(--font-main);
    font-size: 0.85rem;
    color: var(--text-color);
    text-decoration: none;
    transition: color 0.2s ease;
}

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

.link-sep {
    color: var(--border-color);
    font-size: 0.85rem;
}

.see-all {
    display: inline-block;
    margin-top: 16px;
    font-family: var(--font-code);
    font-size: 0.75rem;
    color: var(--secondary-text);
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    transition: color 0.2s ease;
}

.see-all:hover {
    color: var(--text-color);
}

.container > main {
    padding-top: 0;
}

main section {
    margin-bottom: 72px;
}

.intro .highlight {
    font-family: var(--font-main);
    font-weight: inherit;
    color: var(--accent-color);
    transition: color 0.3s ease;
}

.intro .highlight:hover {
    cursor: default;
}

.signal-word {
    font-family: var(--font-main);
    font-weight: inherit;
    color: var(--text-color);
    position: relative;
    display: inline-block;
}

/* --- Section Heading --- */

.section-heading {
    font-size: clamp(3rem, 8vw, 6rem);
    font-weight: 500;
    letter-spacing: -0.04em;
    margin-bottom: 40px;
    text-align: center;
}

/* --- Investigations Grid --- */

.investigations-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 28px;
    width: 100%;
    max-width: 920px;
    border-top: none;
    padding-top: var(--grid-gap);
    align-items: start;
}

.project-card {
    text-decoration: none;
    color: var(--text-color);
    display: flex;
    flex-direction: column;
    border: 1px solid transparent;
    transition: all 0.4s var(--ease-out);
    background: transparent;
    position: relative;
}

.project-card:hover {
    transform: translateY(-5px);
}

.project-header {
    display: flex;
    justify-content: space-between;
    font-family: var(--font-code);
    font-size: 0.75rem;
    color: var(--secondary-text);
    padding-bottom: 12px;
    border-bottom: none;
    margin-bottom: 12px;
}

.project-image {
    width: 100%;
    background-color: transparent;
    margin-bottom: 16px;
    overflow: hidden;
    position: relative;
}

.project-image img {
    width: 100%;
    height: auto;
    display: block;
}

.project-info h2 {
    font-size: 1.25rem;
    font-weight: 500;
    letter-spacing: -0.02em;
    margin-bottom: 4px;
}

.project-title {
    font-family: var(--font-main);
    font-size: 1.1rem;
    font-weight: 400;
    letter-spacing: -0.01em;
    margin-bottom: 4px;
    text-align: center;
}

.project-subtitle {
    font-family: var(--font-main);
    font-size: 0.85rem;
    font-weight: 300;
    color: var(--secondary-text);
    text-align: center;
    margin-bottom: 12px;
}

.project-tech {
    font-family: var(--font-code);
    font-size: 0.7rem;
    color: var(--secondary-text);
    letter-spacing: 0.02em;
}

/* Empty State Card */
.empty-state {
    opacity: 0.5;
    border: 1px dashed var(--border-color);
    min-height: 250px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 20px;
    cursor: default;
}

.empty-state:hover {
    transform: none;
    opacity: 0.7;
}

.empty-state .project-image {
    display: none;
}

/* --- Footer --- */

footer {
    margin-top: auto;
    padding-top: 80px;
    font-family: var(--font-code);
    font-size: 0.75rem;
    color: var(--secondary-text);
    text-transform: uppercase;
    text-align: center;
}

/* --- Animations --- */

.fade-in {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.8s var(--ease-out) forwards;
}

.stagger-1 {
    animation-delay: 0.1s;
}

.stagger-2 {
    animation-delay: 0.2s;
}

.stagger-3 {
    animation-delay: 0.3s;
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- Info Columns --- */

.info-columns {
    display: flex;
    margin-top: 40px;
    gap: 60px;
}


.info-col {
    display: flex;
    flex-direction: column;
}

.info-col-header {
    font-family: var(--font-code);
    font-size: 0.7rem;
    color: var(--secondary-text);
    text-transform: uppercase;
    margin-bottom: 32px;
    letter-spacing: 0.05em;
}

.info-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.info-list li {
    font-size: 0.9rem;
    margin-bottom: 8px;
}

.info-list a {
    color: var(--text-color);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s ease;
}

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

.text-link {
    color: #666;
    text-decoration: none;
    font-weight: inherit;
    transition: color 0.3s ease;
}

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

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

/* --- Blog --- */

.blog-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.blog-item {
    border-top: 1px solid var(--border-color);
    padding: 20px 0;
}

.blog-item a {
    text-decoration: none;
    color: var(--text-color);
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 20px;
    transition: color 0.2s ease;
}

.blog-item a:hover {
    color: #000;
}

.blog-title {
    font-family: var(--font-main);
    font-size: 0.95rem;
    font-weight: 400;
    letter-spacing: -0.01em;
}

.blog-date {
    font-family: var(--font-code);
    font-size: 0.75rem;
    color: var(--secondary-text);
    white-space: nowrap;
}

/* --- Blog Post --- */

.post-content {
    max-width: 1100px;
}

.post-content h1 {
    font-size: clamp(1.4rem, 3vw, 2rem);
    font-weight: 500;
    letter-spacing: -0.02em;
    margin-bottom: 8px;
}

.post-date {
    font-family: var(--font-code);
    font-size: 0.75rem;
    color: var(--secondary-text);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: block;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 32px;
}

.post-layout {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 48px;
    align-items: start;
}

.post-body p {
    font-size: 1.05rem;
    line-height: 1.8;
    margin-bottom: 24px;
    color: var(--text-color);
}

.post-images {
    display: flex;
    flex-direction: column;
    gap: 16px;
    position: sticky;
    top: 40px;
}

.post-image {
    width: 100%;
    margin: 0;
}

.post-image img {
    width: 100%;
    display: block;
}

.post-image figcaption {
    font-family: var(--font-code);
    font-size: 0.7rem;
    color: var(--secondary-text);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-top: 6px;
}

.post-gallery {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-top: 40px;
    max-width: 1200px;
}

.post-gallery .post-image {
    width: 100%;
    margin: 0;
}

.post-gallery .post-image img {
    aspect-ratio: 4 / 3;
    object-fit: cover;
}

/* --- Project Detail Page --- */

.project-content {
    max-width: 800px;
}

.project-content h1 {
    font-size: clamp(1.8rem, 4vw, 2.5rem);
    font-weight: 500;
    letter-spacing: -0.02em;
    margin-bottom: 10px;
}

.project-meta {
    font-family: var(--font-code);
    font-size: 0.75rem;
    color: var(--secondary-text);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: block;
    margin-bottom: 4px;
}

.project-meta:last-of-type {
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 40px;
}

.project-description {
    font-size: 1.05rem;
    line-height: 1.7;
    color: var(--text-color);
    margin-bottom: 40px;
}

.project-section {
    margin-bottom: 48px;
}

.project-section h2 {
    font-size: 1.1rem;
    font-weight: 500;
    letter-spacing: -0.01em;
    margin-bottom: 16px;
}

.project-media {
    width: 100%;
    aspect-ratio: 16 / 9;
    background-color: #e0e0e0;
    overflow: hidden;
    margin-bottom: 16px;
}

.project-media iframe {
    width: 100%;
    height: 100%;
    border: none;
}

.project-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.project-content canvas {
    display: block;
    max-width: 100%;
    margin-bottom: 16px;
}

.project-caption {
    font-family: var(--font-code);
    font-size: 0.7rem;
    color: var(--secondary-text);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

/* --- Project Detail (Editorial Layout) --- */

.project-detail {
    max-width: 100%;
}

.project-detail-header {
    margin-bottom: 48px;
}

.project-detail-header h1 {
    font-size: clamp(2.5rem, 6vw, 4rem);
    font-weight: 500;
    letter-spacing: -0.03em;
    margin-bottom: 16px;
}

.project-detail-header .project-meta {
    display: block;
    padding-bottom: 0;
    border-bottom: none;
    margin-bottom: 0;
}

.project-detail-media {
    max-width: 680px;
    margin: 0 auto 48px auto;
}

.project-detail-media img {
    width: 100%;
    height: auto;
    display: block;
}

.project-detail-media iframe {
    width: 100%;
    max-width: 680px;
    aspect-ratio: 16 / 9;
    border: none;
    display: block;
}

.video-placeholder {
    width: 100%;
    aspect-ratio: 16 / 9;
    background-color: #e8e8e8;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-code);
    font-size: 0.85rem;
    color: var(--secondary-text);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.project-detail-text {
    margin: 0 0 48px 0;
}

.project-detail-text p {
    font-size: 1.15rem;
    line-height: 1.8;
    color: var(--text-color);
}

/* --- Project Navigation --- */

.project-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 48px 0 24px 0;
    border-top: 1px solid var(--border-color);
    margin-top: 48px;
}

.project-nav a {
    font-family: var(--font-code);
    font-size: 0.75rem;
    color: var(--secondary-text);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    text-decoration: none;
    transition: color 0.3s var(--ease-out);
}

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

/* --- Bottom Nav (scroll to top) --- */

.bottom-nav {
    display: flex;
    justify-content: center;
    padding: 48px 0 24px 0;
    margin-top: 48px;
}

.bottom-nav-link {
    font-family: var(--font-code);
    font-size: 1rem;
    color: var(--secondary-text);
    text-decoration: none;
    transition: color 0.3s var(--ease-out);
}

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

/* --- Mobile --- */

@media (max-width: 768px) {
    :root {
        --page-padding: 20px;
    }

    .intro h1 {
        font-size: 2.2rem;
    }

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

    .info-columns {
        flex-direction: column;
        gap: 40px;
    }

    .project-content h1 {
        font-size: 1.8rem;
    }

    .post-layout {
        grid-template-columns: 1fr;
        gap: 32px;
    }

    .post-images {
        position: static;
    }

    .blog-item a {
        flex-direction: column;
        gap: 4px;
    }

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