/* ========================================
   Tiggy_Chan Personal Blog - Stylesheet
   Dark terminal/dev aesthetic
   ======================================== */

/* Reset & Base */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg: #0a0a0f;
    --bg-card: #12121a;
    --border: #1e1e2e;
    --accent: #667eea;
    --accent-pink: #f093fb;
    --accent-green: #4ade80;
    --text: #e2e8f0;
    --text-secondary: #94a3b8;
    --text-muted: #475569;
    --font-body: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', 'Consolas', 'Menlo', monospace;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background: var(--bg);
    color: var(--text);
    line-height: 1.7;
    overflow-x: hidden;
}

/* Scroll Progress Bar */
#scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 2px;
    background: linear-gradient(90deg, var(--accent), var(--accent-pink));
    z-index: 10000;
    transition: width 0.1s linear;
}

/* Navigation */
#navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(10, 10, 15, 0.85);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    transition: background 0.3s ease;
}

.nav-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0.8rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-logo {
    font-family: var(--font-mono);
    font-size: 1rem;
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
    letter-spacing: -0.5px;
}

.nav-logo:hover {
    color: var(--accent-pink);
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
}

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

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

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

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

/* Mobile nav toggle */
.nav-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}

.nav-toggle span {
    display: block;
    width: 20px;
    height: 2px;
    background: var(--text);
    margin: 5px 0;
    transition: all 0.3s ease;
}

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

.nav-toggle.active span:nth-child(2) {
    opacity: 0;
}

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

/* Sections */
section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6rem 2rem;
}

.section-inner {
    max-width: 1000px;
    width: 100%;
}

/* Section Title */
.section-title {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 2.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text);
}

.section-num {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--accent);
    font-weight: 400;
}

.section-title::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
    margin-left: 1rem;
}

/* Hero Section */
#hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: left;
    position: relative;
}

.hero-content {
    max-width: 700px;
    width: 100%;
}

.hero-name {
    font-size: clamp(3rem, 8vw, 5.5rem);
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 1rem;
    letter-spacing: -2px;
}

.gradient-text {
    background: linear-gradient(135deg, var(--accent), var(--accent-pink));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-prompt {
    font-family: var(--font-mono);
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    min-height: 1.5em;
}

.terminal-text {
    color: var(--accent-green);
}

#typing-text {
    color: var(--text);
}

.cursor {
    color: var(--accent-green);
    animation: blink 1s step-end infinite;
    font-weight: 100;
}

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

.hero-tagline {
    color: var(--text-secondary);
    font-size: 1.05rem;
    line-height: 1.8;
    max-width: 600px;
    margin-bottom: 2rem;
}

/* Social Links (Hero) */
.hero-socials {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.social-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 10px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    transition: all 0.25s ease;
    text-decoration: none;
}

.social-link:hover {
    color: var(--accent);
    border-color: var(--accent);
    box-shadow: 0 0 20px rgba(102, 126, 234, 0.15);
    transform: translateY(-2px);
}

/* Scroll Indicator */
.scroll-indicator {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    color: var(--text-muted);
    animation: float 2s ease-in-out infinite;
    text-decoration: none;
}

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

/* About Section */
#about {
    background: linear-gradient(180deg, var(--bg) 0%, #0d0d14 100%);
}

.about-content {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.about-text {
    color: var(--text-secondary);
    font-size: 1.05rem;
    line-height: 1.8;
}

.tech-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-top: 0.5rem;
}

.tech-tag {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--accent);
    background: rgba(102, 126, 234, 0.08);
    border: 1px solid rgba(102, 126, 234, 0.2);
    padding: 0.3rem 0.7rem;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.tech-tag:hover {
    background: rgba(102, 126, 234, 0.15);
    border-color: var(--accent);
}

.server-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    margin-top: 0.5rem;
    transition: color 0.2s ease;
    padding: 0.4rem 0;
}

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

.server-link svg {
    transition: transform 0.2s ease;
}

.server-link:hover svg {
    transform: translate(2px, -2px);
}

/* Projects Section */
#projects {
    background: var(--bg);
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.project-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.project-card:hover {
    border-color: var(--accent);
    box-shadow: 0 0 30px rgba(102, 126, 234, 0.1);
    transform: translateY(-3px);
}

.project-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
}

.project-header svg {
    color: var(--accent);
    flex-shrink: 0;
}

.project-stars {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.project-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text);
}

.project-desc {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
    flex: 1;
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.project-tags span {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--accent-green);
    background: rgba(74, 222, 128, 0.06);
    border: 1px solid rgba(74, 222, 128, 0.15);
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
}

.project-link {
    font-size: 0.85rem;
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
    align-self: flex-start;
}

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

/* Socials Section */
#socials {
    background: linear-gradient(180deg, var(--bg) 0%, #0d0d14 100%);
}

.socials-content {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.social-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.75rem;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.social-card:hover {
    border-color: var(--accent);
    box-shadow: 0 0 25px rgba(102, 126, 234, 0.08);
    transform: translateY(-2px);
}

.social-card-icon {
    color: var(--accent);
    margin-bottom: 0.3rem;
}

.social-card h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text);
}

.social-card p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
    flex: 1;
}

.social-card-link {
    font-size: 0.85rem;
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
    align-self: flex-start;
    transition: color 0.2s ease;
}

.social-card-link:hover {
    color: var(--accent-pink);
}

/* Footer */
#footer {
    min-height: auto;
    padding: 3rem 2rem;
    text-align: center;
    border-top: 1px solid var(--border);
}

.footer-inner {
    max-width: 600px;
    margin: 0 auto;
}

#footer p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.accent {
    color: var(--accent);
    font-family: var(--font-mono);
    font-size: 0.85rem;
}

.footer-meta {
    margin-top: 0.75rem;
    font-size: 0.8rem;
}

/* Responsive */
@media (max-width: 1024px) {
    .projects-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        width: 70%;
        height: 100vh;
        background: var(--bg-card);
        border-left: 1px solid var(--border);
        flex-direction: column;
        padding: 5rem 2rem;
        gap: 1.5rem;
        transition: right 0.3s ease;
    }

    .nav-links.active {
        right: 0;
    }

    .nav-toggle {
        display: block;
        z-index: 1001;
    }

    section {
        padding: 4rem 1.5rem;
    }

    .hero-name {
        letter-spacing: -1px;
    }

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

    .socials-content {
        grid-template-columns: 1fr;
    }

    .nav-inner {
        padding: 0.8rem 1.5rem;
    }
}

@media (max-width: 480px) {
    .hero-prompt {
        font-size: 0.9rem;
    }

    .hero-tagline {
        font-size: 0.95rem;
    }

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

    .project-card {
        padding: 1.2rem;
    }

    .social-card {
        padding: 1.2rem;
    }
}

/* Focus styles for accessibility */
a:focus-visible,
button:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* Selection color */
::selection {
    background: rgba(102, 126, 234, 0.3);
    color: var(--text);
}
