/* ===================================
   HanTul Portfolio - Modern Clean
   =================================== */

:root {
    --bg: #09090b;
    --bg-card: #18181b;
    --bg-card-hover: #1f1f23;
    --border: #27272a;
    --text: #fafafa;
    --text-secondary: #a1a1aa;
    --text-muted: #71717a;
    --accent: #22c55e;
    --accent-hover: #16a34a;
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    --radius: 12px;
    --radius-sm: 8px;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    font-size: 15px;
    line-height: 1.6;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}

a {
    color: inherit;
    text-decoration: none;
}

/* Container */
.container {
    max-width: 960px;
    margin: 0 auto;
    padding: 0 32px;
}

/* Navigation */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: rgba(9, 9, 11, 0.8);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
}

.nav-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 24px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-logo {
    font-size: 18px;
    font-weight: 600;
    color: var(--text);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 32px;
}

.nav-link {
    font-size: 14px;
    color: var(--text-muted);
    transition: color 0.2s;
}

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

/* Nav Right */
.nav-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Hamburger */
.hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 32px;
    height: 32px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}

.hamburger-line {
    width: 100%;
    height: 2px;
    background: var(--text);
    border-radius: 2px;
    transition: transform 0.3s, opacity 0.3s;
}

.hamburger.active .hamburger-line:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.hamburger.active .hamburger-line:nth-child(2) {
    opacity: 0;
}

.hamburger.active .hamburger-line:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* Mobile Menu */
.mobile-menu {
    display: none;
    position: fixed;
    top: 64px;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg);
    padding: 24px;
    flex-direction: column;
    gap: 8px;
    z-index: 99;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.mobile-menu.active {
    opacity: 1;
    visibility: visible;
}

.mobile-link {
    display: block;
    padding: 16px;
    font-size: 18px;
    color: var(--text-muted);
    border-radius: 12px;
    transition: background 0.2s, color 0.2s;
}

.mobile-link:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text);
}

/* Language Toggle */
.lang-toggle {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 4px;
    font-family: var(--font-sans);
    font-size: 12px;
    cursor: pointer;
    display: flex;
    gap: 2px;
    transition: all 0.2s;
}

.lang-toggle:hover {
    border-color: var(--text-muted);
}

.lang-option {
    padding: 4px 8px;
    border-radius: 5px;
    color: var(--text-muted);
    transition: all 0.2s;
}

.lang-option.active {
    background: var(--accent);
    color: var(--bg);
    font-weight: 500;
}

/* Hero */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: 100px 0 80px;
    border-bottom: 1px solid var(--border);
}

.hero-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 64px;
    width: 100%;
}

.hero-text {
    flex: 1;
}

.hero-image {
    flex-shrink: 0;
}

.profile-image {
    width: 260px;
    height: 260px;
    border-radius: 50%;
    overflow: hidden;
    border: 4px solid var(--border);
    background: var(--bg-card);
    box-shadow: 0 0 60px rgba(34, 197, 94, 0.1);
}

.profile-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    background: var(--bg-card);
}

.profile-placeholder svg {
    width: 80px;
    height: 80px;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.2);
    border-radius: 100px;
    font-size: 14px;
    color: var(--accent);
    margin-bottom: 28px;
}

.status-dot {
    width: 8px;
    height: 8px;
    background: var(--accent);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(0.95); }
}

.hero-name {
    font-size: 56px;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 20px;
}

.hero-bio {
    font-size: 18px;
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 32px;
    max-width: 500px;
}

.hero-links {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
}

.hero-contacts {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

.contact-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-family: var(--font-mono);
    color: var(--text-muted);
}

.contact-item svg {
    color: var(--accent);
}

@media (max-width: 768px) {
    .hero-contacts {
        flex-direction: column;
        gap: 12px;
        align-items: center;
    }
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    font-size: 14px;
    font-weight: 500;
    border-radius: var(--radius-sm);
    transition: all 0.2s;
}

.btn-primary {
    background: var(--accent);
    color: #000;
}

.btn-primary:hover {
    background: var(--accent-hover);
}

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

.btn-secondary:hover {
    background: var(--bg-card-hover);
    border-color: var(--text-muted);
}

/* Sections */
.section {
    padding: 40px 32px;
    margin-bottom: 32px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border);
    border-radius: 16px;
    scroll-margin-top: 80px;
}

.section-title {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 24px;
}

/* Year Groups */
.year-group {
    margin-bottom: 32px;
}

.year-group:last-child {
    margin-bottom: 0;
}

.year-header {
    font-size: 14px;
    font-family: var(--font-mono);
    font-weight: 600;
    color: var(--accent);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.year-header::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

/* Skills Grid */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.skill-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    transition: all 0.2s;
}

.skill-card:hover {
    border-color: var(--text-muted);
}

.skill-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(34, 197, 94, 0.1);
    border-radius: 10px;
    color: var(--accent);
    margin-bottom: 14px;
}

.skill-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 6px;
}

.skill-items {
    font-size: 14px;
    color: var(--text);
    line-height: 1.5;
}

/* Affiliations Grid */
.affiliations-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.affiliation-card {
    display: flex;
    align-items: center;
    gap: 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px 24px;
    transition: all 0.3s ease;
}

.affiliation-card:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 0 30px rgba(34, 197, 94, 0.1);
}

.affiliation-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(34, 197, 94, 0.1);
    border-radius: 12px;
    color: var(--accent);
    flex-shrink: 0;
}

.affiliation-info {
    flex: 1;
}

.affiliation-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.affiliation-name {
    font-size: 16px;
    font-weight: 600;
}

.affiliation-date {
    font-size: 12px;
    font-family: var(--font-mono);
    color: var(--text-muted);
}

.affiliation-role {
    font-size: 14px;
    color: var(--text-secondary);
}

.affiliation-desc {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 4px;
}

@media (max-width: 768px) {
    .affiliations-grid {
        grid-template-columns: 1fr;
    }
}

/* Card List */
.card-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    transition: all 0.2s;
}

.card:hover {
    border-color: var(--text-muted);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 8px;
}

.card-title {
    font-size: 16px;
    font-weight: 500;
}

.card-date {
    font-size: 13px;
    font-family: var(--font-mono);
    color: var(--text-muted);
    white-space: nowrap;
}

.card-subtitle {
    font-size: 13px;
    color: var(--accent);
    margin-bottom: 8px;
    line-height: 1.5;
}

.card-desc {
    font-size: 14px;
    color: var(--text-secondary);
}

/* CVE Card */
.cve-link {
    font-family: var(--font-mono);
    font-size: 15px;
    color: var(--accent);
    font-weight: 500;
    transition: opacity 0.2s;
}

.cve-link:hover {
    opacity: 0.8;
}

.cve-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.cve-tag {
    font-size: 11px;
    font-family: var(--font-mono);
    color: var(--accent);
    background: rgba(34, 197, 94, 0.1);
    padding: 4px 10px;
    border-radius: 6px;
    border: 1px solid rgba(34, 197, 94, 0.2);
}

.cve-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 12px;
}

.cve-report {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-family: var(--font-mono);
    color: var(--text-muted);
    transition: color 0.2s;
}

.cve-report:hover {
    color: var(--accent);
}

/* Award Card */
.card-award {
    display: flex;
    align-items: flex-start;
    gap: 16px;
}

.award-rank {
    min-width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(34, 197, 94, 0.1);
    border-radius: 10px;
    font-family: var(--font-mono);
    font-size: 14px;
    font-weight: 600;
    color: var(--accent);
}

.card-body {
    flex: 1;
}

.card-body .card-header {
    margin-bottom: 4px;
}

/* Projects Grid */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.project-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    transition: all 0.2s;
    display: block;
}

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

.project-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.project-date {
    font-size: 12px;
    color: var(--text-muted);
}

.project-category {
    font-size: 12px;
    color: var(--accent);
    margin-bottom: 12px;
}

.project-name {
    font-size: 16px;
    font-weight: 500;
    font-family: var(--font-mono);
}

.project-header svg {
    color: var(--text-muted);
    transition: all 0.2s;
}

.project-card:hover .project-header svg {
    color: var(--accent);
    transform: translate(2px, -2px);
}

.project-desc {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 14px;
    line-height: 1.5;
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag {
    font-size: 12px;
    font-family: var(--font-mono);
    color: var(--text-muted);
    background: var(--bg);
    padding: 4px 10px;
    border-radius: 6px;
}

/* Activity Footer */
.activity-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 12px;
}

.activity-category {
    font-size: 12px;
    color: var(--accent);
}

.activity-links {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.activity-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-family: var(--font-mono);
    color: var(--text-muted);
    transition: color 0.2s;
}

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

/* Education */
.edu-section {
    margin-bottom: 32px;
}

.edu-section:last-child {
    margin-bottom: 0;
}

.edu-category {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 12px;
}

/* Contact Grid */
.contact-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.contact-card {
    display: flex;
    align-items: center;
    gap: 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.contact-card:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 0 30px rgba(34, 197, 94, 0.1);
}

.contact-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(34, 197, 94, 0.1);
    border-radius: 12px;
    color: var(--accent);
    flex-shrink: 0;
}

.contact-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.contact-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.contact-value {
    font-size: 14px;
    font-family: var(--font-mono);
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (max-width: 768px) {
    .contact-grid {
        grid-template-columns: 1fr;
    }
}

/* Footer */
.footer {
    padding: 48px 0;
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
}

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

    .hamburger {
        display: flex;
    }

    .mobile-menu {
        display: flex;
    }

    .nav-container {
        padding: 0 16px;
    }

    .container {
        padding: 0 20px;
    }

    .hero {
        min-height: auto;
        padding: 100px 0 60px;
    }

    .hero-content {
        flex-direction: column-reverse;
        text-align: center;
        gap: 40px;
    }

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

    .profile-placeholder svg {
        width: 60px;
        height: 60px;
    }

    .hero-name {
        font-size: 40px;
    }

    .hero-bio {
        font-size: 16px;
        max-width: 100%;
    }

    .hero-badge {
        margin-bottom: 20px;
    }

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

    .projects-grid {
        grid-template-columns: 1fr;
    }

    .card-header {
        flex-direction: column;
        gap: 4px;
    }
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg);
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Selection */
::selection {
    background: var(--accent);
    color: #000;
}

/* ===================================
   Animations & Effects
   =================================== */

/* Fade In on Scroll */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

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

/* Stagger animation for cards */
.card-list .card,
.projects-grid .project-card,
.affiliations-grid .affiliation-card,
.contact-grid .contact-card {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease-out, transform 0.5s ease-out, border-color 0.2s, background 0.2s;
}

.card-list .card.visible,
.projects-grid .project-card.visible,
.affiliations-grid .affiliation-card.visible,
.contact-grid .contact-card.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Gradient text for name */
.hero-name {
    background: linear-gradient(135deg, var(--text) 0%, var(--accent) 50%, var(--text) 100%);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientShift 8s ease infinite;
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

/* Glow effect on profile image */
.profile-image {
    animation: glowPulse 4s ease-in-out infinite;
}

@keyframes glowPulse {
    0%, 100% { box-shadow: 0 0 40px rgba(34, 197, 94, 0.15); }
    50% { box-shadow: 0 0 80px rgba(34, 197, 94, 0.3); }
}

/* Card hover glow */
.card:hover,
.project-card:hover {
    box-shadow: 0 0 30px rgba(34, 197, 94, 0.1);
}

/* Button shine effect */
.btn-primary {
    position: relative;
    overflow: hidden;
}

.btn-primary::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.5s;
}

.btn-primary:hover::after {
    left: 100%;
}

/* Floating animation for badge */
.hero-badge {
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

/* Link underline animation */
.nav-link {
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent);
    transition: width 0.3s ease;
}

.nav-link:hover::after {
    width: 100%;
}

/* Nav Dropdown */
.nav-dropdown {
    position: relative;
    display: flex;
    align-items: center;
}

.dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
    font-family: var(--font-sans);
}

.dropdown-toggle::after {
    display: none;
}

.dropdown-toggle svg {
    transition: transform 0.2s;
}

.nav-dropdown:hover .dropdown-toggle svg,
.nav-dropdown.active .dropdown-toggle svg {
    transform: rotate(180deg);
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-top: 12px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 8px;
    min-width: 160px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
    z-index: 100;
}

.nav-dropdown:hover .dropdown-menu,
.nav-dropdown.active .dropdown-menu {
    opacity: 1;
    visibility: visible;
}

.dropdown-item {
    display: block;
    padding: 10px 16px;
    font-size: 14px;
    color: var(--text-muted);
    border-radius: 8px;
    transition: background 0.2s, color 0.2s;
}

.dropdown-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text);
}

/* CVE link glow */
.cve-link {
    text-shadow: 0 0 0 transparent;
    transition: text-shadow 0.3s, opacity 0.2s;
}

.cve-link:hover {
    text-shadow: 0 0 20px rgba(34, 197, 94, 0.5);
}

/* Tag hover effect */
.tag {
    transition: all 0.2s;
}

.tag:hover {
    background: var(--accent);
    color: #000;
}

/* Section title decoration */
.section-title {
    position: relative;
    display: inline-block;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 40px;
    height: 3px;
    background: var(--accent);
    border-radius: 2px;
}

/* Smooth page load */
body {
    animation: pageLoad 0.8s ease-out;
}

@keyframes pageLoad {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Hero content stagger */
.hero-badge,
.hero-name,
.hero-bio,
.hero-links,
.hero-contacts {
    opacity: 0;
    animation: slideUp 0.6s ease-out forwards;
}

.hero-badge { animation-delay: 0.2s; }
.hero-name { animation-delay: 0.4s; }
.hero-bio { animation-delay: 0.6s; }
.hero-links { animation-delay: 0.8s; }
.hero-contacts { animation-delay: 1s; }

.hero-image {
    opacity: 0;
    animation: fadeScale 0.8s ease-out 0.3s forwards;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeScale {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Cursor glow effect (optional - follows mouse) */
.cursor-glow {
    position: fixed;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(34, 197, 94, 0.08) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
    transform: translate(-50%, -50%);
    transition: opacity 0.3s;
}
