:root {
    --bg-color: #f8f9fa;
    --card-bg: rgba(255, 255, 255, 0.7);
    --text-color: #1a1e21;
    --primary-color: #2d3436;
    --secondary-color: #636e72;
    --accent-color: #0984e3;
    --accent-glow: rgba(9, 132, 227, 0.4);
    --font-main: 'Inter', system-ui, -apple-system, sans-serif;
    --spacing-unit: 1.5rem;
    --radius-md: 12px;
    --radius-lg: 24px;
    --shadow-sm: 0 4px 6px rgba(0, 0, 0, 0.03);
    --shadow-md: 0 20px 40px rgba(0, 0, 0, 0.06);
    --transition-smooth: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    --transition-fast: all 0.3s ease;
}

@keyframes revealFadeIn {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

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

@keyframes glowPulse {
    0% {
        box-shadow: 0 0 5px var(--accent-glow);
    }

    50% {
        box-shadow: 0 0 20px var(--accent-glow);
    }

    100% {
        box-shadow: 0 0 5px var(--accent-glow);
    }
}

.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: var(--transition-smooth);
}

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

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-color);
    background-image:
        radial-gradient(circle at 2px 2px, rgba(0, 0, 0, 0.03) 1px, transparent 0);
    background-size: 40px 40px;
    color: var(--text-color);
    line-height: 1.7;
    font-size: 16px;
    overflow-x: hidden;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Header with Glassmorphism */
.header {
    padding: 1.2rem 0;
    position: fixed;
    width: 100%;
    z-index: 1000;
    top: 0;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
    transition: var(--transition-smooth);
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.logo-img {
    height: 45px;
    width: auto;
    display: block;
}

.nav-list {
    list-style: none;
    display: flex;
    gap: 2.5rem;
    align-items: center;
}

.nav-list a {
    text-decoration: none;
    color: var(--primary-color);
    font-weight: 500;
    font-size: 0.95rem;
    transition: var(--transition);
    opacity: 0.8;
}

.nav-list a:hover {
    opacity: 1;
    color: var(--accent-color);
}

.lang-form select {
    background: transparent;
    border: 1px solid rgba(0, 0, 0, 0.1);
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    font-family: inherit;
    font-size: 0.85rem;
    cursor: pointer;
    transition: var(--transition);
}

.lang-form select:hover {
    border-color: var(--accent-color);
}

/* Hero Section */
.hero {
    min-height: 85vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    background: radial-gradient(circle at top right, #eef2f3 0%, #ffffff 100%);
    padding-top: 80px;
    /* Offset for fixed header */
}

.hero h1,
.tw-item {
    min-height: 1.1em;
    white-space: pre-wrap;
    /* Preserve spaces during typing */
}

.hero h1 {
    font-size: 5rem;
    line-height: 1.1;
    font-weight: 800;
    margin-bottom: 1.5rem;
    color: var(--primary-color);
    letter-spacing: -2px;
    background: linear-gradient(to right, #2d3436, #636e72);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
}

.typewriter-cursor {
    display: inline-block;
    width: 3px;
    background-color: var(--accent-color);
    margin-left: 6px;
    animation: blink 1s step-end infinite;
    height: 1.1em;
    vertical-align: middle;
    position: relative;
    top: -0.05em;
}

@keyframes blink {

    from,
    to {
        background-color: transparent;
    }

    50% {
        background-color: var(--accent-color);
    }
}

/* Ghost Phrases Effect */
#ghost-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 100;
    /* Above backgrounds, below interactive headers if needed */
    overflow: hidden;
}

.ghost-phrase {
    position: absolute;
    color: var(--secondary-color);
    font-size: 1.2rem;
    font-weight: 500;
    opacity: 0;
    white-space: nowrap;
    animation: ghostFade 10s ease-in-out forwards;
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.8);
    /* Glow for better visibility */
}

@keyframes ghostFade {
    0% {
        opacity: 0;
        transform: translateY(20px) scale(0.9);
    }

    20% {
        opacity: 0.4;
        /* Increased from 0.15 */
        transform: translateY(0) scale(1);
    }

    80% {
        opacity: 0.4;
        /* Increased from 0.15 */
        transform: translateY(-30px) scale(1.05);
    }

    100% {
        opacity: 0;
        transform: translateY(-60px) scale(1.1);
    }
}

.hero p {
    font-size: 1.25rem;
    color: var(--secondary-color);
    max-width: 600px;
    margin: 0 auto;
}

.hero .subtitle {
    margin-top: 0.5rem;
    font-weight: 500;
}

/* Section Headings */
section h2 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 3rem;
    text-align: center;
    letter-spacing: -1px;
}

/* Projects Grid */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 3rem;
    margin-bottom: 6rem;
}

.project-card {
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    background: var(--card-bg);
    border: 1px solid rgba(0, 0, 0, 0.03);
    display: flex;
    flex-direction: column;
}

.project-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-md);
}

.project-card a {
    display: block;
    overflow: hidden;
}

.project-card img,
.project-card video {
    width: 100%;
    height: 250px;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.project-card:hover img {
    transform: scale(1.05);
}

.project-info {
    padding: 2rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.project-title {
    margin-bottom: 0.75rem;
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.project-desc {
    color: var(--secondary-color);
    font-size: 1rem;
    margin-bottom: 1.5rem;
    flex-grow: 1;
}

.btn {
    display: inline-block;
    padding: 0.9rem 2rem;
    background-color: var(--primary-color);
    color: white;
    text-decoration: none;
    border-radius: 100px;
    font-size: 0.95rem;
    font-weight: 600;
    transition: var(--transition-smooth);
    text-align: center;
    align-self: start;
    border: none;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.btn:hover {
    background-color: var(--accent-color);
    transform: translateY(-4px);
    box-shadow: 0 10px 20px var(--accent-glow);
}

.btn:active {
    transform: translateY(-1px);
}

/* Project Detail */
.project-detail-header {
    margin-top: 10rem;
    margin-bottom: 4rem;
    text-align: center;
}

.project-detail-header h1 {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 1rem;
    letter-spacing: -1.5px;
}

.meta {
    font-size: 1.1rem;
    color: var(--secondary-color);
    display: flex;
    justify-content: center;
    gap: 2rem;
}

.project-gallery {
    margin-bottom: 5rem;
}

.slider-container {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    aspect-ratio: 16/9;
}

.slider-track {
    display: flex;
    transition: transform 0.5s ease-in-out;
}

.slide {
    min-width: 100%;
}

.presentation-mode .slide {
    height: auto;
    aspect-ratio: 16/9;
    background: #000;
}

.slide img,
.slide video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    /* Better for details */
    background: #000;
}

/* Controls */
.slider-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.9);
    border: none;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.5rem;
    z-index: 2;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.slider-btn:hover {
    background: white;
    transform: translateY(-50%) scale(1.1);
}

.prev-btn {
    left: 30px;
}

.next-btn {
    right: 30px;
}

/* Content Reading Area */
.content {
    max-width: 800px;
    margin: 0 auto;
    font-size: 1.2rem;
    line-height: 1.8;
}

.content p {
    margin-bottom: 1.5rem;
}

/* Footer */
.footer {
    padding: 4rem 0;
    text-align: center;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    color: var(--secondary-color);
    margin-top: 6rem;
}

.footer .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Forms */
.form-control {
    width: 100%;
    padding: 0.8rem 1rem;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-family: inherit;
    font-size: 1rem;
    transition: var(--transition);
    background: #f9f9f9;
}

.form-control:focus {
    outline: none;
    border-color: var(--accent-color);
    background: white;
    box-shadow: 0 0 0 3px rgba(9, 132, 227, 0.1);
}