:root {
    --bg-color: #030712;
    --card-bg: rgba(15, 23, 42, 0.45);
    --card-border: rgba(255, 255, 255, 0.1);
    --primary: #00f3ff;
    --secondary: #6366f1;
    --accent: #b026ff;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --font: 'Inter', sans-serif;
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    font-family: var(--font);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 60px 20px;
    overflow-x: hidden;
}

/* Aurora Background */
.aurora-bg {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    z-index: -2;
    overflow: hidden;
    background-color: #010308;
}
.aurora-blob {
    position: absolute;
    filter: blur(140px);
    border-radius: 50%;
    animation: floatBlob 20s infinite alternate cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0.45;
}
.blob-1 { width: 50vw; height: 50vw; background: #6366f1; top: -10%; left: -10%; }
.blob-2 { width: 60vw; height: 60vw; background: #00f3ff; bottom: -20%; right: -20%; animation-delay: -5s; animation-direction: alternate-reverse; }
.blob-3 { width: 45vw; height: 45vw; background: #b026ff; top: 30%; left: 30%; animation-duration: 25s; opacity: 0.25; }
@keyframes floatBlob {
    0% { transform: scale(1) translate(0, 0); }
    100% { transform: scale(1.15) translate(8vw, 6vh); }
}

#particles-js { position: fixed; width: 100%; height: 100vh; z-index: -1; top: 0; left: 0; }

.container {
    width: 100%;
    max-width: 1450px; /* Increased max width slightly so new columns fit great */
    z-index: 10;
}

/* Perfect 5x4 Grid Layout */
.glass-bento {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    grid-template-rows: auto auto auto auto;
    grid-gap: 25px; /* Slight reduction for better fit horizontally */
}

/* Cards */
.bento-card {
    background: linear-gradient(135deg, rgba(10, 15, 30, 0.35) 0%, rgba(10, 15, 30, 0.15) 100%);
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    border-left: 1px solid rgba(255, 255, 255, 0.08);
    border-right: 1px solid rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid rgba(255, 255, 255, 0.02);
    border-radius: 28px;
    padding: 30px; 
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.1), 0 25px 50px rgba(0, 0, 0, 0.6);
    transition: box-shadow 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    display: flex;
    flex-direction: column;
}

.bento-card:hover {
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.25), 0 35px 60px rgba(0, 0, 0, 0.7), 0 0 30px rgba(0, 243, 255, 0.1);
}

/* Animated Glowing Border - Smooth Refinement */
.glow-border {
    position: relative;
    border: none !important;
    overflow: hidden;
}
.glow-border::before {
    content: ''; position: absolute;
    top: -100%; left: -100%; width: 300%; height: 300%;
    background: conic-gradient(from 0deg, 
        transparent 0%, 
        rgba(0, 243, 255, 0.8) 25%, 
        transparent 50%, 
        rgba(176, 38, 255, 0.8) 75%, 
        transparent 100%);
    animation: rotateBorder 24s linear infinite;
    opacity: 0.6;
    filter: blur(12px); /* Makes the sharp line a smooth liquid glow */
    z-index: 0;
}
.glow-border::after {
    content: ''; position: absolute;
    inset: 1px; /* border thickness */
    background: linear-gradient(135deg, rgba(10, 15, 30, 0.35) 0%, rgba(10, 15, 30, 0.15) 100%);
    border-radius: 27px;
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.1);
    z-index: 0;
}
.glow-border > * {
    position: relative;
    z-index: 10;
}
@keyframes rotateBorder {
    100% { transform: rotate(360deg); }
}

/* Grid Allocation: Exact Puzzle */
/* Row 1 */
.profile-card { grid-column: span 1; grid-row: span 3; align-items: center; text-align: center; }
.about-card   { grid-column: span 4; grid-row: span 1; justify-content: center;}
/* Row 2 & 3 */
.history-card { grid-column: span 3; grid-row: span 2; }
.company-card { grid-column: span 1; grid-row: span 2; }
/* Row 4 */
.cert-card    { grid-column: span 2; grid-row: span 1; }
.skills-card  { grid-column: span 3; grid-row: span 1; justify-content: flex-start;}


/* Elements & Typography */
h3 { font-size: 1.3rem; font-weight: 600; margin-bottom: 22px; display: flex; align-items: center; gap: 10px; color: #fff; letter-spacing: -0.5px;}

/* CSS Animated SVG Icons */
.anim-icon {
    width: 24px; height: 24px;
    stroke: var(--primary);
    filter: drop-shadow(0 0 5px rgba(0, 243, 255, 0.4));
}
.anim-spin-slow { transform-origin: center; animation: spinSlow 8s linear infinite; }
.anim-pulse { animation: pulseIcon 2s ease-in-out infinite; }
.anim-tick { transform-origin: 12px 12px; animation: tickClock 4s steps(4) infinite; }
.anim-flash { transform-origin: center; animation: flashZap 3s infinite; }

@keyframes spinSlow { 100% { transform: rotate(360deg); } }
@keyframes pulseIcon { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }
@keyframes tickClock { 100% { transform: rotate(360deg); } }
@keyframes flashZap { 
    0%, 100% { transform: scale(1); filter: drop-shadow(0 0 5px rgba(0, 243, 255, 0.4)); } 
    10%, 30% { transform: scale(1.1); filter: drop-shadow(0 0 10px rgba(0, 243, 255, 0.8)); stroke: #fff;} 
    20% { transform: scale(1); filter: drop-shadow(0 0 5px rgba(0, 243, 255, 0.4)); } 
}

p { font-size: 1rem; color: var(--text-muted); line-height: 1.7; }
p strong { color: var(--text-main); font-weight: 600; }

.mb-15 { margin-bottom: 15px; }
.block { display: block; }
.muted { color: var(--text-muted); font-size: 0.9rem; }
.small { font-size: 0.85rem; }
.text-primary { color: var(--primary); font-weight: 500;}

/* Profile */
.profile-img-container {
    width: 150px; height: 150px; border-radius: 50%; padding: 4px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    margin-bottom: 25px;
}
.profile-img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; background: #1e293b; }
.name { font-size: 1.7rem; font-weight: 700; margin-bottom: 6px; letter-spacing: -0.5px;}
.title { font-size: 1.1rem; color: var(--primary); font-weight: 500; margin-bottom: 12px; }
.bento-location { font-size: 0.9rem; color: var(--text-muted); margin-bottom: 15px; }

.profile-details {
    width: 100%; margin-top: auto; margin-bottom: 25px; display: flex; flex-direction: column; gap: 16px;
    background: rgba(0, 0, 0, 0.2); padding: 20px; border-radius: 18px; border: 1px solid rgba(255, 255, 255, 0.05);
    text-align: left;
}
.detail-item { display: flex; align-items: flex-start; gap: 14px; }
.detail-content { display: flex; flex-direction: column; gap: 4px; }
.detail-label { font-size: 0.85rem; font-weight: 600; color: var(--text-main); }
.detail-value { font-size: 0.85rem; color: var(--text-muted); }
.detail-item a.detail-value { color: var(--primary); text-decoration: none; transition: color 0.3s;}
.detail-item a.detail-value:hover { color: var(--text-main); }
.detail-icon { font-size: 1.2rem; margin-top: 2px; }

.single-line-item { align-items: center; margin-top: 2px;}
.single-line-item .detail-icon { margin-top: 0; }
.single-line-text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 0.82rem;
    letter-spacing: -0.2px;
}

.social-bento { display: flex; gap: 15px; width: 100%; margin-top: auto; }
.social-btn {
    flex: 1; padding: 14px; border-radius: 14px; font-size: 0.95rem; font-weight: 600; text-align: center; text-decoration: none;
    background: rgba(255,255,255,0.05); color: var(--text-main); border: 1px solid var(--card-border);
    transition: all 0.3s;
}

.company-wrapper { display: flex; flex-direction: column; align-items: center; justify-content: center; flex-grow: 1; gap: 15px; text-align: center;}
.company-logo {
    width: 75px; height: 75px; flex-shrink: 0; border-radius: 12px; overflow: hidden;
    background: #fff; display: flex; align-items: center; justify-content: center; padding: 5px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.5);
}
.company-logo img { max-width: 100%; max-height: 100%; object-fit: contain; }
.company-info h4 { font-size: 1.1rem; margin-bottom: 6px; color: #fff; }
.company-info span { font-size: 0.85rem; color: var(--primary); display: block; margin-bottom: 8px; font-weight: 500;}
.company-info p { font-size: 0.85rem; line-height: 1.5; color: var(--text-muted);}

/* Edu specific */
.edu-item { width: 100%; text-align: center; border-bottom: 1px solid rgba(255,255,255,0.05); padding-bottom: 12px; }
.edu-item:last-child { border-bottom: none; padding-bottom: 0px; margin-bottom:0; }
.edu-item strong { display: block; color: var(--text-main); font-size: 1rem; margin-bottom: 4px; }

/* Advanced Timelines */
.advanced-timeline { list-style: none; padding-left: 14px; border-left: 2px solid rgba(0, 243, 255, 0.15); flex-grow: 1;}
.advanced-timeline li { position: relative; padding-left: 28px; margin-bottom: 24px; }
.advanced-timeline li::before { 
    content: ''; position: absolute; left: -7px; top: 6px; width: 12px; height: 12px; 
    background: var(--primary); border-radius: 50%; box-shadow: 0 0 12px var(--primary);
}
.advanced-timeline li:last-child { margin-bottom: 0; }
.time-node { font-weight: 600; color: #fff; font-size: 1.1rem; margin-bottom: 8px; display: flex; justify-content: space-between; align-items: center; padding-right: 15px;}
.time-badge { font-size: 0.8rem; background: rgba(0,243,255,0.1); padding: 4px 10px; border-radius: 12px; color: var(--primary); font-weight: 500;}
.time-desc { font-size: 0.95rem; color: var(--text-muted); line-height: 1.6; }
.time-desc strong { color: var(--text-main); font-weight: 600; font-size: 0.95rem;}

.cert-grid {
    column-count: 2;
    column-gap: 20px;
    flex-grow: 1;
}
.cert-category {
    break-inside: avoid;
    margin-bottom: 20px;
    background: rgba(255, 255, 255, 0.02);
    padding: 16px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.04);
}
.cert-header {
    height: 30px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
}
.cert-logo {
    max-height: 100%;
    max-width: 140px;
    object-fit: contain;
}
.light-bg-fix {
    background-color: rgba(255, 255, 255, 0.85);
    padding: 4px 8px;
    border-radius: 6px;
    filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.15));
}
.cert-other-title { font-weight: 600; color: #fff; font-size: 1rem; }

.cert-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-left: 0;
}
.cert-list li {
    font-size: 0.82rem;
    color: var(--text-muted);
    padding-left: 16px;
    position: relative;
    line-height: 1.4;
}
.cert-list li::before {
    content: '▹';
    position: absolute;
    left: 0;
    top: -2px;
    color: var(--primary);
    font-size: 1.1rem;
}

/* Rich Tags & Skills Groups */
.skills-layout {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-top: 5px;
    flex-grow: 1;
}
.skill-group {
    background: rgba(255, 255, 255, 0.02);
    padding: 16px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.04);
}
.skill-group h4 {
    font-size: 0.95rem;
    color: var(--text-main);
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.1);
    padding-bottom: 8px;
    font-weight: 600;
}
.tags { display: flex; flex-wrap: wrap; gap: 8px;}
.tag {
    padding: 6px 14px; background: rgba(0, 243, 255, 0.05); border: 1px solid rgba(0, 243, 255, 0.15);
    border-radius: 20px; font-size: 0.85rem; color: var(--text-main); transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1); cursor: default;
}
.tag:hover { 
    background: rgba(0, 243, 255, 0.15); border-color: var(--primary); 
    transform: translateY(-2px) scale(1.02); color: #fff; font-weight: 500;
    animation: simpleGlitch 0.3s cubic-bezier(.25, .46, .45, .94) both;
}
.social-btn:hover {
    background: var(--primary); color: #000; border-color: var(--primary); box-shadow: 0 0 20px rgba(0, 243, 255, 0.4);
    animation: simpleGlitch 0.3s cubic-bezier(.25, .46, .45, .94) both;
}

@keyframes simpleGlitch {
    0% { transform: translate(0); filter: hue-rotate(0deg); }
    20% { transform: translate(-2px, 1px); filter: hue-rotate(90deg) contrast(150%); }
    40% { transform: translate(2px, -1px); filter: blur(1px) hue-rotate(-90deg); }
    60% { transform: translate(-1px, 2px); filter: hue-rotate(45deg) drop-shadow(0 0 10px red); }
    80% { transform: translate(1px, -2px); filter: invert(0.2) drop-shadow(0 0 10px cyan); }
    100% { transform: translate(0); filter: hue-rotate(0deg); }
}

/* Extra Section - Marquee */
.marquee-container {
    grid-column: span 5; /* This fixes the collapse bug */
    width: 100%;
    overflow: hidden;
    background: rgba(10, 15, 30, 0.35); /* Match bento card */
    padding: 20px 0;
    border-radius: 20px;
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.marquee-title {
    text-align: center;
    justify-content: center; /* Forces centering to overcome .bento-card h3 display:flex */
    width: 100%;
    color: var(--text-muted);
    font-size: 0.85rem;
    letter-spacing: 3px;
    text-transform: uppercase;
    margin-bottom: 25px;
    margin-top: 5px;
    opacity: 0.8;
}

.marquee-content {
    display: flex;
    gap: 60px;
    width: max-content;
    animation: marqueeScroll 70s linear infinite;
    align-items: center; /* Center vertically for variable heights */
}
.marquee-content img {
    height: 38px;
    opacity: 0.4;
    filter: grayscale(100%);
    transition: all 0.3s ease;
}
.marquee-content img.scale-up {
    height: 48px; /* Increases height relative to 38px, roughly ~20% scale up */
}
.marquee-content img:hover {
    opacity: 1;
    filter: grayscale(0%);
    transform: scale(1.2);
}
@keyframes marqueeScroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(calc(-50% - 30px)); }
}

/* Responsive Scaling */
/* Sys Status Badge */
.sys-status {
    background: rgba(0, 243, 255, 0.05);
    border: 1px solid rgba(0, 243, 255, 0.2);
    padding: 6px 14px;
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.floating-status {
    position: fixed;
    top: 25px;
    right: 25px;
    z-index: 1000;
    backdrop-filter: blur(10px);
    background: rgba(15, 23, 42, 0.8);
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}
.status-dot {
    width: 8px; height: 8px; background-color: #10b981;
    border-radius: 50%; box-shadow: 0 0 8px #10b981;
    animation: pulse-dot 2s infinite ease-in-out;
}
.status-text { font-size: 0.8rem; color: var(--text-muted); font-family: monospace; letter-spacing: -0.2px; white-space: nowrap; }
@keyframes pulse-dot { 0%, 100% { transform: scale(0.9); opacity: 0.7; } 50% { transform: scale(1.2); opacity: 1; } }

/* Terminal Loader */
#terminal-loader {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background-color: #010308; z-index: 9999;
    display: flex; justify-content: center; align-items: center;
    transition: opacity 0.8s ease, visibility 0.8s ease;
}
.terminal-content {
    width: 650px; max-width: 90%;
    background: rgba(10, 15, 30, 0.95); border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px; box-shadow: 0 25px 60px rgba(0,0,0,0.8); overflow: hidden;
    backdrop-filter: blur(10px);
}
.terminal-header { background: rgba(0, 0, 0, 0.6); padding: 12px 15px; display: flex; gap: 8px; }
.mac-btn { width: 12px; height: 12px; border-radius: 50%; }
.mac-btn.close { background: #ff5f56; }
.mac-btn.minimize { background: #ffbd2e; }
.mac-btn.expand { background: #27c93f; }

.terminal-body {
    padding: 24px; font-family: 'Courier New', Courier, monospace; font-size: 0.95rem;
    color: #00f3ff; min-height: 250px; line-height: 1.6;
}
.term-cursor { display: inline-block; width: 9px; height: 16px; background: #00f3ff; animation: blink 1s infinite; vertical-align: middle; margin-left: 4px; }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }


@media (max-width: 1280px) {
    .glass-bento { grid-template-columns: repeat(4, 1fr); }
    .profile-card { grid-column: span 1; grid-row: span 3; }
    .about-card { grid-column: span 3; }
    .history-card { grid-column: span 3; }
    .company-card { grid-column: span 3; grid-row: auto; flex-direction: row;}
    .cert-card, .skills-card, .marquee-container { grid-column: span 4; }
}

@media (max-width: 900px) {
    .floating-status { top: 15px; right: 15px; transform: scale(0.85); transform-origin: top right; }
    .cert-grid { column-count: 1; }
    .skills-layout { grid-template-columns: 1fr; }
    .glass-bento { grid-template-columns: 1fr; gap: 20px; }
    .profile-card, .about-card, .company-card, .history-card, .skills-card, .cert-card, .marquee-container { grid-column: span 1; grid-row: auto; }
    .time-node { flex-direction: column; align-items: flex-start; gap: 5px;}
    .marquee-content { gap: 30px; }
    .marquee-content img { height: 30px; }
    .marquee-content img.scale-up { height: 38px; }
}
