/* ============================================
   MODERN AESTHETIC - 2025
   ============================================ */

:root {
    /* Colors - HSL for better control */
    --hue: 265;
    --sat: 100%;
    
    --bg-dark: hsl(var(--hue), 40%, 8%);
    --bg-card: hsl(var(--hue), 30%, 12%);
    --bg-card-hover: hsl(var(--hue), 30%, 16%);
    
    --primary: hsl(var(--hue), 80%, 85%);
    --primary-dim: hsl(var(--hue), 40%, 65%);
    --accent: hsl(280, 100%, 70%);
    
    --text-main: hsl(var(--hue), 20%, 95%);
    --text-muted: hsl(var(--hue), 15%, 65%);
    
    --border: hsla(var(--hue), 30%, 80%, 0.1);
    --border-hover: hsla(var(--hue), 50%, 80%, 0.3);
    
    --glow: hsla(var(--hue), 80%, 70%, 0.15);
    
    /* Spacing */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 48px;
    
    /* Typography */
    --font-mono: 'JetBrains Mono', monospace;
    --font-display: 'Archivo Black', sans-serif;
    
    /* Animation */
    --ease-out: cubic-bezier(0.215, 0.61, 0.355, 1);
    --ease-in-out: cubic-bezier(0.645, 0.045, 0.355, 1);
}

/* ============================================
   RESET & BASE
   ============================================ */

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
    height: 100%;
}

body {
    font-family: var(--font-mono);
    background-color: var(--bg-dark);
    color: var(--text-main);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow-x: hidden;
    position: relative;
}

/* Noise Texture Overlay */
body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.05'/%3E%3C/svg%3E");
    pointer-events: none;
    z-index: 9999;
    opacity: 0.4;
}

/* Selection */
::selection {
    background: var(--primary);
    color: var(--bg-dark);
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-dark);
}

::-webkit-scrollbar-thumb {
    background: var(--border-hover);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dim);
}

/* ============================================
   LAYOUT
   ============================================ */

.container {
    width: 100%;
    max-width: 680px;
    padding: var(--space-xl) var(--space-md);
    position: relative;
    z-index: 1;
}

/* ============================================
   BACKGROUND EFFECTS
   ============================================ */

.grid-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    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: 40px 40px;
    z-index: -1;
    mask-image: radial-gradient(circle at 50% 50%, black 40%, transparent 80%);
    -webkit-mask-image: radial-gradient(circle at 50% 50%, black 40%, transparent 80%);
}

.glow-spot {
    position: fixed;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, var(--glow) 0%, transparent 70%);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: -2;
    opacity: 0.6;
    pointer-events: none;
}

/* ============================================
   HERO SECTION
   ============================================ */

.hero {
    text-align: center;
    margin-bottom: var(--space-xl);
    animation: fadeIn 1s var(--ease-out);
}

.avatar-wrapper {
    position: relative;
    width: 100px;
    height: 100px;
    margin: 0 auto var(--space-lg);
}

.avatar {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border);
    transition: transform 0.4s var(--ease-out), border-color 0.3s;
    position: relative;
    z-index: 2;
}

.avatar:hover {
    transform: scale(1.05);
    border-color: var(--primary);
}

.avatar-glow {
    position: absolute;
    inset: -10px;
    background: var(--primary);
    filter: blur(20px);
    opacity: 0.2;
    border-radius: 50%;
    z-index: 1;
    animation: pulse 4s ease-in-out infinite;
}

.name {
    font-family: var(--font-display);
    font-size: clamp(3rem, 10vw, 5rem);
    line-height: 1;
    letter-spacing: -0.03em;
    margin-bottom: var(--space-sm);
    color: var(--text-main);
    text-transform: uppercase;
    display: flex;
    justify-content: center;
    gap: 0.2em;
    cursor: default;
}

.name-group {
    display: inline-flex;
    position: relative;
    /* Removed overflow: hidden to prevent clipping */
}

.name-part {
    position: relative;
    z-index: 2;
    transition: color 0.3s var(--ease-out);
}

.name-part.highlight {
    color: var(--primary);
}

.name-hidden {
    display: inline-block;
    max-width: 0;
    opacity: 0;
    transform: translateX(-20px);
    transition: all 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
    color: var(--text-muted);
    white-space: nowrap;
    background: linear-gradient(90deg, var(--text-muted), var(--text-main));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: blur(4px);
    overflow: hidden; /* Keep overflow here for the reveal effect */
    vertical-align: bottom; /* Align with baseline */
}

/* Hover Effect */
.name:hover .name-hidden {
    max-width: 500px; /* Increased to ensure no clipping */
    opacity: 1;
    transform: translateX(0);
    padding-left: 2px;
    filter: blur(0);
    padding-right: 5px; /* Extra space to prevent clipping */
}



.name:hover .name-part.highlight {
    color: var(--accent);
    text-shadow: 0 0 20px var(--glow);
}

/* Mobile: Auto-reveal slightly or keep hidden? 
   Let's keep it hidden but tappable/active state works */
@media (hover: none) {
    .name:active .name-hidden {
        max-width: 400px;
        opacity: 1;
        transform: translateX(0);
        filter: blur(0);
    }
}

.tagline {
    font-size: 0.9rem;
    color: var(--primary-dim);
    margin-bottom: var(--space-lg);
    letter-spacing: 0.05em;
    text-transform: uppercase;
    font-weight: 500;
}

.bracket {
    color: var(--border-hover);
    margin: 0 var(--space-xs);
}

.divider {
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border), transparent);
    margin: var(--space-lg) 0;
}

/* ============================================
   BIO
   ============================================ */

.bio {
    text-align: left;
    margin-bottom: var(--space-xl);
}

.bio-line {
    display: flex;
    gap: var(--space-md);
    margin-bottom: var(--space-sm);
    font-size: 0.95rem;
    color: var(--text-muted);
    transition: color 0.2s;
}

.bio-line:hover {
    color: var(--text-main);
}

.line-number {
    color: var(--border-hover);
    font-size: 0.8rem;
    user-select: none;
    min-width: 24px;
    text-align: right;
}

.text {
    flex: 1;
}

/* ============================================
   BUTTONS
   ============================================ */

.quick-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
    justify-content: center;
    margin-bottom: var(--space-xl);
}

.btn {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-main);
    padding: 10px 20px;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s var(--ease-out);
    text-decoration: none;
    border-radius: 4px;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--primary);
    opacity: 0;
    transition: opacity 0.2s;
    z-index: -1;
}

.btn:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 20px var(--glow);
    color: var(--bg-dark);
}

.btn:hover::before {
    opacity: 1;
}

.btn-secondary {
    border-color: transparent;
    color: var(--text-muted);
}

.btn-secondary:hover {
    background: var(--bg-card-hover);
    color: var(--text-main);
    border-color: var(--border);
}

.btn-secondary:hover::before {
    opacity: 0;
}

/* ============================================
   SECTIONS
   ============================================ */

.section-title {
    font-family: var(--font-display);
    font-size: 1.5rem;
    color: var(--text-main);
    margin-bottom: var(--space-lg);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.section-title::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
    opacity: 0.5;
}

/* ============================================
   CONTACTS GRID
   ============================================ */

.contact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-md);
    margin-bottom: var(--space-xl);
}

.contact-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    padding: var(--space-md);
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.3s var(--ease-out);
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.contact-card:hover {
    border-color: var(--primary-dim);
    background: var(--bg-card-hover);
    transform: translateY(-4px);
}

.contact-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

.contact-value {
    font-size: 0.9rem;
    color: var(--text-main);
    font-weight: 500;
    word-break: normal;
    white-space: nowrap; /* Force single line */
    overflow: hidden;
    text-overflow: ellipsis; /* Graceful degradation */
}

/* ============================================
   EASTER EGG & EXTRAS
   ============================================ */

/* Vibe Coder Mode */
body.vibe-mode {
    animation: vibe-bg 5s infinite alternate;
}

body.vibe-mode .name-part {
    animation: vibe-text 0.5s infinite alternate;
}

@keyframes vibe-bg {
    0% { filter: hue-rotate(0deg); }
    100% { filter: hue-rotate(360deg); }
}

@keyframes vibe-text {
    0% { transform: skewX(0deg); }
    100% { transform: skewX(-10deg); }
}

.interactive-text {
    cursor: pointer;
    position: relative;
    display: inline-block;
    transition: color 0.3s;
    border-bottom: 1px dashed var(--text-muted);
}

.interactive-text:hover {
    color: var(--primary);
    border-bottom-style: solid;
}

/* Glitch Effect */
.glitch-text {
    position: relative;
}

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

.glitch-text::before {
    left: 2px;
    text-shadow: -1px 0 #ff00c1;
    clip: rect(44px, 450px, 56px, 0);
    animation: glitch-anim-1 5s infinite linear alternate-reverse;
    display: none;
}

.glitch-text::after {
    left: -2px;
    text-shadow: -1px 0 #00fff9;
    clip: rect(44px, 450px, 56px, 0);
    animation: glitch-anim-2 5s infinite linear alternate-reverse;
    display: none;
}

.glitch-text:hover::before,
.glitch-text:hover::after {
    display: block;
}

@keyframes glitch-anim-1 {
    0% { clip: rect(30px, 9999px, 10px, 0); }
    20% { clip: rect(50px, 9999px, 80px, 0); }
    40% { clip: rect(10px, 9999px, 90px, 0); }
    60% { clip: rect(80px, 9999px, 20px, 0); }
    80% { clip: rect(40px, 9999px, 60px, 0); }
    100% { clip: rect(60px, 9999px, 30px, 0); }
}

@keyframes glitch-anim-2 {
    0% { clip: rect(60px, 9999px, 30px, 0); }
    20% { clip: rect(40px, 9999px, 60px, 0); }
    40% { clip: rect(80px, 9999px, 20px, 0); }
    60% { clip: rect(10px, 9999px, 90px, 0); }
    80% { clip: rect(50px, 9999px, 80px, 0); }
    100% { clip: rect(30px, 9999px, 10px, 0); }
}

/* Terminal */
.terminal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.terminal-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.terminal-window {
    width: 800px;
    max-width: 90%;
    height: 500px;
    background: #1e1e1e;
    border-radius: 6px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    border: 1px solid #333;
    font-family: 'JetBrains Mono', monospace;
    transform: scale(0.95);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.terminal-overlay.active .terminal-window {
    transform: scale(1);
}

.terminal-header {
    background: #2d2d2d;
    padding: 10px 15px;
    border-top-left-radius: 6px;
    border-top-right-radius: 6px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #333;
}

.terminal-title {
    color: #ccc;
    font-size: 0.8rem;
}

.terminal-close {
    background: none;
    border: none;
    color: #666;
    font-size: 1.2rem;
    cursor: pointer;
    line-height: 1;
}

.terminal-close:hover {
    color: #fff;
}

.terminal-body {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    color: #0f0;
    font-size: 0.9rem;
}

.terminal-line {
    margin-bottom: 5px;
    line-height: 1.4;
}

.terminal-input-line {
    display: flex;
    align-items: center;
}

.prompt {
    color: #00ff00;
    margin-right: 8px;
}

.terminal-input {
    background: transparent;
    border: none;
    color: #fff;
    font-family: inherit;
    font-size: inherit;
    flex: 1;
    outline: none;
}

.easter-egg {
    margin-top: 0;
    padding: 0;
    background: var(--bg-card);
    border: 0 solid var(--border);
    border-radius: 8px;
    text-align: center;
    max-width: 300px;
    margin-left: auto;
    margin-right: auto;
    opacity: 0;
    transform: translateY(20px);
    max-height: 0;
    overflow: hidden;
    transition: all 0.5s var(--ease-out);
}

.easter-egg.revealed {
    opacity: 1;
    transform: translateY(0);
    max-height: 150px;
    margin-top: var(--space-lg);
    margin-bottom: var(--space-lg);
    padding: var(--space-md);
    border-width: 1px;
}

.egg-label {
    display: block;
    font-size: 0.75rem;
    color: var(--primary);
    margin-bottom: var(--space-sm);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.egg-code {
    width: 100%;
    padding: 8px;
    background: var(--bg-dark);
    border: 1px solid var(--border);
    color: var(--text-main);
    font-family: var(--font-mono);
    font-size: 0.85rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    border-radius: 4px;
}

.egg-code:hover {
    border-color: var(--primary);
    box-shadow: 0 0 15px var(--glow);
}

.donate-intro-block {
    text-align: center;
    margin-bottom: var(--space-lg);
}

.donate-intro {
    color: var(--text-muted);
    margin-bottom: var(--space-md);
}

.coffee-counter {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    padding: 8px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 20px;
    transition: all 0.2s;
}

.coffee-counter:hover {
    border-color: var(--primary);
    background: var(--bg-card-hover);
}

.coffee-icon {
    font-size: 1.2rem;
    cursor: pointer;
    transition: transform 0.2s;
    user-select: none;
}

.coffee-icon:hover {
    transform: rotate(-15deg) scale(1.1);
}

.coffee-icon:active {
    transform: rotate(15deg) scale(0.95);
}

.coffee-text {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.coffee-num {
    color: var(--primary);
    font-weight: bold;
}

/* Copied State */
.copied {
    background: var(--primary) !important;
    color: var(--bg-dark) !important;
    border-color: var(--primary) !important;
}

.section-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(10, 5, 15, 0.8);
    backdrop-filter: blur(8px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
    z-index: 100;
}

.section-backdrop.active {
    opacity: 1;
    pointer-events: all;
}

.collapsible-section, .modal-content {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -40%);
    width: 90%;
    max-width: 600px;
    background: var(--bg-dark);
    border: 1px solid var(--border-hover);
    border-radius: 12px;
    padding: 0;
    opacity: 0;
    pointer-events: none;
    transition: all 0.4s var(--ease-out);
    z-index: 101;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
    max-height: 85vh;
    display: flex;
    flex-direction: column;
}

.collapsible-section.active, .modal.active .modal-content {
    opacity: 1;
    pointer-events: all;
    transform: translate(-50%, -50%);
}

.section-header, .modal-header {
    padding: var(--space-lg);
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-card);
    border-radius: 12px 12px 0 0;
}

.section-header .section-title, .modal-header .modal-title {
    margin: 0;
    font-size: 1.2rem;
}

.close-btn, .modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    transition: color 0.2s;
    padding: 0;
    line-height: 1;
}

.close-btn:hover, .modal-close:hover {
    color: var(--primary);
}

.section-content, .projects-list {
    padding: var(--space-lg);
    overflow-y: auto;
}

/* ============================================
   TIMELINE
   ============================================ */

.timeline-item {
    display: grid;
    grid-template-columns: 80px 24px 1fr; /* Year, Space for Dot, Content */
    gap: var(--space-sm);
    margin-bottom: 0;
    position: relative;
    padding-bottom: var(--space-lg);
    align-items: baseline;
}

/* The Line */
.timeline-item::before {
    content: '';
    position: absolute;
    left: 92px; /* 80px + 12px (half of mid col) */
    top: 9px; /* Align with dot center */
    bottom: 0;
    width: 1px;
    background: var(--border);
    transform: translateX(-50%);
}

/* The Dot */
.timeline-item::after {
    content: '';
    position: absolute;
    left: 92px;
    top: 9px; /* Visual center of numbers (approx) */
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--bg-dark);
    border: 2px solid var(--primary-dim);
    transform: translateX(-50%);
    z-index: 1;
    box-shadow: 0 0 10px var(--glow);
}

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

.timeline-item:last-child::before {
    display: none;
}

.timeline-item.highlight::after {
    background: var(--primary);
    border-color: var(--primary);
    box-shadow: 0 0 15px var(--primary);
}

.timeline-item.active::after {
    background: var(--accent);
    border-color: var(--accent);
    animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
    0% { box-shadow: 0 0 0 0 rgba(255, 0, 193, 0.4); }
    70% { box-shadow: 0 0 0 6px rgba(255, 0, 193, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 0, 193, 0); }
}

.year {
    text-align: right;
    font-weight: bold;
    color: var(--primary-dim);
    grid-column: 1;
}

.desc {
    color: var(--text-muted);
    font-size: 0.9rem;
    grid-column: 3;
    margin: 0;
}

/* ============================================
   PROJECTS
   ============================================ */

.project-item {
    display: flex;
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
    padding: var(--space-md);
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg-card);
    transition: all 0.3s var(--ease-out);
}

.project-item:hover {
    border-color: var(--primary-dim);
    transform: translateY(-2px);
}

.project-avatar {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    object-fit: cover;
}

.project-details {
    flex: 1;
}

.project-title {
    font-size: 1.1rem;
    color: var(--text-main);
    margin-bottom: 4px;
}

.project-type {
    font-size: 0.75rem;
    color: var(--primary-dim);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: block;
    margin-bottom: 8px;
}

.project-description {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: var(--space-sm);
}

.project-link-inline {
    font-size: 0.85rem;
    color: var(--text-main);
    text-decoration: none;
    border-bottom: 1px solid var(--primary-dim);
    padding-bottom: 2px;
    transition: all 0.2s;
}

.project-link-inline:hover {
    color: var(--primary);
    border-color: var(--primary);
}

/* ============================================
   ANIMATIONS
   ============================================ */

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

@keyframes pulse {
    0%, 100% { opacity: 0.2; transform: scale(1); }
    50% { opacity: 0.3; transform: scale(1.1); }
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 600px) {
    .container {
        padding: var(--space-lg) var(--space-md);
    }
    
    .name {
        font-size: 2.5rem;
    }
    
    .bio-line {
        font-size: 0.85rem;
    }
    
    .project-item {
        flex-direction: column;
    }
    
    .project-avatar {
        width: 48px;
        height: 48px;
    }
}
