:root {
    /* Candlewick Dark — warm charcoal, candlelit amber accent */
    --bg-color: #0c0a08;
    --surface-color: #17130f;
    --surface-raised: #1d1812;
    --text-primary: #f4ecdf;
    --text-secondary: #a89a89;
    --accent-color: #e0a039;
    /* Candle flame amber */
    --accent-color-hover: #f4c169;
    --accent-glow: rgba(224, 160, 57, 0.28);
    --nav-bg: rgba(12, 10, 8, 0.72);
    --card-border: rgba(244, 236, 223, 0.08);
    --font-display: 'Fraunces', 'Outfit', serif;
    --font-body: 'Outfit', sans-serif;
}

.light-theme {
    /* Candlewick Light — warm paper tones, deeper amber for contrast */
    --bg-color: #faf6ef;
    --surface-color: #ffffff;
    --surface-raised: #f3ece0;
    --text-primary: #1c1712;
    --text-secondary: #6b6255;
    --accent-color: #b5761a;
    /* Steadier amber for light mode */
    --accent-color-hover: #8f5c12;
    --accent-glow: rgba(181, 118, 26, 0.18);
    --nav-bg: rgba(250, 246, 239, 0.85);
    --card-border: rgba(28, 23, 18, 0.08);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-color);
    color: var(--text-primary);
    transition: background-color 0.4s ease, color 0.4s ease;
    overflow-x: hidden;
}

/* Subtle Film Grain Overlay — keeps flat gradients from reading as generic/AI-templated */
.grain-overlay {
    position: fixed;
    inset: 0;
    z-index: 9998;
    pointer-events: none;
    opacity: 0.05;
    mix-blend-mode: overlay;
    background-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMDAiIGhlaWdodD0iMjAwIj48ZmlsdGVyIGlkPSJuIj48ZmVUdXJidWxlbmNlIHR5cGU9ImZyYWN0YWxOb2lzZSIgYmFzZUZyZXF1ZW5jeT0iMC44NSIgbnVtT2N0YXZlcz0iMyIgc3RpdGNoVGlsZXM9InN0aXRjaCIvPjxmZUNvbG9yTWF0cml4IHR5cGU9Im1hdHJpeCIgdmFsdWVzPSIwIDAgMCAwIDEgMCAwIDAgMCAxIDAgMCAwIDAgMSAwIDAgMCAwLjA1IDAiLz48L2ZpbHRlcj48cmVjdCB3aWR0aD0iMTAwJSIgaGVpZ2h0PSIxMDAlIiBmaWx0ZXI9InVybCgjbikiLz48L3N2Zz4=");
    background-size: 200px 200px;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg-color);
}

::-webkit-scrollbar-thumb {
    background: var(--card-border);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-color);
}

/* Static candlelight vignette — a fixed pool of warm light behind the hero, not a
   cursor-chasing blob. Stays still; the room feels lit, not animated. */
.dynamic-glow {
    position: fixed;
    top: 0;
    left: 50%;
    width: 70vw;
    height: 60vh;
    transform: translateX(-50%);
    background: radial-gradient(ellipse at center, var(--accent-glow) 0%, transparent 68%);
    z-index: -1;
    opacity: 0.6;
    filter: blur(110px);
    pointer-events: none;
}

/* Navigation Bar */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.2rem 6%;
    background: var(--nav-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    z-index: 100;
    border-bottom: 1px solid var(--card-border);
    transition: background-color 0.4s ease, border-color 0.4s ease;
}

.logo {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    text-decoration: none;
    letter-spacing: 0.3px;
}

.logo-mark {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    color: var(--accent-color);
    filter: drop-shadow(0 0 6px var(--accent-glow));
}

.logo span {
    color: var(--text-secondary);
    font-family: var(--font-body);
    font-weight: 300;
    font-size: 0.95em;
    letter-spacing: 1px;
    text-transform: uppercase;
}

/* Mobile Menu Button */
.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.8rem;
    cursor: pointer;
    z-index: 101;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 2.5rem;
}

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    transition: color 0.3s ease;
}

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

/* "Work" nav dropdown — groups the project-category links behind hover/focus
   instead of listing each one flat in the navbar. */
.nav-dropdown {
    position: relative;
}

.nav-dropdown-trigger {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.nav-dropdown-trigger i {
    font-size: 0.65rem;
    color: var(--text-secondary);
    transition: transform 0.3s ease, color 0.3s ease;
}

.nav-dropdown:hover .nav-dropdown-trigger i,
.nav-dropdown:focus-within .nav-dropdown-trigger i {
    transform: translateY(1px) rotate(180deg);
    color: var(--accent-color);
}

/* The outer .nav-dropdown-menu is an invisible hit-area, not the visible card.
   Its padding-top stands in for the visual gap so the hover region is one
   continuous shape from the trigger down through the menu — no dead zone the
   mouse can wander through and drop out of :hover before reaching the links. */
.nav-dropdown-menu {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding-top: 1.2rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown:focus-within .nav-dropdown-menu {
    opacity: 1;
    pointer-events: auto;
}

.nav-dropdown-menu-inner {
    display: flex;
    flex-direction: column;
    min-width: 180px;
    background: var(--surface-color);
    border: 1px solid var(--card-border);
    border-radius: 3px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.3);
    padding: 0.5rem;
}

.nav-dropdown-menu a {
    padding: 0.6rem 0.9rem;
    border-radius: 2px;
    font-size: 0.95rem;
    white-space: nowrap;
}

.nav-dropdown-menu a:hover {
    background: var(--accent-glow);
}

#theme-toggle {
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.3rem;
    cursor: pointer;
    transition: color 0.3s ease;
}

#theme-toggle:hover {
    color: var(--accent-color);
}

.light-theme .dark-icon {
    display: none;
}

.light-theme .light-icon {
    display: inline-block;
}

.dark-theme .dark-icon {
    display: inline-block;
}

.dark-theme .light-icon {
    display: none;
}

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 0 20px;
    position: relative;
    overflow: hidden;
}

/* Real render work behind the hero text, not just typography on a flat glow —
   muted and gradient-masked so the copy stays the focal point. */
.hero-video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.3;
}

.hero-video-overlay {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(180deg, var(--bg-color) 0%, transparent 30%, transparent 65%, var(--bg-color) 100%),
        radial-gradient(ellipse at center, transparent 0%, var(--bg-color) 88%);
}

.hero-content {
    max-width: 820px;
    z-index: 1;
    position: relative;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.7rem;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: var(--accent-color);
    margin-bottom: 1.75rem;
}

.eyebrow::before {
    content: '';
    width: 28px;
    height: 1px;
    background: var(--accent-color);
    opacity: 0.7;
}

.hero-content h1 {
    font-family: var(--font-display);
    font-size: clamp(2.6rem, 6vw, 5rem);
    line-height: 1.35;
    margin-bottom: 1.5rem;
    font-weight: 500;
    letter-spacing: -0.5px;
}

.accent-text {
    font-style: italic;
    font-weight: 600;
    color: var(--accent-color);
}

.hero-content p {
    font-size: clamp(1.05rem, 1.6vw, 1.2rem);
    color: var(--text-secondary);
    margin: 0 auto 3rem;
    font-weight: 300;
    max-width: 580px;
    line-height: 1.7;
}

.cta-btn {
    display: inline-block;
    padding: 1rem 2.5rem;
    background: transparent;
    border: 1px solid var(--text-secondary);
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    letter-spacing: 0.5px;
    border-radius: 2px;
    transition: border-color 0.3s ease, color 0.3s ease;
}

.cta-btn:hover {
    border-color: var(--accent-color);
    color: var(--accent-color);
}

/* Trusted By — a slow, seamless-looping marquee of real collaborators.
   Hidden entirely (see the EJS partial) when content/clients.json is empty. */
.trusted-by {
    padding: 3rem 0 1rem;
    text-align: center;
    border-bottom: 1px solid var(--card-border);
}

.trusted-by-label {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.marquee {
    overflow: hidden;
}

/* Default: centered, static, no animation — right for however many clients
   fit in the viewport without needing to scroll. main.js adds .is-scrolling
   (and duplicates the item list, and only then does this need the edge
   fade mask) once it measures that the list actually overflows. */
.marquee-track {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 2.5rem 4rem;
    width: 100%;
}

.marquee.is-scrolling {
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
    mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}

.marquee-track.is-scrolling {
    flex-wrap: nowrap;
    justify-content: flex-start;
    gap: 4rem;
    width: max-content;
    animation: marquee-scroll 32s linear infinite;
}

/* Pause on hover so a logo can actually be clicked without it sliding away */
.marquee:hover .marquee-track.is-scrolling {
    animation-play-state: paused;
}

@media (prefers-reduced-motion: reduce) {
    .marquee-track.is-scrolling {
        animation: none;
    }
}

@keyframes marquee-scroll {
    from {
        transform: translateX(0);
    }

    to {
        /* main.js only duplicates the item list once it's actually scrolling,
           so -50% is exactly one full loop — no visible seam. */
        transform: translateX(-50%);
    }
}

.marquee-item {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 40px;
    padding: 0 0.5rem;
    flex-shrink: 0;
    text-decoration: none;
    opacity: 0.85;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.marquee-item:hover {
    opacity: 1;
    transform: scale(1.05);
}

.marquee-item img {
    max-height: 100%;
    max-width: 140px;
    object-fit: contain;
}

/* A logo's own colors don't always have enough contrast against both themes
   (a dark wordmark disappears on the dark theme, a white one disappears on
   the light theme) — an explicit chip fixes that regardless of which theme
   is active, instead of guessing with color filters. Opt in per-client via
   "background": "light" | "dark" in clients.json. */
.marquee-item--chip-light,
.marquee-item--chip-dark {
    padding: 0.6rem 1rem;
    border-radius: 4px;
}

.marquee-item--chip-light {
    background: rgba(255, 255, 255, 0.92);
}

.marquee-item--chip-dark {
    background: rgba(12, 10, 8, 0.85);
}

.marquee-wordmark {
    font-family: var(--font-display);
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
}

@media (max-width: 768px) {
    .marquee-track {
        gap: 2rem 2.5rem;
    }

    .marquee-track.is-scrolling {
        gap: 2.5rem;
    }

    .marquee-item {
        height: 32px;
    }

    .marquee-item img {
        max-width: 100px;
    }
}

/* Capability Strip — honest facts only (real project count, real tools) */
.capability-strip {
    padding: 2.5rem 6%;
    border-bottom: 1px solid var(--card-border);
}

.capability-strip-inner {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1.5rem 2.5rem;
}

.capability-stat {
    display: flex;
    align-items: baseline;
    gap: 0.6rem;
    flex-shrink: 0;
}

.capability-number {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 600;
    color: var(--accent-color);
}

.capability-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.capability-tools {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

/* Portfolio Grid */
.category-section {
    padding: 6rem 6%;
}

.section-title {
    font-family: var(--font-display);
    font-size: 2.6rem;
    line-height: 1.3;
    margin-bottom: 3.5rem;
    position: relative;
    display: inline-block;
    font-weight: 600;
    letter-spacing: -0.5px;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -12px;
    left: 0;
    width: 48px;
    height: 2px;
    background: var(--accent-color);
}

.about-content {
    max-width: 800px;
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--text-secondary);
}

.about-content p {
    margin-bottom: 1.4rem;
}

.about-skills-title {
    margin-top: 2rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    font-size: 1.3rem;
}

.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    gap: 3rem;
}

/* The newest project per section reads as a lead piece rather than one more
   tile in a flat wall — same card, just more room on wide viewports. */
@media (min-width: 900px) {
    .project-card-featured {
        grid-column: span 2;
    }

    .project-card-featured .project-media-container {
        aspect-ratio: 21 / 9;
    }
}

/* Project Card — a real link now (case studies are pages, not a lightbox),
   so it needs the usual anchor reset. */
.project-card {
    background: var(--surface-color);
    border: 1px solid var(--card-border);
    border-radius: 3px;
    overflow: hidden;
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.7s ease, transform 0.7s ease, border-color 0.3s ease;
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
}

.project-card.visible {
    opacity: 1;
    transform: translateY(0);
}

.project-card:hover {
    border-color: var(--accent-color);
}

.project-media-container {
    width: 100%;
    aspect-ratio: 16/9;
    overflow: hidden;
    position: relative;
    background: #000;
}

.project-media {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border: none;
    transition: transform 0.5s ease;
}

/* Ensure native videos display fully without cropping (cards use a thumbnail
   <img>, so this only really applies on project pages) */
.project-media-container video.project-media {
    object-fit: contain;
}


.project-card:hover .project-media {
    transform: scale(1.05);
    /* Slight zoom on hover */
}

/* CAROUSEL STYLES */
.carousel-track {
    display: flex;
    width: 100%;
    height: 100%;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    scrollbar-width: none;
    /* Firefox */
}

.carousel-track::-webkit-scrollbar {
    display: none;
    /* Chrome/Safari */
}

.carousel-slide {
    flex: 0 0 100%;
    width: 100%;
    height: 100%;
    scroll-snap-align: start;
    position: relative;
    overflow: hidden;
}

.carousel-slide .project-media {
    width: 100%;
    height: 100%;
}

.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 10;
    opacity: 0;
    transition: opacity 0.3s ease, background 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.project-media-container:hover .carousel-btn {
    opacity: 1;
}

.carousel-btn:hover {
    background: var(--accent-color);
}

.carousel-btn.prev-btn {
    left: 10px;
}

.carousel-btn.next-btn {
    right: 10px;
}

.project-info {
    padding: 2rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.project-title-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.8rem;
}

.project-date {
    font-size: 0.8rem;
    color: var(--accent-color);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.4rem;
    opacity: 0.8;
}

.project-info h3 {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 0;
    /* Reset margin since wrapper handles it */
}

/* External Link appearing on hover */
.external-link-btn {
    opacity: 0;
    transform: translateX(-10px);
    transition: all 0.3s ease;
    color: var(--text-secondary);
    font-size: 1.2rem;
    text-decoration: none;
    padding: 0.4rem;
    border-radius: 5px;
}

.project-page-info .external-link-btn {
    opacity: 1;
    transform: translateX(0);
    font-size: 1.5rem;
}

.external-link-btn:hover {
    color: var(--accent-color);
    background: rgba(255, 255, 255, 0.05);
}

.project-info p {
    color: var(--text-secondary);
    font-size: 1.05rem;
    line-height: 1.6;
    margin-bottom: 1.2rem;
}

.expand-hint {
    margin-top: auto;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--accent-color);
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    opacity: 0.6;
}

.expand-hint i {
    font-size: 0.8rem;
    transition: transform 0.3s ease;
}

.project-card:hover .expand-hint {
    opacity: 1;
    transform: translateX(5px);
}

.project-card:hover .expand-hint i {
    transform: translateX(3px);
}


footer {
    text-align: center;
    padding: 5rem 6% 3rem;
    color: var(--text-secondary);
    border-top: 1px solid var(--card-border);
    margin-top: 2rem;
}

.footer-inner {
    max-width: 700px;
    margin: 0 auto;
}

.footer-tagline {
    font-family: var(--font-display);
    font-style: italic;
    font-size: 1.4rem;
    color: var(--text-primary);
    margin-bottom: 2.5rem;
}

.footer-nav {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
    margin-bottom: 2rem;
}

.footer-nav a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    transition: color 0.3s ease;
}

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

.footer-social {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.footer-social a {
    color: var(--text-secondary);
    font-size: 1.3rem;
    transition: color 0.3s ease;
}

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

.footer-copy {
    font-size: 0.85rem;
    letter-spacing: 0.3px;
}

/* Legally required business identification — deliberately understated
   (small, muted, below the copyright line) so it doesn't compete visually
   with the rest of the footer, while still being present on every page. */
.footer-legal {
    margin-top: 0.75rem;
    font-size: 0.68rem;
    line-height: 1.6;
    color: var(--text-secondary);
    opacity: 0.65;
}

.footer-legal a {
    color: inherit;
    text-decoration: underline;
    text-decoration-color: var(--card-border);
    text-underline-offset: 2px;
}

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

.footer-legal-links {
    margin-top: 0.5rem;
    font-size: 0.75rem;
}

.footer-legal-links a {
    color: var(--text-secondary);
    text-decoration: none;
}

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

/* Project Page (individual case study) */
.project-page {
    padding: 140px 6% 6rem;
    max-width: 1000px;
    margin: 0 auto;
}

/* Legal/privacy pages reuse the project-page container for consistent
   typography, with a narrower measure for easier reading of prose. */
.legal-page {
    max-width: 760px;
}

.legal-page h1 {
    font-family: var(--font-display);
    font-size: clamp(2rem, 4vw, 2.6rem);
    font-weight: 600;
    margin-bottom: 0.4rem;
}

.legal-updated {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.legal-page .process-title {
    margin-top: 2.5rem;
    margin-bottom: 1rem;
}

/* Scoped to the prose content specifically (not .back-link, which should
   keep matching every other page's muted back-link treatment) */
.legal-page .project-page-desc a {
    color: var(--accent-color);
    text-decoration: underline;
    text-decoration-color: var(--accent-glow);
    text-underline-offset: 2px;
    transition: color 0.3s ease;
}

.legal-page .project-page-desc a:hover {
    color: var(--accent-color-hover);
}

.project-page-header {
    margin-bottom: 2rem;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    transition: color 0.3s ease;
}

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

.project-page-info {
    padding: 2.5rem 0 0;
}

.project-page-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.6rem;
}

.project-page-category {
    font-weight: 800;
    letter-spacing: 2px;
    color: var(--text-secondary);
    font-size: 0.8rem;
    text-transform: uppercase;
}

.project-page-info .project-title-wrapper {
    align-items: flex-start;
    margin-bottom: 1.5rem;
}

.project-page-info h1 {
    font-family: var(--font-display);
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.2;
}

.tools-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.tools-label {
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--text-secondary);
}

.process-title {
    font-family: var(--font-display);
    font-size: 1.8rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0;
}

.project-nav {
    margin-top: 4rem;
    padding-top: 2.5rem;
    border-top: 1px solid var(--card-border);
}

.project-nav-heading {
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.project-nav-links {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.project-nav-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    text-decoration: none;
    padding: 1.5rem;
    border: 1px solid var(--card-border);
    border-radius: 3px;
    transition: border-color 0.3s ease;
}

.project-nav-link:hover {
    border-color: var(--accent-color);
}

.project-nav-next {
    justify-content: flex-end;
    text-align: right;
}

.project-nav-label {
    color: var(--accent-color);
    font-size: 1rem;
    flex-shrink: 0;
}

.project-nav-title {
    font-family: var(--font-display);
    font-size: 1.1rem;
    color: var(--text-primary);
}

/* Responsive */
@media (max-width: 768px) {
    .grid-container {
        grid-template-columns: 1fr;
    }

    .mobile-menu-btn {
        display: block;
    }

    .nav-links {
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: var(--nav-bg);
        flex-direction: column;
        align-items: center;
        padding: 2rem 0;
        gap: 1.5rem;
        border-bottom: 1px solid var(--card-border);
        transform: translateY(-150%);
        opacity: 0;
        pointer-events: none;
        transition: all 0.4s ease;
        backdrop-filter: blur(16px);
        -webkit-backdrop-filter: blur(16px);
    }

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

    .nav-links a {
        display: block !important;
        font-size: 1.2rem;
    }

    /* No real hover on touch — the dropdown menu just sits inline, always open,
       nested under the "Work" trigger in the stacked mobile menu. */
    .nav-dropdown {
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .nav-dropdown-trigger i {
        display: none;
    }

    .nav-dropdown-menu {
        position: static;
        opacity: 1;
        pointer-events: auto;
        transform: none;
        padding-top: 0;
    }

    .nav-dropdown-menu-inner {
        background: none;
        border: none;
        box-shadow: none;
        padding: 0;
        margin-top: 1rem;
        gap: 0.75rem;
        align-items: center;
    }

    .nav-dropdown-menu a {
        font-size: 1rem;
        color: var(--text-secondary);
    }

    #theme-toggle {
        margin-top: 1rem;
    }

    .section-title {
        font-size: 2.2rem;
    }

    .contact-links {
        flex-direction: column;
    }

    .project-page-info h1 {
        font-size: 1.6rem;
    }

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

    .project-nav-next {
        justify-content: flex-start;
        text-align: left;
    }
}

/* Contact Section */
#contact {
    text-align: center;
}

.contact-subtitle {
    color: var(--text-secondary);
    font-size: 1.2rem;
    margin-bottom: 3rem;
}

.contact-links {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.contact-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.2rem 2rem;
    background: var(--surface-color);
    border: 1px solid var(--card-border);
    border-radius: 3px;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 1.1rem;
    font-weight: 600;
    transition: border-color 0.3s ease, color 0.3s ease;
}

.contact-card:hover {
    border-color: var(--accent-color);
    color: var(--accent-color);
}

.contact-card i {
    font-size: 1.4rem;
}

/* Project page — media (carousel/embed lives directly on the page now, not a modal) */
.project-page .project-media-container {
    aspect-ratio: 16 / 9;
    border-radius: 4px;
    border: 1px solid var(--card-border);
    background: #000;
}

.project-page .project-media-container img,
.project-page .project-media-container iframe,
.project-page .project-media-container video {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.project-page-desc {
    font-size: 1.1rem;
    line-height: 1.7;
    color: var(--text-primary);
}

/* WIP Section inside Modal */
.wip-section {
    margin-top: 3rem;
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
    border-top: 1px solid var(--card-border);
    padding-top: 2.5rem;
}

.wip-step {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2.5rem;
    align-items: center;
}

.wip-step:nth-child(even) {
    direction: rtl;
    /* swap layout direction for even steps */
}

.wip-step:nth-child(even)>* {
    direction: ltr;
    /* revert text direction back to normal */
}

.wip-image {
    width: 100%;
    border-radius: 12px;
    border: 1px solid var(--card-border);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
    object-fit: cover;
}

.wip-content {
    display: flex;
    flex-direction: column;
}

.wip-title {
    font-size: 1.4rem;
    font-weight: 800;
    margin-bottom: 0.8rem;
    color: var(--text-primary);
}

.wip-text {
    font-size: 1.1rem;
    color: var(--text-secondary);
    line-height: 1.7;
}

@media (max-width: 768px) {

    .wip-step,
    .wip-step:nth-child(even) {
        grid-template-columns: 1fr;
        direction: ltr;
        gap: 1.5rem;
    }
}

/* Floating News Card Collapsed Icon */
.news-card-collapsed {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: var(--surface-color);
    border: 1px solid var(--card-border);
    border-radius: 50%;
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
    z-index: 90;
    cursor: pointer;
    transform: translateY(150%);
    opacity: 0;
    transition: transform 0.5s ease, opacity 0.5s ease, border-color 0.3s ease;
}

.news-card-collapsed i {
    font-size: 1.3rem;
    color: var(--accent-color);
}

.news-card-collapsed:hover {
    border-color: var(--accent-color);
}

.news-card-collapsed.show {
    transform: translateY(0);
    opacity: 1;
}

/* Floating News Card */
.news-card {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: var(--surface-color);
    border: 1px solid var(--card-border);
    border-radius: 4px;
    padding: 1.5rem;
    max-width: 320px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
    z-index: 90;
    transform: translateY(150%);
    opacity: 0;
    transition: transform 0.5s ease, opacity 0.5s ease;
    display: flex;
    flex-direction: column;
}

.news-card.show {
    transform: translateY(0);
    opacity: 1;
}

.news-card-content {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.news-icon {
    font-size: 1.6rem;
    color: var(--accent-color);
}

.news-card h4 {
    margin-bottom: 0.4rem;
    font-size: 1.1rem;
    color: var(--text-primary);
}

.news-card p {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.close-news-btn {
    position: absolute;
    top: 8px;
    right: 12px;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.2rem;
    cursor: pointer;
    transition: color 0.3s;
}

.close-news-btn:hover {
    color: var(--accent-color);
}

@media (max-width: 768px) {
    .news-card {
        bottom: 20px;
        right: 20px;
        left: 20px;
        max-width: none;
    }

    .news-card-collapsed {
        bottom: 20px;
        right: 20px;
        left: auto;
        /* explicit to prevent any left alignment bugs */
        z-index: 9999;
        /* ensure it stays on top of everything */
    }
}

/* Skills Container & Tags */
.skills-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    margin-top: 1.5rem;
}

.project-info .skills-container {
    margin-top: 0;
    margin-bottom: 0.8rem;
}

.tools-row .skills-container {
    margin-top: 0;
}

.skill-tag {
    display: inline-block;
    padding: 0.4rem 1rem;
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--card-border);
    border-radius: 2px;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    transition: border-color 0.3s ease, color 0.3s ease;
}

.skill-tag:hover {
    border-color: var(--accent-color);
    color: var(--accent-color);
}