/* CSS Variables & Reset */
:root {
    --bg-color: #050505;
    --text-color: #ffffff;
    --accent-gray: #333333;
    --accent-light: #e0e0e0;
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
    --spacing-container: 8vw;
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-body);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

img {
    max-width: 100%;
    display: block;
}

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

/* Utilities */
.theme-noir {
    background-color: #000;
    color: #fff;
}

.noise-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 50;
    opacity: 0.04;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}

/* Typography */
h1,
h2,
h3 {
    font-family: var(--font-heading);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: -0.02em;
}

h1 {
    font-size: clamp(3rem, 10vw, 8rem);
    line-height: 0.9;
    margin-bottom: 2rem;
}

h2 {
    font-size: clamp(2rem, 5vw, 4rem);
}

p {
    font-size: 1.1rem;
    color: #aeaeae;
}

/* Layout */
section {
    padding: 6rem var(--spacing-container);
    min-height: 50vh;
}

/* Navbar */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2rem var(--spacing-container);
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 100;
    mix-blend-mode: difference;
    backdrop-filter: blur(5px);
}

.logo {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.5rem;
    transition: opacity 0.3s ease;
}

.logo:hover {
    opacity: 0.8;
}

.nav-links {
    display: none;
}

.menu-toggle {
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.menu-toggle svg {
    display: block;
    transition: transform 0.3s ease;
}

/* Hide close icon by default */
.menu-toggle .icon-close {
    display: none;
}

/* When expanded, hide menu icon and show close icon */
.menu-toggle[aria-expanded="true"] .icon-menu {
    display: none;
}

.menu-toggle[aria-expanded="true"] .icon-close {
    display: block;
}

@media(min-width: 768px) {
    .menu-toggle {
        display: none;
    }

    .nav-links {
        display: flex;
        position: static;
        flex-direction: row;
        width: auto;
        padding: 0;
        background: none;
        border: none;
        gap: 3rem;
        list-style: none;
        clip-path: none;
    }

    .nav-links li {
        opacity: 1;
        transform: translateY(0);
    }

    .nav-links li a {
        font-size: 0.9rem;
        text-transform: uppercase;
        letter-spacing: 0.05em;
        position: relative;
    }

    .nav-links li a::after {
        content: '';
        position: absolute;
        width: 0;
        height: 1px;
        bottom: -4px;
        left: 0;
        background-color: white;
        transition: width 0.3s ease;
    }

    .nav-links li a:hover::after {
        width: 100%;
    }
}

/* Mobile Menu Styles */
@media (max-width: 767px) {
    .nav-links {
        display: flex;
        flex-direction: column;
        position: absolute;
        top: 100%;
        right: var(--spacing-container);
        background: rgba(12, 12, 12, 0.95);
        backdrop-filter: blur(10px);
        width: 200px;
        padding: 1.5rem;
        border-radius: 1rem;
        border: 1px solid #333;
        gap: 1.5rem;
        list-style: none;
        /* Animation setup */
        transform-origin: top right;
        transform: scale(0.95);
        opacity: 0;
        visibility: hidden;
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
            opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1),
            visibility 0.3s step-end;
    }

    .nav-links.active {
        transform: scale(1);
        opacity: 1;
        visibility: visible;
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
            opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1),
            visibility 0s step-start;
    }

    .nav-links li {
        opacity: 0;
        transform: translateY(-10px);
        transition: opacity 0.3s ease, transform 0.3s ease;
    }

    .nav-links.active li {
        opacity: 1;
        transform: translateY(0);
    }

    /* Stagger delay for list items */
    .nav-links.active li:nth-child(1) {
        transition-delay: 0.1s;
    }

    .nav-links.active li:nth-child(2) {
        transition-delay: 0.15s;
    }

    .nav-links.active li:nth-child(3) {
        transition-delay: 0.2s;
    }

    .nav-links li a {
        font-size: 1rem;
        text-transform: uppercase;
        letter-spacing: 0.05em;
        display: block;
        padding: 0.5rem 0;
        border-bottom: 1px solid transparent;
        transition: border-color 0.3s ease, padding-left 0.3s ease;
    }

    .nav-links li a:hover {
        border-color: #333;
        padding-left: 0.5rem;
    }
}

/* Hero Section */
.hero-section {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding-top: calc(20vh - 5px);
}

.hero-content {
    display: grid;
    grid-template-columns: 1fr;
    gap: 4rem;
}

@media(min-width: 900px) {
    .hero-content {
        grid-template-columns: 1.2fr 1fr;
        align-items: center;
    }
}

.subtitle {
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-size: 0.9rem;
    margin-bottom: 1rem;
    color: var(--accent-light);
}

.hero-stats {
    display: flex;
    gap: 4rem;
    margin-top: 3rem;
}

.stat {
    display: flex;
    flex-direction: column;
}

.stat .num {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 600;
}

.stat .label {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: #666;
    margin-top: 0.25rem;
}

.hero-image-container {
    position: relative;
    transition: transform 0.5s ease;
}

.hero-image-container:hover {
    transform: scale(1.02);
}

.hero-img {
    width: 100%;
    max-width: 500px;
    height: auto;
    border-radius: 2rem;
    filter: grayscale(100%) contrast(1.1);
}

/* About Section */
.about-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 4rem;
    margin-top: 4rem;
}

@media(min-width: 768px) {
    .about-grid {
        grid-template-columns: 1fr 1fr;
    }
}

.about-text p {
    font-size: clamp(1.2rem, 2vw, 1.8rem);
    line-height: 1.4;
    color: #fff;
}

/* Geometric Patterns & Placeholders */
.geometric-box {
    background: #0a0a0a;
    height: 300px;
    border-radius: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-heading);
    font-size: 2rem;
    color: #333;
    border: 1px solid #222;
    position: relative;
    overflow: hidden;
}

/* About Image - Matching original 300px height */
.about-img {
    width: 100%;
    height: 300px;
    /* Matches previous .geometric-box height */
    object-fit: cover;
    border-radius: 2rem;
    border: 1px solid #222;
    filter: grayscale(100%) contrast(1.1);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    transition: transform 0.3s ease;
}

.about-img:hover {
    transform: scale(1.02);
}

/* CSS Pattern for About Section */
.geometric-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image:
        linear-gradient(45deg, #222 25%, transparent 25%),
        linear-gradient(-45deg, #222 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #222 75%),
        linear-gradient(-45deg, transparent 75%, #222 75%);
    background-size: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
    opacity: 0.8;
}

.project-grid {
    display: flex;
    flex-direction: column;
    gap: 8rem;
    margin-top: 4rem;
}

.project-card {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    transition: transform 0.3s ease;
}

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

@media(min-width: 768px) {
    .project-card {
        grid-template-columns: 1fr 1.5fr;
        align-items: center;
    }

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

    .offset-card .project-info {
        order: 2;
    }
}

.project-info h3 {
    font-size: 1.5rem;
    color: #444;
    margin-bottom: 0.5rem;
}

.project-info h4 {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.img-placeholder {
    background-color: #1a1a1a;
    aspect-ratio: 4/3;
    border-radius: 1rem;
    width: 100%;
    position: relative;
    overflow: hidden;
    border: 1px solid #222;
}

/* Vision Project Image - already an img tag, but if fallback needed */
.project-img {
    border-radius: 1rem;
    filter: grayscale(100%);
    transition: filter 0.3s ease;
}

.project-card:hover .project-img {
    filter: grayscale(0%);
}

/* NLP Placeholder Pattern */
#project-nlp-ph {
    background: radial-gradient(circle at 50% 50%, #222 0%, #050505 70%);
}

#project-nlp-ph::after {
    content: 'NLP CORE';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #333;
    font-family: monospace;
    font-size: 2rem;
    font-weight: bold;
    letter-spacing: 0.5rem;
    z-index: 2;
}

#project-nlp-ph::before {
    content: '';
    position: absolute;
    width: 200%;
    height: 200%;
    top: -50%;
    left: -50%;
    background: repeating-linear-gradient(transparent, transparent 10px, #1a1a1a 10px, #1a1a1a 11px);
    transform: rotate(45deg);
    animation: flow 20s linear infinite;
}

@keyframes flow {
    0% {
        transform: rotate(45deg) translateY(0);
    }

    100% {
        transform: rotate(45deg) translateY(50px);
    }
}

/* Generative Art Placeholder Pattern */
#project-gen-ph {
    background: #000;
}

#project-gen-ph::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        conic-gradient(from 0deg at 50% 50%, #111 0deg, transparent 60deg, #111 120deg, transparent 180deg, #111 240deg, transparent 300deg, #111 360deg);
    opacity: 0.5;
}

#project-gen-ph::after {
    content: '';
    position: absolute;
    top: 20%;
    left: 20%;
    right: 20%;
    bottom: 20%;
    border: 1px solid #333;
    border-radius: 50%;
    box-shadow: 0 0 50px #1a1a1a;
}

/* Testimonials */
.testimonial-card {
    border-top: 1px solid #333;
    padding-top: 4rem;
    margin-top: 4rem;
    max-width: 800px;
}

blockquote {
    font-family: var(--font-heading);
    font-size: clamp(1.5rem, 3vw, 2.5rem);
    line-height: 1.2;
    margin: 2rem 0;
}

.quote-mark {
    font-size: 4rem;
    line-height: 1;
    font-family: serif;
    color: #444;
}

.author {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.role {
    font-size: 0.9rem;
    color: #666;
}

/* Footer */
.footer-section {
    background-color: #0c0c0c;
    padding-bottom: 4rem;
}

.contact-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 4rem;
    margin-top: 4rem;
}

@media(min-width: 768px) {
    .contact-grid {
        grid-template-columns: 1fr 2fr;
    }
}

.small-img-placeholder {
    width: 150px;
    height: 150px;
    background-color: #222;
    border-radius: 1rem;
    background-image: linear-gradient(135deg, #222 25%, #1a1a1a 25%, #1a1a1a 50%, #222 50%, #222 75%, #1a1a1a 75%, #1a1a1a 100%);
    background-size: 20px 20px;
}

.contact-details {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

@media(min-width: 600px) {
    .contact-details {
        grid-template-columns: repeat(2, 1fr);
    }
}

.detail-group .label {
    display: block;
    font-size: 0.8rem;
    text-transform: uppercase;
    color: #555;
    margin-bottom: 0.5rem;
}

.social-links {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.social-links a {
    transition: color 0.2s ease;
}

.social-links a:hover {
    color: #fff;
    text-decoration: underline;
}

/* Animation Classes */
.fade-in-section {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.fade-in-section.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Contact Small Image */
.contact-img {
    width: 150px;
    height: 150px;
    object-fit: cover;
    border-radius: 1rem;
    filter: grayscale(100%) contrast(1.1);
    border: 1px solid #333;
}

/* -------------------------------------------
   BLOG STYLES
------------------------------------------- */

/* Blog Header */
.blog-header-section {
    padding-top: calc(20vh - 5px);
    padding-bottom: 2rem;
    min-height: 40vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Blog Grid */
.blog-list-section {
    padding-top: 0;
}

.blog-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 4rem;
}

@media(min-width: 768px) {
    .blog-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media(min-width: 1200px) {
    .blog-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Blog Card */
.blog-card {
    background: #0a0a0a;
    border: 1px solid #222;
    border-radius: 1rem;
    padding: 2rem;
    transition: transform 0.3s ease, border-color 0.3s ease;
    opacity: 0;
    transform: translateY(20px);
}

.blog-card.visible {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.blog-card:hover {
    transform: translateY(-5px);
    border-color: #444;
}

.blog-date {
    display: block;
    font-size: 0.8rem;
    color: #666;
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.blog-title {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.blog-title a {
    color: #fff;
    transition: color 0.2s ease;
}

.blog-title a:hover {
    color: #aaa;
}

.blog-summary {
    font-size: 1rem;
    color: #888;
    margin-bottom: 2rem;
    line-height: 1.5;
}

.read-more {
    display: inline-flex;
    align-items: center;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #fff;
    font-weight: 500;
}

.read-more .arrow {
    margin-left: 0.5rem;
    transition: transform 0.2s ease;
}

.read-more:hover .arrow {
    transform: translateX(5px);
}

/* Post Page */
.post-page {
    padding-top: 8rem;
    min-height: 100vh;
}

.post-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 var(--spacing-container);
}

/* Post Header */
.post-header {
    margin-bottom: 4rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid #222;
}

.back-link {
    display: inline-block;
    margin-bottom: 2rem;
    color: #666;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: color 0.2s ease;
}

.back-link:hover {
    color: #fff;
}

.post-header-date {
    display: block;
    color: #444;
    font-size: 0.9rem;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
}

.post-header-title {
    font-size: clamp(2rem, 5vw, 4rem);
    line-height: 1.1;
    color: #fff;
}

/* Markdown Content Styling */
.markdown-content {
    color: #ccc;
    font-size: 1.1rem;
    line-height: 1.8;
}

.markdown-content h1,
.markdown-content h2,
.markdown-content h3 {
    color: #fff;
    margin-top: 3rem;
    margin-bottom: 1.5rem;
}

.markdown-content p {
    margin-bottom: 1.5rem;
    color: #ccc;
}

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

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

.markdown-content strong {
    color: #fff;
    font-weight: 600;
}

.markdown-content em {
    color: #aaa;
}

.markdown-content blockquote {
    border-left: 2px solid #333;
    padding-left: 1.5rem;
    margin: 2rem 0;
    font-style: italic;
    color: #888;
    font-family: var(--font-body);
    /* Override heading font if inherited */
    font-size: 1.2rem;
}

.markdown-content pre {
    background: #0a0a0a;
    padding: 1.5rem;
    border-radius: 0.5rem;
    overflow-x: auto;
    margin: 2rem 0;
    border: 1px solid #222;
}

.markdown-content code {
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.9em;
    background: rgba(255, 255, 255, 0.1);
    padding: 0.2rem 0.4rem;
    border-radius: 0.2rem;
}

.markdown-content pre code {
    background: none;
    padding: 0;
    color: #e0e0e0;
}

.markdown-content img {
    border-radius: 0.5rem;
    margin: 2rem 0;
    border: 1px solid #222;
}

.markdown-content a {
    color: #fff;
    text-decoration: underline;
    text-decoration-color: #444;
    text-underline-offset: 4px;
    transition: text-decoration-color 0.2s ease;
}

.markdown-content a:hover {
    text-decoration-color: #fff;
}

.loading-state,
.loading-spinner {
    text-align: center;
    color: #444;
    font-family: monospace;
    margin-top: 4rem;
    text-transform: uppercase;
    letter-spacing: 0.1rem;
    animation: blink 1.5s infinite;
}

.error-container {
    text-align: center;
    padding: 4rem 0;
}

.error-container h2 {
    color: #cc0000;
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

.post-footer {
    margin-top: 6rem;
    padding-top: 2rem;
    border-top: 1px solid #222;
    padding-bottom: 4rem;
}