/* ============================================= */
/* ==   VARIABLES & GLOBAL STYLES             == */
/* ============================================= */
:root {
    --bg-primary: #0d0c1d;
    --bg-secondary: #16152b;
    --glass-bg: rgba(13, 12, 29, 0.6);
    --text-primary: #dcd7de;
    --text-secondary: #7f7a99;
    --accent: #c084fc; /* Lain Purple */
    --accent-dim: #9333ea;
    --accent-alt: #f472b6; /* Lain Pink/Magenta */
    --glow-color: rgba(192, 132, 252, 0.3);
    --border-color: rgba(192, 132, 252, 0.15);
    --transition: all 0.3s ease-in-out;
    font-size: 16px;
}

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

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: 'Roboto', sans-serif;
    line-height: 1.7;
    overflow-x: hidden;
    cursor: default;
    /* Mouse-follow spotlight effect */
    background-image: radial-gradient(
        circle 400px at var(--mouse-x) var(--mouse-y),
        rgba(192, 132, 252, 0.06),
        transparent 80%
    );
}

body::after {
    content: ' ';
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%), linear-gradient(90deg, rgba(255, 0, 0, 0.03), rgba(0, 255, 0, 0.02), rgba(0, 0, 255, 0.03));
    background-size: 100% 4px, 6px 100%;
    z-index: -1;
    pointer-events: none;
    animation: scanlines 50s linear infinite;
}

@keyframes scanlines {
    0% { background-position: 0 0; }
    100% { background-position: 0 100vh; }
}

/* ============================================= */
/* ==   PRELOADER & LAYOUT                    == */
/* ============================================= */
#preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-primary);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'JetBrains Mono', monospace;
    color: var(--accent);
    flex-direction: column;
    gap: 1rem;
    transition: opacity 0.5s ease;
}

#preloader.loaded {
    opacity: 0;
    pointer-events: none;
}

.loader-text {
    font-size: 1rem;
    letter-spacing: 1px;
}

#loader-status {
    color: var(--text-secondary);
}

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

/* ============================================= */
/* ==   HEADER & NAVIGATION                   == */
/* ============================================= */
header {
    padding: 1.5rem 0;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    background-color: rgba(13, 12, 29, 0.7);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    transition: var(--transition);
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 500;
    font-size: 1.25rem;
}

.logo a {
    color: var(--text-primary);
    text-decoration: none;
}

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

.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.95rem;
    font-family: 'JetBrains Mono', monospace;
    transition: var(--transition);
}

.nav-links a:hover, .nav-links a.active {
    color: var(--accent);
    text-shadow: 0 0 5px var(--glow-color);
}

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

.hamburger {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 28px;
    height: 21px;
    cursor: pointer;
}

.hamburger span {
    height: 3px;
    width: 100%;
    background-color: var(--text-primary);
    border-radius: 3px;
    transition: var(--transition);
}

.mobile-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 70%;
    height: 100vh;
    background: rgba(13, 12, 29, 0.9);
    backdrop-filter: blur(15px);
    z-index: 999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: right 0.4s cubic-bezier(0.23, 1, 0.32, 1);
}

.mobile-menu.active {
    right: 0;
}

.mobile-nav-links {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    text-align: center;
}

.mobile-nav-links a {
    color: var(--text-primary);
    text-decoration: none;
    font-size: 1.5rem;
    font-family: 'JetBrains Mono', monospace;
}

.close-menu {
    position: absolute;
    top: 2rem;
    right: 2rem;
    font-size: 1.5rem;
    color: var(--text-primary);
    background: none;
    border: none;
    cursor: pointer;
}

/* ============================================= */
/* ==   SECTIONS & COMPONENTS                 == */
/* ============================================= */
section {
    padding: 6rem 0;
}

#about {
    padding-top: 8rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.8rem 1.8rem;
    background: transparent;
    color: var(--accent);
    text-decoration: none;
    border-radius: 4px;
    font-size: 1rem;
    transition: var(--transition);
    border: 1px solid var(--border-color);
    font-family: 'JetBrains Mono', monospace;
}

.btn:hover {
    background: var(--glow-color);
    color: var(--text-primary);
    border-color: var(--accent);
}

/* --- Hero Section --- */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
}

.hero-content {
    max-width: 700px;
}

.hero-subtitle {
    color: var(--accent);
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

.hero-title {
    font-family: 'JetBrains Mono', monospace;
    font-size: clamp(2.2rem, 5vw, 3.5rem);
    font-weight: 500;
    line-height: 1.3;
    margin-bottom: 1.5rem;
    min-height: 120px;
}

.hero-title .highlight {
    color: var(--accent);
}

.typing-cursor {
    display: inline-block;
    width: 0.8rem;
    height: 2.8rem;
    background-color: var(--accent-alt);
    animation: blink 1s infinite;
    vertical-align: bottom;
}

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

.hero-description {
    color: var(--text-secondary);
    font-size: 1.15rem;
    margin-bottom: 2.5rem;
    max-width: 600px;
}

/* --- Window Styling --- */
.section-window {
    background: var(--glass-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 0 30px rgba(0,0,0,0.5);
    backdrop-filter: blur(10px);
    padding: 3rem;
    margin-top: 2rem;
}

.window-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1rem;
    margin-bottom: 3rem;
}

.window-title {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.2rem;
    color: var(--accent-alt);
}

.window-controls {
    display: flex;
    gap: 0.5rem;
}

.window-controls span {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--text-secondary);
    opacity: 0.5;
}

/* --- About Section --- */
.about-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 3rem;
    align-items: center;
}

.about-content p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
}

.about-image-wrapper {
    position: relative;
    height: 205px;
    width: 205px;
    background: linear-gradient(var(--accent-dim), var(--accent-alt));
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    padding: 3px;
    margin: auto; 
    box-shadow: #5d5d5d 0px 0px 15px;
}

.about-image {
    background-color: var(--bg-secondary);
    width: 100%;
    height: 100%;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden; /* Hide parts of image that overflow */
}

.about-image img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Ensure image covers the area */
    border-radius: 6px;
}

/* --- Skills Section --- */
.skills-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2.5rem;
}

.skill-category h3 {
    font-family: 'JetBrains Mono', monospace;
    color: var(--accent);
    font-size: 1.1rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
}

.skill-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.7rem;
}

.skill-tag {
    padding: 0.4rem 0.9rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 0.9rem;
    font-family: 'JetBrains Mono', monospace;
    color: var(--text-secondary);
    transition: var(--transition);
}

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

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

.project-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    transition: var(--transition);
}

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

.project-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.project-icon {
    font-size: 2.5rem;
    color: var(--accent);
}

.project-links a {
    color: var(--text-secondary);
    text-decoration: none;
    margin-left: 1rem;
    font-size: 1.2rem;
    transition: var(--transition);
}

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

.project-title {
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.project-description {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    flex-grow: 1;
    font-size: 1rem;
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.project-tag {
    font-size: 0.8rem;
    padding: 0.3rem 0.8rem;
    background: rgba(192, 132, 252, 0.08);
    border-radius: 4px;
    font-family: 'JetBrains Mono', monospace;
    color: var(--accent);
}

/* --- Broadcasts (LinkedIn Cards) --- */
.broadcast-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2rem;
}

.linkedin-card {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    text-decoration: none;
}

.linkedin-card:hover {
    transform: translateY(-5px);
    border-color: var(--accent-alt);
    box-shadow: 0 0 15px var(--glow-color);
}

.linkedin-card-image {
    height: 250px; /* Reduced height for better card proportions */
    background-size: cover;
    background-position: center center;
    position: relative;
}

.linkedin-card-image::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to top, var(--bg-secondary) 0%, rgba(22, 21, 43, 0.5) 50%, transparent 100%);
}

.linkedin-card-content {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.linkedin-card-title {
    font-family: 'JetBrains Mono', monospace;
    color: var(--text-primary);
    font-size: 1.1rem;
    margin-bottom: 1rem;
    flex-grow: 1; /* Allow title to grow to push footer down */
}

.linkedin-card-footer {
    margin-top: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.linkedin-card-footer span {
    font-family: 'JetBrains Mono', monospace;
    color: var(--accent);
    font-size: 0.9rem;
}

.linkedin-card-footer i {
    color: var(--accent);
    font-size: 1.5rem;
    transition: transform 0.3s ease;
}

.linkedin-card:hover .linkedin-card-footer i {
    transform: translateX(5px);
}

.instruction-text {
    font-family: 'JetBrains Mono', monospace;
    color: var(--text-secondary);
    text-align: center;
    font-size: 0.9rem;
    margin-bottom: 3rem;
}

/* --- Timeline Section --- */
.timeline {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 10px;
    top: 0;
    width: 2px;
    height: 100%;
    background: var(--border-color);
}

.timeline-item {
    position: relative;
    padding-left: 40px;
    margin-bottom: 3rem;
}

.timeline-item:last-child {
    margin-bottom: 0;
}

.timeline-node {
    position: absolute;
    left: 0;
    top: 5px;
    width: 22px;
    height: 22px;
    background: var(--bg-primary);
    border: 2px solid var(--accent);
    border-radius: 50%;
}

.timeline-item.active .timeline-node {
    background: var(--accent);
}
.timeline-item.future .timeline-node {
    background-color: rgba(228, 41, 179, 0.5);
}

.timeline-date {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.timeline-title {
    font-size: 1.2rem;
    margin-bottom: 0.2rem;
    color: var(--text-primary);
}

.timeline-role {
    font-size: 1rem;
    color: var(--accent);
    margin-bottom: 0.5rem;
    font-weight: 400;
}

.timeline-desc {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.timeline-desc a {
    color: var(--accent-alt);
    text-decoration: none;
}

/* --- Contact Section --- */
.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
}

.contact-list {
    list-style: none;
}

.contact-list li {
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.contact-list i {
    color: var(--accent-alt);
    width: 20px;
    text-align: center;
}

.contact-list a, .contact-list span {
    color: var(--text-secondary);
    text-decoration: none;
    font-family: 'JetBrains Mono', monospace;
    transition: var(--transition);
}

.contact-list a:hover {
    color: var(--accent);
}

form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

input, textarea {
    padding: 1rem;
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-primary);
    font-family: 'Roboto', sans-serif;
    font-size: 1rem;
}

input:focus, textarea:focus {
    outline: none;
    border-color: var(--accent);
}

textarea {
    min-height: 120px;
    resize: vertical;
}

.submit-btn {
    align-self: flex-start;
    cursor: pointer;
}

/* ============================================= */
/* ==   FOOTER                                == */
/* ============================================= */
footer {
    padding: 4rem 0 2rem;
    text-align: center;
    border-top: 1px solid var(--border-color);
}

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

.social-link {
    font-size: 1.5rem;
    color: var(--text-secondary);
    text-decoration: none;
    transition: var(--transition);
}

.social-link:hover {
    color: var(--accent);
    transform: translateY(-3px);
}

.copyright {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-family: 'JetBrains Mono', monospace;
}

/* ============================================= */
/* ==   GLITCH & ANIMATION EFFECTS            == */
/* ============================================= */
/* --- Hover Glitch --- */
.glitch-hover {
    position: relative;
    display: inline-block;
}

.glitch-hover:hover::before, .glitch-hover:hover::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-primary);
    overflow: hidden;
}

.glitch-hover:hover::before {
    left: 2px;
    text-shadow: -2px 0 var(--accent-alt);
    clip: rect(44px, 450px, 56px, 0);
    animation: glitch-anim 2s infinite linear alternate-reverse;
}

.glitch-hover:hover::after {
    left: -2px;
    text-shadow: -2px 0 var(--accent), 2px 2px var(--accent-alt);
    clip: rect(85px, 450px, 140px, 0);
    animation: glitch-anim-2 3s infinite linear alternate-reverse;
}

@keyframes glitch-anim {
    0% { clip: rect(42px,9999px,44px,0); } 25% { clip: rect(19px,9999px,95px,0); } 50% { clip: rect(49px,9999px,23px,0); } 75% { clip: rect(23px,9999px,73px,0); } 100% { clip: rect(89px,9999px,7px,0); }
}

@keyframes glitch-anim-2 {
    0% { clip: rect(87px,9999px,42px,0); } 25% { clip: rect(28px,9999px,7px,0); } 50% { clip: rect(72px,9999px,65px,0); } 75% { clip: rect(5px,9999px,85px,0); } 100% { clip: rect(55px,9999px,77px,0); }
}

/* --- Achievement Glitches --- */
.glitch-first-place,
.glitch-second-place,
.glitch-hosting {
    position: relative;
    text-decoration: none;
}

.glitch-first-place::before, .glitch-first-place::after,
.glitch-second-place::before, .glitch-second-place::after,
.glitch-hosting::before, .glitch-hosting::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-secondary);
    overflow: hidden;
}

/* --- 🥇 1st Place --- */
.glitch-first-place { color: var(--accent); }
.glitch-first-place::before {
    left: 2px;
    text-shadow: -2px 0 var(--accent-alt);
    animation: glitch-burst 3s infinite linear alternate-reverse;
}
.glitch-first-place::after {
    left: -2px;
    text-shadow: -2px 0 var(--accent), 2px 2px var(--accent-alt);
    animation: glitch-burst 2s infinite linear alternate-reverse;
}

@keyframes glitch-burst {
    0% { clip-path: polygon(0 60%, 100% 60%, 100% 100%, 0 100%); } 5% { clip-path: polygon(0 20%, 100% 20%, 100% 40%, 0 40%); } 10% { clip-path: polygon(0 85%, 100% 85%, 100% 100%, 0 100%); } 20% { clip-path: polygon(0 45%, 100% 45%, 100% 65%, 0 65%); } 30% { clip-path: polygon(0 90%, 100% 90%, 100% 100%, 0 100%); } 40% { clip-path: polygon(0 10%, 100% 10%, 100% 25%, 0 25%); } 50% { clip-path: polygon(0 70%, 100% 70%, 100% 80%, 0 80%); } 60% { clip-path: polygon(0 30%, 100% 30%, 100% 50%, 0 50%); } 70% { clip-path: polygon(0 95%, 100% 95%, 100% 100%, 0 100%); } 80% { clip-path: polygon(0 5%, 100% 5%, 100% 15%, 0 15%); } 90% { clip-path: polygon(0 80%, 100% 80%, 100% 90%, 0 90%); } 100% { clip-path: polygon(0 40%, 100% 40%, 100% 55%, 0 55%); }
}

/* --- 🥈 2nd Place --- */
.glitch-second-place { color: var(--text-primary); }
.glitch-second-place::before {
    left: 1px;
    text-shadow: -1px 0 var(--accent);
    animation: glitch-subtle 5s infinite linear alternate-reverse;
}
.glitch-second-place::after {
    left: -1px;
    text-shadow: -1px 0 var(--text-secondary);
    animation: glitch-subtle 7s infinite linear alternate-reverse;
}

@keyframes glitch-subtle {
    0% { clip-path: inset(95% 0 0 0); } 20% { clip-path: inset(50% 0 48% 0); } 40% { clip-path: inset(20% 0 75% 0); } 60% { clip-path: inset(80% 0 10% 0); } 80% { clip-path: inset(40% 0 55% 0); } 100% { clip-path: inset(95% 0 0 0); }
}

/* --- 🎤 Hosting --- */
.glitch-hosting { color: var(--accent-alt); }
.glitch-hosting::before {
    opacity: 0.8;
    text-shadow: 0 0 3px var(--accent-alt);
    animation: glitch-scanline 6s infinite cubic-bezier(0.2, 1, 0.8, 0);
}
.glitch-hosting::after { opacity: 0; }

@keyframes glitch-scanline {
    0%, 50% { clip-path: polygon(0 0, 100% 0, 100% 3px, 0 3px); }
    50.5%, 100% { clip-path: polygon(0 100%, 100% 100%, 100% calc(100% - 3px), 0 calc(100% - 3px)); }
}

/* ============================================= */
/* ==   RESPONSIVE DESIGN                     == */
/* ============================================= */
@media (max-width: 992px) {
    .nav-links { display: none; }
    .hamburger { display: flex; }
    .skills-grid, .projects-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .about-grid, .contact-grid { grid-template-columns: 1fr; }
    .about-image-wrapper { margin: 2rem auto 0; }
    .section-window { padding: 2rem; }
    .hero-title { min-height: 100px; }
    .broadcast-grid { grid-template-columns: 1fr; }
}