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

:root {
    --bg: #000;
    --text: #e8e8e8;
    --text-dim: #666;
    --accent: #888;
}

/* Intro Animation */
#intro-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: opacity 0.8s ease-out;
}

#intro-overlay.fade-out {
    opacity: 0;
    pointer-events: none;
}

#intro-overlay.hidden {
    display: none;
}

#cube-canvas {
    position: absolute;
    width: 100%;
    height: 100%;
}

#intro-hero {
    position: absolute;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    z-index: 10;
    pointer-events: none;
}

#intro-hero .intro-logo {
    width: 80px;
    height: 80px;
    margin-bottom: 28px;
}

#intro-hero h1 {
    font-size: 36px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 12px;
}

#intro-hero h1 .handle {
    color: var(--text-dim);
    font-weight: 400;
    font-size: 20px;
}

#intro-hero p {
    font-size: 16px;
    color: var(--accent);
}

#intro-hero .intro-tagline {
    margin-top: 20px;
    font-size: 14px;
    color: var(--text-dim);
    font-style: italic;
}

#click-hint {
    position: absolute;
    bottom: 60px;
    color: #444;
    font-family: 'JetBrains Mono', monospace;
    font-size: 14px;
    letter-spacing: 2px;
    animation: pulse 2s ease-in-out infinite;
    z-index: 10;
}

@keyframes pulse {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 1; }
}

/* Terminal Animation */
.terminal-container {
    position: absolute;
    width: 280px;
    height: 165px;
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid #333;
    border-radius: 6px;
    padding: 12px 14px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    color: #888;
    overflow: hidden;
    z-index: 5;
    opacity: 0.7;
}

.terminal-container::before {
    content: '● ● ●';
    display: block;
    font-size: 8px;
    color: #444;
    margin-bottom: 10px;
    letter-spacing: 4px;
}

.terminal-line {
    white-space: nowrap;
    overflow: hidden;
    margin-bottom: 4px;
    opacity: 0;
    animation: fadeInLine 0.3s ease forwards;
}

.terminal-line.fade-out {
    animation: fadeOutLine 0.3s ease forwards;
}

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

@keyframes fadeOutLine {
    from { opacity: 1; transform: translateY(0); }
    to { opacity: 0; transform: translateY(-5px); }
}

.terminal-prompt {
    color: #6a9955;
}

.terminal-command {
    color: #dcdcaa;
}

.terminal-string {
    color: #ce9178;
}

.terminal-keyword {
    color: #569cd6;
}

.terminal-comment {
    color: #6a9955;
}

.terminal-left-top {
    left: 5%;
    top: 15%;
}

.terminal-left-bottom {
    left: 8%;
    bottom: 20%;
}

.terminal-right-top {
    right: 5%;
    top: 18%;
}

.terminal-right-bottom {
    right: 8%;
    bottom: 22%;
}

@media (max-width: 1200px) {
    .terminal-container {
        display: none;
    }
}

#floating-particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
}

main .hero {
    opacity: 0;
}

main.visible .hero {
    opacity: 1;
}

/* Hide content only when intro is playing */
main.intro-playing section:not(.hero) h2,
main.intro-playing section:not(.hero) h3,
main.intro-playing section:not(.hero) p,
main.intro-playing section:not(.hero) .year {
    visibility: hidden;
}

main.intro-playing.typing-started section:not(.hero) h2,
main.intro-playing.typing-started section:not(.hero) h3,
main.intro-playing.typing-started section:not(.hero) p,
main.intro-playing.typing-started section:not(.hero) .year {
    visibility: visible;
}

/* Hide project boxes until typing starts */
.project.typing-pending {
    border-color: transparent;
}

.project.typing-pending h3,
.project.typing-pending p {
    visibility: hidden;
}

/* Typing effect */
.typing-hidden {
    opacity: 0;
}

.typing-cursor {
    display: inline-block;
    width: 0.55em;
    height: 1.15em;
    background: #e8e8e8;
    vertical-align: text-bottom;
    margin-left: 1px;
    animation: cursor-blink 0.7s step-end infinite;
}

@keyframes cursor-blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

body {
    font-family: 'JetBrains Mono', monospace;
    background: var(--bg);
    color: var(--text);
    line-height: 1.9;
    font-size: 15px;
}

/* Navigation */
.about {
    position: relative;
}

.about-nav {
    position: absolute;
    top: -75px;
    right: 0;
    display: flex;
    align-items: center;
    gap: 16px;
}

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

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

.lang-switch {
    display: flex;
    gap: 4px;
}

.lang-btn {
    background: transparent;
    border: 1px solid #333;
    color: var(--text-dim);
    padding: 6px 12px;
    font-family: inherit;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

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

.lang-btn.active {
    background: var(--text);
    border-color: var(--text);
    color: var(--bg);
}

.effect-btn {
    background: transparent;
    border: 1px solid #333;
    color: var(--text-dim);
    padding: 6px 10px;
    font-family: inherit;
    font-size: 10px;
    cursor: pointer;
    transition: all 0.2s;
    margin-left: 8px;
}

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

.effect-btn.active {
    background: var(--text);
    border-color: var(--text);
    color: var(--bg);
}

/* Main */
main {
    max-width: 720px;
    margin: 0 auto;
    padding: 80px 32px 80px;
    position: relative;
    z-index: 1;
    background: var(--bg);
}

/* Hero */
.hero {
    margin-bottom: 110px;
    text-align: center;
}

.hero-logo {
    width: 80px;
    height: 80px;
    margin-bottom: 28px;
}

.hero h1 {
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 12px;
}

.handle {
    color: var(--text-dim);
    font-weight: 400;
    font-size: 20px;
}

.role {
    color: var(--accent);
    font-size: 16px;
}

/* Sections */
section {
    margin-bottom: 80px;
}

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

section h2 {
    font-size: 12px;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 28px;
}

/* About */
.about p {
    margin-bottom: 20px;
    color: #bbb;
    font-size: 15px;
}

.about p:last-child {
    margin-bottom: 0;
}

/* History */
.history .item {
    margin-bottom: 28px;
}

.history .item:last-child {
    margin-bottom: 0;
}

.history .year {
    display: block;
    color: #e8e8e8;
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 10px;
    letter-spacing: 1px;
}

.history .year a {
    color: #e8e8e8;
    text-decoration: none;
}

.history .year a:hover {
    text-decoration: underline;
}

.history .item p {
    color: #999;
    font-size: 14px;
    line-height: 1.9;
}

/* Presentation */
.presentation .item {
    margin-bottom: 28px;
}

.presentation .item:last-child {
    margin-bottom: 0;
}

.presentation .year {
    display: block;
    color: #e8e8e8;
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 10px;
    letter-spacing: 1px;
}

.presentation .year a {
    color: #e8e8e8;
    text-decoration: none;
}

.presentation .year a:hover {
    text-decoration: underline;
}

.presentation .item p {
    color: #999;
    font-size: 14px;
    line-height: 1.9;
}

/* Tags (Interested) */
.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.tags span {
    padding: 10px 16px;
    border: 1px solid #333;
    font-size: 13px;
    color: #aaa;
    transition: all 0.2s;
}

.tags span:hover {
    border-color: var(--accent);
    color: var(--accent);
}

/* Projects */
.project {
    margin-bottom: 24px;
    padding: 24px;
    border: 1px solid #222;
}

.project:last-child {
    margin-bottom: 0;
}

.project h3 {
    font-size: 17px;
    margin-bottom: 14px;
}

.project h3 a {
    color: var(--text);
    text-decoration: none;
    transition: color 0.2s;
}

.project h3 a:hover {
    color: var(--accent);
}

.project p {
    color: #888;
    font-size: 14px;
    line-height: 1.9;
}

/* Contact */
.contact p {
    margin-bottom: 12px;
    font-size: 15px;
}

.contact a {
    color: var(--text);
    text-decoration: none;
    transition: color 0.2s;
}

.contact a:hover {
    color: var(--accent);
}

/* Q&A Page */
.qna-intro {
    position: relative;
    margin-bottom: 60px;
}

.qna-intro h2 {
    margin-bottom: 16px;
}

.qna-date {
    color: var(--text-dim);
    font-size: 13px;
    margin-bottom: 20px;
}

.qna-introduce {
    color: #999;
    font-size: 15px;
    line-height: 1.9;
}

.qna-list {
    margin-bottom: 80px;
}

.qna-item {
    margin-bottom: 48px;
}

.qna-item:last-child {
    margin-bottom: 0;
}

.qna-item .question {
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 16px;
}

.qna-item .question::before {
    content: 'Q. ';
    font-weight: 700;
    color: #fff;
}

.qna-item .question.sub-question {
    margin-top: 28px;
}

.qna-item .answer {
    color: #ddd;
    font-size: 16px;
    line-height: 2;
}

.qna-item .answer::before {
    content: 'A. ';
    font-weight: 700;
    color: #aaa;
}

/* Footer */
footer {
    text-align: center;
    padding: 40px 32px;
    color: var(--text-dim);
    font-size: 12px;
}

#replay-intro {
    background: transparent;
    border: none;
    color: #666;
    font-size: 14px;
    cursor: pointer;
    padding: 8px;
    margin-top: 12px;
    opacity: 0.5;
    transition: opacity 0.2s;
}

#replay-intro:hover {
    opacity: 1;
    color: #999;
}

/* Responsive */
@media (max-width: 700px) {
    main {
        padding: 60px 20px 60px;
    }

    .about-nav {
        position: static;
        margin-bottom: 20px;
    }

    .hero {
        margin-bottom: 60px;
    }

    .hero-logo {
        width: 64px;
        height: 64px;
    }

    .hero h1 {
        font-size: 28px;
    }

    .handle {
        font-size: 16px;
    }

    section {
        margin-bottom: 60px;
    }

    .project {
        padding: 18px;
    }
}
