/* 
 * Geometric Precision Theme 
 * Designed for Mansour Alotaibi
 */

:root {
    /* Colors - Light Mode (Default) */
    --bg-body: #FFFFFF;
    --bg-surface: #FAFAFA;
    --bg-card: #FFFFFF;
    --text-primary: #18181B;
    /* Zinc-900 */
    --text-secondary: #52525B;
    /* Zinc-600 */
    --text-muted: #A1A1AA;
    /* Zinc-400 */
    --accent: #2563EB;
    /* Royal Blue */
    --accent-hover: #1D4ED8;
    --border: #E4E4E7;
    /* Zinc-200 */
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    --shadow-hover: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.025);

    /* Spacing & Layout */
    --container-width: 1100px;
    --header-height: 80px;
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 1rem;

    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-smooth: 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] {
    /* Colors - Dark Mode */
    --bg-body: #09090B;
    /* Zinc-950 */
    --bg-surface: #121417;
    /* Slightly lighter surface for contrast */
    --bg-card: #18181B;
    /* Zinc-900 */
    --text-primary: #FAFAFA;
    /* Zinc-50 */
    --text-secondary: #A1A1AA;
    /* Zinc-400 */
    --text-muted: #71717A;
    /* Zinc-500 */
    --accent: #38BDF8;
    /* Sky-400 */
    --accent-hover: #0EA5E9;
    --border: #3F3F46;
    /* Zinc-700 - Brightened from Zinc-800 for better visibility */
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
    --shadow-hover: 0 20px 25px -5px rgba(0, 0, 0, 0.5), 0 8px 10px -6px rgba(0, 0, 0, 0.3);
}

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

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    background-color: var(--bg-body);
    color: var(--text-primary);
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    transition: background-color var(--transition-smooth), color var(--transition-smooth);
}

img {
    max-width: 100%;
    display: block;
}

a {
    color: inherit;
    text-decoration: none;
    transition: color var(--transition-fast);
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.025em;
    color: var(--text-primary);
}

p {
    color: var(--text-secondary);
    max-width: 70ch;
    /* Reading limit for better UX */
}

.mono {
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
}

/* Utilities */
.container {
    width: 100%;
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 1.5rem;
}

.section {
    padding: 6rem 0;
    /* Breathable vertical spacing */
}

/* Premium Button Styles */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.75rem;
    /* Wider buttons */
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.95rem;
    transition: all var(--transition-fast);
    cursor: pointer;
    gap: 0.5rem;
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background-color: var(--accent);
    color: white;
    box-shadow: 0 4px 6px -1px rgba(37, 99, 235, 0.2);
    /* Colored shadow */
}

.btn-primary:hover {
    background-color: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(37, 99, 235, 0.3);
}

.btn-outline {
    border: 1px solid var(--border);
    background-color: transparent;
    color: var(--text-primary);
}

.btn-outline:hover {
    border-color: var(--text-primary);
    background-color: var(--bg-surface);
}

/* Header */
.site-header {
    height: var(--header-height);
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: rgba(var(--bg-body), 0.8);
    /* Placeholder for JS rgba conversion or just use solid for now */
    background-color: var(--bg-body);
    /* Solid for simplicity */
    border-bottom: 1px solid var(--border);
    z-index: 100;
    display: flex;
    align-items: center;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 1.5rem;
}

.logo {
    font-weight: 800;
    font-size: 1.25rem;
    letter-spacing: -0.05em;
}

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

.nav-link {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.nav-link:hover {
    color: var(--accent);
}

#theme-toggle {
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--radius-sm);
    transition: background-color var(--transition-fast);
}

#theme-toggle:hover {
    background-color: var(--bg-surface);
}

/* Profile Section (Unified) */
.profile-section {
    min-height: 90vh;
    /* Takes most of the viewport */
    display: flex;
    align-items: center;
    padding-top: calc(var(--header-height) + 2rem);
    padding-bottom: 4rem;
}

.profile-grid {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 4rem;
    align-items: center;
}

.profile-avatar-wrapper {
    position: relative;
    width: 250px;
    margin: 0 auto;
}

.profile-image {
    width: 250px;
    height: 250px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid var(--bg-surface);
    box-shadow: var(--shadow-hover);
    transition: transform var(--transition-smooth);
}

.status-badge {
    position: absolute;
    bottom: 25px;
    right: 25px;
    width: 25px;
    height: 25px;
    background-color: #22c55e;
    border: 4px solid var(--bg-body);
    border-radius: 50%;
}

.accent-text {
    color: var(--accent);
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    display: block;
}

.profile-name {
    font-size: clamp(2.5rem, 5vw, 3.8rem);
    margin-bottom: 1rem;
    line-height: 1.1;
}

.profile-lead {
    font-size: 1.25rem;
    color: var(--text-primary);
    font-weight: 500;
    margin-bottom: 1.5rem;
}

.profile-bio {
    color: var(--text-secondary);
    margin-bottom: 2.5rem;
    max-width: 650px;
    line-height: 1.7;
}

.profile-bio p {
    margin-bottom: 1rem;
}

.hero-actions {
    display: flex;
    gap: 1rem;
}

/* Skill Grouping (Tiered Layout) */
.skills-grid {
    /* Fallback for older browsers if core/foundation grids not used directly */
    display: grid;
    gap: 2rem;
}

.tier-label {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    margin-bottom: 2rem;
    border-left: 3px solid var(--accent);
    padding-left: 1rem;
}

/* Core Grid (Top Tier - 3 Columns) */
.core-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
}

/* Foundation Grid (Bottom Tier - 2 Columns) */
.foundation-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    /* Explicit 2-col for desktop */
    gap: 2rem;
    max-width: 900px;
    /* Constrain width for better centered look */
}

/* Card Differences */
.skill-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    padding: 2.5rem;
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
    display: flex;
    flex-direction: column;
}

.skill-card:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.core-card {
    border-top: 4px solid var(--accent);
    /* Visual emphasis on Core */
}

.foundation-card {
    border-top: 4px solid var(--border);
    /* Visual distinction for Foundation */
    background-color: var(--bg-surface);
    /* Subtle shift */
}

.skill-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.skill-header h3 {
    margin-bottom: 0;
    font-size: 1.1rem;
}

.skill-icon {
    font-size: 1.5rem;
    color: var(--accent);
}

.skill-desc {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
    line-height: 1.5;
    min-height: 3rem;
    /* Align chips */
}

/* --- NEW STRUCTURE: Tech Groups --- */

/* Container for groups */
.skill-content {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    /* Space between groups */
}

.tech-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* Title for each group (Web Languages, Frameworks, etc.) */
.tech-title {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.tech-group p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin: 0;
}

/* Muted group for Legacy */
.tech-group.muted .tech-title,
.tech-group.muted p {
    color: var(--text-muted);
}

/* Tech Chips (Used inside tech-group) */
.tech-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tech-tag {
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    font-size: 0.8rem;
    color: var(--text-primary);
    background-color: var(--bg-surface);
    border: 1px solid var(--border);
    padding: 0.3rem 0.6rem;
    border-radius: 4px;
    transition: all var(--transition-fast);
    cursor: default;
}

.tech-tag.primary {
    background-color: var(--bg-body);
    /* Contrast against surface if needed */
    border-color: var(--border);
    /* Clean border */
    font-weight: 500;
}

.tech-tag:hover {
    border-color: var(--accent);
    color: var(--accent);
}

/* Footer */
.site-footer {
    padding: 3rem 0;
    border-top: 1px solid var(--border);
    margin-top: 4rem;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Mobile Menu & Responsive Refinements */
.nav-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.mobile-menu-btn {
    display: none;
    /* Hidden on desktop */
    background: none;
    border: none;
    font-size: 1.25rem;
    color: var(--text-primary);
    cursor: pointer;
    padding: 0.5rem;
}

.mobile-menu {
    position: fixed;
    top: var(--header-height);
    left: 0;
    width: 100%;
    height: calc(100vh - var(--header-height));
    background-color: var(--bg-body);
    padding: 2rem;
    transform: translateX(100%);
    /* Hidden by default */
    transition: transform var(--transition-smooth);
    z-index: 99;
    border-top: 1px solid var(--border);
}

.mobile-menu.active {
    transform: translateX(0);
}

.mobile-nav-links {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    font-size: 1.25rem;
    font-weight: 600;
}

.mobile-nav-link {
    color: var(--text-primary);
    padding: 1rem 0;
    border-bottom: 1px solid var(--border);
}

/* Responsive Breakpoints */
@media (max-width: 900px) {
    .section {
        padding: 4rem 0;
        /* Reduced from 6rem */
    }

    .profile-grid {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 2.5rem;
    }

    .profile-avatar-wrapper {
        width: 200px;
        /* Slightly smaller on tablet/mobile */
        margin: 0 auto;
    }

    .profile-image {
        width: 200px;
        height: 200px;
    }

    .hero-actions {
        justify-content: center;
    }

    .profile-bio {
        margin: 0 auto 2.5rem;
    }

    .foundation-grid {
        grid-template-columns: 1fr;
        max-width: 100%;
    }
}

@media (max-width: 768px) {
    .nav-links {
        display: none;
        /* Hide desktop nav */
    }

    .mobile-menu-btn {
        display: block;
        /* Show hamburger */
    }

    .profile-name {
        font-size: 2.5rem;
        /* Better scaling */
    }

    .nav-container {
        padding: 0 1.25rem;
        /* Align with container */
    }

    .container {
        padding: 0 1.25rem;
    }
}

/* Spacing refinement for consolidated groups */
.tech-group>.tech-title:not(:first-child) {
    margin-top: 1rem;
}

/* Social Media Revamp */
.social-links-container {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 2rem;
}

.social-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-primary);
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    font-weight: 600;
}

.social-btn i {
    font-size: 1.2rem;
    transition: transform 0.2s ease;
}

.social-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-color: transparent;
}

.social-btn:hover i {
    transform: scale(1.1);
}

/* Brand Colors */
.btn-x:hover {
    background-color: #000000;
    color: #FFFFFF;
}

[data-theme="dark"] .btn-x:hover {
    background-color: #FFFFFF;
    color: #000000;
}

.btn-linkedin:hover {
    background-color: #0077b5;
    color: #FFFFFF;
}

.btn-github:hover {
    background-color: #333333;
    color: #FFFFFF;
}

[data-theme="dark"] .btn-github:hover {
    background-color: #f0f6fc;
    color: #24292f;
}