/* ========================================
   Sunny — Portfolio
   Clean Dark Mode
   ======================================== */

/* ---------- Variables ---------- */
:root {
    --bg: #0a0a0b;
    --bg-alt: #111113;
    --surface: #161618;
    --surface-hover: #1d1d20;
    --border: #232327;
    --border-hover: #33333a;

    --text: #e8e8ea;
    --text-secondary: #a0a0a8;
    --text-muted: #6b6b73;

    --accent: #4a9eff;
    --accent-soft: rgba(74, 158, 255, 0.1);
    --accent-hover: #6ab0ff;
    --accent-blog: #b366ff;
    --accent-blog-soft: rgba(179, 102, 255, 0.12);
    --accent-blog-hover: #c885ff;
    --accent-resume: #3dd68c;
    --accent-resume-soft: rgba(61, 214, 140, 0.12);
    --accent-resume-hover: #54e09a;

    --green: #4ade80;

    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 20px;

    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;

    --max-width: 1100px;
    --max-width-narrow: 720px;

    --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---------- Reset ---------- */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
}

body {
    font-family: var(--font-sans);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

a {
    color: inherit;
    text-decoration: none;
    transition: color var(--transition);
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    display: block;
}

::selection {
    background: var(--accent-soft);
    color: var(--accent-hover);
}

/* ---------- 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(--border-hover);
}

/* ---------- Layout ---------- */
.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 24px;
}

.container-narrow {
    max-width: var(--max-width-narrow);
}

.section {
    padding: 100px 0;
}

.section-alt {
    background: var(--bg-alt);
}

.section-head {
    margin-bottom: 48px;
}

.section-label {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--accent);
    margin-bottom: 8px;
    letter-spacing: 0.05em;
}

.section-title {
    font-size: clamp(1.6rem, 4vw, 2.2rem);
    font-weight: 700;
    letter-spacing: -0.02em;
}

/* ---------- Scroll Progress ---------- */
#scrollProgress {
    position: fixed;
    top: 0;
    left: 0;
    height: 2px;
    background: var(--accent);
    width: 0;
    z-index: 1000;
    transition: width 0.1s linear;
}

/* ---------- Nav ---------- */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    background: rgba(10, 10, 11, 0.7);
    border-bottom: 1px solid transparent;
    transition: border-color var(--transition), background var(--transition);
}

.nav.scrolled {
    border-bottom-color: var(--border);
}

.nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}

.nav-logo {
    font-family: var(--font-mono);
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--text);
}

.nav-logo:hover {
    color: var(--accent);
}

.nav-links {
    display: flex;
    gap: 32px;
}

.nav-links a {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
    position: relative;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--accent);
    transition: width var(--transition);
}

.nav-links a:hover {
    color: var(--text);
}

.nav-links a:hover::after {
    width: 100%;
}

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}

.nav-toggle span {
    width: 22px;
    height: 2px;
    background: var(--text);
    border-radius: 2px;
    transition: var(--transition);
}

.nav-toggle.open span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.nav-toggle.open span:nth-child(2) {
    opacity: 0;
}

.nav-toggle.open span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* ---------- Hero ---------- */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.hero-content {
    max-width: 720px;
    padding-top: 64px;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    border: 1px solid var(--border);
    border-radius: 100px;
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 28px;
    background: var(--surface);
}

.status-dot {
    width: 8px;
    height: 8px;
    background: var(--green);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.hero-name {
    font-size: clamp(2.5rem, 8vw, 4.5rem);
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.03em;
    margin-bottom: 16px;
}

.hero-role {
    font-family: var(--font-mono);
    font-size: clamp(1rem, 2.5vw, 1.25rem);
    color: var(--accent);
    margin-bottom: 24px;
    min-height: 1.5em;
}

.cursor-blink {
    color: var(--accent);
    margin-left: 2px;
    font-weight: 700;
    animation: blink 1s step-end infinite;
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

.hero-intro {
    font-size: 1.05rem;
    color: var(--text-secondary);
    margin-bottom: 36px;
    max-width: 560px;
}

.hero-socials {
    display: flex;
    gap: 16px;
    margin-bottom: 36px;
}

.hero-socials a {
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    background: var(--surface);
    transition: all var(--transition);
}

.hero-socials a:hover {
    color: var(--accent);
    border-color: var(--accent);
    background: var(--accent-soft);
    transform: translateY(-2px);
}

.hero-socials svg {
    width: 20px;
    height: 20px;
}

.hero-socials i {
    font-size: 20px;
    line-height: 1;
}

.hero-actions {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    border: 1px solid transparent;
}

.btn-primary {
    background: var(--accent);
    color: #fff;
}

.btn-primary:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
}

.btn-ghost {
    background: transparent;
    color: var(--text);
    border-color: var(--border);
}

.btn-ghost:hover {
    border-color: var(--border-hover);
    background: var(--surface);
}

.btn-blog {
    background: var(--accent-blog-soft);
    color: var(--accent-blog);
    border-color: rgba(179, 102, 255, 0.35);
}

.btn-blog:hover {
    background: var(--accent-blog);
    color: #fff;
    border-color: var(--accent-blog);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(179, 102, 255, 0.25);
}

.btn-resume {
    background: var(--accent-resume-soft);
    color: var(--accent-resume);
    border-color: rgba(61, 214, 140, 0.35);
}

.btn-resume:hover {
    background: var(--accent-resume);
    color: #04130a;
    border-color: var(--accent-resume);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(61, 214, 140, 0.25);
}

/* ---------- Scroll Hint ---------- */
.scroll-hint {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-muted);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    animation: bob 2s ease-in-out infinite;
}

@keyframes bob {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50% { transform: translateX(-50%) translateY(-8px); }
}

/* ---------- Grid ---------- */
.grid {
    display: grid;
    gap: 20px;
}

.grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

.grid-2 {
    grid-template-columns: repeat(2, 1fr);
}

/* ---------- Cards ---------- */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px;
    transition: all var(--transition);
}

.card:hover {
    border-color: var(--border-hover);
    background: var(--surface-hover);
    transform: translateY(-2px);
}

.card-icon {
    font-size: 1.8rem;
    margin-bottom: 16px;
    display: block;
}

.card-h {
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 12px;
}

.card p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* ---------- Projects ---------- */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.project-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: all var(--transition);
    display: flex;
    flex-direction: column;
}

.project-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
}

.project-image {
    aspect-ratio: 16 / 9;
    background: var(--bg-alt);
    border-bottom: 1px solid var(--border);
    overflow: hidden;
    position: relative;
}

.project-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}

.project-card:hover .project-image img {
    transform: scale(1.04);
}

.project-body {
    padding: 24px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.project-body h3 {
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.project-body h3 a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s ease;
}

.project-body h3 a:hover {
    color: var(--accent);
}

.project-body h3 a i {
    font-size: 0.75em;
    margin-left: 6px;
    color: var(--text-secondary);
    transition: color 0.2s ease, transform 0.2s ease;
}

.project-body h3 a:hover i {
    color: var(--accent);
    transform: translate(2px, -2px);
}

.project-body p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 16px;
    flex: 1;
}

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-secondary);
    background: var(--bg-alt);
    border: 1px solid var(--border);
    padding: 4px 10px;
    border-radius: 6px;
}

/* ---------- Contact ---------- */
.contact-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: start;
}

.contact-text {
    color: var(--text-secondary);
    font-size: 1.05rem;
}

.contact-links {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.contact-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 24px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: all var(--transition);
}

.contact-link:hover {
    border-color: var(--border-hover);
    background: var(--surface-hover);
    transform: translateX(4px);
}

.contact-link-label {
    display: flex;
    align-items: center;
    gap: 14px;
}

.contact-link-label svg {
    width: 20px;
    height: 20px;
    color: var(--text-secondary);
}

.contact-link-arrow {
    color: var(--text-muted);
    transition: var(--transition);
}

.contact-link:hover .contact-link-arrow {
    color: var(--accent);
    transform: translateX(4px);
}

/* ---------- About Page ---------- */
.page-hero {
    padding: 140px 0 60px;
    border-bottom: 1px solid var(--border);
}

.page-title {
    font-size: clamp(2rem, 6vw, 3rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    margin: 8px 0 12px;
}

.page-title .aka {
    font-size: 0.55em;
    font-weight: 500;
    color: var(--text-muted);
}

.page-subtitle {
    color: var(--text-secondary);
    font-family: var(--font-mono);
    font-size: 0.85rem;
}

.prose {
    font-size: 1.05rem;
    color: var(--text-secondary);
    line-height: 1.8;
}

.prose p {
    margin-bottom: 20px;
}

.prose p:last-child {
    margin-bottom: 0;
}

/* ---------- Timeline ---------- */
.timeline {
    position: relative;
    padding-left: 28px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 0;
    top: 8px;
    bottom: 8px;
    width: 1px;
    background: var(--border);
}

.timeline-item {
    position: relative;
    padding-bottom: 40px;
}

.timeline-item:last-child {
    padding-bottom: 0;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -32px;
    top: 6px;
    width: 9px;
    height: 9px;
    background: var(--accent);
    border-radius: 50%;
    border: 2px solid var(--bg);
}

.timeline-date {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--accent);
    margin-bottom: 6px;
}

.timeline-body h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 2px;
}

.timeline-company {
    color: var(--accent);
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 12px;
}

.timeline-body ul {
    display: grid;
    gap: 6px;
}

.timeline-body li {
    color: var(--text-secondary);
    font-size: 0.9rem;
    padding-left: 18px;
    position: relative;
}

.timeline-body li::before {
    content: '▹';
    position: absolute;
    left: 0;
    color: var(--accent);
}

.muted {
    color: var(--text-muted) !important;
    font-size: 0.85rem !important;
    margin-top: 4px;
}

/* ---------- Footer ---------- */
.footer {
    border-top: 1px solid var(--border);
    padding: 32px 0;
}

.footer-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.footer-copy {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-muted);
}

.footer-top {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.footer-top:hover {
    color: var(--accent);
}

/* ---------- Reveal Animation ---------- */
.reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ---------- Custom Cursor ---------- */

/* ---------- Particle Network Background ---------- */
#particle-network {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
}

.cursor-dot,
.cursor-ring {
    position: fixed;
    top: 0;
    left: 0;
    border-radius: 50%;
    pointer-events: none;
    z-index: 9999;
    mix-blend-mode: difference;
}

.cursor-dot {
    width: 6px;
    height: 6px;
    background: var(--accent);
    transform: translate(-50%, -50%);
}

.cursor-ring {
    width: 32px;
    height: 32px;
    border: 1px solid rgba(74, 158, 255, 0.5);
    transform: translate(-50%, -50%);
    transition: width 0.2s ease, height 0.2s ease, border-color 0.2s ease;
}

.cursor-ring.hover {
    width: 48px;
    height: 48px;
    border-color: var(--accent);
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
    .grid-3 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .nav-toggle {
        display: flex;
    }

    .projects-grid {
        grid-template-columns: 1fr;
    }

    .nav-links {
        position: fixed;
        top: 64px;
        left: 0;
        right: 0;
        background: var(--bg-alt);
        border-bottom: 1px solid var(--border);
        flex-direction: column;
        padding: 24px;
        gap: 20px;
        transform: translateY(-150%);
        transition: transform var(--transition);
    }

    .nav-links.open {
        transform: translateY(0);
    }

    .section {
        padding: 60px 0;
    }

    .grid-3,
    .grid-2 {
        grid-template-columns: 1fr;
    }

    .contact-layout {
        grid-template-columns: 1fr;
        gap: 32px;
    }

    .footer-container {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }

    .timeline {
        padding-left: 24px;
    }

    .timeline-item::before {
        left: -28px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 16px;
    }

    .hero-actions {
        flex-direction: column;
    }

    .btn {
        justify-content: center;
    }

    .project-body {
        padding: 20px;
    }
}

/* ---------- Touch / No Hover Devices ---------- */
@media (hover: none) {
    .cursor-dot,
    .cursor-ring {
        display: none;
    }
}
