:root {
    --bg-main: #0a0a0a;
    --text-main: #ffffff;
    --text-muted: #888888;
    --glass-bg: rgba(255, 255, 255, 0.02);
    --glass-border: rgba(255, 255, 255, 0.08);
    --accent: #ffffff;
}

@font-face {
    font-family: 'Quera';
    src: url('Quera%20DEMO.otf') format('opentype');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'Rengok';
    src: url('Rengok.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

html {
    font-size: 18px; /* Scales up all rem-based sizes across the entire page */
}

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

body {
    font-family: 'Rengok', 'Inter', sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    overflow-x: hidden;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6, .section-title {
    font-family: 'Quera', serif;
    letter-spacing: 1.5px; /* Added to fix tightly packed characters */
}

/* Landing Page Typography */
.logo, .nav-links a, .hero .elegant-title, .hero .elegant-subtitle {
    font-family: Verdana, sans-serif;
}

/* Navigation */
nav {
    position: fixed;
    top: 0;
    width: 100%;
    padding: 2rem 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 100;
    mix-blend-mode: difference;
}

.logo {
    font-weight: 700;
    font-size: 1.1rem;
    letter-spacing: -0.5px;
}

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

.nav-links a {
    color: var(--text-main);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.7;
    transition: color 0.3s ease, opacity 0.3s ease, border-color 0.3s ease, transform 0.3s ease;
}

.nav-links a:hover {
    opacity: 1;
    color: #d4af37;
}

.nav-btn {
    border: 1px solid var(--text-main);
    padding: 0.5rem 1.2rem;
    border-radius: 20px;
}

.nav-btn:hover {
    border-color: #d4af37;
}

/* Hero Section */
.hero {
    height: 100vh;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: flex-end; /* Push content to bottom */
    padding: 0 5% 2vh 5%;
}

.hero-video-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background-color: var(--bg-main); /* Blocks the 3D canvas from showing through the video */
}

#bg-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.75; /* highly visible */
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* Very subtle gradient just to ensure bottom text is readable */
    background: linear-gradient(to bottom, transparent 50%, #0a0a0a 100%);
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
    margin-bottom: 0;
}

.elegant-title {
    font-size: clamp(2rem, 5vw, 5rem);
    font-weight: 600;
    letter-spacing: -2px;
    line-height: 1;
    margin-bottom: 0.5rem;
    white-space: nowrap;
}

.elegant-subtitle {
    font-size: clamp(1rem, 2vw, 1.5rem);
    font-weight: 300;
    color: var(--text-muted);
    letter-spacing: 1px;
}

#typed-roles {
    color: var(--text-main);
    font-weight: 500;
    border-right: 2px solid var(--text-main);
    padding-right: 4px;
    animation: blink 0.75s step-end infinite;
}

@keyframes blink {
    from, to { border-color: transparent }
    50% { border-color: var(--text-main) }
}

.scroll-indicator {
    margin-top: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.line-scroll {
    width: 1px;
    height: 60px;
    background: rgba(255,255,255,0.2);
    position: relative;
    overflow: hidden;
}

.line-scroll::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 50%;
    background: #fff;
    animation: drop 2s infinite ease-in-out;
}

@keyframes drop {
    0% { transform: translateY(-100%); }
    100% { transform: translateY(200%); }
}

/* Common Section */
.section {
    padding: 120px 5%;
}

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

.section-title {
    font-size: clamp(3rem, 6vw, 5rem);
    font-weight: 500;
    letter-spacing: -1px;
    margin-bottom: 4rem;
    color: var(--text-main);
}

/* Elegant Panel (Premium Glass & Spotlight) */
.elegant-panel {
    background: rgba(255, 255, 255, 0.02);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 3rem;
    position: relative;
    overflow: hidden;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.4s ease, border-color 0.4s ease, background 0.4s ease;
}

/* Mouse-tracking Spotlight Glow */
.elegant-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(800px circle at var(--mouse-x, 50%) var(--mouse-y, 50%), rgba(255, 255, 255, 0.06), transparent 40%);
    opacity: 0;
    transition: opacity 0.5s ease;
    pointer-events: none;
    z-index: 0;
}

.elegant-panel:hover::before {
    opacity: 1;
}

.desc-list {
    list-style-type: disc;
    padding-left: 1.5rem;
    margin-top: 1rem;
    margin-bottom: auto;
    font-size: 1.25rem; /* Increased size for readability */
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.95);
}

.desc-list li {
    margin-bottom: 0.6rem;
}

.desc-list li:last-child {
    margin-bottom: 0;
}

.elegant-panel:hover {
    transform: translateY(-8px);
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5), 0 0 20px rgba(255, 255, 255, 0.03);
}

.elegant-panel > * {
    position: relative;
    z-index: 1;
}

/* Typography elements */
p {
    color: var(--text-muted);
    font-size: 1.1rem;
    font-weight: 300;
}

/* About Section */
.about-text p {
    font-size: 1.4rem;
    font-weight: 400;
    color: var(--text-main);
    line-height: 1.8;
}

.achievements-minimal {
    margin-top: 3rem;
    border-top: 1px solid var(--glass-border);
    padding-top: 2rem;
}

.achievements-minimal h3 {
    font-size: 1rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 1.5rem;
    color: var(--text-main);
}

.achievements-minimal ul {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.achievements-minimal li {
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--text-main);
    display: flex;
    align-items: center;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    transition: all 0.3s ease;
    cursor: default;
    
    position: relative;
    z-index: 1;
    overflow: hidden;
    background: transparent;
    border: none;
}

/* Shiny Gold Border */
.achievements-minimal li::before {
    content: '';
    position: absolute;
    top: -50%; left: -50%; width: 200%; height: 200%;
    background: conic-gradient(from 0deg, transparent 70%, #d4af37 85%, #fff 90%, #d4af37 95%, transparent 100%);
    animation: gold-spin 4s linear infinite;
    z-index: -2;
}

/* Pure Black Inner Background */
.achievements-minimal li::after {
    content: '';
    position: absolute;
    top: 1.5px; left: 1.5px; right: 1.5px; bottom: 1.5px;
    background: #000000;
    border-radius: 6.5px;
    z-index: -1;
}

.achievements-minimal li:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.5);
}

/* Grids */
.minimal-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
}

/* Sticky Stack (Experience) */
.sticky-stack {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    padding-bottom: 4rem; /* Let the last card stick cleanly */
}

.stacked-card {
    position: sticky;
    top: 15vh;
    padding: 3rem;
    border-radius: 24px;
    box-shadow: 0 -10px 40px rgba(0,0,0,0.8);
    min-height: 380px;
    height: auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    color: white;
    transition: transform 0.3s ease;
    
    background: #000;
    overflow: hidden;
    z-index: 1;
}

/* Dynamic Shiny Gold Border */
.stacked-card::before {
    content: '';
    position: absolute;
    top: -50%; left: -50%; width: 200%; height: 200%;
    /* Subtle spinning gold highlight */
    background: conic-gradient(from 0deg, transparent 70%, #d4af37 85%, #fff 90%, #d4af37 95%, transparent 100%);
    animation: gold-spin 4s linear infinite;
    z-index: -2;
}

/* Pure Black Inner Background */
.stacked-card::after {
    content: '';
    position: absolute;
    top: 1.5px; left: 1.5px; right: 1.5px; bottom: 1.5px;
    background: #000000;
    border-radius: 22.5px;
    z-index: -1;
}

@keyframes gold-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

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

/* Standard Project Grid */
.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
}

.project-card {
    position: relative;
    background: #000;
    border-radius: 16px;
    padding: 2.5rem;
    z-index: 1;
    display: flex;
    flex-direction: column;
    color: white;
    overflow: hidden;
    transition: transform 0.3s ease;
}

.project-card::before {
    content: '';
    position: absolute;
    top: -50%; left: -50%; width: 200%; height: 200%;
    /* Subtle spinning gold highlight */
    background: conic-gradient(from 0deg, transparent 70%, #d4af37 85%, #fff 90%, #d4af37 95%, transparent 100%);
    animation: gold-spin 4s linear infinite;
    z-index: -2;
}

.project-card::after {
    content: '';
    position: absolute;
    top: 1.5px; left: 1.5px; right: 1.5px; bottom: 1.5px;
    background: #000000;
    border-radius: 14.5px;
    z-index: -1;
}

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

/* Projects Marquee Enhancements */
.projects-marquee-container {
    width: 100vw;
    position: relative;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
    overflow: hidden;
    padding: 2rem 0;
    display: flex;
    flex-direction: column;
    gap: 3rem;
}

.project-strip {
    cursor: grab;
    /* CSS Animation is removed, JS takes over for dragging */
}

.project-strip:active {
    cursor: grabbing;
}

.project-marquee-content {
    gap: 3rem;
    padding-right: 3rem; /* Match gap for seamless loop */
}

.project-marquee-content .project-card {
    width: 450px;
    flex-shrink: 0;
    white-space: normal; /* Override any potential inline issues */
}

@media (max-width: 600px) {
    .stacked-card {
        height: auto;
        min-height: 400px;
        padding: 2rem;
    }
    .project-marquee-content .project-card {
        width: 85vw;
        padding: 1.5rem;
    }
}

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

.panel-header h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.4rem;
    background: linear-gradient(to right, #ffffff, #888888);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.panel-header h4 {
    font-size: 0.95rem;
    font-weight: 400;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border: 1px solid var(--glass-border);
    border-radius: 4px;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin-top: 0.5rem;
}

.tech {
    margin-top: 2rem;
    font-size: 1.1rem;
    font-family: 'Quera', serif;
    color: #ffffff;
    letter-spacing: 1px;
}
.tech strong {
    color: #d4af37;
}

/* GitHub Icon */
.github-icon {
    width: 40px; height: 40px;
    display: flex; justify-content: center; align-items: center;
    border: 1px solid var(--glass-border);
    border-radius: 50%;
    transition: all 0.3s;
}
.github-icon svg {
    width: 24px; height: 24px; /* Slightly larger */
    fill: #ffffff; /* Bright, pure white so it doesn't look faded */
    transition: fill 0.3s, transform 0.3s;
}
.github-icon:hover {
    border-color: #d4af37; /* gold highlight on hover */
}
.github-icon:hover svg {
    fill: #d4af37;
    transform: scale(1.1);
}

/* Infinite Scrolling Marquee */
.marquee-container {
    width: 100vw;
    position: relative;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
    overflow: hidden;
    padding: 6rem 0;
    display: flex;
    flex-direction: column;
    gap: 12vw;
    background: #000;
    z-index: 1;
}

/* Dynamic Shiny Gold Border for Capabilities */
.marquee-container::before {
    content: '';
    position: absolute;
    top: -150%; left: -50%; width: 200%; height: 400%; /* Extra height to ensure rotation covers the wide container */
    background: conic-gradient(from 0deg, transparent 70%, #d4af37 85%, #fff 90%, #d4af37 95%, transparent 100%);
    animation: gold-spin 8s linear infinite; /* slower spin for wide element */
    z-index: -2;
}

.marquee-container::after {
    content: '';
    position: absolute;
    top: 2px; left: 0; right: 0; bottom: 2px;
    background: #080808;
    z-index: -1;
}

.marquee-strip {
    display: flex;
    width: max-content;
}

.marquee-content {
    display: flex;
    gap: 8rem;
    padding-right: 8rem; /* Critical for seamless loop */
}

.strip-left {
    animation: scroll-left 35s linear infinite;
}

.strip-right {
    animation: scroll-right 35s linear infinite;
}

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

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

.icon-wrap {
    animation: float-icon 5s ease-in-out infinite alternate;
}

/* Stagger the float animation so they bob independently */
.icon-wrap:nth-child(even) {
    animation-delay: -2.5s;
}
.icon-wrap:nth-child(3n) {
    animation-delay: -1.2s;
}

@keyframes float-icon {
    0% { transform: translateY(-25px); }
    100% { transform: translateY(25px); }
}

.marquee-strip i {
    font-size: clamp(6rem, 8vw, 12rem);
    color: var(--text-muted); /* Fallback */
    transition: transform 0.3s ease, filter 0.3s ease;
    display: block;
}

.icon-wrap:hover i {
    transform: scale(1.2);
    filter: drop-shadow(0 0 15px rgba(255, 255, 255, 0.2));
}

/* Make Next.js logo white instead of black to be visible on dark background */
i.devicon-nextjs-plain {
    filter: invert(1) opacity(0.8);
}
.icon-wrap:hover i.devicon-nextjs-plain {
    filter: invert(1) drop-shadow(0 0 15px rgba(255, 255, 255, 0.2));
}

/* Contact */
.contact-wrap {
    max-width: 600px;
    margin: 0 auto;
}

.contact-desc {
    margin-bottom: 3rem;
}

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

.clean-form input, .clean-form textarea {
    width: 100%;
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--glass-border);
    padding: 1rem 0;
    color: var(--text-main);
    font-family: inherit;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.3s;
}

.clean-form input:focus, .clean-form textarea:focus {
    border-color: var(--text-main);
}

.clean-btn {
    align-self: flex-start;
    margin-top: 1rem;
    padding: 1rem 2.5rem;
    background: var(--text-main);
    color: var(--bg-main);
    border: none;
    border-radius: 30px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.3s;
}

.clean-btn:hover {
    opacity: 0.8;
}

/* Contact Grid Setup */
.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    align-items: stretch;
}
#contact-canvas-container canvas {
    display: block;
    width: 100%;
    height: 100%;
    outline: none;
}

/* Footer */
footer {
    padding: 2rem 5%;
    border-top: 1px solid var(--glass-border);
}

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

.footer-content p {
    color: #ffffff;
    font-size: 1.1rem;
}

.footer-links a {
    color: #ffffff; /* Bright white instead of muted */
    text-decoration: none;
    margin-left: 2rem;
    font-size: 1.1rem; /* Slightly larger */
    transition: color 0.3s, transform 0.3s;
    display: inline-block;
}
.footer-links a:hover {
    color: #d4af37; /* Gold hover */
    transform: translateY(-2px);
}

@media (max-width: 768px) {
    .nav-links { display: none; }
    .hero { justify-content: center; }
    .section-title { font-size: 2.2rem; }
    .skill-category { flex-direction: column; gap: 0.5rem; }
    .skill-label { flex: auto; }
    .contact-grid { grid-template-columns: 1fr; }
    .contact-right { min-height: 400px; }
}
