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

:root {
    /* Color Palette - Industrial Tech */
    --bg-black: #050505;
    --bg-gray: #0f0f0f;
    --bg-card: #141414;
    
    --primary: #fb923c; /* Safety Orange */
    --primary-glow: rgba(251, 146, 60, 0.2);
    --secondary: #4ade80; /* Terminal Green */
    --accent: #22d3ee; /* Cyber Blue */
    --primary-rgb: 251, 146, 60;
    
    --text-high: #ffffff;
    --text-mid: #a3a3a3;
    --text-low: #525252;
    
    --border: rgba(255, 255, 255, 0.05);
    --border-hover: rgba(255, 255, 255, 0.15);
    
    /* Typography */
    --font-heading: 'Syne', sans-serif;
    --font-mono: 'IBM Plex Mono', monospace;
    --font-body: 'Inter', sans-serif;
    
    /* System */
    --transition: all 0.4s cubic-bezier(0.25, 1, 0.5, 1);
    --radius: 0px; /* Sharp, industrial feel */
    --bg: #050505;
}

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

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

/* System Elements (Cursor & Scroll) */
.scroll-progress-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: transparent;
    z-index: 10000;
}

.scroll-progress-bar {
    height: 100%;
    background: var(--primary);
    width: 0%;
    transition: width 0.1s ease-out;
    box-shadow: 0 0 10px var(--primary-glow);
}

body::before {
    content: '';
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: url('https://grainy-gradients.vercel.app/noise.svg');
    opacity: 0.03;
    pointer-events: none;
    z-index: 9999;
}

/* Scroll Reveal Animation */
.reveal {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 0.7s cubic-bezier(0.25, 1, 0.5, 1), transform 0.7s cubic-bezier(0.25, 1, 0.5, 1);
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Stagger delays for child elements */
.reveal-d1 { transition-delay: 0.1s; }
.reveal-d2 { transition-delay: 0.2s; }
.reveal-d3 { transition-delay: 0.35s; }

/* Section Divider */
.section-divider {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 0 4rem;
    max-width: 1400px;
    margin: 0 auto;
    opacity: 0.4;
}

.section-divider span {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--text-low);
    letter-spacing: 0.15em;
    white-space: nowrap;
}

.section-divider::before,
.section-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border), transparent);
}

.section-divider::before {
    max-width: 2rem;
}

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

h1 { font-size: clamp(2.5rem, 6vw, 4.25rem); font-weight: 800; line-height: 1; margin-bottom: 2rem; }
h2 { 
    font-size: clamp(2.5rem, 8vw, 4rem); 
    font-weight: 700; 
    margin-bottom: 3rem; 
    line-height: 1; /* Pull letters to the absolute top of the box */
    transition: var(--transition);
}
h3 { font-size: 1.25rem; font-weight: 700; font-family: var(--font-mono); color: var(--primary); }

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

/* Navigation */
header {
    position: fixed;
    top: 0; width: 100%;
    z-index: 1000;
    padding: 2rem 0;
    transition: var(--transition);
}

header.scrolled {
    padding: 1rem 0;
    background: rgba(5, 5, 5, 0.8);
    backdrop-filter: blur(12px) saturate(180%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 4rem;
}

.logo {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 1.5rem;
    color: var(--text-high);
    text-decoration: none;
    position: relative;
    display: inline-flex;
    align-items: center;
}

.logo::after {
    content: '_';
    color: var(--primary);
    margin-left: 2px;
    animation: blink 1s step-end infinite;
    transition: opacity 0.3s ease;
}

.logo.cursor-off::after {
    animation: none;
    opacity: 0;
}

@keyframes blink {
    from, to { opacity: 1; }
    50% { opacity: 0; }
}

.nav-links {
    display: flex;
    gap: 4rem; /* Increased spacing */
    align-items: center;
}

.nav-link {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    text-decoration: none;
    color: var(--text-low);
    transition: var(--transition);
    position: relative;
    letter-spacing: 0.05em;
    padding: 0 0.5rem;
}

.nav-link::before,
.nav-link::after {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0;
    transition: opacity 0.2s ease, transform 0.2s ease;
    color: var(--primary);
    font-weight: bold;
}

.nav-link::before {
    content: '[';
    left: -0.5rem;
    transform: translate(0.5rem, -50%);
}

.nav-link::after {
    content: ']';
    right: -0.5rem;
    transform: translate(-0.5rem, -50%);
}

.nav-link:hover, .nav-link.active {
    color: var(--text-high);
}

.nav-link:hover::before, .nav-link.active::before {
    opacity: 1;
    transform: translate(0, -50%);
}

.nav-link:hover::after, .nav-link.active::after {
    opacity: 1;
    transform: translate(0, -50%);
}

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

/* CTA Nav Button */
.nav-cta {
    padding: 0.6rem 1.2rem !important;
    border: 1px solid var(--primary) !important;
    background: transparent;
    color: var(--primary) !important;
    font-size: 0.7rem !important;
    letter-spacing: 0.1em;
    transition: all 0.3s ease;
}

.nav-cta:hover {
    background: var(--primary);
    color: var(--bg-black) !important;
    box-shadow: 0 0 20px var(--primary-glow);
}

/* Hero Section - Asymmetrical */
.hero {
    min-height: 90vh; /* Slightly reduced to give breath */
    display: flex;
    align-items: center;
    padding: 120px 4rem 8rem; /* Increased bottom padding for hierarchy */
    max-width: 1400px;
    margin: 0 auto;
}

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

.hero-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    z-index: 2;
}

.hero-content::before {
    content: '';
    position: absolute;
    top: 40%;
    left: -10%;
    width: 600px;
    height: 600px;
    background: radial-gradient(ellipse at center, rgba(251, 146, 60, 0.07) 0%, transparent 65%);
    pointer-events: none;
    z-index: -1;
    transform: translateY(-50%);
    max-width: 100vw; /* Prevent overflow */
}


.hero-status {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--secondary);
    margin-bottom: 2rem;
}

.hero-status .dot {
    width: 8px; height: 8px;
    background: var(--secondary);
    border-radius: 50%;
    box-shadow: 0 0 12px var(--secondary);
    animation: status-pulse 2s ease-in-out infinite;
}

@keyframes status-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(0.85); }
}

.hero-desc {
    font-size: 1.5rem;
    color: var(--text-mid);
    max-width: 600px;
    margin-bottom: 3rem;
}

.hero-image-wrap {
    position: relative;
    border: none;
    padding: 0;
    overflow: visible;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-left: -20%; /* Shift left to overlap text area */
    z-index: 1;
}

.heartbeat-container {
    display: grid;
    place-items: center;
}

.hero-image-wrap img {
    width: 140%; /* More impact */
    height: auto;
    transition: var(--transition);
    grid-area: 1/1;
    -webkit-mask-image: radial-gradient(circle, black 30%, transparent 70%);
    mask-image: radial-gradient(circle, black 30%, transparent 70%);
}

.pulse-img {
    opacity: 0.3; /* Static subtle glow */
    mix-blend-mode: screen;
    filter: sepia(100%) saturate(300%) hue-rotate(-15deg);
}

.hero-image-wrap:hover img {
    filter: contrast(1.1);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center; /* Center text globally for all buttons */
    padding: 1.25rem 2.5rem;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    border: 1px solid var(--border);
    transition: all 0.2s ease;
    background: transparent;
    color: var(--text-high);
}

.btn-primary {
    background: var(--primary);
    color: var(--bg-black);
    border-color: var(--primary);
}

.btn-primary:hover {
    background: rgba(var(--primary-rgb), 0.1);
    color: var(--primary);
    transform: translateY(-1px);
}

.btn-outline {
    border-color: var(--border);
    color: var(--text-mid);
    transition: all 0.2s ease;
}

.btn-outline:hover {
    border-color: var(--primary);
    color: var(--text-high);
}

#submit-btn {
    color: var(--bg-black) !important; /* Ensure black text on orange background */
}

#submit-btn:hover {
    background: rgba(var(--primary-rgb), 0.1) !important;
    color: var(--primary) !important;
}

#submit-btn:disabled:not(.success):not(.error) {
    background: var(--primary) !important;
    color: var(--bg-black) !important;
    opacity: 0.6;
    cursor: not-allowed;
}

#submit-btn.success,
#submit-btn.success:hover,
#submit-btn.success:active,
#submit-btn.success:focus,
#submit-btn.success:disabled {
    background: var(--secondary) !important;
    color: var(--bg-black) !important;
    border-color: var(--secondary) !important;
    opacity: 1 !important;
    cursor: default !important;
}

#submit-btn.error,
#submit-btn.error:hover,
#submit-btn.error:active,
#submit-btn.error:focus,
#submit-btn.error:disabled {
    background: #ef4444 !important;
    color: white !important;
    border-color: #ef4444 !important;
    opacity: 1 !important;
    cursor: default !important;
}

/* Section Containers */
section {
    padding: 10rem 4rem;
    max-width: 1400px;
    margin: 0 auto;
}

/* Timeline / CV Section */
.timeline {
    position: relative;
    padding-left: 3rem; /* Space for the pipeline track */
}

/* The Pipeline Track */
.timeline::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(to bottom, var(--primary) 0%, var(--border) 50%, transparent 100%);
    opacity: 0.3;
}

.timeline-item {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 4rem;
    padding: 3rem 0;
    position: relative;
}

/* Connecting Nodes */
.timeline-item::before {
    content: '';
    position: absolute;
    top: 3.5rem; /* Align with title */
    left: -3rem; /* Position on the track */
    width: 12px;
    height: 12px;
    background: var(--bg-black);
    border: 2px solid var(--primary);
    border-radius: 50%;
    transform: translateX(-5px); /* Center on the 2px track */
    box-shadow: 0 0 10px rgba(var(--primary-rgb), 0.3);
    z-index: 1;
    transition: background-color 0.3s ease;
}

.timeline-item:hover::before {
    background: var(--primary);
    box-shadow: 0 0 15px rgba(var(--primary-rgb), 0.6);
}

.timeline-date {
    font-family: var(--font-mono);
    color: var(--text-low);
    padding-top: 0.5rem;
}

.timeline-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text-high);
}

.timeline-desc {
    font-size: 1.125rem;
    color: var(--text-mid);
    max-width: 800px;
}

/* Projects */
.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.project-card {
    background: var(--bg-card);
    padding: 0; /* Changed to accommodate terminal bar */
    border: 1px solid var(--border);
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
}

.card-terminal-bar {
    background: #161616;
    padding: 0.75rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03); /* Subtle divider */
}

.terminal-dots {
    display: flex;
    gap: 0.5rem;
}

.terminal-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 7px;
    font-weight: bold;
    color: transparent;
    transition: color 0.15s ease;
    cursor: default;
}

.terminal-dots:hover .terminal-dot {
    color: rgba(0, 0, 0, 0.5);
}

.terminal-dot.red { background: #ee6a5f; }
.terminal-dot.yellow { background: #f5be4f; }
.terminal-dot.green { background: #61c454; }

.terminal-path {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: #555;
    letter-spacing: 0.05em;
    position: relative;
}

/* Terminal Hover Interactions */
.card-terminal-bar:hover .terminal-path::after {
    content: '_';
    color: var(--primary);
    animation: blink 1s step-end infinite;
}

.project-card-content {
    padding: 3rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.project-card::before {
    content: '';
    position: absolute;
    top: var(--y, 0);
    left: var(--x, 0);
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(var(--primary-rgb), 0.15) 0%, transparent 70%);
    transform: translate(-50%, -50%);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.5s;
    z-index: 1;
}

.project-card:hover::before {
    opacity: 1;
}

.project-card:hover {
    border-color: var(--primary);
    transform: translateY(-5px);
}

.project-card:has(.btn-primary:hover) {
    box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 2rem;
}

.tag {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    padding: 0.4rem 0.8rem;
    border: 1px solid #555;
    color: #e0e0e0;
}

/* Tech Marquee */
.marquee-container {
    overflow: hidden;
    padding: 4rem 0; /* Tightened padding */
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    background: var(--bg-gray);
    width: 100vw;
    margin-left: calc(-50vw + 50%);
    position: relative;
    z-index: 5;
}

.marquee-content {
    display: flex;
    gap: 8rem;
    animation: marquee 40s linear infinite;
    width: max-content;
}

.marquee-item {
    font-family: var(--font-heading);
    font-size: 4rem;
    font-weight: 800;
    color: var(--border);
    transition: var(--transition);
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.marquee-icon {
    height: 4rem;
    width: auto;
    object-fit: contain;
    filter: grayscale(100%) opacity(0.3);
    transition: var(--transition);
}

@keyframes marquee {
    from { transform: translateX(0); }
    to { transform: translateX(-50%); }
}

/* Brand-Specific Marquee Hover States */
.marquee-item.aws:hover { color: #FF9900; text-shadow: 0 0 20px rgba(255, 153, 0, 0.4); }
.marquee-item.aws:hover .marquee-icon { filter: grayscale(0%) opacity(1) drop-shadow(0 0 10px rgba(255, 153, 0, 0.4)); }

.marquee-item.terraform:hover { color: #844FBA; text-shadow: 0 0 20px rgba(132, 79, 186, 0.4); }
.marquee-item.terraform:hover .marquee-icon { filter: grayscale(0%) opacity(1) drop-shadow(0 0 10px rgba(132, 79, 186, 0.4)); }

.marquee-item.k8s:hover { color: #326CE5; text-shadow: 0 0 20px rgba(50, 108, 229, 0.4); }
.marquee-item.k8s:hover .marquee-icon { filter: grayscale(0%) opacity(1) drop-shadow(0 0 10px rgba(50, 108, 229, 0.4)); }

.marquee-item.docker:hover { color: #2496ED; text-shadow: 0 0 20px rgba(36, 150, 237, 0.4); }
.marquee-item.docker:hover .marquee-icon { filter: grayscale(0%) opacity(1) drop-shadow(0 0 10px rgba(36, 150, 237, 0.4)); }

.marquee-item.github:hover { color: #FFFFFF; text-shadow: 0 0 20px rgba(255, 255, 255, 0.4); }
.marquee-item.github:hover .marquee-icon { filter: grayscale(0%) opacity(1) drop-shadow(0 0 10px rgba(255, 255, 255, 0.4)); }

.marquee-item.ansible:hover { color: #EE0000; text-shadow: 0 0 20px rgba(238, 0, 0, 0.4); }
.marquee-item.ansible:hover .marquee-icon { filter: grayscale(0%) opacity(1) drop-shadow(0 0 10px rgba(238, 0, 0, 0.4)); }

/* Contact */
#copy-email-btn .copy-icon {
    transition: stroke 0.2s ease;
}
#copy-email-btn:hover .copy-icon {
    stroke: var(--primary) !important;
}

.contact-grid {
    display: grid;
    grid-template-columns: 0.8fr 1.2fr;
    gap: 6rem;
    align-items: flex-start; /* Precise top-alignment for both columns */
}

@media (max-width: 1024px) {
    .contact-grid {
        grid-template-columns: 1fr;
        gap: 3rem;
    }
}

/* Post-overhaul additions */

/* Form Styling */
#contact-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-auto-rows: min-content;
    gap: 16px;
    align-self: start;
    padding-top: 10px; /* Offset to align first input row with H2 cap-height */
}

.contact-info {
    display: flex;
    flex-direction: column;
    justify-content: flex-start; /* Bunch content at the top */
    gap: 2rem; /* Add consistent gap between header elements if needed */
}

#contact-form [hidden],
#contact-form input[style*="display:none"] {
    display: none !important;
    grid-column: none !important;
    position: absolute; /* Fully remove from grid flow */
}

#contact-form textarea,
#contact-form #submit-btn,
#contact-form .form-control {
    margin: 0 !important;
}

#contact-form textarea,
#contact-form #submit-btn {
    grid-column: span 2;
}

#contact-form #submit-btn {
    height: 56px;
    padding: 0;
}

.form-control {
    width: 100%;
    height: 52px; /* Consistent height for single-line inputs */
    padding: 0 1.25rem; /* Reduced height padding, used height instead */
    background: #0a0a0a;
    border: 1px solid #333;
    color: var(--text-high);
    font-family: var(--font-mono);
    font-size: 0.85rem;
    transition: all 0.2s ease-in-out;
    border-radius: 0;
    appearance: none;
    -webkit-appearance: none;
}

#contact-form textarea.form-control {
    height: auto; /* Allow height to be determined by rows/resize */
    padding: 1.25rem;
    resize: vertical;
    min-height: 120px;
}

.form-control::placeholder {
    color: #666;
    opacity: 1;
}

.form-control:focus {
    outline: none;
    border-color: #ffa500;
    box-shadow: 0 0 8px rgba(255, 165, 0, 0.4);
    background: #111;
}

/* ===== Hamburger & Mobile Nav ===== */
.hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    z-index: 1001;
}

.hamburger span {
    display: block;
    width: 24px;
    height: 1.5px;
    background: var(--text-high);
    transition: all 0.3s ease;
    transform-origin: center;
}

.hamburger.open span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

.mobile-nav {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0;
    background: rgba(5, 5, 5, 0.97);
    backdrop-filter: blur(16px);
    padding: 5rem 2rem 3rem;
    flex-direction: column;
    gap: 2rem;
    z-index: 999;
    border-bottom: 1px solid var(--border);
    transform: translateY(-100%);
    transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1);
}

.mobile-nav.open {
    transform: translateY(0);
}

.mobile-nav-link {
    font-family: var(--font-mono);
    font-size: 1rem;
    letter-spacing: 0.1em;
    color: var(--text-mid);
    text-decoration: none;
    transition: color 0.2s ease;
    border-bottom: 1px solid var(--border);
    padding-bottom: 1.5rem;
}

.mobile-nav-link:hover {
    color: var(--primary);
}

.mobile-cta {
    color: var(--primary) !important;
    border-bottom: none;
    padding-bottom: 0;
}

/* =====================
   RESPONSIVE
   ===================== */

/* Tablet (≤1024px) */
@media (max-width: 1024px) {
    /* Nav */
    .nav-links { display: none; }
    nav { padding: 0 2rem; }
    .hamburger { display: flex; }
    .mobile-nav { display: flex; }

    /* Hero */
    .hero {
        padding: 120px 2rem 5rem;
        min-height: auto;
    }
    .hero-grid {
        grid-template-columns: 1fr;
        gap: 3rem;
    }
    .hero-image-wrap {
        margin-left: 0;
        order: -1; /* Image above text on tablet */
    }
    .hero-image-wrap img {
        width: 80%;
        margin: 0 auto;
        display: block;
    }

    /* Sections */
    section { padding: 6rem 2rem; }
    .section-divider { padding: 0 2rem; }

    /* About */
    .contact-grid {
        grid-template-columns: 1fr;
        gap: 3rem;
    }

    /* Timeline */
    .timeline-item {
        grid-template-columns: 1fr;
        gap: 1rem;
        padding: 3rem 0;
    }
    .timeline-date {
        padding-top: 0;
    }

    /* Projects */
    .grid-2 { grid-template-columns: 1fr; }
}

/* Mobile (≤600px) */
@media (max-width: 600px) {
    /* Typography scale down */
    h1 { font-size: clamp(1.8rem, 8vw, 2.8rem); } /* Tighter clamp so long words like ARCHITECTING don't overflow */
    h2 { font-size: clamp(1.8rem, 8vw, 2.6rem); }
    .hero-desc { font-size: 1.05rem; }

    /* Hero: clip its own overflow so nothing else is affected */
    .hero {
        overflow: hidden;
        padding: 110px 1.5rem 4rem;
    }
    .hero-content {
        max-width: 100%;
        overflow: hidden;
    }
    .hero-status {
        white-space: normal; /* Allow status text to wrap */
        word-break: break-word;
    }

    /* Hero buttons stack */
    div[style*="display: flex"][style*="gap: 2rem"] {
        flex-direction: column;
        gap: 1rem;
    }
    .btn {
        width: 100%;
        text-align: center;
        justify-content: center;
        padding: 1rem 1.5rem;
    }

    /* Hero image — prevent any overflow */
    .hero-image-wrap {
        width: 100%;
        overflow: hidden;
        margin-left: 0;
    }
    .hero-image-wrap img {
        width: 100% !important;
        margin: 0;
    }

    /* Disable oversized ambient glow on mobile */
    .hero-content::before { display: none; }

    /* Nav */
    .logo { font-size: 1.2rem; }

    /* Marquee — prevent vw overflow */
    .marquee-container {
        width: 100%;
        margin-left: 0;
        overflow: hidden;
    }
    .marquee-item {
        font-size: 2.5rem;
        gap: 1rem;
    }
    .marquee-icon {
        height: 2.5rem;
    }
    .marquee-content { gap: 5rem; }

    /* Section padding */
    section { padding: 4rem 1.25rem; }
    .section-divider { padding: 0 1.25rem; }

    /* About text */
    p[style*="font-size: 1.5rem"] {
        font-size: 1.2rem !important;
    }

    /* Timeline */
    .timeline-title { font-size: 1.5rem !important; }
    .timeline-desc { font-size: 1rem; }

    /* Project cards */
    .project-card-content { padding: 1.75rem; }
    .project-card h3[style*="font-size: 2rem"] {
        font-size: 1.5rem !important;
    }

    /* Contact form */
    #contact-form {
        grid-template-columns: 1fr;
    }
    #contact-form textarea,
    #contact-form #submit-btn {
        grid-column: span 1;
    }

    /* Footer */
    footer p {
        font-size: 0.7rem;
        text-align: center;
        line-height: 1.8;
    }
}

/* ==========================================================================
   Chat Widget - Premium Glassmorphism Design
   ========================================================================== */

:root {
    --chat-bg: rgba(10, 10, 10, 0.85);
    --chat-border: rgba(255, 255, 255, 0.1);
    --chat-user-msg: var(--primary);
    --chat-asst-msg: rgba(255, 255, 255, 0.05);
}

.chat-widget {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 1000;
    font-family: var(--font-mono);
}

.chat-toggle {
    padding: 0.6rem 1.2rem;
    border-radius: var(--radius);
    background: rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    color: var(--primary);
    border: 1px solid var(--primary);
    cursor: pointer;
    box-shadow: none;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    position: relative;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.1em;
}

.chat-toggle:hover {
    background: var(--primary);
    color: var(--bg-black);
    box-shadow: 0 0 20px var(--primary-glow);
    transform: translateY(-2px);
}

.toggle-text {
    display: flex;
    align-items: center;
}

.cursor {
    animation: blink 1s step-end infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

.chat-toggle.hidden {
    transform: scale(0.9) translateY(20px);
    opacity: 0;
    pointer-events: none;
}

.chat-notification {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--secondary);
    color: #000;
    font-size: 10px;
    font-weight: 700;
    width: 18px;
    height: 18px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--bg-black);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.chat-container {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 400px;
    height: 580px;
    background: linear-gradient(160deg, rgba(20, 20, 20, 0.98) 0%, rgba(10, 10, 10, 0.99) 100%);
    backdrop-filter: blur(24px) saturate(180%);
    border: 1px solid rgba(251, 146, 60, 0.2);
    border-radius: var(--radius);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: translateY(24px) scale(0.95);
    opacity: 0;
    pointer-events: none;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    box-shadow:
        0 24px 60px rgba(0, 0, 0, 0.75),
        0 0 0 1px rgba(255, 255, 255, 0.04),
        inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.chat-container.open {
    transform: translateY(0) scale(1);
    opacity: 1;
    pointer-events: all;
}

/* Chat header mirrors .card-terminal-bar exactly */
.chat-header {
    background: #161616;
    padding: 0.75rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    flex-shrink: 0;
}

/* Title: same style as .terminal-path in project cards */
.chat-title {
    flex: 1;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: #555;
    letter-spacing: 0.05em;
    position: relative;
}

/* Mirrors .card-terminal-bar:hover .terminal-path::after — hover only */
.chat-header:hover .chat-title::after {
    content: '_';
    color: var(--primary);
    animation: blink 1s step-end infinite;
}

.chat-header .terminal-dot {
    cursor: default;
    transition: all 0.2s ease;
}

.chat-header .terminal-dot.red {
    cursor: pointer;
}

.chat-header .terminal-dot.red:hover {
    box-shadow: 0 0 10px rgba(238, 106, 95, 0.5);
    transform: scale(1.1);
}

.chat-header .terminal-dots:hover .terminal-dot:not(.red) {
    opacity: 0.5;
    filter: grayscale(0.8);
}

.chat-messages {
    flex: 1;
    padding: 1.25rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    scrollbar-width: thin;
    scrollbar-color: rgba(251, 146, 60, 0.2) transparent;
}

.chat-messages::-webkit-scrollbar {
    width: 3px;
}

.chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: rgba(251, 146, 60, 0.25);
    border-radius: 10px;
}

.message {
    padding: 0.75rem 1.1rem;
    font-size: 0.83rem;
    max-width: 82%;
    line-height: 1.6;
    position: relative;
    animation: msgFadeIn 0.3s ease-out;
    word-break: break-word;
}

@keyframes msgFadeIn {
    from { opacity: 0; transform: translateY(8px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.message.assistant {
    align-self: flex-start;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-high);
    border-radius: var(--radius);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
}

.message.user {
    align-self: flex-end;
    background: var(--primary);
    color: #000000;
    border-radius: var(--radius);
    font-weight: 600;
    box-shadow: 0 4px 16px rgba(251, 146, 60, 0.3);
}

.message.assistant.error {
    border-color: rgba(239, 68, 68, 0.3);
    background: rgba(239, 68, 68, 0.06);
    color: #fca5a5;
}

.message.typing {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    color: transparent;
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
}

.message.typing::after {
    content: '';
    display: inline-block;
    width: 5px;
    height: 5px;
    background: var(--text-low);
    border-radius: 50%;
    box-shadow: 9px 0 var(--text-low), 18px 0 var(--text-low);
    animation: typingDots 1.4s ease-in-out infinite;
}

@keyframes typingDots {
    0%, 60%, 100% { opacity: 0.3; transform: translateY(0); }
    30% { opacity: 1; transform: translateY(-3px); }
}

.chat-input-area {
    padding: 1rem 1.25rem 1.25rem;
    background: rgba(0, 0, 0, 0.3);
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    gap: 0.65rem;
    align-items: center;
    flex-shrink: 0;
}

#chat-input {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius);
    padding: 0.7rem 1rem;
    color: var(--text-high);
    font-family: var(--font-mono);
    font-size: 0.82rem;
    transition: all 0.25s ease;
    line-height: 1.4;
}

#chat-input::placeholder {
    color: var(--text-low);
}

#chat-input:focus {
    outline: none;
    border-color: rgba(251, 146, 60, 0.5);
    background: rgba(251, 146, 60, 0.04);
    box-shadow: 0 0 0 3px rgba(251, 146, 60, 0.08);
}

#chat-send {
    background: var(--primary);
    color: #000000;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.25s ease;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(251, 146, 60, 0.25);
}

#chat-send:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(251, 146, 60, 0.4);
    background: #fca962;
}

#chat-send:active {
    transform: translateY(0);
}

@media (max-width: 480px) {
    .chat-container {
        position: fixed;
        width: 100vw;
        height: 70%;
        bottom: 0;
        right: 0;
        border-radius: var(--radius); /* Sharp corners on mobile too */
        border-left: none;
        border-right: none;
        border-bottom: none;
    }

    .chat-widget {
        bottom: 1rem;
        right: 1rem;
    }
}

/* ======================================
   LiveChat Widget
====================================== */
.lc-widget {
    position: fixed;
    bottom: 2rem;
    right: 14rem; /* Offset left of AI chat toggle */
    z-index: 9998;
    font-family: var(--font-mono);
}

.lc-toggle {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.75rem 1.25rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--accent);
    font-family: var(--font-mono);
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
}

.lc-toggle:hover {
    border-color: var(--accent);
    background: rgba(34, 211, 238, 0.05);
    box-shadow: 0 0 20px rgba(34, 211, 238, 0.1);
}

.lc-toggle.hidden {
    display: none;
}

.lc-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--primary);
    color: var(--bg-black);
    font-size: 0.6rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lc-container {
    position: absolute;
    bottom: calc(100% + 0.75rem);
    right: 0;
    width: 340px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    display: none;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 24px 64px rgba(0,0,0,0.6);
}

.lc-container.open {
    display: flex;
}

.lc-header {
    background: #161616;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.lc-header-info {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.lc-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #555;
    transition: background 0.4s ease;
}

.lc-title {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-high);
    letter-spacing: 0.05em;
}

.lc-header-status {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.lc-status-text {
    font-size: 0.65rem;
    color: var(--text-low);
    font-family: var(--font-mono);
}

.lc-close {
    background: none;
    border: none;
    color: var(--text-low);
    cursor: pointer;
    font-size: 0.85rem;
    padding: 0;
    line-height: 1;
    transition: color 0.2s ease;
}

.lc-close:hover { color: var(--text-high); }

.lc-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    min-height: 200px;
    max-height: 300px;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    scroll-behavior: smooth;
}

.lc-messages::-webkit-scrollbar { width: 3px; }
.lc-messages::-webkit-scrollbar-track { background: transparent; }
.lc-messages::-webkit-scrollbar-thumb { background: var(--border); }

.lc-message {
    max-width: 85%;
    padding: 0.6rem 0.9rem;
    font-size: 0.82rem;
    line-height: 1.5;
    word-break: break-word;
}

.lc-user {
    align-self: flex-end;
    background: rgba(251, 146, 60, 0.12);
    border: 1px solid rgba(251, 146, 60, 0.25);
    color: var(--text-high);
}

.lc-assistant {
    align-self: flex-start;
    background: rgba(34, 211, 238, 0.07);
    border: 1px solid rgba(34, 211, 238, 0.15);
    color: var(--accent);
}

.lc-system {
    align-self: center;
    background: transparent;
    color: var(--text-low);
    font-size: 0.72rem;
    text-align: center;
    border: none;
    padding: 0.25rem 0;
}

.lc-input-area {
    border-top: 1px solid var(--border);
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    background: #0a0a0a;
}

.lc-email {
    width: 100%;
    padding: 0.5rem 0.75rem;
    background: transparent;
    border: 1px solid rgba(255,255,255,0.06);
    color: var(--text-mid);
    font-family: var(--font-mono);
    font-size: 0.72rem;
    outline: none;
    transition: border-color 0.2s;
}

.lc-email:focus { border-color: rgba(34, 211, 238, 0.3); }
.lc-email::placeholder { color: var(--text-low); }

.lc-input-row {
    display: flex;
    gap: 0.5rem;
}

.lc-input {
    flex: 1;
    padding: 0.6rem 0.75rem;
    background: transparent;
    border: 1px solid rgba(255,255,255,0.06);
    color: var(--text-high);
    font-family: var(--font-mono);
    font-size: 0.8rem;
    outline: none;
    transition: border-color 0.2s;
}

.lc-input:focus { border-color: var(--accent); }
.lc-input::placeholder { color: var(--text-low); }

.lc-send {
    width: 36px;
    height: 36px;
    background: var(--accent);
    border: none;
    color: var(--bg-black);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.2s ease;
}

.lc-send:hover { background: rgba(34, 211, 238, 0.75); }

@media (max-width: 768px) {
    .lc-widget {
        bottom: calc(5rem + 70px); /* Stack above the AI chat toggle on mobile */
        right: 1rem;
    }

    .lc-container {
        right: 0;
        width: calc(100vw - 2rem);
        max-width: 380px;
    }
}

