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

:root {
    --bg: #0a0a0f;
    --bg-card: #111119;
    --bg-card-hover: #1a1a25;
    --surface: #16161f;
    --border: #1e1e2e;
    --border-hover: #2e2e45;
    --text: #e4e4ed;
    --text-muted: #7a7a8e;
    --accent: #00f0ff;
    --accent-2: #a855f7;
    --gradient: linear-gradient(135deg, #00f0ff, #a855f7);
    --gradient-hover: linear-gradient(135deg, #00f0ff, #c084fc);
    --radius: 12px;
    --radius-sm: 8px;
    --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --mono: 'JetBrains Mono', 'Fira Code', monospace;
    --syntax-keyword: #c084fc;
    --syntax-string: #34d399;
    --syntax-func: #60a5fa;
    --syntax-comment: #4a4a5e;
    --syntax-number: #f59e0b;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
}

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

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

img {
    max-width: 100%;
    display: block;
}

/* ===== Code Rain Canvas ===== */
.code-rain {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    opacity: 0.07;
}

/* ===== Background Effects ===== */
.grain-overlay {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.03;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
}

.glow {
    position: fixed;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    filter: blur(120px);
    pointer-events: none;
    z-index: 0;
}

.glow-1 {
    top: -200px;
    right: -100px;
    background: rgba(0, 240, 255, 0.08);
}

.glow-2 {
    bottom: -200px;
    left: -100px;
    background: rgba(168, 85, 247, 0.06);
}

/* ===== Container ===== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ===== Nav ===== */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 16px 24px;
    transition: background 0.3s, backdrop-filter 0.3s;
}

.nav.scrolled {
    background: rgba(10, 10, 15, 0.85);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
}

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

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 1.05rem;
}

.logo-icon {
    font-family: var(--mono);
    font-size: 1.3rem;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.logo-text {
    letter-spacing: -0.02em;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 32px;
    font-size: 0.9rem;
    font-weight: 500;
}

.nav-links a {
    color: var(--text-muted);
    transition: color 0.2s;
}

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

.nav-cta {
    background: var(--gradient);
    color: #0a0a0f !important;
    padding: 8px 20px;
    border-radius: 100px;
    font-weight: 600;
    transition: opacity 0.2s;
}

.nav-cta:hover {
    opacity: 0.9;
}

/* Mobile menu button */
.mobile-menu-btn {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}

.mobile-menu-btn span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text);
    border-radius: 2px;
    transition: transform 0.3s, opacity 0.3s;
}

.mobile-menu-btn.active span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.mobile-menu-btn.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-btn.active span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

.mobile-menu {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(10, 10, 15, 0.97);
    z-index: 999;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 32px;
    font-size: 1.5rem;
    font-weight: 600;
}

.mobile-menu.active {
    display: flex;
}

.mobile-menu a {
    color: var(--text-muted);
    transition: color 0.2s;
}

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

/* ===== Hero ===== */
.hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    z-index: 1;
    padding: 120px 24px 80px;
    max-width: 1200px;
    margin: 0 auto;
}

.hero-content {
    width: 100%;
}

.hero-content:first-child {
    display: flex;
    align-items: center;
    gap: 60px;
    margin-bottom: 48px;
}

.hero-left {
    flex: 1;
    min-width: 0;
}

.hero-badge {
    display: inline-block;
    font-family: var(--mono);
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--accent);
    background: rgba(0, 240, 255, 0.08);
    border: 1px solid rgba(0, 240, 255, 0.15);
    padding: 6px 16px;
    border-radius: 100px;
    margin-bottom: 24px;
    letter-spacing: 0.02em;
}

.hero h1 {
    font-size: clamp(2.8rem, 5vw, 4.5rem);
    font-weight: 900;
    line-height: 1.05;
    letter-spacing: -0.03em;
    margin-bottom: 24px;
}

.gradient-text {
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-sub {
    font-size: clamp(1.05rem, 2vw, 1.25rem);
    color: var(--text-muted);
    max-width: 540px;
    line-height: 1.7;
    margin-bottom: 40px;
}

/* ===== Hero Terminal ===== */
.hero-terminal {
    flex: 0 0 420px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    background: #0d0d14;
    box-shadow:
        0 0 40px rgba(0, 240, 255, 0.05),
        0 20px 60px rgba(0, 0, 0, 0.5);
}

.terminal-chrome {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: #131320;
    border-bottom: 1px solid var(--border);
}

.terminal-dots {
    display: flex;
    gap: 6px;
}

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

.dot-red { background: #ff5f57; }
.dot-yellow { background: #febc2e; }
.dot-green { background: #28c840; }

.terminal-title {
    font-family: var(--mono);
    font-size: 0.72rem;
    color: var(--text-muted);
}

.terminal-body {
    padding: 20px;
    font-family: var(--mono);
    font-size: 0.82rem;
    line-height: 1.8;
    color: var(--text);
    min-height: 260px;
    margin: 0;
    overflow: hidden;
}

.terminal-body code {
    font-family: inherit;
}

.terminal-cursor {
    display: inline-block;
    color: var(--accent);
    animation: blink 1s step-end infinite;
    font-weight: 300;
}

@keyframes blink {
    50% { opacity: 0; }
}

/* Syntax highlighting classes */
.syn-keyword { color: var(--syntax-keyword); }
.syn-string { color: var(--syntax-string); }
.syn-func { color: var(--syntax-func); }
.syn-comment { color: var(--syntax-comment); font-style: italic; }
.syn-number { color: var(--syntax-number); }
.syn-punct { color: #6b6b80; }
.syn-line-num {
    color: #2a2a3a;
    user-select: none;
    display: inline-block;
    width: 2.2em;
    text-align: right;
    margin-right: 1.2em;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 28px;
    border-radius: 100px;
    font-size: 0.95rem;
    font-weight: 600;
    transition: all 0.25s;
    cursor: pointer;
    border: none;
    font-family: var(--font);
}

.btn-primary {
    background: var(--gradient);
    color: #0a0a0f;
}

.btn-primary:hover {
    box-shadow: 0 0 30px rgba(0, 240, 255, 0.3);
    transform: translateY(-1px);
}

.btn-ghost {
    background: transparent;
    color: var(--text);
    border: 1px solid var(--border-hover);
}

.btn-ghost:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.btn-lg {
    padding: 18px 36px;
    font-size: 1.05rem;
}

.hero-actions {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

/* Stats */
.hero-stats {
    display: flex;
    gap: 48px;
    padding-top: 40px;
    border-top: 1px solid var(--border);
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 4px;
}

/* ===== Sections ===== */
.section {
    padding: 100px 0;
    position: relative;
    z-index: 1;
}

.section-alt {
    background: var(--surface);
}

.section-header {
    text-align: center;
    margin-bottom: 64px;
}

.section-tag {
    font-family: var(--mono);
    font-size: 0.8rem;
    color: var(--accent);
    letter-spacing: 0.05em;
    display: block;
    margin-bottom: 12px;
}

.section-header h2 {
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    margin-bottom: 12px;
}

.section-header p {
    font-size: 1.1rem;
    color: var(--text-muted);
    max-width: 500px;
    margin: 0 auto;
}

/* ===== Project Grid ===== */
.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 24px;
}

.project-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: all 0.3s;
    display: block;
}

.project-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-4px);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

.project-image {
    aspect-ratio: 16 / 10;
    overflow: hidden;
}

.terminal-window {
    position: relative;
}

.terminal-chrome-mini {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    gap: 5px;
    padding: 10px 14px;
    z-index: 2;
    background: linear-gradient(180deg, rgba(13,13,20,0.9) 0%, transparent 100%);
}

.terminal-chrome-mini .dot {
    width: 8px;
    height: 8px;
}

/* Project screenshot image */
.project-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top;
    display: block;
}

.project-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--bg-card), color-mix(in srgb, var(--accent) 15%, var(--bg)));
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.project-placeholder::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 30% 40%, color-mix(in srgb, var(--accent) 10%, transparent), transparent 60%);
}

/* Floating code lines inside project placeholders */
.project-placeholder::after {
    content: '{ code }';
    position: absolute;
    bottom: 16px;
    right: 16px;
    font-family: var(--mono);
    font-size: 0.65rem;
    color: var(--accent);
    opacity: 0.15;
    letter-spacing: 0.05em;
}

.placeholder-icon {
    font-size: 3rem;
    color: var(--accent);
    opacity: 0.4;
    z-index: 1;
}

.project-info {
    padding: 24px;
}

.project-tags {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.project-tags span {
    font-family: var(--mono);
    font-size: 0.7rem;
    color: var(--accent);
    background: rgba(0, 240, 255, 0.06);
    border: 1px solid rgba(0, 240, 255, 0.1);
    padding: 3px 10px;
    border-radius: 100px;
}

.project-info h3 {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 8px;
    letter-spacing: -0.01em;
}

.project-info p {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 16px;
}

.project-link {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--accent);
    transition: gap 0.2s;
}

.project-card:hover .project-link {
    letter-spacing: 0.02em;
}

/* ===== Process Grid ===== */
.process-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    margin-bottom: 80px;
}

.process-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 36px 28px;
    transition: border-color 0.3s;
    position: relative;
    overflow: hidden;
}

.process-card::before {
    content: '</>';
    position: absolute;
    top: 16px;
    right: 16px;
    font-family: var(--mono);
    font-size: 0.7rem;
    color: var(--accent);
    opacity: 0.12;
}

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

.process-number {
    font-family: var(--mono);
    font-size: 2.5rem;
    font-weight: 800;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 16px;
    line-height: 1;
}

.process-card h3 {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 10px;
}

.process-card p {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.7;
}

/* Tech badges strip */
.tech-strip {
    text-align: center;
}

.tech-badges {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-top: 16px;
}

.tech-badges span {
    font-family: var(--mono);
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--text-muted);
    background: var(--bg);
    border: 1px solid var(--border);
    padding: 6px 16px;
    border-radius: 100px;
    transition: all 0.2s;
}

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

/* ===== CTA Block ===== */
.cta-block {
    text-align: center;
    padding: 80px 0;
    position: relative;
}

.cta-block::before {
    content: 'npm run build && npm run deploy';
    display: block;
    font-family: var(--mono);
    font-size: 0.75rem;
    color: var(--accent);
    opacity: 0.15;
    margin-bottom: 32px;
    letter-spacing: 0.03em;
}

.cta-block h2 {
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 900;
    letter-spacing: -0.03em;
    margin-bottom: 16px;
    line-height: 1.15;
}

.cta-block p {
    font-size: 1.1rem;
    color: var(--text-muted);
    max-width: 480px;
    margin: 0 auto 40px;
}

.cta-actions {
    display: flex;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
}

/* ===== Footer ===== */
.footer {
    border-top: 1px solid var(--border);
    padding: 32px 0;
    position: relative;
    z-index: 1;
}

.footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 0.9rem;
}

.footer-links {
    display: flex;
    gap: 24px;
    font-size: 0.85rem;
}

.footer-links a {
    color: var(--text-muted);
    transition: color 0.2s;
}

.footer-links a:hover {
    color: var(--text);
}

.footer-copy {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* ===== Animations ===== */
.fade-in {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

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

/* ===== Responsive ===== */

/* Tablet */
@media (max-width: 968px) {
    .hero-content:first-child {
        flex-direction: column;
        gap: 40px;
    }

    .hero-terminal {
        flex: 1;
        width: 100%;
        max-width: 500px;
    }

    .hero h1 {
        font-size: clamp(2.4rem, 5vw, 3.5rem);
    }
}

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

    .mobile-menu-btn {
        display: flex;
    }

    .hero {
        padding: 100px 20px 60px;
    }

    .hero-terminal {
        flex: none;
        width: 100%;
        max-width: 100%;
    }

    .terminal-body {
        font-size: 0.72rem;
        line-height: 1.7;
        min-height: 200px;
        padding: 16px;
    }

    .hero-stats {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 16px;
        text-align: center;
    }

    .stat-number {
        font-size: 1.8rem;
    }

    .stat-label {
        font-size: 0.75rem;
    }

    .section {
        padding: 64px 0;
    }

    .section-header {
        margin-bottom: 40px;
    }

    .project-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .project-tags {
        flex-wrap: wrap;
    }

    .process-grid {
        grid-template-columns: 1fr;
        gap: 16px;
        margin-bottom: 48px;
    }

    .process-card {
        padding: 28px 22px;
    }

    .tech-badges {
        gap: 8px;
    }

    .tech-badges span {
        font-size: 0.7rem;
        padding: 5px 12px;
    }

    .cta-block {
        padding: 40px 0;
    }

    .cta-block::before {
        font-size: 0.65rem;
        word-break: break-all;
    }

    .footer-inner {
        flex-direction: column;
        text-align: center;
    }

    .footer-links {
        gap: 16px;
    }

}

/* Small phone */
@media (max-width: 480px) {
    .hero {
        padding: 90px 16px 48px;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .hero-sub {
        font-size: 0.95rem;
        margin-bottom: 28px;
    }

    .hero-actions {
        flex-direction: column;
    }

    .btn {
        width: 100%;
        justify-content: center;
    }

    .btn-lg {
        padding: 14px 24px;
        font-size: 0.9rem;
    }

    .hero-stats {
        grid-template-columns: repeat(3, 1fr);
        gap: 12px;
    }

    .stat-number {
        font-size: 1.5rem;
    }

    .section-header h2 {
        font-size: 1.75rem;
    }

    .section-header p {
        font-size: 0.95rem;
    }

    .project-info {
        padding: 18px;
    }

    .project-info h3 {
        font-size: 1.05rem;
    }

    .project-info p {
        font-size: 0.85rem;
    }

    .cta-block h2 {
        font-size: 1.75rem;
    }

    .cta-block p {
        font-size: 0.95rem;
    }

    .mobile-menu {
        font-size: 1.25rem;
    }

    .logo-text {
        font-size: 0.9rem;
    }
}

/* Very small screens */
@media (max-width: 360px) {
    .hero h1 {
        font-size: 1.7rem;
    }

    .hero-badge {
        font-size: 0.7rem;
        padding: 5px 12px;
    }

    .terminal-body {
        font-size: 0.65rem;
        min-height: 170px;
        padding: 12px;
    }

    .syn-line-num {
        width: 1.8em;
        margin-right: 0.8em;
    }
}
