/* 
   Theme: AAA Game Dev / Brutalist / Cyber Interface
   Author: Antigravity
   For: Tristan Davin Dakara
*/

:root {
    --bg-color: #050505;
    --bg-secondary: #0a0a0a;
    --text-primary: #e0e0e0;
    --text-dim: #555555;
    
    --accent: #ff3e3e; /* Kill switch red */
    --accent-secondary: #ffffff;
    
    --border-light: rgba(255, 255, 255, 0.1);
    --border-strong: rgba(255, 255, 255, 0.4);
    
    --font-display: 'Rajdhani', sans-serif;
    --font-code: 'JetBrains Mono', monospace;
    
    --container-width: 1100px;
    --spacing: 120px;
}

/* LENIS RECOMMENDED CSS */
html.lenis, html.lenis body {
  height: auto;
}

.lenis.lenis-smooth {
  scroll-behavior: auto !important;
}

.lenis.lenis-smooth [data-lenis-prevent] {
  overscroll-behavior: contain;
}

.lenis.lenis-stopped {
  overflow: hidden;
}

.lenis.lenis-scrolling iframe {
  pointer-events: none;
}

/* RESET */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    cursor: crosshair; /* Gamer feel */
    /* scroll-behavior: smooth; -- REMOVED: Lenis handles this */
}

body, html {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: var(--font-display);
    width: 100%;
    overflow-x: hidden; 
}

/* INTERACTIVE CURSORS */
a, button, input[type="submit"], .clickable {
    cursor: pointer;
}

/* UTILS */
.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 20px;
    position: relative;
    z-index: 10;
}

/* BACKGROUND FX */
#bg-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    opacity: 0.3;
    pointer-events: none; /* Ensure no interaction interference */
}

.scanlines {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 998;
    pointer-events: none;
    opacity: 0.6;
    /* CSS Grid Pattern for better performance */
    background-image: 
        linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 50px 50px;
    background-position: center top;
}

.vignette {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, transparent 50%, black 150%);
    z-index: 998;
    pointer-events: none;
}

/* UI FRAMING */
.ui-frame {
    position: fixed;
    padding: 15px; /* Add padding for space inside borders */
    font-family: var(--font-code);
    font-size: 12px;
    color: var(--text-dim);
    z-index: 999;
    letter-spacing: 2px;
    pointer-events: none;
    /* Reset dimensions to auto */
    width: auto;
    height: auto;
}
.top-left { 
    top: 20px; left: 20px; 
    border-left: 1px solid var(--text-dim); 
    border-top: 1px solid var(--text-dim); 
}
.top-right { 
    top: 20px; right: 20px;  
    border-right: 1px solid var(--text-dim); 
    border-top: 1px solid var(--text-dim); 
    text-align: right;
}
.bottom-left { 
    bottom: 20px; left: 20px;  
    border-left: 1px solid var(--text-dim); 
    border-bottom: 1px solid var(--text-dim); 
    display: flex; align-items: flex-end;
}
.bottom-right { 
    bottom: 20px; right: 20px;  
    border-right: 1px solid var(--text-dim); 
    border-bottom: 1px solid var(--text-dim); 
    display: flex; align-items: flex-end; justify-content: flex-end;
}

/* NAVIGATION */
nav {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    padding: 25px 0;
    
    /* CYBER GLASS EFFECT */
    background: 
        /* Grid Texture Overlay */
        linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        /* Base Tint */
        linear-gradient(to bottom, rgba(5, 5, 5, 0.9), rgba(5, 5, 5, 0.6));
        
    background-size: 
        30px 30px, 
        30px 30px, 
        100% 100%;
        
    /* Glass Params */
    backdrop-filter: blur(12px) saturate(160%);
    -webkit-backdrop-filter: blur(12px) saturate(160%);
    
    /* Tech Border */
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.8);
    
    transition: padding 0.3s ease;
}

.nav-inner {
    max-width: var(--container-width);
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
}

.logo {
    font-family: var(--font-code);
    font-weight: 700;
    font-size: 1.5rem;
    letter-spacing: -2px;
}

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

.nav-links {
    list-style: none;
    display: flex;
    gap: 40px;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-primary);
    font-family: var(--font-code);
    font-size: 0.9rem;
    position: relative;
    overflow: hidden;
    display: inline-block;
}

/* Glitch Hover Effect for Nav */
.nav-links a::before {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 100%;
    color: var(--accent);
    background: var(--bg-color);
    overflow: hidden;
    transition: width 0.3s ease;
    border-right: 2px solid var(--accent);
}

.nav-links a:hover::before {
    width: 100%;
}

/* HERO SECTION */
#hero {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: left;
}

.hero-container {
    width: 100%;
}

.glitch-wrapper {
    position: relative;
    margin-bottom: 20px;
}

.hero-title {
    font-size: 7rem;
    line-height: 0.85;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: -3px;
    margin: 0;
    color: var(--text-primary);
    will-change: transform; /* Optimize Glitch */
}

.layer2 {
    color: transparent;
    -webkit-text-stroke: 1px var(--text-primary);
    margin-left: 60px; /* Offset style */
}

/* CYBERPUNK 2077 HARDCORE GLITCH */
.cyber-glitch {
    position: relative;
    /* transition: none; -- Instant change for robotic feel */
}

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

/* Hardcore Glitch on Hover */
.cyber-glitch:hover::before {
    opacity: 1;
    z-index: 2; /* Move ON TOP to mask/cut the main text */
    text-shadow: 2px 0 #00e5ff; /* Cyber Cyan */
    animation: cyber-glitch-1 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94) both infinite;
}

.cyber-glitch:hover::after {
    opacity: 1;
    z-index: 3; /* Move ON TOP */
    text-shadow: -2px 0 #ff003c; /* Cyber Red */
    animation: cyber-glitch-2 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94) both infinite;
}

.cyber-glitch:hover {
    /* Shake main text */
    animation: cyber-glitch-skew 0.5s infinite linear alternate-reverse;
}

/* Chaos Keyframes */
@keyframes cyber-glitch-1 {
    0% { clip-path: inset(80% 0 0 0); transform: translate(-2px, 1px); }
    10% { clip-path: inset(10% 0 85% 0); transform: translate(2px, -1px); }
    20% { clip-path: inset(45% 0 40% 0); transform: translate(-2px, 2px); }
    30% { clip-path: inset(0 0 90% 0); transform: translate(2px, -2px); }
    40% { clip-path: inset(60% 0 20% 0); transform: translate(-2px, 1px); }
    50% { clip-path: inset(10% 0 70% 0); transform: translate(2px, -1px); }
    60% { clip-path: inset(30% 0 10% 0); transform: translate(-2px, 2px); }
    70% { clip-path: inset(80% 0 5% 0); transform: translate(2px, -2px); }
    80% { clip-path: inset(20% 0 60% 0); transform: translate(-2px, 1px); }
    90% { clip-path: inset(50% 0 30% 0); transform: translate(2px, -1px); }
    100% { clip-path: inset(10% 0 80% 0); transform: translate(-2px, 2px); }
}

@keyframes cyber-glitch-2 {
    0% { clip-path: inset(10% 0 80% 0); transform: translate(2px, -1px); }
    10% { clip-path: inset(80% 0 0 0); transform: translate(-2px, 1px); }
    20% { clip-path: inset(0 0 90% 0); transform: translate(2px, -2px); }
    30% { clip-path: inset(45% 0 40% 0); transform: translate(-2px, 2px); }
    40% { clip-path: inset(10% 0 70% 0); transform: translate(2px, -1px); }
    50% { clip-path: inset(60% 0 20% 0); transform: translate(-2px, 1px); }
    60% { clip-path: inset(10% 0 80% 0); transform: translate(-2px, 2px); }
    70% { clip-path: inset(50% 0 30% 0); transform: translate(2px, -1px); }
    80% { clip-path: inset(30% 0 10% 0); transform: translate(-2px, 2px); }
    90% { clip-path: inset(80% 0 5% 0); transform: translate(2px, -2px); }
    100% { clip-path: inset(20% 0 60% 0); transform: translate(-2px, 1px); }
}

@keyframes cyber-glitch-skew {
    0% { transform: skew(0deg); }
    20% { transform: skew(-2deg); }
    40% { transform: skew(2deg); }
    60% { transform: skew(0deg); }
    80% { transform: skew(-1deg); }
    100% { transform: skew(1deg); }
}

.hero-subtitle {
    margin-left: 5px;
    font-family: var(--font-code);
    font-size: 1.1rem;
    line-height: 1.6;
    margin-top: 30px;
    border-left: 2px solid var(--accent);
    padding-left: 20px;
    max-width: 600px;
}

.accent { color: var(--accent); }
.dim { color: var(--text-dim); font-size: 0.9em; }

.hero-cta {
    margin-top: 50px;
    display: flex;
    gap: 20px;
}

/* BRUTAL BUTTONS */
.btn-brutal {
    position: relative;
    display: inline-block;
    padding: 18px 36px;
    background: var(--text-primary);
    color: var(--bg-color);
    text-decoration: none;
    font-family: var(--font-code);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.9rem;
    border: 1px solid var(--text-primary);
    transition: transform 0.1s;
}

.btn-brutal:hover {
    transform: translate(-3px, -3px);
    box-shadow: 3px 3px 0 var(--accent);
}

.btn-brutal.outline {
    background: transparent;
    color: var(--text-primary);
}

.btn-brutal.outline:hover {
    background: rgba(255,255,255,0.05);
}

/* SECTION HEADERS */
.section-layout {
    padding-top: var(--spacing);
    padding-bottom: var(--spacing);
}

.section-title h2 {
    font-size: 1.5rem;
    font-family: var(--font-code);
    color: var(--text-dim);
    margin-bottom: 10px;
}

.line {
    width: 100%;
    height: 1px;
    background: var(--border-light);
    margin-bottom: 50px;
    position: relative;
}

.line::after {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 100px;
    background: var(--accent);
}

/* ABOUT */
.about-content {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 60px;
}

.terminal-text {
    font-family: var(--font-code);
    font-size: 1.1rem;
    line-height: 1.7;
    color: #cccccc;
}

.stats-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

.stat-box {
    border: 1px solid var(--border-light);
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.stat-box h3 { font-size: 2rem; }
.stat-box p { font-family: var(--font-code); font-size: 0.8rem; color: var(--text-dim); }

/* TECH STACK */
.stack-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2px; /* Super tight gap */
    background: var(--border-light);
    border: 1px solid var(--border-light);
}

.stack-card {
    background: var(--bg-color);
    padding: 30px;
}

.card-header {
    font-family: var(--font-code);
    color: var(--accent);
    margin-bottom: 20px;
    font-weight: 700;
}

.stack-card ul { list-style: none; }
.stack-card li {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #111;
    font-weight: 600;
    letter-spacing: 1px;
}

.stack-card li span {
    font-family: var(--font-code);
    font-size: 0.8rem;
    color: var(--text-dim);
    font-weight: 400;
}

/* EXPERIENCE TIMELINE */
.timeline {
    border-left: 1px solid var(--border-light);
    margin-left: 20px;
}

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

.timeline-item::before {
    content: '';
    position: absolute;
    left: -5px;
    top: 0;
    width: 9px;
    height: 9px;
    background: var(--bg-color);
    border: 1px solid var(--text-primary);
}

.timeline-item:hover::before {
    background: var(--accent);
    border-color: var(--accent);
}

.time-marker {
    font-family: var(--font-code);
    font-size: 0.9rem;
    color: var(--accent);
    margin-bottom: 5px;
}

.time-content h3 { font-size: 1.8rem; margin-bottom: 5px; }
.time-content h4 { font-size: 1rem; color: var(--text-dim); margin-bottom: 15px; }
.time-content p { max-width: 600px; line-height: 1.6; }

.log-focus {
    color: var(--accent);
    font-family: var(--font-mono);
    font-size: 0.9rem;
    margin-bottom: 10px;
    display: block;
}

.log-contrib { margin-top: 15px; }
.log-contrib h4 { color: var(--text-primary); margin-bottom: 5px; font-size: 0.9rem; }
.log-contrib ul { list-style: none; padding-left: 10px; border-left: 2px solid var(--border-light); }
.log-contrib li { font-family: var(--font-mono); font-size: 0.85rem; color: var(--text-dim); margin-bottom: 5px; }
.log-contrib li::before { content: "> "; color: var(--accent); }

/* === PROJECT ROW (NEW DESIGN) === */
.project-row {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    display: flex; /* Flex layout: Icon | Content */
    gap: 50px;
    padding: 30px;
    margin-bottom: 30px;
    opacity: 0;
    animation: fadeInUp 0.5s ease forwards;
    transition: transform 0.3s ease, border-color 0.3s ease;
}

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

/* LEFT: ICON */
.project-icon-container {
    flex-shrink: 0;
    width: 200px;
    height: 200px;
    background: transparent; /* Changed from #fff */
    padding: 0; /* Removed padding */
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-light);
    overflow: hidden; /* Ensure image doesn't bleed */
}

.project-icon {
    width: 100%;
    height: 100%;
    object-fit: contain; /* Ensure logo fits inside */
}

/* RIGHT: CONTENT */
.project-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

/* FAR RIGHT: ACTION */
.project-action {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 150px;
    border-left: 1px solid var(--border-light);
    padding-left: 20px;
}

/* CONTENT HEADER: Title + Meta */
.project-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
    border-bottom: 1px dashed #222;
    padding-bottom: 15px;
}

.project-meta-right {
    text-align: right;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.project-title {
    font-size: 1.8rem;
    font-weight: 700;
    margin: 0;
    line-height: 1.2;
    color: var(--text-main);
}

.project-type {
    display: block;
    margin-top: 5px;
    font-family: var(--font-mono);
    color: var(--text-dim);
    font-size: 0.9rem;
}

/* CTA BUTTON */
.btn-access {
    background: var(--text-main); /* White button */
    color: var(--bg-main); /* Black text */
    padding: 15px 30px;
    font-size: 1rem;
    font-weight: 700;
    text-decoration: none;
    border: 1px solid var(--text-main);
    transition: all 0.3s ease;
    white-space: nowrap;
}

.btn-access:hover {
    background: transparent;
    color: var(--text-main);
}

/* DESCRIPTION */
.project-body {
    flex-grow: 1;
}

.project-desc {
    color: var(--text-dim);
    line-height: 1.6;
    margin-bottom: 15px;
    font-size: 1rem;
}

.project-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: auto;
}


/* --- TARGET CURSOR --- */
body { cursor: none; } /* Hide default cursor */

.target-cursor-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 9999;
    pointer-events: none;
    width: 0;
    height: 0;
    display: none; /* Shown by JS */
}

.target-cursor-dot {
    position: absolute;
    width: 4px;
    height: 4px;
    background-color: var(--accent);
    border-radius: 50%;
    transform: translate(-50%, -50%);
}

.target-cursor-corner {
    position: absolute;
    width: 12px;
    height: 12px;
    border: 2px solid var(--text-primary);
    box-sizing: border-box;
    /* transition: border-color 0.2s; */
}

/* Corner Orientations */
.corner-tl { border-right: none; border-bottom: none; top: -15px; left: -15px; }
.corner-tr { border-left: none; border-bottom: none; top: -15px; left: 3px; }
.corner-br { border-left: none; border-top: none; top: 3px; left: 3px; }
.corner-bl { border-right: none; border-top: none; top: 3px; left: -15px; }

.stack-tag {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--accent);
    border: 1px solid var(--border-dim);
    padding: 2px 8px;
}

/* CONTACT */
.centered {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
}

.big-mail-link {
    font-size: 4vw;
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 700;
    margin: 40px 0;
    transition: color 0.3s;
}

.big-mail-link:hover {
    color: var(--accent);
    text-decoration: underline;
    text-decoration-thickness: 4px;
    text-underline-offset: 10px;
}

.social-grid {
    display: flex;
    gap: 40px;
}

.social-grid a {
    color: var(--text-dim);
    text-decoration: none;
    font-family: var(--font-code);
    letter-spacing: 1px;
}

.social-grid a:hover { color: var(--text-primary); }

footer {
    margin-top: 100px;
    font-family: var(--font-code);
    font-size: 0.7rem;
    color: #333;
}

/* KEYFRAMES */
@keyframes blink {
    50% { opacity: 0; }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* RESPONSIVE */
@media (max-width: 768px) {
    .hero-title { font-size: 3.5rem; }
    .layer2 { margin-left: 20px; }
    
    .about-content { grid-template-columns: 1fr; }
    .stack-grid { grid-template-columns: 1fr; }
    
    .project-row {
        flex-direction: column;
        gap: 30px;
        align-items: stretch;
    }
    .project-icon-container {
        width: 100%;
        height: auto;
        aspect-ratio: 1/1;
    }
    .project-action {
        border-left: none;
        border-top: 1px solid var(--border-light);
        padding-left: 0;
        padding-top: 20px;
        min-height: 60px;
    }
    .proj-meta { flex-direction: row; gap: 20px; }
    
    .big-mail-link { font-size: 1.5rem; }
}
/* --- EXPERIENCE NEW FIELDS --- */
.log-focus {
    color: var(--accent);
    font-size: 0.9em;
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: bold;
}

.log-contrib {
    margin-top: 15px;
    border-left: 1px solid var(--accent-dim);
    padding-left: 15px;
}

.log-contrib h4 {
    color: var(--text-main);
    font-size: 0.85em;
    margin-bottom: 8px;
    text-transform: uppercase;
    opacity: 0.8;
}

.log-contrib ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.log-contrib li {
    color: var(--text-dim);
    font-size: 0.9rem;
    margin-bottom: 6px;
    position: relative;
    padding-left: 12px;
}

.log-contrib li::before {
    content: "•";
    position: absolute;
    left: 0;
    color: var(--accent);
    line-height: 1.5;
}

/* --- PROJECT STATUS BADGES --- */
.status-badge {
    font-size: 0.75rem;
    padding: 8px 12px;
    border: 1px solid var(--text-dim);
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 1px;
    background: rgba(0,0,0,0.3);
    height: fit-content;
    display: inline-block;
}

.status-badge.working {
    color: #ffaa00;
    border-color: #ffaa00;
    background: rgba(255, 170, 0, 0.1);
}

.status-badge.completed {
    color: #00ff88;
    border-color: #00ff88;
    background: rgba(0, 255, 136, 0.1);
}

.status-badge.discontinue {
    color: #ff4444;
    border-color: #ff4444;
    background: rgba(255, 68, 68, 0.1);
}
