﻿/* Global Variables */
:root {
    --bg-color: #161616;
    --text-color: #FFFFFF;
    --accent-color: #309EDB;
    --secondary-bg: #1f1f1f;
    --font-main: 'Inter', system-ui, -apple-system, sans-serif;
    --transition-speed: 0.3s;
    --nav-height: 80px;
}

/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-main);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color var(--transition-speed) ease;
}

img {
    max-width: 100%;
    display: block;
}

button {
    cursor: pointer;
    font-family: inherit;
    border: none;
    outline: none;
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1rem;
}

h1 {
    font-size: 3.5rem;
    letter-spacing: -2px;
}

h2 {
    font-size: 2.5rem;
    letter-spacing: -1px;
}

h3 {
    font-size: 1.75rem;
}

p {
    margin-bottom: 1.5rem;
    color: #cccccc;
}

/* Utilities */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.section {
    padding: 6rem 0;
    /* overflow: hidden; Removed to allow card shadows/animations to be visible */
}

.text-accent {
    color: var(--accent-color);
}

.btn {
    display: inline-block;
    padding: 12px 32px;
    background: var(--accent-color);
    color: #fff;
    font-weight: 600;
    border-radius: 4px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(48, 158, 219, 0.4);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--accent-color);
    color: var(--accent-color);
    padding: 10px 30px;
}

.btn-outline:hover {
    background: var(--accent-color);
    color: #fff;
}

.btn-small {
    padding: 8px 20px;
    font-size: 0.9rem;
}

/* Navigation */
.navbar {
    height: var(--nav-height);
    background: rgba(22, 22, 22, 0.6);
    /* More transparent */
    backdrop-filter: blur(20px);
    /* Stronger blur */
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    display: flex;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.navbar.transparent {
    background: transparent;
    backdrop-filter: none;
    border-bottom: none;
    transition: background 0.5s ease, backdrop-filter 0.5s ease;
}

.navbar.transparent.scrolled {
    background: rgba(22, 22, 22, 0.8);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -1px;
}

.logo span {
    color: var(--accent-color);
}

.nav-links {
    display: flex;
    gap: 2rem;
    list-style: none;
}

.nav-link {
    font-weight: 500;
    position: relative;
    font-size: 0.95rem;
}

.nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -4px;
    left: 0;
    background-color: var(--accent-color);
    transition: width var(--transition-speed);
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

/* Dropdown */
.dropdown {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: -10px;
    background: var(--secondary-bg);
    min-width: 200px;
    list-style: none;
    padding: 10px 0;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all var(--transition-speed);
}

.dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-menu li a {
    display: block;
    padding: 10px 20px;
    color: #ddd;
    font-size: 0.9rem;
}

.dropdown-menu li a:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--accent-color);
}

/* Mobile Menu Toggle */
.menu-toggle {
    display: none;
    flex-direction: column;
    gap: 6px;
    cursor: pointer;
}

.bar {
    width: 25px;
    height: 2px;
    background-color: #fff;
    transition: var(--transition-speed);
}

/* Footer */
footer {
    margin-top: auto;
    background: #111;
    padding: 3rem 0;
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.social-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-speed);
}

.social-btn:hover {
    transform: translateY(-3px) rotate(360deg);
    color: #fff;
}

.social-btn.youtube:hover {
    background: #FF0000;
}

.social-btn.discord:hover {
    background: #5865F2;
}

.social-btn.github:hover {
    background: #333;
}

.social-btn.email:hover {
    background: #EA4335;
}

.social-btn.phone:hover {
    background: #25D366;
}

/* New Scroll Animations */
/* Reveal Text: Blur + Translate Y -> Clear + Original Pos */
.reveal-text {
    opacity: 0;
    transform: translateY(30px);
    filter: blur(10px);
    transition: opacity 1s ease, transform 1s ease, filter 1s ease;
}

.reveal-text.in-view {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
}

/* Scale In: Scale 0.9 -> 1.0 */
.scale-in {
    opacity: 0;
    transform: scale(0.95);
    transition: opacity 0.8s ease, transform 0.8s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.scale-in.in-view {
    opacity: 1;
    transform: scale(1);
}

/* Delays */
.delay-1 {
    transition-delay: 0.1s;
}

.delay-2 {
    transition-delay: 0.2s;
}

.delay-3 {
    transition-delay: 0.3s;
}

.delay-4 {
    transition-delay: 0.4s;
}


/* Projects Grid Update (Strict 2 Columns) */
.projects-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-top: 3rem;
}

@media (max-width: 768px) {
    .projects-grid {
        grid-template-columns: 1fr;
    }

    .menu-toggle {
        display: flex;
    }

    .nav-links {
        position: fixed;
        top: var(--nav-height);
        right: -100%;
        width: 100%;
        height: calc(100vh - var(--nav-height));
        background: var(--bg-color);
        flex-direction: column;
        align-items: center;
        justify-content: center;
        transition: right var(--transition-speed);
    }

    .nav-links.active {
        right: 0;
    }

    .dropdown-menu {
        position: static;
        background: transparent;
        box-shadow: none;
        text-align: center;
        opacity: 1;
        visibility: visible;
        transform: none;
        display: none;
    }

    .dropdown.active .dropdown-menu {
        display: block;
    }
}

/* --- Card Stack Styles --- */
.card-stack-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding-top: 2rem;
    width: 100%;
}

.card-stack-container {
    position: relative;
    /* height will be set by JS in grid mode, default 380px */
    height: 380px;
    width: 100%;
    max-width: 800px;
    /* Default for stack */
    transition: max-width 0.8s ease, height 0.8s ease;
    margin: 0 auto;
}

/* Card Base */
.stack-card {
    position: absolute;
    /* JS will control top/left/transform for grid view */
    /* Default Stack Position: centered horizontally */
    left: 50%;
    top: 0;
    /* aligned to container top for calculation simplicity, or we can keep bottom alignment if preferred, but top is easier for grid */

    width: 324px;
    height: 280px;
    background: #252525;
    border-radius: 12px 12px 0 0;
    /* Keep top radius? Or make full radius? User kept dims. */
    /* Make full radius for grid view aesthetics maybe? No, "exact same dimensions". Let's keep it. */
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;

    /* Smooth transitions for all changing props */
    transition: transform 0.8s cubic-bezier(0.34, 1.56, 0.64, 1),
        opacity 0.5s ease,
        left 0.8s cubic-bezier(0.34, 1.56, 0.64, 1),
        top 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);

    transform-origin: center center;
    /* Easier for grid scaling */

    /* Initial Stack Centering logic relies on margin-left, but for grid we want full control.
       We will remove margin-left in JS or override it. */
    margin-left: -162px;
    /* Default stack centering */
}

/* Responsive Widths */
@media (min-width: 640px) {
    .stack-card {
        width: 512px;
        margin-left: -256px;
    }
}

/* Grid View Modifiers */
.card-stack-container.grid-view {
    max-width: 1200px;
    /* Wider for 2 cols */
}

/* When in grid view, we might need to reset margin-left if we position by top/left explicitly */
.card-stack-container.grid-view .stack-card {
    margin-left: 0;
    border-radius: 12px;
    /* Rounded bottom too in grid? Looks better. */
    transform-origin: center;
}

/* Card Positions */
.card-pos-0 {
    z-index: 3;
    transform: translateY(12px) scale(1);
    opacity: 1;
}

.card-pos-1 {
    z-index: 2;
    transform: translateY(-16px) scale(0.95);
    opacity: 1;
}

.card-pos-2 {
    z-index: 1;
    transform: translateY(-44px) scale(0.9);
    opacity: 1;
}

/* Entry state (for new card appearing effectively at pos 2) */
.card-enter {
    transform: translateY(-44px) scale(0.9);
    opacity: 0;
}

/* Exit state */
.card-exit {
    z-index: 10;
    transform: translateY(340px) scale(1);
    opacity: 0;
    pointer-events: none;
}

/* Content Layout inside Card */
.stack-card-inner {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    padding: 4px;
}

.card-image-box {
    flex: 1;
    /* Takes remaining space minus footer */
    width: 100%;
    background-size: cover;
    background-position: center;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    /* Keep glass feel or just clean */
    background-color: #333;
}

.card-footer {
    height: 70px;
    /* Adjust height for title/desc area */
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
}

.card-info {
    display: flex;
    flex-direction: column;
}

.card-title {
    font-weight: 600;
    color: #fff;
    font-size: 1rem;
}

.card-desc {
    font-size: 0.8rem;
    color: #888;
}

.card-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    /* Frosted glass base */
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.2rem;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: pointer;
    text-decoration: none;
}

.card-btn:hover {
    background: #fff;
    color: #000;
    transform: scale(1.1) rotate(-45deg);
    /* Cool rotation hover */
}

/* Controls */
.stack-controls {
    margin-top: 2.5rem;
    z-index: 20;
    display: flex;
    justify-content: center;
}

#next-project-btn {
    background: transparent;
    color: #fff;
    font-family: var(--font-main);
    font-weight: 700;
    font-size: 1rem;
    padding: 14px 40px;
    border-radius: 100px;
    border: 2px solid #fff;
    box-shadow: none;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

#next-project-btn:hover {
    background: var(--accent-color);
    border-color: var(--accent-color);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(48, 158, 219, 0.3);
}

/* --- Dual Marquee Styles --- */
.dual-marquee-container {
    padding: 4rem 0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    overflow: hidden;
}

.marquee-strip {
    width: 100%;
    background: var(--accent-color);
    color: #fff;
    padding: 0.8rem 0;
    overflow: hidden;
    white-space: nowrap;
    position: relative;
    transform: skewY(-2deg);
    /* Stylish skew */
}

.marquee-content {
    display: inline-block;
    padding-left: 100%;
    animation: marquee 20s linear infinite;
    font-weight: 700;
    font-size: 1.2rem;
    text-transform: uppercase;
}

.marquee-content.reverse {
    animation-direction: reverse;
}

.marquee-content span {
    padding: 0 2rem;
}

@keyframes marquee {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-100%);
    }
}

/* --- Wavy Text Styles --- */
.wavy-text-section {
    position: relative;
    height: 175vh;
    /* Reduced from 300vh for shorter scroll */
    background: transparent;
}

.wavy-sticky-wrapper {
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    /* Left align as per demo */
    overflow: visible;
    /* Allow slight overlap if needed, but centering should fix */
    padding-left: 5vw;
}

.wavy-lines-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 5vh 0;
    /* Prevent vertical clipping */
}

.wavy-line {
    font-size: min(6vw, 11vh);
    /* Constrain vertically to fit all screens */
    font-weight: 800;
    line-height: 1.1;
    text-transform: uppercase;
    white-space: nowrap;
    color: #fff;
    /* Solid white */
    will-change: transform;
}

/* --- Project Details Page Styles --- */
.project-hero {
    height: 65vh;
    /* Reduced to 65vh */
    width: 100%;
    /* Gradient mask: Fades image into bg-color at bottom */
    background-size: cover;
    background-position: center;
    position: relative;
    display: flex;
    align-items: flex-end;
    padding-bottom: 6rem;
}

/* Gradient Overlay for Fade Effect */
.project-hero::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 60%;
    /* Fade starts from bottom 60% */
    background: linear-gradient(to bottom, transparent 0%, var(--bg-color) 100%);
    pointer-events: none;
}

.project-hero .container {
    position: relative;
    z-index: 2;
    /* Above the gradient overlay */
    text-align: center;
    width: 100%;
}

.project-meta-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 4rem;
    margin-top: 2rem;
    /* Reduced margin since hero is huge */
}

.meta-sidebar {
    background: var(--secondary-bg);
    padding: 2rem;
    border-radius: 8px;
    height: fit-content;
    position: sticky;
    top: 100px;
    /* Sticky sidebar */
}

.meta-item {
    margin-bottom: 1.5rem;
}

.meta-label {
    display: block;
    font-size: 0.8rem;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.25rem;
}

.meta-value {
    font-weight: 600;
    color: #fff;
}

.project-description h2 {
    margin-top: 2rem;
    color: var(--accent-color);
}

.project-description ul {
    list-style-position: inside;
    margin-top: 1rem;
    color: #cccccc;
}

.project-description li {
    margin-bottom: 0.5rem;
}

@media (max-width: 768px) {
    .project-meta-grid {
        grid-template-columns: 1fr;
    }

    .project-hero {
        height: 60vh;
    }
}

/* --- Magnetic Button Effect --- */
.magnetic-btn {
    position: relative;
    transition: transform 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: transform;
    /* Ensure text inside doesn't drag/select easily */
    user-select: none;
    overflow: hidden;
}

/* Add a subtle shine effect on hover for premium feel */
.magnetic-btn::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.2) 0%, transparent 60%);
    transform: scale(0);
    transition: transform 0.4s ease;
    pointer-events: none;
}

.magnetic-btn:hover::before {
    transform: scale(1);
}

/* --- Code Showcase Section --- */
.code-showcase-container {
    background: #1e1e1e;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    border: 1px solid #333;
}

.code-tabs {
    display: flex;
    background: #252526;
    padding: 0 1rem;
    border-bottom: 1px solid #333;
    overflow-x: auto;
}

.code-tab {
    background: transparent;
    border: none;
    color: #969696;
    padding: 0.8rem 1.5rem;
    cursor: pointer;
    font-size: 0.9rem;
    border-right: 1px solid #333;
    transition: color 0.2s, background 0.2s;
}

.code-tab:hover {
    color: #fff;
    background: #2d2d2d;
}

.code-tab.active {
    color: #fff;
    background: #1e1e1e;
    border-top: 2px solid var(--accent-color);
}

.window-header {
    background: #1e1e1e;
    padding: 0.8rem 1rem;
    display: flex;
    align-items: center;
    border-bottom: 1px solid #2d2d2d;
}

.traffic-lights {
    display: flex;
    gap: 8px;
    margin-right: 1rem;
}

.light {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.light.red {
    background: #ff5f56;
}

.light.yellow {
    background: #ffbd2e;
}

.light.green {
    background: #27c93f;
}

.filename {
    color: #969696;
    font-size: 0.85rem;
    font-family: monospace;
}

.code-content {
    display: none;
    padding: 1.5rem;
    overflow-x: auto;
}

.code-content.active {
    display: block;
}

pre {
    margin: 0;
}

code {
    font-family: 'Fira Code', 'Consolas', monospace;
    font-size: 0.95rem;
    line-height: 1.6;
    color: #d4d4d4;
}

/* Syntax Highlighting (Dark Theme) */
.kwd {
    color: #569cd6;
    font-weight: bold;
}

/* Keyword */
.cls {
    color: #4ec9b0;
}

/* Class */
.str {
    color: #ce9178;
}

/* String */
.num {
    color: #b5cea8;
}

/* Number */
.com {
    color: #6a9955;
    font-style: italic;
}

/* Comment */
.mth {
    color: #dcdcaa;
}

/* Method */


/* --- Expandable Code Blocks --- */
.code-viewer {
    position: relative;
    max-height: 400px;
    /* Reduced specific height for "short" look */
    overflow-y: hidden;
    overflow-x: auto;
    /* Allow horizontal scrolling */
    transition: max-height 0.5s ease-out;
}

.code-viewer.expanded {
    max-height: 8000px;
    /* Extremely large to ensure no truncation */
    transition: max-height 0.8s ease-in;
}

.code-fade-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 120px;
    background: linear-gradient(to bottom, transparent 0%, #1e1e1e 90%);
    pointer-events: none;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.code-viewer.expanded .code-fade-overlay {
    opacity: 0;
}

.expand-code-btn {
    width: 100%;
    background: #252526;
    border: none;
    border-top: 1px solid #333;
    color: #969696;
    padding: 12px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: background 0.2s, color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.expand-code-btn:hover {
    background: #2d2d2d;
    color: #fff;
}

/* --- Globe Section Styles --- */
.globe-section {
    padding: 6rem 0;
    /* Increase padding to match other sections */
    overflow: hidden;
}

.globe-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.globe-text-content {
    /* Removed max-width to let grid control width */
    padding-right: 2rem;
    position: relative;
    z-index: 10;
    /* Ensure text stays above if overlap occurs */
}

.globe-text-content h2 {
    font-size: 3rem;
    margin-bottom: 2rem;
    line-height: 1.1;
}

.globe-desc p {
    font-size: 1.15rem;
    /* Slightly larger */
    color: #d1d5db;
    /* Softer white */
    margin-bottom: 1.5rem;
    line-height: 1.8;
    /* Better readability */
}

.globe-viz-container {
    width: 100%;
    height: 600px;
    border-radius: 20px;
    background: transparent;
    position: relative;
    cursor: grab;
    overflow: hidden;
    /* CRITICAL: Prevent canvas from breaking layout */
}

/* Force canvas to respect container */
.globe-viz-container canvas {
    outline: none;
}

.globe-viz-container:active {
    cursor: grabbing;
}

@media (max-width: 900px) {
    .globe-wrapper {
        grid-template-columns: 1fr;
        gap: 3rem;
        text-align: center;
    }

    .globe-text-content {
        padding-right: 0;
        order: 1;
    }

    .globe-viz-container {
        height: 450px;
        order: 2;
    }
}

/* About Gallery */
/* About Gallery */
.about-gallery {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 400px;
}

.gallery-pos {
    position: absolute;
    z-index: 1;
    transition: z-index 0s;
}

.gallery-pos:hover {
    z-index: 10;
}

.gallery-img {
    width: 160px;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    object-fit: cover;
    transition: transform 0.1s ease;
    /* Fast response for magnetic */
    display: block;
}

.gallery-img:hover {
    box-shadow: 0 15px 40px rgba(var(--accent-color-rgb), 0.2);
}

/* Spread out positioning */
.pos-1 {
    top: 5%;
    left: 0%;
    transform: rotate(-5deg);
}

.pos-2 {
    bottom: 10%;
    left: 5%;
    top: auto;
    transform: rotate(8deg);
}

.pos-3 {
    top: 5%;
    right: 0%;
    transform: rotate(5deg);
}

.pos-4 {
    bottom: 10%;
    right: 5%;
    top: auto;
    transform: rotate(-10deg);
}

.pos-5 {
    top: 40%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(2deg);
}

.pos-5 .gallery-img {
    width: 200px;
}

@media (max-width: 768px) {
    .gallery-img {
        width: 120px;
    }

    .pos-5 .gallery-img {
        width: 150px;
    }
}