/* ----- Reset & base ----- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg: #2a2a2a;
    --bg-elev: #333333;
    --bg-soft: #3a3a3a;
    --border: #4a4a4a;
    --border-strong: #5a5a5a;
    --text: #e6e9ef;
    --text-dim: #a3adbb;
    --text-mute: #6b7585;
    --accent: #a8ff60;
    --accent-soft: rgba(168, 255, 96, 0.12);
    --accent-2: #7c5cff;
    --danger: #ff6b6b;
    --radius: 14px;
    --radius-sm: 8px;
    --container: 1200px;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    position: relative;
}

.container {
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 24px;
}

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

h1, h2, h3, h4, h5 {
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.15;
}

/* ----- Background atmosphere ----- */
.bg-grid {
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
    background-size: 56px 56px;
    mask-image: radial-gradient(ellipse at 50% 0%, #000 30%, transparent 80%);
    -webkit-mask-image: radial-gradient(ellipse at 50% 0%, #000 30%, transparent 80%);
    pointer-events: none;
    z-index: 0;
}

.bg-glow {
    position: fixed;
    top: -200px;
    left: 50%;
    transform: translateX(-50%);
    width: 900px;
    height: 600px;
    background: radial-gradient(ellipse at center, rgba(168, 255, 96, 0.18), transparent 60%);
    filter: blur(40px);
    pointer-events: none;
    z-index: 0;
}

main, .site-header, .site-footer {
    position: relative;
    z-index: 1;
}

/* ----- Header ----- */
.site-header {
    position: sticky;
    top: 0;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    background: rgba(11, 13, 16, 0.7);
    border-bottom: 1px solid var(--border);
    z-index: 50;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
    gap: 32px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 17px;
    letter-spacing: -0.01em;
}

.logo-mark {
    font-size: 22px;
    color: var(--accent);
    line-height: 1;
}

.nav {
    display: flex;
    gap: 28px;
    font-size: 14px;
    color: var(--text-dim);
}

.nav a {
    transition: color 0.15s ease;
}

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

/* ----- Buttons ----- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 11px 18px;
    border-radius: var(--radius-sm);
    font-weight: 500;
    font-size: 14px;
    border: 1px solid transparent;
    transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
    cursor: pointer;
    white-space: nowrap;
}

.btn-sm { padding: 8px 14px; font-size: 13px; }
.btn-lg { padding: 14px 24px; font-size: 15px; }

.btn-primary {
    background: var(--accent);
    color: #0b0d10;
    font-weight: 600;
}

.btn-primary:hover {
    transform: translateY(-1px);
    background: #b8ff7a;
}

.btn-ghost {
    background: transparent;
    color: var(--text);
    border-color: var(--border-strong);
}

.btn-ghost:hover {
    background: var(--bg-elev);
    border-color: #3a4555;
}

.arrow { transition: transform 0.2s ease; }
.btn:hover .arrow { transform: translateX(3px); }

/* ----- Hero ----- */
.hero {
    padding: 90px 0 80px;
    text-align: center;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    border: 1px solid var(--border-strong);
    border-radius: 999px;
    font-size: 13px;
    color: var(--text-dim);
    background: var(--bg-elev);
    margin-bottom: 28px;
}

.dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 10px var(--accent);
    animation: pulse 2s infinite;
}

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

.hero-title {
    font-size: clamp(36px, 6vw, 64px);
    max-width: 880px;
    margin: 0 auto 24px;
    letter-spacing: -0.03em;
}

.grad {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.hero-sub {
    font-size: 18px;
    color: var(--text-dim);
    max-width: 640px;
    margin: 0 auto 40px;
    line-height: 1.6;
}

.hero-cta {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 72px;
}

.hero-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1px;
    background: var(--border);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    max-width: 880px;
    margin: 0 auto;
}

.stat {
    background: var(--bg-elev);
    padding: 24px 16px;
    text-align: center;
}

.stat-num {
    font-size: 28px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.02em;
    margin-bottom: 4px;
}

.stat-label {
    font-size: 13px;
    color: var(--text-mute);
}

/* ----- Sections ----- */
.section {
    padding: 100px 0;
    border-top: 1px solid var(--border);
}

.section-head {
    text-align: center;
    margin-bottom: 56px;
    max-width: 640px;
    margin-left: auto;
    margin-right: auto;
}

.kicker {
    display: inline-block;
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 14px;
}

.section-head h2 {
    font-size: clamp(28px, 4vw, 42px);
    margin-bottom: 14px;
}

.section-sub {
    color: var(--text-dim);
    font-size: 16px;
}

/* ----- Projects grid ----- */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-auto-rows: 1fr;
    gap: 20px;
}

.project-card {
    background: var(--bg-elev);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px;
    display: flex;
    flex-direction: column;
    transition: border-color 0.2s ease, transform 0.2s ease, background 0.2s ease;
    position: relative;
}

.project-card:hover {
    border-color: var(--border-strong);
    transform: translateY(-2px);
}

.project-card.featured {
    grid-column: span 3;
    background: linear-gradient(135deg, var(--bg-elev) 0%, #161b22 100%);
    border-color: var(--border-strong);
    padding: 36px;
}

.project-tag {
    display: inline-block;
    align-self: flex-start;
    padding: 4px 10px;
    border-radius: 6px;
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 14px;
    font-family: 'JetBrains Mono', monospace;
}

.project-card h3 {
    font-size: 22px;
    margin-bottom: 10px;
}

.project-card.featured h3 {
    font-size: 32px;
}

.project-desc {
    color: var(--text-dim);
    font-size: 15px;
    margin-bottom: 18px;
    flex: 1;
}

.project-card.featured .project-desc {
    font-size: 17px;
    max-width: 620px;
}

.project-meta {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 18px;
}

.project-meta li {
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    color: var(--text-mute);
    padding: 4px 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg);
}

.project-link {
    font-size: 14px;
    color: var(--accent);
    font-weight: 500;
}

.project-link.muted {
    color: var(--text-mute);
    font-style: italic;
}

/* ----- Feature section (Wiggle) ----- */
.section-feature {
    background: linear-gradient(180deg, transparent 0%, rgba(124, 92, 255, 0.04) 50%, transparent 100%);
}

.feature-grid {
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    gap: 64px;
    align-items: center;
}

.feature-text h2 {
    font-size: clamp(30px, 4vw, 44px);
    margin: 14px 0 18px;
}

.lead {
    font-size: 17px;
    color: var(--text-dim);
    margin-bottom: 36px;
    line-height: 1.6;
}

.feature-points {
    display: flex;
    flex-direction: column;
    gap: 24px;
    margin-bottom: 36px;
}

.point {
    display: flex;
    gap: 16px;
}

.point-num {
    flex-shrink: 0;
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    color: var(--accent);
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: 1px solid var(--border-strong);
    background: var(--bg-elev);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

.point h4 {
    font-size: 16px;
    margin-bottom: 4px;
}

.point p {
    color: var(--text-dim);
    font-size: 14px;
}

.feature-cta {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

/* ----- Feature visual ----- */
.feature-visual {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.wiggle-frame {
    position: relative;
    aspect-ratio: 4 / 3;
    border-radius: var(--radius);
    overflow: hidden;
    background: #0a0c10;
    border: 1px solid var(--border-strong);
    box-shadow: 0 30px 80px -20px rgba(124, 92, 255, 0.3);
}

.wiggle-layer {
    position: absolute;
    inset: 0;
    animation: wiggle 4s ease-in-out infinite;
}

.layer-back {
    background:
        radial-gradient(circle at 30% 40%, rgba(124, 92, 255, 0.4), transparent 50%),
        radial-gradient(circle at 70% 60%, rgba(168, 255, 96, 0.25), transparent 50%),
        linear-gradient(180deg, #1a1530 0%, #0a0c10 100%);
    animation-duration: 5s;
}

.layer-mid {
    background:
        radial-gradient(ellipse 40% 30% at 50% 70%, rgba(168, 255, 96, 0.35), transparent 70%);
    animation-duration: 4s;
    animation-delay: -0.5s;
}

.layer-front {
    background:
        radial-gradient(circle 80px at 35% 55%, rgba(255, 255, 255, 0.08), transparent),
        radial-gradient(circle 60px at 65% 45%, rgba(168, 255, 96, 0.2), transparent);
    animation-duration: 3s;
    animation-delay: -1s;
}

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

.layer-mid { animation-name: wiggle-mid; }
@keyframes wiggle-mid {
    0%, 100% { transform: translateX(-16px); }
    50% { transform: translateX(16px); }
}

.layer-front { animation-name: wiggle-front; }
@keyframes wiggle-front {
    0%, 100% { transform: translateX(-26px) scale(1.02); }
    50% { transform: translateX(26px) scale(1.02); }
}

.wiggle-label {
    position: absolute;
    bottom: 12px;
    left: 12px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    color: var(--text-dim);
    background: rgba(0, 0, 0, 0.5);
    padding: 4px 8px;
    border-radius: 4px;
    backdrop-filter: blur(6px);
    z-index: 5;
}

/* ----- Code block ----- */
.code-block {
    background: #07090c;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    font-family: 'JetBrains Mono', monospace;
    font-size: 12.5px;
}

.code-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: var(--bg-elev);
    border-bottom: 1px solid var(--border);
}

.dots { display: flex; gap: 6px; }
.dots i {
    display: block;
    width: 10px; height: 10px;
    border-radius: 50%;
    background: var(--border-strong);
}
.dots i:nth-child(1) { background: #ff5f57; }
.dots i:nth-child(2) { background: #febc2e; }
.dots i:nth-child(3) { background: #28c840; }

.code-file {
    font-size: 12px;
    color: var(--text-mute);
}

.code-block pre {
    padding: 16px 18px;
    overflow-x: auto;
    line-height: 1.6;
    color: #d4d8e0;
}

.c-key { color: #ff7b9c; }
.c-typ { color: #7dd3fc; }
.c-fn  { color: #c4b5fd; }
.c-com { color: #6b7585; font-style: italic; }

/* ----- Stack ----- */
.stack-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.stack-cat {
    background: var(--bg-elev);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
}

.stack-cat h4 {
    font-size: 14px;
    color: var(--accent);
    margin-bottom: 14px;
    font-family: 'JetBrains Mono', monospace;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stack-cat ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.stack-cat li {
    color: var(--text-dim);
    font-size: 14px;
    padding-bottom: 8px;
    border-bottom: 1px dashed var(--border);
}

.stack-cat li:last-child {
    border-bottom: none;
}

/* ----- About ----- */
.about-grid {
    display: grid;
    grid-template-columns: 1fr 1.4fr;
    gap: 64px;
    align-items: start;
}

.about-grid h2 {
    font-size: clamp(28px, 4vw, 40px);
    margin-top: 14px;
}

.about-text {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.about-text p {
    color: var(--text-dim);
    font-size: 16px;
    line-height: 1.7;
}

/* ----- CTA ----- */
.section-cta {
    background:
        radial-gradient(ellipse at 50% 100%, rgba(168, 255, 96, 0.1), transparent 70%),
        var(--bg);
    text-align: center;
    padding: 120px 0;
}

.cta-inner h2 {
    font-size: clamp(28px, 4.5vw, 44px);
    margin-bottom: 16px;
}

.cta-inner p {
    color: var(--text-dim);
    font-size: 17px;
    margin-bottom: 32px;
}

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

/* ----- Footer ----- */
.site-footer {
    border-top: 1px solid var(--border);
    padding: 56px 0 32px;
    background: var(--bg-elev);
}

.footer-inner {
    display: flex;
    flex-direction: column;
    gap: 40px;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 18px;
}

.footer-cols {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.footer-cols h5 {
    font-size: 13px;
    color: var(--text);
    margin-bottom: 14px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-family: 'JetBrains Mono', monospace;
}

.footer-cols a {
    display: block;
    color: var(--text-dim);
    font-size: 14px;
    padding: 4px 0;
    transition: color 0.15s ease;
}

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

.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 24px;
    border-top: 1px solid var(--border);
    color: var(--text-mute);
    font-size: 13px;
}

.mono { font-family: 'JetBrains Mono', monospace; }

/* ----- Responsive ----- */
@media (max-width: 960px) {
    .nav { display: none; }
    .projects-grid { grid-template-columns: repeat(2, 1fr); }
    .project-card.featured { grid-column: span 2; }
    .feature-grid { grid-template-columns: 1fr; gap: 40px; }
    .about-grid { grid-template-columns: 1fr; gap: 24px; }
    .stack-grid { grid-template-columns: repeat(2, 1fr); }
    .hero-stats { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 600px) {
    .hero { padding: 60px 0 50px; }
    .section { padding: 70px 0; }
    .projects-grid { grid-template-columns: 1fr; }
    .project-card.featured { grid-column: span 1; padding: 24px; }
    .project-card.featured h3 { font-size: 26px; }
    .footer-cols { grid-template-columns: repeat(2, 1fr); }
    .footer-bottom { flex-direction: column; gap: 10px; }
    .header-inner .btn { display: none; }
}
