/* CSS Variables & Theme Setup */
@import 'modal.css';

/* Fix for Site Modal layering over Library Modal */
#site-modal.active {
    z-index: 4000 !important;
}

/* Fix for Image Modal layering over Library Modal */
#image-modal.active {
    z-index: 4100 !important;
    /* Higher than site modal even, safely above library (3000) */
}

:root {
    /* Geometric / Strict Theme - Light Version */
    --bg-main: #ffffff;
    --text-main: #000000;
    --text-muted: #525252;

    --accent-color: #4f46e5;
    /* Electric Indigo */
    --gradient-accent: linear-gradient(135deg, #4f46e5 0%, #ec4899 100%);
    --border-main: #d4d4d8;
    /* Neutral-300 (Lighter for minimal style) */
    --grid-color: rgba(0, 0, 0, 0.015);
    /* Even softer grid for less visual noise */

    --font-heading: 'Outfit', sans-serif;
    --font-mono: 'Outfit', sans-serif;
    /* Tech feel replaced with readable feel */

    /* Text Accents for Services */
    --accent-1: #3b82f6;
    /* Blue 500 */
    --accent-2: #e11d48;
    /* Rose 600 */
    --accent-3: #9333ea;
    /* Purple 600 */
    --accent-4: #10b981;
    /* Emerald 500 (Green) */
    --accent-5: #f97316;
    /* Orange 500 */
    --accent-6: #eab308;
    /* Yellow 500 */
}

.text-accent-1 {
    color: var(--accent-1);
    font-weight: 700;
}

.text-accent-2 {
    color: var(--accent-2);
    font-weight: 700;
}

.text-accent-3 {
    color: var(--accent-3);
    font-weight: 700;
}

.text-accent-4 {
    color: var(--accent-4);
    font-weight: 700;
}

.text-accent-5 {
    color: var(--accent-5);
    font-weight: 700;
}

.text-accent-6 {
    color: var(--accent-6);
    font-weight: 700;
}

/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-heading);
    background-color: var(--bg-main);
    color: var(--text-main);
    line-height: 1.5;
    overflow-x: hidden;
    position: relative;
}

/* Geometric Grid Background */
.grid-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    background-image:
        linear-gradient(var(--grid-color) 1px, transparent 1px),
        linear-gradient(90deg, var(--grid-color) 1px, transparent 1px);
    background-size: 60px 60px;
    /* Larger spacing for cleaner look */
    pointer-events: none;
    opacity: 0.5;
    /* Reduced opacity for minimal style */
}

.scanline {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, transparent 50%, rgba(0, 0, 0, 0.02) 51%);
    background-size: 100% 4px;
    z-index: 900;
    pointer-events: none;
}

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

ul {
    list-style: none;
}

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

/* Typography */
h1,
h2,
h3 {
    text-transform: uppercase;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.mono-text {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

/* Header */
.main-header {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.9);
    border-bottom: 1px solid var(--border-main);
    backdrop-filter: blur(5px);
}

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

.logo {
    font-size: 1.5rem;
    font-weight: 900;
    letter-spacing: -0.05em;
    border: 1px solid var(--text-main);
    padding: 5px 15px;
}

.nav-links {
    display: flex;
    gap: 40px;
}

.nav-links a {
    font-weight: 700;
    font-size: 0.9rem;
    text-transform: uppercase;
    position: relative;
}

.nav-links a::after {
    content: '';
    position: absolute;
    top: -5px;
    /* Moved to top */
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent-color);
    transition: width 0.3s ease;
}

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

/* Multi-line Nav Items */
.nav-links li {
    display: flex;
    align-items: center;
}

.nav-multiline {
    position: relative;
    display: inline-block;
    text-align: center;
}

.nav-subtitle {
    display: block;
    position: absolute;
    top: 22px;
    left: 50%;
    transform: translateX(-50%);
    width: max-content;

    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: none;
    line-height: 1;
}

/* Sections */
.section {
    padding: 140px 0;
    /* More vertical space between sections */
    position: relative;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Hero */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--border-main);
}

.hero-title {
    font-size: 5rem;
    line-height: 0.9;
    margin-bottom: 30px;
    font-weight: 800;
}

.glitch-text {
    background: var(--gradient-accent);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    position: relative;
    display: inline-block;
}

.hero-text {
    font-family: var(--font-mono);
    color: var(--text-muted);
    font-size: 1.1rem;
    margin-bottom: 50px;
}

/* Buttons (Strict Geo) */
.btn-geo {
    display: inline-block;
    padding: 15px 40px;
    background: var(--text-main);
    color: var(--bg-main);
    font-weight: 700;
    text-transform: uppercase;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    overflow: hidden;
}

.btn-geo:hover {
    background: var(--accent-color);
    transform: translate(-4px, -4px);
    box-shadow: 6px 6px 0 var(--text-main);
}

/* Cards (Strict Geo) */
.section-title {
    font-size: 3rem;
    margin-bottom: 80px;
    border-left: 10px solid var(--accent-color);
    padding-left: 10px;
    line-height: 1;
}

.geo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 0;
    /* Connected grid */
    border: 1px solid var(--border-main);
    background: var(--bg-main);
}

.card-geo {
    border: 1px solid var(--border-main);
    padding: 50px 40px;
    /* More vertical space */
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    /* Smooth easing */
    background: var(--bg-main);
}

.card-geo:hover {
    background: #fafafa;
    /* More subtle background */
    z-index: 2;
    outline: 2px solid var(--accent-color);
    /* Thinner outline */
    outline-offset: -2px;
    transform: translateY(-2px);
    /* Subtle lift effect */
}

.card-header {
    font-family: var(--font-mono);
    color: var(--text-muted);
    margin-bottom: 20px;
    font-size: 0.8rem;
}

/* Portfolio */
.portfolio-item-geo {
    border: 1px solid var(--border-main);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    /* Subtle shadow instead of hard borders */
}

.portfolio-visual {
    height: 250px;
    background: #f4f4f5;
    /* Lighter background */
    border-bottom: 1px solid var(--border-main);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.4s ease;
}

.visual-tag {
    font-family: var(--font-mono);
    background: var(--text-main);
    color: var(--bg-main);
    padding: 5px 10px;
}

.portfolio-info {
    padding: 20px;
    background: var(--bg-main);
}

.portfolio-item-geo:hover .portfolio-visual {
    background: var(--accent-color);
}

/* Contact Form */
.contact-form-geo {
    border: 1px solid var(--border-main);
    padding: 50px;
    /* More breathing room */
    background: white;
    max-width: 800px;
    margin: 0 auto;
    box-shadow: 8px 8px 0 rgba(0, 0, 0, 0.06);
    /* Reduced shadow for minimal style */
}

.form-row {
    display: flex;
    gap: 20px;
}

.form-group {
    margin-bottom: 25px;
    flex: 1;
}

.form-group label {
    display: block;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    margin-bottom: 10px;
    font-weight: 700;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 16px;
    border: 1px solid #e5e7eb;
    /* Even lighter border */
    background: #fafafa;
    font-family: inherit;
    font-size: 1rem;
    border-radius: 0;
    transition: all 0.3s ease;
    /* Smooth transition */
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent-color);
    background: white;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
    /* Subtle focus ring */
}

.btn-full {
    width: 100%;
    text-align: center;
}

/* Floating Glitch Button */
.btn-glitch-fixed {
    position: fixed;
    bottom: 150px;
    right: 50px;
    background: var(--gradient-accent);
    /* GRADIENT BACKGROUND */
    color: #ffffff;
    padding: 20px 40px;
    font-weight: 900;
    text-transform: uppercase;
    font-size: 1.2rem;
    z-index: 2000;
    border: none;
    /* Angle Cut */
    clip-path: polygon(10% 0, 100% 0, 100% 70%, 90% 100%, 0 100%, 0 30%);
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 10px 20px rgba(79, 70, 229, 0.3);
    /* Soft glow instead of hard shadow for "cleaner" look */
}

.btn-glitch-fixed:hover {
    transform: scale(1.05);
    box-shadow: 0 15px 30px rgba(236, 72, 153, 0.4);
    color: white;
}

/* Footer */
.main-footer {
    border-top: 1px solid var(--border-main);
    padding: 60px 0;
    background: #f4f4f5;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    font-weight: 700;
}

/* --- LIBRARY SPLIT LAYOUT --- */
.library-split-layout {
    display: flex;
    gap: 60px;
    align-items: flex-start;
    overflow: hidden;
    /* Prevent marquee scrollbar */
}

.library-list {
    flex: 1;
    min-width: 300px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.library-list-item {
    padding: 24px 20px;
    /* More vertical padding */
    border-left: 1px solid var(--border-main);
    /* Thinner border */
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

.library-list-item:hover {
    border-left-width: 3px;
    /* Grows on hover */
    border-left-color: var(--accent-color);
    background: #fafafa;
    padding-left: 28px;
}

/* MARQUEE */
.library-marquee-wrapper {
    flex: 1.5;
    position: relative;
    overflow: hidden;
    height: 700px;
    /* Increased height for 3 rows */
    background: #fafafa;
    border: 1px solid var(--border-main);
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 30px;
    /* Space between rows */
}

.marquee-track {
    display: flex;
    gap: 20px;
    width: max-content;
    will-change: transform;
    /* Performance */
}

/* Animations */
.marquee-track.scroll-left {
    animation: scrollMarqueeLeft 60s linear infinite;
}

.marquee-track.scroll-right {
    animation: scrollMarqueeRight 60s linear infinite;
}

.marquee-track:hover {
    animation-play-state: paused;
}

.marquee-card-wrapper {
    display: flex;
    flex-direction: column;
    width: 300px;
    /* Reduced width to fit more */
    flex-shrink: 0;
    cursor: pointer;
    transition: transform 0.3s;
}

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

.marquee-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 5px;
    letter-spacing: 0.05em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.marquee-image-box {
    width: 100%;
    height: 200px;
    border: 1px solid var(--border-main);
    overflow: hidden;
    background: white;
}

.marquee-image-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s;
}

.marquee-card-wrapper:hover .marquee-image-box img {
    transform: scale(1.1);
}

@keyframes scrollMarqueeLeft {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-50%);
    }
}

@keyframes scrollMarqueeRight {
    0% {
        transform: translateX(-50%);
    }

    100% {
        transform: translateX(0);
    }
}


/* --- LARGE SCREENS ADAPTATION (14-16 inch+) --- */
@media (min-width: 1440px) {
    :root {
        /* Increase base font size slightly for better proportions */
        font-size: 17px;
    }

    .container {
        max-width: 1380px;
    }

    /* Make grid items slightly wider before wrapping */
    .geo-grid {
        grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    }

    .hero-title {
        font-size: 5.5rem;
    }
}

@media (min-width: 1600px) {
    :root {
        font-size: 18px;
    }

    .container {
        max-width: 1560px;
    }

    /* More breathing room in cards */
    .card-geo {
        padding: 70px 50px;
    }

    .section-title {
        font-size: 3.5rem;
        margin-bottom: 100px;
    }

    /* Larger button on big screens */
    .btn-geo {
        padding: 20px 50px;
        font-size: 1.1rem;
    }
}

/* --- MOBILE RESPONSIVENESS --- */
@media (max-width: 768px) {

    /* Typography */
    .hero-title {
        font-size: 3rem;
        line-height: 1.1;
    }

    .section-title {
        font-size: 2rem;
        margin-bottom: 40px;
    }

    .hero-text {
        font-size: 1rem;
    }

    /* Layout */
    .section {
        padding: 60px 0;
    }

    .container {
        padding: 0 20px;
    }

    /* Header & Nav */
    .nav-container {
        height: auto;
        flex-direction: column;
        padding: 15px 0;
    }

    .nav-links {
        margin-top: 15px;
        gap: 20px;
        flex-wrap: wrap;
        justify-content: center;
    }

    .logo {
        margin-bottom: 5px;
    }

    /* Hero Section */
    .hero {
        flex-direction: column;
        justify-content: center;
        text-align: center;
        padding-top: 140px;
    }

    .hero-content {
        margin-bottom: 40px;
    }

    /* Contact Form */
    .form-row {
        flex-direction: column;
        gap: 0;
    }

    /* Fixed Button */
    .btn-glitch-fixed {
        bottom: 20px;
        right: 20px;
        padding: 15px 25px;
        font-size: 0.9rem;
        width: calc(100% - 40px);
        text-align: center;
        clip-path: none;
        border-radius: 4px;
    }

    /* Footer */
    /* Footer */
    .footer-content {
        flex-direction: column;
        gap: 30px;
        text-align: center;
    }

    /* Library Mobile */
    .library-split-layout {
        flex-direction: column;
        gap: 40px;
    }

    .library-marquee-wrapper {
        width: 100%;
        height: 300px;
        /* Smaller on mobile */
    }

    .marquee-item {
        width: 300px;
        height: 200px;
    }
}

/* --- DYNAMIC PORTFOLIO CARDS (Added for Consistency) --- */
.portfolio-card {
    border: 1px solid var(--border-main);
    background: var(--bg-main);
    display: flex;
    flex-direction: column;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    height: 100%;
    /* Ensure they stretch */
}

.portfolio-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.05);
    z-index: 2;
    border-color: var(--accent-color);
}

.card-image {
    width: 100%;
    height: 240px;
    /* FIXED HEIGHT */
    overflow: hidden;
    position: relative;
    border-bottom: 1px solid var(--border-main);
    background: #f4f4f5;
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* Key fix */
    transition: transform 0.5s ease;
}

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

.card-info {
    padding: 25px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.card-info h3 {
    font-size: 1.1rem;
    margin-bottom: 15px;
    color: var(--text-main);
    line-height: 1.3;
}

.card-info p {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.6;
}

/* Visualization Comparison */
.visual-comparison {
    margin-top: 30px;
    display: flex;
    gap: 15px;
}

.visual-box {
    flex: 1;
}

.visual-label {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-bottom: 8px;
    text-transform: uppercase;
    font-weight: 700;
}

.visual-img-container {
    border: 1px solid var(--border-main);
    height: 160px;
    overflow: hidden;
    background: #f4f4f5;
    transition: transform 0.3s ease;
    cursor: pointer;
    /* Added pointer */
}

.visual-img-container:hover {
    transform: scale(1.02);
    border-color: var(--accent-color);
}

.visual-img-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}