:root {
    --primary: #3b82f6;
    --primary-light: #60a5fa;
    --primary-dark: #2563eb;
    --secondary: #cbd5e1;
    --bg-base: #020617; /* Deepest blue/black */
    --bg-card: rgba(15, 23, 42, 0.7);
    --text-main: #ffffff;
    --text-muted: rgba(255, 255, 255, 0.85); /* Significant boost */
    --glass-border: rgba(255, 255, 255, 0.15);
    --linear-gradient: linear-gradient(135deg, var(--primary), #8b5cf6);
    --font-heading: 'Sora', 'Inter', sans-serif;
    --font-body: 'Inter', system-ui, sans-serif;
    --transition-base: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-base);
    color: var(--text-main);
    font-family: var(--font-body);
    line-height: 1.7;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* Global Contrast Reset */
p, li, span:not(.badge), small {
    color: var(--text-muted) !important;
}

h1, h2, h3, h4, h5, h6 {
    color: var(--text-main) !important;
}

.text-primary {
    color: var(--primary-light) !important;
}

.text-muted {
    color: var(--text-muted) !important;
}

h1, h2, h3, h4, .font-heading {
    font-family: var(--font-heading);
    font-weight: 700;
}

/* Sophisticated Glassmorphism */
.glass-panel {
    background: var(--bg-card);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.8);
    transition: var(--transition-base);
}

.glass-panel:hover {
    border-color: rgba(59, 130, 246, 0.5);
    background: rgba(15, 23, 42, 0.7);
    transform: translateY(-5px);
    box-shadow: 0 12px 40px -5px rgba(59, 130, 246, 0.2);
}

/* Canvas Background */
#canvas-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
    background: radial-gradient(circle at 50% 50%, #111827 0%, #000 100%);
}

/* Modern Navigation */
.nav-enterprise {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 1.5rem 0;
    transition: var(--transition-base);
}

.nav-enterprise.scrolled {
    background: rgba(3, 4, 6, 0.6);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    padding: 0.8rem 0;
    border-bottom: 1px solid var(--glass-border);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
}

.nav-link-custom {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: var(--transition-base);
    position: relative;
}

.nav-link-custom:hover, .nav-link-custom.active {
    color: var(--text-main);
}

/* Primary Button (Enterprise Style) */
.btn-enterprise {
    padding: 0.75rem 2rem;
    background: var(--primary);
    color: white;
    border-radius: 8px;
    border: none;
    font-weight: 600;
    letter-spacing: -0.01em;
    transition: var(--transition-base);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
}

.btn-enterprise:hover {
    background: var(--primary-dark);
    box-shadow: 0 0 30px rgba(59, 130, 246, 0.4);
    transform: scale(1.02);
    color: white;
}

/* Sections */
.section-padding {
    padding: 120px 0;
}

.title-gradient {
    background: linear-gradient(to right, #fff 30%, var(--primary-light));
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .display-2 { font-size: 2.5rem; }
    .section-padding { padding: 60px 0; }
    .nav-enterprise { padding: 1rem 0; background: rgba(10, 10, 10, 0.95); backdrop-filter: blur(10px); }
    .nav-link-custom { font-size: 0.85rem; }
    .btn-enterprise { padding: 0.6rem 1.2rem; font-size: 0.9rem; }
}

/* Cards & Grids */
.grid-stack {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.feature-card {
    padding: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.project-image-container {
    width: 100%;
    height: 220px;
    overflow: hidden;
    position: relative;
    border-bottom: 1px solid var(--glass-border);
}

.project-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.feature-card:hover .project-image {
    transform: scale(1.1);
}

.project-body {
    padding: 2rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

/* Floating Animation */
@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
    100% { transform: translateY(0px); }
}

.animate-float {
    animation: float 4s ease-in-out infinite;
}

/* Staggered Floating */
.projects-grid .col-lg-6:nth-child(2) .animate-float,
.skills-grid .glass-panel:nth-child(even) {
    animation-delay: 1s;
}

.skills-grid .glass-panel:nth-child(3n) {
    animation-delay: 1.5s;
}

.value-card:nth-child(2) { animation-delay: 0.5s; }
.value-card:nth-child(3) { animation-delay: 1s; }
.value-card:nth-child(4) { animation-delay: 1.5s; }

.feature-icon {
    width: 48px;
    height: 48px;
    background: rgba(59, 130, 246, 0.1);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    color: var(--primary);
    font-size: 1.5rem;
}

/* Animations (Reuse but refine) */
.reveal {
    opacity: 1;
    transform: translateY(0);
    transition: all 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Only hide if the data-animate attribute is present (we'll add this via JS) */
[data-animate].reveal {
    opacity: 0;
    transform: translateY(20px);
}

[data-animate].reveal.active {
    opacity: 1;
    transform: translateY(0);
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
  color: var(--bs-secondary-color);
  text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
  text-align: start;
}