/* Global Reset & Variables */
:root {
    --bg-color: #0A1128;
    --bg-secondary: #152238;
    --text-primary: #EAEAEA;
    --text-heading: #FFFFFF;
    --accent-color: #00BFFF;
    --accent-hover: #009ACD;

    /* New Premium Assets */
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
    --neon-glow: 0 0 15px rgba(0, 191, 255, 0.4);

    --font-main: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-code: 'D2Coding', 'Fira Code', monospace;

    --container-width: 1200px;
    --spacing-section: 120px;
    --header-height: 80px;
}

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

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-color);
    background-image:
        radial-gradient(circle at 15% 50%, rgba(0, 191, 255, 0.08), transparent 25%),
        radial-gradient(circle at 85% 30%, rgba(75, 0, 130, 0.15), transparent 25%);
    background-attachment: fixed;
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.3s ease;
}

ul {
    list-style: none;
}

.container {
    width: 90%;
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 20px;
}

/* Typography Utility */
.highlight {
    color: var(--accent-color);
}

.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-heading);
    margin-bottom: 3rem;
    position: relative;
    display: inline-block;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 0;
    width: 60px;
    height: 4px;
    background: linear-gradient(90deg, var(--accent-color), transparent);
    border-radius: 2px;
}

/* Button Utility */
.btn {
    display: inline-block;
    padding: 1rem 2rem;
    border-radius: 4px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-primary {
    background-color: var(--accent-color);
    color: #fff;
    box-shadow: 0 4px 15px rgba(0, 191, 255, 0.3);
}

.btn-primary:hover {
    background-color: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 191, 255, 0.4);
}

/* Header */
header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--header-height);
    background: rgba(10, 17, 40, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 1000;
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--glass-border);
}

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

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo-text {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-heading);
    letter-spacing: -0.5px;
    background: linear-gradient(90deg, #fff, var(--accent-color));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

#nav-menu ul {
    display: flex;
    gap: 2rem;
}

#nav-menu a {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-primary);
}

#nav-menu a:hover {
    color: var(--accent-color);
}

/* Hero Section */
#hero {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding-top: var(--header-height);
}

.hero-logo-img {
    max-width: 500px;
    /* Increased for overwhelming impact */
    width: 90%;
    margin-bottom: 3rem;
    animation: float 4s ease-in-out infinite;
    filter: drop-shadow(0 0 30px rgba(0, 191, 255, 0.2));
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

#hero h1 {
    font-size: 3rem;
    line-height: 1.2;
    color: var(--text-heading);
    margin-bottom: 1.5rem;
}

.hero-desc {
    font-size: 1.2rem;
    margin-bottom: 2.5rem;
    opacity: 0.8;
}

/* About Section */
#about {
    padding: var(--spacing-section) 0;
}

.terminal-window {
    background: rgba(30, 30, 30, 0.6);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    box-shadow: var(--glass-shadow);
    overflow: hidden;
    max-width: 800px;
    margin: 0 auto;
    border: 1px solid var(--glass-border);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.terminal-window:hover {
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4), var(--neon-glow);
    border-color: rgba(0, 191, 255, 0.3);
}

.terminal-header {
    background-color: #2d2d2d;
    padding: 10px 15px;
    display: flex;
    gap: 8px;
}

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

.dot.red {
    background-color: #ff5f56;
}

.dot.yellow {
    background-color: #ffbd2e;
}

.dot.green {
    background-color: #27c93f;
}

.terminal-body {
    padding: 30px;
    font-family: var(--font-code);
    font-size: 1rem;
    color: #d4d4d4;
}

.cmd {
    color: var(--accent-color);
    margin-right: 8px;
}

.code-output {
    margin-bottom: 5px;
    color: #fff;
}

.text-block {
    color: #a0a0a0;
    line-height: 1.8;
}

/* Works Section */
#works {
    padding: var(--spacing-section) 0;
    position: relative;
    /* Removed solid bg-secondary for transparent gradient flow */
}

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

.project-card {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 1px solid var(--glass-border);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.project-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4), 0 0 20px rgba(0, 191, 255, 0.15);
    border-color: rgba(0, 191, 255, 0.5);
}

.card-image {
    height: 200px;
    background-color: #2a3b55;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.2);
    font-size: 1.5rem;
    font-weight: 700;
}

.card-content {
    padding: 1.5rem;
}

.card-content h3 {
    font-size: 1.5rem;
    color: var(--text-heading);
    margin-bottom: 0.5rem;
    background: linear-gradient(to right, #fff, #b0e0ff);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    display: inline-block;
}

.card-desc {
    font-size: 0.95rem;
    color: #aaa;
    margin-bottom: 1rem;
    height: 3em;
    /* roughly 2 lines */
    overflow: hidden;
    text-overflow: ellipsis;
}

.tech-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.tag {
    font-size: 0.8rem;
    padding: 0.2rem 0.6rem;
    background-color: rgba(0, 191, 255, 0.1);
    color: var(--accent-color);
    border-radius: 20px;
    font-family: var(--font-code);
}

.card-links {
    display: flex;
    gap: 1rem;
}

.link-icon {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-heading);
    border-bottom: 1px solid transparent;
}

.link-icon:hover {
    color: var(--accent-color);
    border-bottom-color: var(--accent-color);
}

/* Contact/Footer */
#contact {
    padding: 80px 0;
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

#contact h2 {
    font-size: 2rem;
    color: var(--text-heading);
    margin-bottom: 1rem;
}

.email-link {
    display: inline-block;
    font-size: 1.2rem;
    color: var(--accent-color);
    margin-top: 1rem;
    margin-bottom: 3rem;
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 3rem;
}

.social-icon {
    font-size: 1.1rem;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50px;
    transition: all 0.3s ease;
}

.social-icon:hover {
    border-color: var(--accent-color);
    background-color: var(--accent-color);
    color: #fff;
}

.copyright {
    font-size: 0.9rem;
    opacity: 0.5;
}

/* Responsive Design */

/* Tablet & Mobile */
@media (max-width: 768px) {
    :root {
        --spacing-section: 80px;
    }

    #hero h1 {
        font-size: 2.2rem;
    }

    #nav-menu {
        display: block;
        width: 100%;
        margin-top: 1rem;
        overflow-x: auto;
        white-space: nowrap;
        padding-bottom: 5px;
        /* Space for scrollbar if needed */
    }

    #nav-menu ul {
        justify-content: center;
        gap: 1.5rem;
    }

    header {
        height: auto;
        padding: 1rem 0;
    }

    header .container {
        flex-direction: column;
    }

    /* Simple footer nav/links for mobile substitution or just keeping it simple for now */

    .section-title {
        font-size: 2rem;
    }
}

/* Animations */
.scroll-reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s cubic-bezier(0.5, 0, 0, 1);
}

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

.delay-100 {
    transition-delay: 0.1s;
}

.delay-200 {
    transition-delay: 0.2s;
}

.delay-300 {
    transition-delay: 0.3s;
}