/* ========================================
   Dark Premium Design System (Refined)
   ======================================== */

:root {
    /* Colors */
    --bg-dark: #050505;
    --bg-card: rgba(255, 255, 255, 0.03);
    --bg-card-hover: rgba(255, 255, 255, 0.06);
    --border-color: rgba(255, 255, 255, 0.08);

    /* Accents */
    --accent-primary: #3b82f6;
    /* Modern Blue */
    --accent-glow: rgba(59, 130, 246, 0.5);
    --accent-border: #00f0ff;
    /* Bright Cyan for Avatar */

    /* Text - High Contrast for Readability */
    --text-primary: #ffffff;
    --text-secondary: #e5e7eb;
    /* Silver / Gray 200 - Much brighter */
    --text-muted: #d1d5db;
    /* Light Gray / Gray 300 - High contrast */

    /* Fonts */
    --font-main: 'Inter', system-ui, -apple-system, sans-serif;
    --font-code: 'JetBrains Mono', monospace;

    /* Spacing */
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 2rem;
    --spacing-xl: 4rem;

    /* Effects */
    --blur: 12px;
    --radius: 16px;
    --radius-sm: 8px;
    --custom-squircle: 40px;
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    font-family: var(--font-main);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
}

/* Background Noise Texture */
.noise-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 50;
    opacity: 0.05;
    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)'/%3E%3C/svg%3E");
}

/* Background Gradients */
body::before {
    content: '';
    position: fixed;
    top: -50%;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 1000px;
    height: 100%;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.15) 0%, transparent 70%);
    z-index: -1;
    pointer-events: none;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-lg);
}

/* Typography Overrides */
h1,
h2,
h3,
h4 {
    font-weight: 700;
    letter-spacing: -0.02em;
}

.section-title {
    font-size: 2rem;
    margin-bottom: var(--spacing-lg);
    background: linear-gradient(to right, #fff, #e5e7eb);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
}

/* ========================================
   Hero Section
   ======================================== */
.hero-section {
    min-height: 90vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    text-align: center;
}

/* STOCKY HERO MOMENT */
.hero-avatar {
    width: 220px;
    height: 220px;
    border-radius: var(--custom-squircle);
    border: 2px solid var(--accent-border);
    /* Exact Cyan/Teal Glow match */
    box-shadow: 0 0 60px rgba(0, 241, 255, 0.2);
    display: block;
    margin: 0 auto 40px auto;
    object-fit: cover;
    object-position: center 20%;
    transition: var(--transition);
}

.hero-avatar:hover {
    transform: scale(1.05);
    box-shadow: 0 0 60px rgba(0, 240, 255, 0.3);
}

.hero-title {
    font-size: 4.5rem;
    line-height: 1.1;
    margin-bottom: var(--spacing-sm);
    background: linear-gradient(180deg, #ffffff 0%, #e5e7eb 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-subtitle {
    font-size: 1.5rem;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-md);
}

.hero-description {
    font-size: 1.15rem;
    color: var(--text-muted);
    /* Brighter for readability */
    max-width: 600px;
    margin: 0 auto var(--spacing-lg);
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.2);
    padding: 6px 16px;
    /* Increased padding */
    border-radius: 20px;
    font-size: 0.85rem;
    color: #ffffff;
    /* Pure white text */
    font-weight: 500;
    margin-bottom: var(--spacing-md);
}

.status-dot {
    width: 8px;
    height: 8px;
    background-color: var(--accent-primary);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--accent-primary);
}

.cta-group {
    display: flex;
    gap: var(--spacing-md);
    justify-content: center;
}

.cta-button {
    padding: 12px 24px;
    border-radius: var(--radius-sm);
    font-weight: 500;
    text-decoration: none;
    transition: var(--transition);
}

.cta-button.primary {
    background: var(--text-primary);
    color: var(--bg-dark);
}

.cta-button.primary:hover {
    background: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 10px 20px -10px rgba(255, 255, 255, 0.3);
}

.cta-button.secondary {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.cta-button.secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

/* ========================================
   Bento Grid Layout (About)
   ======================================== */
.about-section {
    padding: var(--spacing-xl) 0;
}

.bento-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(2, minmax(180px, auto));
    gap: var(--spacing-md);
}

.bento-item {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: var(--spacing-lg);
    backdrop-filter: blur(var(--blur));
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden;
    position: relative;
}

.bento-item:hover {
    background: var(--bg-card-hover);
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-4px);
}

/* Grid Assignments */
.bio-card {
    grid-column: span 2;
    grid-row: span 2;
}

.edu-card {
    grid-column: span 1;
    grid-row: span 1;
}

.stat-card {
    grid-column: span 1;
    grid-row: span 1;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(139, 92, 246, 0.05));
}

.focus-card {
    grid-column: span 2;
    grid-row: span 1;
}

/* Content */
.bio-card p {
    color: var(--text-secondary);
    margin-bottom: var(--spacing-md);
}

.bio-card strong {
    color: var(--text-primary);
    font-weight: 600;
}

.card-decoration {
    position: absolute;
    bottom: -20px;
    right: -20px;
    font-size: 8rem;
    color: rgba(255, 255, 255, 0.02);
    transform: rotate(-15deg);
}

.edu-card .label,
.edu-card .sub-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.edu-card h4 {
    font-size: 1.5rem;
    margin: 4px 0;
    color: var(--text-primary);
}

.stat-number {
    font-size: 3.5rem;
    font-weight: 800;
    color: var(--accent-primary);
    line-height: 1;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.focus-list {
    list-style: none;
    display: flex;
    gap: var(--spacing-md);
    flex-wrap: wrap;
    margin-top: auto;
}

.focus-list li {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.focus-list i {
    color: var(--accent-primary);
}

/* ========================================
   Skills Section (Tech Cards)
   ======================================== */
.skills-section {
    padding: var(--spacing-xl) 0;
}

/* Fluid Flexbox Layout */
.tech-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
    max-width: 900px;
    margin: 0 auto;
}

.tech-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: var(--spacing-md);
    text-align: center;
    transition: var(--transition);
    /* Fixed size for uniform cards in flex */
    width: 140px;
    height: 110px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

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

.tech-icon {
    font-size: 2rem;
    margin-bottom: var(--spacing-sm);
    color: var(--text-secondary);
    transition: var(--transition);
}

.tech-card:hover .tech-icon {
    color: var(--accent-primary);
    transform: scale(1.1);
}

.tech-name {
    font-size: 0.9rem;
    color: var(--text-primary);
    font-weight: 500;
}

/* ========================================
   Projects Section
   ======================================== */
.projects-section {
    padding: var(--spacing-xl) 0;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--spacing-md);
}

.project-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 0;
    /* Remove padding to let frame touch edges */
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.project-card:hover {
    background: var(--bg-card-hover);
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-4px);
}

/* ==========================================
   WINDOW FRAME EFFECT (macOS-style)
   ========================================== */

/* Container for the entire window frame */
.project-frame {
    width: 100%;
    background: rgba(255, 255, 255, 0.02);
    border-radius: var(--radius) var(--radius) 0 0;
    overflow: hidden;
    /* CRITICAL: Border to separate from dark backgrounds */
    border: 1px solid rgba(255, 255, 255, 0.12);
    /* Separator between frame and content */
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

/* Window titlebar with macOS-style dots */
.window-titlebar {
    background: #2a2a2a;
    /* Slightly lighter than card background */
    padding: 10px 12px;
    display: flex;
    align-items: center;
    /* Subtle border to define titlebar */
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

/* Container for the three dots */
.window-dots {
    display: flex;
    gap: 6px;
}

/* Individual dots (red, yellow, green) */
.window-dots .dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: block;
}

.window-dots .dot.red {
    background: #ff5f57;
}

.window-dots .dot.yellow {
    background: #febc2e;
}

.window-dots .dot.green {
    background: #28c840;
}

/* Project Images (inside the frame) */
.project-image {
    width: 100%;
    height: 150px;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.4);
    /* Darker background for contrast */
    display: flex;
    align-items: center;
    justify-content: center;
}

.project-image img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    transition: var(--transition);
}

/* Hover effect: zoom image inside frame */
.project-card:hover .project-image img {
    transform: scale(1.05);
}

/* ==========================================
   PROJECT CONTENT (below the frame)
   ========================================== */

.project-content {
    padding: var(--spacing-lg);
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    /* SPACING: Increased top margin for breathing room */
    margin-top: 1.5rem;
}

.project-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: var(--spacing-md);
    font-size: 1.25rem;
}

.folder-icon {
    color: var(--accent-primary);
}

.github-link {
    color: var(--text-secondary);
    transition: var(--transition);
}

.github-link:hover {
    color: var(--text-primary);
}

/* ==========================================
   TYPOGRAPHY HIERARCHY (Critical Fix)
   ========================================== */

/* Project Title - PURE WHITE for dominance */
.project-card h3 {
    color: #ffffff;
    /* Pure white */
    font-weight: 600;
    margin-bottom: 12px;
    /* Increased spacing */
    transition: var(--transition);
}

/* Hover effect: title changes to accent color */
.project-card:hover h3 {
    color: var(--accent-primary);
}

/* Project Description - SILVER GRAY for hierarchy */
.project-card p {
    color: #a1a1aa;
    /* Silver gray - clearly secondary */
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: var(--spacing-lg);
    flex-grow: 1;
}

.tags {
    display: flex;
    gap: 8px;
}

.tags span {
    font-family: var(--font-code);
    font-size: 0.75rem;
    background: rgba(255, 255, 255, 0.08);
    padding: 6px 10px;
    border-radius: 4px;
    color: #e5e7eb;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* ==========================================
   MAINTENANCE MODE (AGGRESSIVE OVERLAY)
   ========================================== */

.project-card.maintenance {
    position: relative;
    opacity: 0.8;
    filter: grayscale(60%);
    pointer-events: none;
    /* Disable all interactions */
}

/* Disable hover effects for maintenance cards */
.project-card.maintenance:hover {
    transform: none;
    border-color: var(--border-color);
}

.project-card.maintenance:hover h3 {
    color: inherit;
    /* No color change */
}

.project-card.maintenance:hover .project-image img {
    transform: none;
    /* No zoom */
}

/* AGGRESSIVE OVERLAY - 95% opacity */
.maintenance-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    /* Increased to 95% - almost black */
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    border-radius: var(--radius);
}

/* Centered badge - "exploding" from darkness */
.maintenance-badge {
    background: rgba(255, 165, 0, 0.3);
    border: 2px solid #ffa500;
    padding: 14px 24px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    gap: 12px;
    color: #ffa500;
    font-weight: 600;
    font-size: 0.95rem;
    box-shadow: 0 4px 16px rgba(255, 165, 0, 0.4);
}

.maintenance-badge i {
    font-size: 1.3rem;
}

/* ========================================
   Contact Section (GUI Window)
   ======================================== */
.contact-section {
    padding: var(--spacing-xl) 0;
}

.contact-wrapper {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: var(--spacing-lg);
}

.gui-window {
    background: #0f0f11;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.5);
}

.window-header {
    background: rgba(255, 255, 255, 0.03);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
}

.window-control {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.window-controls {
    display: flex;
    gap: 8px;
}

.control {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.control.red {
    background: #ff5f57;
}

.control.yellow {
    background: #febc2e;
}

.control.green {
    background: #28c840;
}

.window-title {
    flex-grow: 1;
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-muted);
    font-family: var(--font-main);
    margin-right: 52px;
}

.window-body {
    padding: var(--spacing-lg);
}

.form-group {
    margin-bottom: var(--spacing-md);
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.form-row {
    display: flex;
    gap: var(--spacing-md);
}

.form-row .form-group {
    flex: 1;
}

/* Input Styling */
input,
select,
textarea {
    width: 100%;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    font-family: var(--font-main);
    transition: var(--transition);
}

/* Dropdown Option Fix */
select option {
    background-color: #1a1a1a !important;
    color: #ffffff !important;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--accent-primary);
    background: rgba(255, 255, 255, 0.05);
}

/* Placeholder Styling - High Contrast */
input::placeholder,
textarea::placeholder {
    color: #a1a1aa;
    /* Light Gray */
    opacity: 1;
    /* Firefox fix */
    font-style: italic;
    /* UX Improvement */
}

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

.textarea-footer {
    display: flex;
    justify-content: flex-end;
    margin-top: 4px;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.form-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: var(--spacing-md);
}

.status-display {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.status-dot.ready {
    background: #28c840;
}

.gui-submit {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-family: var(--font-code);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition);
}

.gui-submit:hover {
    border-color: var(--accent-primary);
    background: rgba(59, 130, 246, 0.1);
    color: var(--accent-primary);
}

/* Social Links */
.social-links-minimal {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 60px;
}

.social-pill {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    text-decoration: none;
    transition: var(--transition);
}

.social-pill:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
    border-color: rgba(255, 255, 255, 0.2);
}

/* Footer UPDATED padding */
.footer {
    padding: var(--spacing-lg) 0 60px 0;
    /* 60px bottom padding */
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
    border-top: 1px solid var(--border-color);
    margin-top: var(--spacing-xl);
}

/* Responsive */
@media (max-width: 900px) {
    .bento-grid {
        display: flex;
        flex-direction: column;
    }

    .contact-wrapper {
        grid-template-columns: 1fr;
    }

    .social-links-minimal {
        margin-top: 0;
        flex-direction: row;
        justify-content: center;
    }

    .hero-title {
        font-size: 3rem;
    }

    /* Mobile Grid Fix - No longer needed for Flex, but can keep for container width adjustments if any */
}

@media (max-width: 480px) {
    /* Avatar resize for minimal screens */

    .hero-avatar {
        width: 120px;
        height: 120px;
    }
}