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

:root {
    --bg:         #0d0d14;
    --bg-2:       #111120;
    --card:       #161626;
    --card-hover: #1c1c34;
    --accent:     #00d4ff;
    --accent-2:   #8b5cf6;
    --text:       #f1f5f9;
    --text-dim:   #94a3b8;
    --text-muted: #4a5568;
    --border:     rgba(0, 212, 255, 0.12);
    --glow:       0 0 30px rgba(0, 212, 255, 0.18);
    --r:          14px;
    --r-lg:       20px;
}

html { scroll-behavior: smooth; }

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    overflow-x: hidden;
}

.accent { color: var(--accent); }

/* === NAVIGATION === */
#navbar {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 100;
    padding: 1.1rem 0;
    transition: background 0.3s, box-shadow 0.3s;
}

#navbar.scrolled {
    background: rgba(13, 13, 20, 0.92);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 1px 0 var(--border);
}

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

.nav-logo {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text);
    text-decoration: none;
    letter-spacing: -0.02em;
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 2.5rem;
    align-items: center;
}

.nav-links a {
    color: var(--text-dim);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: color 0.2s;
}

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

.nav-links a.nav-cta {
    background: var(--accent);
    color: var(--bg);
    padding: 0.5rem 1.25rem;
    border-radius: 8px;
    font-weight: 600;
    transition: opacity 0.2s, transform 0.2s, box-shadow 0.2s;
}

.nav-links a.nav-cta:hover {
    opacity: 0.9;
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(0, 212, 255, 0.3);
}

/* Hamburger button */
.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    z-index: 200;
}

.nav-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text);
    border-radius: 2px;
    transition: all 0.3s;
}

.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;
    justify-content: center;
    text-align: center;
    position: relative;
    padding: 120px 2rem 80px;
    overflow: hidden;
}

.hero-bg {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.grid-overlay {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(0, 212, 255, 0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 212, 255, 0.035) 1px, transparent 1px);
    background-size: 64px 64px;
    mask-image: radial-gradient(ellipse 80% 80% at 50% 50%, black 30%, transparent 100%);
    -webkit-mask-image: radial-gradient(ellipse 80% 80% at 50% 50%, black 30%, transparent 100%);
}

.glow-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.15;
}

.glow-1 {
    width: 600px; height: 600px;
    background: var(--accent);
    top: -200px; left: -200px;
}

.glow-2 {
    width: 500px; height: 500px;
    background: var(--accent-2);
    bottom: -200px; right: -200px;
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 680px;
}

/* Terminal */
.terminal-window {
    background: rgba(22, 22, 38, 0.85);
    border: 1px solid var(--border);
    border-radius: var(--r);
    margin-bottom: 2.5rem;
    overflow: hidden;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    text-align: left;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.terminal-header {
    background: rgba(255, 255, 255, 0.035);
    padding: 0.7rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-bottom: 1px solid var(--border);
}

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

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

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

.terminal-title {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.72rem;
    color: var(--text-muted);
    margin: 0 auto;
}

.terminal-body {
    padding: 1.1rem 1.4rem;
    min-height: 50px;
}

.terminal-line {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.terminal-prompt { color: var(--accent); user-select: none; }
#typed-text      { color: var(--text); }

.terminal-cursor {
    color: var(--accent);
    animation: blink 1s step-end infinite;
    line-height: 1;
}

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

/* Hero text */
#hero h1 {
    font-size: clamp(2.4rem, 6vw, 3.8rem);
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.1;
    margin-bottom: 0.6rem;
}

.hero-subtitle {
    font-size: 1.2rem;
    color: var(--text-dim);
    font-weight: 400;
    margin-bottom: 1.25rem;
}

.hero-description {
    font-size: 1rem;
    color: var(--text-muted);
    line-height: 1.75;
    margin-bottom: 2.5rem;
    max-width: 560px;
    margin-left: auto;
    margin-right: auto;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* === BUTTONS === */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.85rem 2rem;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    text-decoration: none;
    cursor: pointer;
    border: none;
    transition: all 0.22s;
    white-space: nowrap;
}

.btn-primary {
    background: var(--accent);
    color: var(--bg);
    box-shadow: 0 0 24px rgba(0, 212, 255, 0.25);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 36px rgba(0, 212, 255, 0.45);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    background: transparent;
    color: var(--text);
    border: 1px solid rgba(255, 255, 255, 0.12);
}

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

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

.btn-arrow { font-style: normal; }

/* === SECTIONS COMMON === */
section { padding: 100px 2rem; }

.section-container {
    max-width: 1120px;
    margin: 0 auto;
}

.section-header {
    text-align: center;
    margin-bottom: 4rem;
}

.section-tag {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    color: var(--accent);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    display: block;
    margin-bottom: 0.9rem;
}

.section-header h2 {
    font-size: clamp(1.8rem, 4vw, 2.6rem);
    font-weight: 700;
    letter-spacing: -0.025em;
    margin-bottom: 0.9rem;
}

.section-subtitle {
    color: var(--text-muted);
    max-width: 460px;
    margin: 0 auto;
    font-size: 1rem;
}

/* === SKILLS === */
#skills { background: var(--bg-2); }

.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.25rem;
}

.skill-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: 2rem;
    opacity: 0;
    transform: translateY(22px);
    transition:
        opacity 0.55s ease,
        transform 0.55s ease,
        border-color 0.3s,
        background 0.3s,
        box-shadow 0.3s;
}

.skill-card.visible {
    opacity: 1;
    transform: translateY(0);
}

.skill-card.visible:hover {
    border-color: rgba(0, 212, 255, 0.28);
    background: var(--card-hover);
    transform: translateY(-5px);
    box-shadow: var(--glow);
}

.skill-card:nth-child(1) { transition-delay: 0.05s; }
.skill-card:nth-child(2) { transition-delay: 0.15s; }
.skill-card:nth-child(3) { transition-delay: 0.25s; }
.skill-card:nth-child(4) { transition-delay: 0.35s; }

.skill-icon {
    width: 48px;
    height: 48px;
    margin-bottom: 1.3rem;
}

.skill-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.ts-icon {
    background: #3178c6;
    color: #fff;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
    font-size: 1rem;
}

.skill-card h3 {
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.skill-card p {
    color: var(--text-muted);
    font-size: 0.875rem;
    line-height: 1.6;
    margin-bottom: 1.3rem;
}

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

.tag {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.7rem;
    background: rgba(0, 212, 255, 0.07);
    color: var(--accent);
    border: 1px solid rgba(0, 212, 255, 0.15);
    padding: 0.2rem 0.55rem;
    border-radius: 6px;
}

/* === PROJECTS === */
#projects { background: var(--bg); }

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.25rem;
}

.project-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
    position: relative;
    overflow: hidden;
    opacity: 0;
    transform: translateY(22px);
    transition:
        opacity 0.55s ease,
        transform 0.55s ease,
        border-color 0.3s,
        background 0.3s,
        box-shadow 0.3s;
}

.project-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
    opacity: 0;
    transition: opacity 0.3s;
}

.project-card.visible {
    opacity: 1;
    transform: translateY(0);
}

.project-card.visible:hover {
    border-color: rgba(0, 212, 255, 0.25);
    background: var(--card-hover);
    transform: translateY(-5px);
    box-shadow: var(--glow);
}

.project-card.visible:hover::before { opacity: 1; }

.project-card:nth-child(1) { transition-delay: 0.05s; }
.project-card:nth-child(2) { transition-delay: 0.15s; }
.project-card:nth-child(3) { transition-delay: 0.25s; }

.project-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.72rem;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.status-dot {
    width: 7px; height: 7px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 6px var(--accent);
    animation: pulse 2.2s ease-in-out infinite;
}

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

.project-icon { font-size: 2.2rem; }

.project-card h3 {
    font-size: 1.1rem;
    font-weight: 600;
}

.project-card p {
    color: var(--text-muted);
    font-size: 0.875rem;
    line-height: 1.65;
    flex: 1;
}

.project-footer {
    padding-top: 1rem;
    border-top: 1px solid var(--border);
    margin-top: auto;
}

.coming-soon-label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* === CONTACT === */
#contact { background: var(--bg-2); }

.contact-wrapper {
    max-width: 580px;
    margin: 0 auto;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-group {
    margin-bottom: 1.1rem;
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text-dim);
    margin-bottom: 0.4rem;
}

.form-group input,
.form-group textarea {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0.85rem 1rem;
    color: var(--text);
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    outline: none;
    resize: vertical;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--text-muted);
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.1);
}

.form-success,
.form-error {
    display: none;
    text-align: center;
    font-size: 0.875rem;
    margin-top: 1rem;
    padding: 0.85rem 1rem;
    border-radius: 10px;
}

.form-success.visible {
    display: block;
    color: var(--accent);
    background: rgba(0, 212, 255, 0.07);
    border: 1px solid rgba(0, 212, 255, 0.18);
}

.form-error.visible {
    display: block;
    color: #f87171;
    background: rgba(248, 113, 113, 0.07);
    border: 1px solid rgba(248, 113, 113, 0.18);
}

/* === FOOTER === */
footer {
    padding: 2rem;
    border-top: 1px solid var(--border);
}

.footer-container {
    max-width: 1120px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
}

.footer-logo {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.2rem;
    font-weight: 700;
}

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

/* === SCROLL FADE-IN === */
.fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

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

/* === RESPONSIVE === */
@media (max-width: 768px) {
    .nav-toggle { display: flex; }

    .nav-links {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(13, 13, 20, 0.97);
        backdrop-filter: blur(16px);
        -webkit-backdrop-filter: blur(16px);
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 2.5rem;
        z-index: 150;
    }

    .nav-links.open { display: flex; }

    .nav-links a {
        font-size: 1.3rem;
        color: var(--text);
    }

    .nav-links a.nav-cta {
        padding: 0.8rem 2.5rem;
        font-size: 1.1rem;
    }

    section { padding: 80px 1.25rem; }

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

    .form-row { grid-template-columns: 1fr; }

    .hero-buttons {
        flex-direction: column;
        align-items: stretch;
    }

    .btn { justify-content: center; }

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

@media (max-width: 480px) {
    #hero { padding-top: 100px; }

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