@font-face {
    font-family: "Hk Grotesk";
    font-style: normal;
    font-weight: 400;
    src: url("../fonts/HKGrotesk-Regular.woff") format("woff");
    font-display: swap;
}

@font-face {
    font-family: "Roboto";
    font-style: normal;
    font-weight: 400;
    src: url("../fonts/Roboto-Black.ttf") format("woff");
    font-display: swap;
}

:root {
    /* Colors - Apple-esque Dark Mode */
    --bg-color: #000000;
    --text-main: #ffffff;
    /* Pure white for max contrast */
    --text-secondary: #d1d1d6;
    /* Much brighter secondary text */
    --accent-color: #2997ff;
    /* Apple blue */

    /* Glassmorphism - Switch to Dark Glass */
    --glass-bg: rgba(0, 0, 0, 0.8);
    --glass-panel: rgba(0, 0, 0, 0);
    /* Transparent for cleaner look */
    --glass-border: rgba(255, 255, 255, 0.15);
    --glass-blur: 25px;

    /* Spacing */
    --section-spacing: 120px;
    --container-width: 980px;
    /* Apple tends to use narrower, focused containers */

    /* Typography */
    --font-heading: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
    --font-body: "Hk Grotesk", -apple-system, BlinkMacSystemFont, sans-serif;

    /* Animation */
    --transition-fast: 0.3s cubic-bezier(0.25, 0.1, 0.25, 1);
    --transition-smooth: 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

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

html {
    font-size: 62.5%;
    /* 1rem = 10px */
    scroll-padding-top: 120px;
    /* Offset for fixed header */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-body);
    font-size: 1.7rem;
    /* Apple uses legible, slightly larger body text */
    line-height: 1.5;
    background-color: var(--bg-color);
    color: var(--text-main);
    overflow-x: hidden;
}

/* Base Styles */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-heading);
    color: var(--text-main);
    font-weight: 600;
    letter-spacing: -0.02em;
    /* Tight tracking for that premium look */
}

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

ul {
    list-style: none;
}

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

/* Utilities */
.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 20px;
}

.glass-panel {
    background: var(--glass-panel);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    /* Restored rounded corners */
    /* Smooth corners */
    /* Hardware acceleration for glass */
    transform: translateZ(0);
    backface-visibility: hidden;
    will-change: backdrop-filter;
}

/* Background Handling */
.background-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    z-index: -1;
    overflow: hidden;
}

.background-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.4;
    /* Darker background for better text visibility */
    filter: blur(20px);
    /* Default state optional, leaving clear for finding it */
    transform: translateZ(0);
    /* Promote to layer */
    will-change: opacity;
}

/* Component Styles */

/* Navigation */
.nav-container {
    position: fixed;
    top: 0;
    left: 0;
    transform: none;
    width: 100%;
    max-width: none;
    z-index: 1000;
    padding: 15px 0;
    border-radius: 0;
    /* Full width means no corners */
    border: none;
    border-bottom: 1px solid var(--glass-border);
    /* Performance fixes for glassmorphism */
    -webkit-transform: translate3d(0, 0, 0);
    transform: translate3d(0, 0, 0);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    perspective: 1000px;
    will-change: transform, backdrop-filter;
}

.nav-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    /* Add internal padding since container width is 100% */
    max-width: var(--container-width);
    margin: 0 auto;
}

.nav-logo {
    font-size: 2rem;
    font-weight: 800;
    /* Bolder */
    color: var(--text-main);
    letter-spacing: -0.05em;
}

.nav-items {
    display: flex;
    gap: 30px;
}

.nav-link {
    color: var(--text-secondary);
    font-size: 1.5rem;
    font-weight: 500;
    position: relative;
    transition: color 0.4s ease;
}

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

/* Hero Section */
.hero-section {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    /* Removed padding-top to allow true centering */
}

.hero-title {
    font-size: 8rem;
    font-weight: 800;
    /* Bolder */
    margin-bottom: 20px;
    background: linear-gradient(135deg, #fff 0%, #a5a5a5 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.03em;
}

.hero-subtitle {
    font-size: 2.4rem;
    color: var(--text-secondary);
    margin-bottom: 40px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* Sections */
.section {
    padding: var(--section-spacing) 0;
}

.section-title {
    font-size: 4rem;
    margin-bottom: 60px;
    text-align: center;
}

/* Projects Grid */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 30px;
}

.project-logo {
    width: 120px;
    height: 120px;
    border-radius: 30px;
    border: 1px solid var(--glass-border);
    background: var(--glass-panel);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    margin-bottom: 20px;
    transform: translateZ(0);
}

.project-card {
    padding: 40px;
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    /* Removed bg transition for instant spotlight */
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
    position: relative;
    border-radius: 20px;
    /* Rounded corners */
    background: var(--glass-panel);
    /* Transparent base */
    will-change: transform, box-shadow;
    transform: translateZ(0);
}

.project-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(800px circle at var(--mouse-x) var(--mouse-y),
            rgba(255, 255, 255, 0.1),
            transparent 40%);
    opacity: 0;
    transition: opacity 0.5s ease;
    z-index: -1;
    /* Behind content */
    pointer-events: none;
}

.project-card:hover::before {
    opacity: 1;
}

.project-card:hover {
    transform: translateY(-5px);
    /* Just lift, no scale */
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
    border-color: rgba(255, 255, 255, 0.2);
}

.project-content {
    margin-bottom: 30px;
}

.project-content h3 {
    font-size: 2.8rem;
    margin-bottom: 15px;
}

.feature-list {
    margin: 20px 0;
    padding-left: 0;
}

.feature-list li {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    color: var(--text-secondary);
}

.project-links {
    margin-top: 20px;
    display: flex;
    gap: 20px;
}

.link-text {
    font-weight: 600;
    font-size: 1.5rem;
}

.project-image-wrapper {
    margin-top: auto;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.project-img {
    width: 100%;
    transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.project-card:hover .project-img {
    /* No scale */
    transform: none;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 30px;
    border-radius: 99px;
    /* Pill shape */
    font-weight: 500;
    font-size: 1.6rem;
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.5s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.5s ease, color 0.5s ease;
    transform: translateZ(0);
    /* Hardware acceleration */
    backface-visibility: hidden;
}

.btn-primary {
    background: var(--text-main);
    color: var(--bg-color);
}

.btn-primary:hover {
    background: #ffffff;
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.3);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    color: var(--text-main);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.1);
}

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

.btn-outline:hover {
    border-color: var(--text-main);
    color: var(--text-main);
}

/* About & Contact Cards */
.about-card,
.contact-card {
    padding: 50px;
    display: flex;
    align-items: center;
    gap: 50px;
}

.contact-card {
    flex-direction: column;
    text-align: center;
    max-width: 600px;
    margin: 0 auto;
}

.about-text {
    flex: 1;
}

.about-text p {
    margin-bottom: 30px;
}

.about-image-wrapper {
    flex: 1;
    max-width: 300px;
}

.about-photo {
    border-radius: 20px;
}

/* Footer */
.footer {
    padding: 50px 0;
    text-align: center;
    color: var(--text-secondary);
    border-top: 1px solid var(--glass-border);
    background: var(--glass-panel);
    backdrop-filter: blur(20px);
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-bottom: 30px;
}

.social-links img {
    height: 24px;
    opacity: 0.7;
    transition: opacity 0.4s ease, transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.social-links a:hover img {
    opacity: 1;
    transform: scale(1.2);
    /* Adding a subtle pop */
}

/* Emoji */
.emoji {
    height: 1.25em;
    width: 1.25em;
    margin: 0 0.15em;
    vertical-align: -0.2em;
    display: inline-block;
}

/* Utilities */
/* Premium Onload Animation */
.hero-reveal {
    animation: heroReveal 1.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    opacity: 0;
    transform: scale(1.1);
    filter: blur(10px);
    will-change: transform, opacity, filter;
}

@keyframes heroReveal {
    to {
        opacity: 1;
        transform: scale(1) translate3d(0, 0, 0);
        filter: blur(0);
    }
}

.delay-1 {
    animation-delay: 0.2s;
}

.delay-2 {
    animation-delay: 0.4s;
}

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

/* Animation Utilities */
.hidden-on-load {
    opacity: 0;
    transform: translateY(40px);
    /* Slightly more distance for dramatic effect */
    transition: opacity 1.2s ease-out, transform 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Add stagger delays for grid items if needed */
.project-card:nth-child(2) {
    transition-delay: 0.1s;
}

/* Responsive */
@media (max-width: 768px) {
    :root {
        --section-spacing: 60px;
        /* Reduce spacing by half */
        --font-size-huge: 4.5rem;
    }

    .nav-container {
        width: 100%;
        top: 0;
        left: 0;
        transform: none;
        max-width: none;
        border-radius: 0;
        border-top: none;
        border-left: none;
        border-right: none;
        padding: 15px 20px;
    }

    .nav-content {
        padding: 0;
    }

    .nav-items {
        gap: 15px;
        /* Tighter gap for mobile */
    }

    .hero-section {
        padding-top: 100px;
        /* More space for stacked nav */
    }

    .hero-title {
        font-size: 4.5rem;
        line-height: 1.1;
    }

    .projects-grid {
        grid-template-columns: 1fr;
        /* Force single column */
    }

    .project-card {
        padding: 30px;
        text-align: center;
        align-items: center;
    }

    .feature-list li {
        justify-content: center;
    }

    .project-links {
        justify-content: center;
    }

    .about-card,
    .contact-card {
        flex-direction: column-reverse;
        text-align: center;
        padding: 30px;
        gap: 30px;
    }

    .about-image-wrapper,
    .about-text {
        width: 100%;
        max-width: none;
    }

    .contact-card {
        flex-direction: column;
    }

    .footer {
        padding: 40px 0;
    }
}

@media (max-width: 400px) {
    .hero-title {
        font-size: 3.5rem;
    }

    .project-card {
        padding: 20px;
    }

    .btn {
        padding: 10px 20px;
        font-size: 1.4rem;
        width: 100%;
        /* Full width buttons on tiny screens */
    }
}

/* Form Styles for CEB */
input[type="text"] {
    width: 100%;
    padding: 15px 20px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    color: var(--text-main);
    font-family: var(--font-body);
    font-size: 1.6rem;
    outline: none;
    transition: var(--transition-fast);
}

input[type="text"]:focus {
    background: rgba(255, 255, 255, 0.15);
    border-color: var(--accent-color);
    box-shadow: 0 0 0 4px rgba(41, 151, 255, 0.1);
}

.form-label {
    font-size: 1.6rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-right: 10px;
}

code {
    display: block;
    background: rgba(0, 0, 0, 0.3);
    padding: 20px;
    border-radius: 12px;
    color: var(--accent-color);
    font-family: monospace;
    font-size: 1.6rem;
    margin-top: 20px;
    border: 1px solid var(--glass-border);
}

table {
    width: 100%;
    border-collapse: collapse;
}

td {
    padding: 10px 0;
    vertical-align: middle;
}

/* Back to Top Button */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: var(--glass-panel);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-main);
    cursor: pointer;
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.1);
}

.back-to-top svg {
    width: 20px;
    height: 20px;
}