/* Variables (Dark Mode Default) */
:root {
    --bg: #0a0a0c;
    --card-bg: #121214;
    --text-main: #ffffff;
    --text-dim: #a1a1aa;
    --border: #27272a;
    --accent: #8b5cf6;
    --accent-hover: #7c3aed;
    --badge-bg: rgba(249, 115, 22, 0.1);
    --badge-text: #f97316;
}

/* Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    transition: background 0.3s, color 0.3s;
}

html {
    background-color: var(--bg);
    scroll-behavior: smooth;
    width: 100%;
    height: 100%;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: transparent;
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: clip;
    width: 100%;
    height: 100%;
}

.container {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

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

ul {
    list-style: none;
}

/* Interactive Background Canvas */
.bg-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    pointer-events: none;
}

/* Navigation */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
}

.nav-content {
    display: flex;
    justify-content: space-between;
    height: 70px;
    align-items: center;
}

.logo {
    font-weight: bold;
    font-size: 1.2rem;
}

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

.nav-right {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.nav-links {
    display: flex;
    gap: 1.5rem;
    font-size: 0.9rem;
    font-weight: 500;
    opacity: 0.8;
}

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

/* =========================================
   MASTER LAYOUT (Desktop Sidebar Design)
   ========================================= */
.master-layout {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 70px 2rem 0 2rem;
    display: flex;
    gap: 4rem;
    align-items: flex-start;
}

/* 1. Sticky Hero Sidebar */
.hero-sidebar {
    width: 380px;
    flex-shrink: 0;
    position: sticky;
    top: 70px;
    height: calc(100vh - 70px);
    display: flex;
    align-items: center;
    overflow-y: auto;
    scrollbar-width: none;
}

.hero-sidebar::-webkit-scrollbar {
    display: none;
}

.hero-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 2.5rem;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
    width: 100%;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--badge-bg);
    color: var(--badge-text);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
}

.dot {
    width: 8px;
    height: 8px;
    background: var(--badge-text);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

.name {
    font-family: 'Playfair Display', serif;
    font-size: 3.5rem;
    line-height: 1.1;
    margin-bottom: 0.5rem;
}

.role {
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 3px;
    font-weight: 600;
    margin-bottom: 1.5rem;
    font-size: 0.85rem;
}

.bio {
    font-size: 1rem;
    color: var(--text-dim);
    margin-bottom: 2rem;
}

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-start;
    margin-bottom: 2.5rem;
}

.tags span {
    display: inline-block;
    padding: 5px 15px;
    border: 1px solid var(--border);
    border-radius: 5px;
    font-size: 0.85rem;
    background: rgba(255, 255, 255, 0.03);
}

.hero-socials {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.hero-socials a {
    color: var(--text-dim);
    transition: color 0.3s ease, transform 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-socials a svg,
.hero-socials a i {
    width: 24px !important;
    height: 24px !important;
    font-size: 24px !important;
}

.hero-socials a:hover {
    color: var(--accent);
    transform: translateY(-3px);
}

/* 2. Main Content Area */
.main-content {
    flex-grow: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 6rem;
    padding-top: 50px;
    padding-bottom: 100px;
}

.main-content>section {
    margin: 0;
    padding: 0;
    background: transparent;
    scroll-margin-top: 100px;
}

.section-subtitle {
    text-align: left;
    color: var(--accent);
    font-size: 0.75rem;
    letter-spacing: 4px;
    font-weight: bold;
    margin-bottom: 1rem;
    text-transform: uppercase;
}

.section-title {
    text-align: left;
    font-family: 'Playfair Display', serif;
    font-size: 2.5rem;
    margin-bottom: 2rem;
}

/* Specialisation (Featured) */
.featured-card {
    position: relative;
    border-radius: 24px;
    overflow: hidden;
    border: 1px solid var(--border);
    display: block;
    cursor: pointer;
    text-decoration: none;
    transition: transform 0.4s ease, border-color 0.4s ease, box-shadow 0.4s ease;
}

.featured-card:hover {
    transform: translateY(-5px);
    border-color: var(--accent);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4);
}

.featured-card img {
    width: 100%;
    display: block;
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.featured-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 3rem;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9), transparent);
    color: white;
}

#spec-desc {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    margin: 0;
}

.featured-card:hover #spec-desc {
    opacity: 1;
    transform: translateY(0);
}

/* Projects Grid (Desktop layout) */
.project-wrapper {
    width: 100%;
}

.project-grid {
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
}

.project-card {
    position: relative;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
    display: flex;
    flex-direction: row;
    height: 236px;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    transition: transform 0.4s ease, border-color 0.4s ease, box-shadow 0.4s ease;
}

.project-card:hover {
    transform: translateY(-5px);
    border-color: var(--accent);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4);
}

.project-card-image {
    position: relative;
    width: 420px;
    flex-shrink: 0;
    aspect-ratio: 16 / 9;
    height: 100%;
}

.card-bg-static,
.card-bg-gif {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.5s ease;
}

.card-bg-gif {
    opacity: 0;
}

.project-card:hover .card-bg-gif {
    opacity: 1;
}

.card-image-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 3rem 1.5rem 1.25rem 1.5rem;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.95), transparent);
    z-index: 3;
}

.card-image-overlay h3 {
    font-family: 'Playfair Display', serif;
    font-size: 1.8rem;
    color: #ffffff;
    margin: 0;
    text-shadow: 0 4px 10px rgba(0, 0, 0, 0.8);
    line-height: 1.2;
}

.project-card-info {
    padding: 2rem 2.5rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-align: left;
    height: 100%;
    overflow: hidden;
}

.project-card-info .card-desc {
    color: var(--text-dim);
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 5;
    line-clamp: 5;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.project-card-info h3 {
    font-family: 'Playfair Display', serif;
    font-size: 2rem;
    margin-bottom: 0.75rem;
    color: var(--text-main);
}

.card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: auto;
}

.card-tags span {
    padding: 4px 12px;
    border: 1px solid var(--border);
    border-radius: 20px;
    font-size: 0.75rem;
    color: var(--text-dim);
    background: rgba(255, 255, 255, 0.03);
}

/* Projects Toggle Button */
.projects-actions {
    display: flex;
    justify-content: center;
    margin-top: 3rem;
}

.btn-outline {
    background: transparent;
    color: var(--text-main);
    border: 1px solid var(--border);
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    font-family: 'Inter', sans-serif;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-outline:hover {
    border-color: var(--accent);
    color: var(--accent);
    transform: translateY(-2px);
}

.hidden-project {
    display: none !important;
}

/* Contact Section Updates */
.simple-contact {
    text-align: left;
}

.contact-text {
    margin-bottom: 2rem;
    max-width: 700px;
}

.contact-text p {
    margin-bottom: 1rem;
    font-size: 1rem;
    line-height: 1.8;
    color: var(--text-main);
    opacity: 0.9;
}

.contact-email-wrapper {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    margin-bottom: 2rem;
    cursor: pointer;
}

.contact-email-text {
    color: var(--text-dim);
    font-size: 1rem;
    transition: color 0.3s ease;
}

.contact-email-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--badge-text);
    transition: transform 0.3s ease;
}

.contact-email-icon svg {
    width: 20px;
    height: 20px;
}

.contact-email-wrapper:hover .contact-email-text {
    color: var(--text-main);
}

.contact-email-wrapper:hover .contact-email-icon {
    transform: translateY(-2px) scale(1.1);
}

@keyframes pulse {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(249, 115, 22, 0.7);
    }

    70% {
        transform: scale(1);
        box-shadow: 0 0 0 10px rgba(249, 115, 22, 0);
    }

    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(249, 115, 22, 0);
    }
}

/* =========================================
   TABLET & SMALL LAPTOP FIX (1024px - 1200px)
   ========================================= */
@media (max-width: 1200px) {
    .project-card {
        flex-direction: column;
        height: auto;
    }

    .project-card-image {
        width: 100%;
        height: auto;
    }

    .project-card-info {
        padding: 2rem;
    }

    .card-image-overlay {
        padding: 4rem 2rem 1.5rem 2rem;
    }
}

/* =========================================
   MOBILE & TABLET RESPONSIVENESS (< 900px)
   ========================================= */
@media (max-width: 900px) {
    .master-layout {
        flex-direction: column;
        gap: 4rem;
        padding: 100px 1.5rem 60px 1.5rem;
    }

    .hero-sidebar {
        width: 100%;
        position: relative;
        top: 0;
        height: auto;
        max-height: none;
        overflow: visible;
        display: block;
    }

    .main-content {
        padding-top: 0;
    }

    .hero-card {
        padding: 3rem 2.5rem 4rem 2.5rem;
    }

    .name {
        font-size: 3.5rem;
    }

    .tags,
    .hero-socials {
        justify-content: center;
    }

    .section-subtitle,
    .section-title,
    .simple-contact {
        text-align: center;
    }

    .contact-text {
        margin: 0 auto 2.5rem auto;
    }

    .contact-email-wrapper {
        display: flex;
        justify-content: center;
    }

    #spec-desc {
        opacity: 1;
        transform: translateY(0);
    }

    .project-grid {
        display: flex;
        flex-direction: column;
        gap: 2rem;
        overflow-x: visible;
        padding-bottom: 0;
    }

    .project-card {
        width: 100%;
        height: auto;
        flex-direction: column;
        opacity: 1 !important;
        transform: scale(1) !important;
    }

    .project-card-image {
        width: 100%;
        height: auto;
    }

    .project-card-info {
        padding: 1.5rem;
    }

    .project-card:hover {
        transform: scale(1);
    }

    .nav-links {
        display: none;
    }
}

@media (max-width: 480px) {
    .master-layout {
        padding: 90px 1rem 40px 1rem;
    }

    .name {
        font-size: 2.5rem;
    }

    .featured-overlay {
        padding: 1.5rem;
    }

    .featured-overlay p {
        font-size: 0.85rem;
    }
}

/* =========================================
   PROJECT DETAILS PAGE (project.html)
   ========================================= */

.project-hero {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    z-index: 1;
}

.hero-bg-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: rgba(10, 10, 12, 0.55);
    z-index: 2;
}

.hero-content {
    position: relative;
    z-index: 3;
    text-align: center;
    padding: 0 2rem;
    max-width: 900px;
    margin-top: 70px;
}

.project-detail-title {
    font-family: 'Playfair Display', serif;
    font-size: 5rem;
    line-height: 1.1;
    margin-bottom: 1rem;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.8);
}

.project-detail-role {
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 4px;
    font-weight: 600;
    margin-bottom: 2rem;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.8);
}

.scroll-indicator {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 3;
}

.scroll-indicator i {
    animation: bounce 2s infinite;
    color: white;
    width: 32px;
    height: 32px;
}

.project-content-wrapper {
    position: relative;
    z-index: 10;
    margin-top: 100vh;
    background-color: var(--bg);
    box-shadow: 0 -20px 50px rgba(0, 0, 0, 0.8);
    padding-top: 1rem;
}

.bg-canvas-absolute {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 0;
    pointer-events: none;
}

.project-details {
    position: relative;
    z-index: 1;
    padding-bottom: 100px;
}

.project-info-bar {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    flex-wrap: wrap;
    gap: 2rem;
    padding: 2rem 0 0 0;
    border-bottom: none;
    margin-bottom: 2rem;
}

.detail-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.detail-tags span {
    padding: 6px 16px;
    border: 1px solid var(--border);
    border-radius: 20px;
    font-size: 0.85rem;
    background: var(--card-bg);
    color: var(--text-dim);
}

/* Layout for tags and custom button */
.tags-and-button {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

/* Custom button styled to match tags but stand out as clickable */
.custom-tag-btn {
    padding: 6px 16px !important;
    /* Overrides the standard big button padding */
    font-size: 0.85rem !important;
    border-radius: 20px !important;
    border-color: var(--accent) !important;
    color: var(--accent) !important;
}

.custom-tag-btn svg {
    width: 14px;
    height: 14px;
}

.custom-tag-btn:hover {
    background: var(--accent);
    color: white !important;
}

/* =========================================
   MODULAR CONTENT SECTIONS
   ========================================= */
.modular-content {
    margin-top: 4rem;
    display: flex;
    flex-direction: column;
    gap: 6rem;
    /* Large gap between different modular blocks */
}

.modular-section {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    /* Space between the Title and the Row */
}

/* The dynamic grid that makes side-by-side possible */
.modular-row {
    display: grid;
    gap: 4rem;
    align-items: center;
    /* Vertically centers the text with the image */
}

.modular-row.two-columns {
    grid-template-columns: 1fr 1fr;
    /* Exactly 50/50 split */
}

.modular-row.one-column {
    grid-template-columns: 1fr;
    /* Takes up 100% of the width */
}

/* Ensure text doesn't have weird margins when in the grid */
.modular-text .detail-text {
    margin: 0;
}

/* Keep the images beautifully constrained */
.modular-image-container {
    width: 100%;
}

.modular-image {
    width: 100%;
    max-height: 600px;
    object-fit: cover;
    border-radius: 16px;
    border: 1px solid var(--border);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    display: block;
}

.detail-links {
    display: flex;
    gap: 1rem;
}

.btn-primary {
    background: var(--accent);
    color: white;
    border: none;
}

.btn-primary:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
}

.project-content-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: start;
}

.detail-section-title {
    font-family: 'Playfair Display', serif;
    font-size: 2rem;
    margin-bottom: 1.5rem;
    color: var(--text-main);
}

.detail-text {
    color: var(--text-dim);
    font-size: 1.1rem;
    line-height: 1.8;
}

.contributions-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.contribution-item {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1.5rem;
    transition: transform 0.3s ease, border-color 0.3s ease;
}

.contribution-item:hover {
    transform: translateY(-3px);
    border-color: var(--accent);
}

.contribution-item h4 {
    color: var(--accent);
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.contribution-item p {
    color: var(--text-dim);
    font-size: 0.95rem;
    line-height: 1.6;
}

@keyframes bounce {

    0%,
    20%,
    50%,
    80%,
    100% {
        transform: translateY(0);
    }

    40% {
        transform: translateY(10px);
    }

    60% {
        transform: translateY(5px);
    }
}

.youtube-wrapper {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%;
    height: 0;
    margin-top: 2.5rem;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border);
    background: var(--card-bg);
}

.youtube-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

@media (max-width: 900px) {
    .project-detail-title {
        font-size: 2.5rem;
    }

    .modular-row.two-columns {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .project-info-bar {
        flex-direction: column;
        align-items: flex-start;
    }

    .project-content-grid {
        grid-template-columns: 1fr;
        gap: 3rem;
    }

    .detail-links {
        width: 100%;
        flex-direction: column;
    }

    .btn-primary,
    .btn-outline {
        justify-content: center;
    }
}

/* =========================================
   WEBGL FULLSCREEN PAGE (dungeon-generator-demo.html)
   ========================================= */
.webgl-body {
    margin: 0 !important;
    padding: 0 !important;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    background-color: #000;
}

.game-frame {
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
    margin: 0;
    padding: 0;
}

.webgl-back-btn {
    position: absolute;
    top: 20px;
    left: 20px;
    z-index: 100;
    background: rgba(18, 18, 20, 0.85);
    border: 1px solid var(--border);
    color: white;
    padding: 10px 20px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    font-weight: 500;
    backdrop-filter: blur(8px);
    transition: all 0.3s ease;
}

.webgl-back-btn:hover {
    background: var(--accent);
    border-color: var(--accent);
    transform: translateX(-3px);
}