/* ============================================
   DESIGN TOKENS
   ============================================ */
:root {
    /* Surface */
    --bg-deep:       #08090d;
    --bg-base:       #0c0e14;
    --bg-elevated:   #12151e;
    --bg-card:       rgba(18, 21, 30, 0.65);
    --bg-card-hover: rgba(24, 28, 40, 0.8);

    /* Borders */
    --border-subtle:  rgba(255, 255, 255, 0.06);
    --border-medium:  rgba(255, 255, 255, 0.1);
    --border-hover:   rgba(255, 255, 255, 0.15);

    /* Text */
    --text-primary:   #e8eaed;
    --text-secondary: #8b8fa3;
    --text-muted:     #565a6e;

    /* Accents */
    --cyan:    #06d6a0;
    --cyan-glow: rgba(6, 214, 160, 0.15);
    --violet:  #7c3aed;
    --violet-glow: rgba(124, 58, 237, 0.15);
    --amber:   #f59e0b;
    --amber-glow: rgba(245, 158, 11, 0.15);
    --green:   #10b981;
    --green-glow: rgba(16, 185, 129, 0.15);
    --blue:    #3b82f6;

    /* Typography */
    --font-sans:  'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono:  'JetBrains Mono', 'Fira Code', monospace;

    /* Layout */
    --max-width: 1200px;
    --gutter: 24px;

    /* Timing */
    --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-out-quart: cubic-bezier(0.25, 1, 0.5, 1);
}


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

html {
    scroll-behavior: smooth;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

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

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


/* ============================================
   AMBIENT BACKGROUND
   ============================================ */
.bg-grid {
    position: fixed;
    inset: 0;
    z-index: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
    background-size: 60px 60px;
    pointer-events: none;
}

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

.bg-glow--1 {
    width: 600px;
    height: 600px;
    top: -200px;
    right: -100px;
    background: radial-gradient(circle, var(--cyan-glow), transparent 70%);
    animation: glowDrift1 20s ease-in-out infinite alternate;
}

.bg-glow--2 {
    width: 500px;
    height: 500px;
    bottom: -150px;
    left: -100px;
    background: radial-gradient(circle, var(--violet-glow), transparent 70%);
    animation: glowDrift2 25s ease-in-out infinite alternate;
}

@keyframes glowDrift1 {
    0%   { transform: translate(0, 0); }
    100% { transform: translate(-80px, 60px); }
}

@keyframes glowDrift2 {
    0%   { transform: translate(0, 0); }
    100% { transform: translate(60px, -80px); }
}


/* ============================================
   NAVIGATION
   ============================================ */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    padding: 0 var(--gutter);
    background: rgba(8, 9, 13, 0.6);
    backdrop-filter: blur(20px) saturate(1.2);
    -webkit-backdrop-filter: blur(20px) saturate(1.2);
    border-bottom: 1px solid var(--border-subtle);
    transition: background 0.3s ease;
}

.nav__inner {
    max-width: var(--max-width);
    margin: 0 auto;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav__brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.nav__logo {
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--cyan), var(--violet));
    border-radius: 8px;
    font-weight: 700;
    font-size: 16px;
    color: #fff;
}

.nav__name {
    font-weight: 600;
    font-size: 16px;
    letter-spacing: -0.02em;
}

.nav__links {
    display: flex;
    align-items: center;
    gap: 28px;
}

.nav__link {
    font-size: 14px;
    font-weight: 400;
    color: var(--text-secondary);
    transition: color 0.25s ease;
    position: relative;
}

.nav__link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 1.5px;
    background: var(--cyan);
    transition: width 0.3s var(--ease-out-expo);
}

.nav__link:hover {
    color: var(--text-primary);
}

.nav__link:hover::after {
    width: 100%;
}

.nav__link--github {
    display: flex;
    align-items: center;
    padding: 6px;
    border-radius: 6px;
    transition: background 0.2s ease, color 0.2s ease;
}

.nav__link--github::after {
    display: none;
}

.nav__link--github:hover {
    background: var(--border-subtle);
    color: var(--text-primary);
}


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

.hero__content {
    max-width: 740px;
}

.hero__badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-mono);
    font-size: 13px;
    font-weight: 500;
    color: var(--cyan);
    padding: 6px 16px;
    border: 1px solid rgba(6, 214, 160, 0.2);
    border-radius: 100px;
    background: rgba(6, 214, 160, 0.06);
    margin-bottom: 32px;
    letter-spacing: 0.02em;
    animation: fadeUp 0.8s var(--ease-out-expo) 0.1s both;
}

.hero__title {
    font-size: clamp(2.8rem, 6vw, 4.5rem);
    font-weight: 800;
    line-height: 1.08;
    letter-spacing: -0.035em;
    margin-bottom: 24px;
}

.hero__line {
    display: block;
}

.hero__line--1 {
    animation: fadeUp 0.8s var(--ease-out-expo) 0.2s both;
}

.hero__line--2 {
    animation: fadeUp 0.8s var(--ease-out-expo) 0.35s both;
}

.hero__line--2 em {
    font-style: normal;
    background: linear-gradient(135deg, var(--cyan), var(--violet));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero__sub {
    font-size: 18px;
    color: var(--text-secondary);
    line-height: 1.7;
    max-width: 560px;
    margin-bottom: 40px;
    animation: fadeUp 0.8s var(--ease-out-expo) 0.5s both;
}

.hero__cta {
    display: flex;
    gap: 16px;
    animation: fadeUp 0.8s var(--ease-out-expo) 0.65s both;
}


/* ============================================
   BUTTONS
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 28px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 10px;
    transition: all 0.3s var(--ease-out-quart);
    cursor: pointer;
    border: none;
}

.btn--primary {
    background: linear-gradient(135deg, var(--cyan), #059669);
    color: #fff;
    box-shadow: 0 0 20px rgba(6, 214, 160, 0.15);
}

.btn--primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 30px rgba(6, 214, 160, 0.3);
}

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

.btn--ghost:hover {
    color: var(--text-primary);
    border-color: var(--border-hover);
    background: rgba(255, 255, 255, 0.03);
    transform: translateY(-2px);
}


/* ============================================
   HERO SCROLL INDICATOR
   ============================================ */
.hero__scroll {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    animation: fadeUp 0.8s var(--ease-out-expo) 1s both;
}

.hero__scroll-line {
    width: 1px;
    height: 48px;
    background: linear-gradient(to bottom, var(--cyan), transparent);
    animation: scrollPulse 2s ease-in-out infinite;
}

@keyframes scrollPulse {
    0%, 100% { opacity: 0.3; transform: scaleY(0.6); }
    50%      { opacity: 1; transform: scaleY(1); }
}


/* ============================================
   SECTIONS
   ============================================ */
.section {
    position: relative;
    z-index: 1;
    padding: 100px var(--gutter);
    max-width: var(--max-width);
    margin: 0 auto;
}

.section__header {
    margin-bottom: 56px;
}

.section__label {
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--cyan);
    font-weight: 500;
    display: block;
    margin-bottom: 12px;
    letter-spacing: 0.04em;
}

.section__title {
    font-size: clamp(1.8rem, 4vw, 2.4rem);
    font-weight: 700;
    letter-spacing: -0.03em;
    margin-bottom: 12px;
}

.section__desc {
    color: var(--text-secondary);
    font-size: 16px;
    max-width: 480px;
}


/* ============================================
   FEATURED PROJECT GRID
   ============================================ */
.featured-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}

.card--wide {
    grid-column: span 2;
}


/* ============================================
   CARD — FEATURED
   ============================================ */
.card {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    transition: transform 0.4s var(--ease-out-expo), box-shadow 0.4s ease;
}

.card--featured {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.card--featured:hover {
    transform: translateY(-4px);
    border-color: var(--border-hover);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.3);
}

.card__accent {
    height: 3px;
    width: 100%;
}

.card__accent--cyan   { background: linear-gradient(90deg, var(--cyan), var(--blue)); }
.card__accent--violet { background: linear-gradient(90deg, var(--violet), #a855f7); }
.card__accent--amber  { background: linear-gradient(90deg, var(--amber), #ef4444); }
.card__accent--green  { background: linear-gradient(90deg, var(--green), var(--cyan)); }

.card__body {
    padding: 32px;
}

.card__meta {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.card__tag {
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 500;
    padding: 4px 10px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    letter-spacing: 0.02em;
}

.card__tag--cyan   { background: var(--cyan-glow);   color: var(--cyan); }
.card__tag--violet { background: var(--violet-glow); color: #a78bfa; }
.card__tag--amber  { background: var(--amber-glow);  color: var(--amber); }
.card__tag--green  { background: var(--green-glow);  color: var(--green); }

.card__title {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 12px;
}

.card--featured.card--wide .card__title {
    font-size: 26px;
}

.card__desc {
    color: var(--text-secondary);
    font-size: 15px;
    line-height: 1.7;
    margin-bottom: 20px;
}

.card__stack {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 24px;
}

.card__stack span {
    font-size: 12px;
    font-weight: 500;
    padding: 4px 12px;
    border-radius: 100px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-subtle);
    color: var(--text-muted);
    transition: border-color 0.2s ease, color 0.2s ease;
}

.card:hover .card__stack span {
    border-color: var(--border-medium);
    color: var(--text-secondary);
}

.card__links {
    display: flex;
    gap: 16px;
    align-items: center;
}

.card__link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    transition: color 0.25s ease;
}

.card__link:hover {
    color: var(--text-primary);
}

.card__link--live {
    color: var(--cyan);
}

.card__link--live:hover {
    color: #34d399;
}

.card__live-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--cyan);
    animation: livePulse 2s ease-in-out infinite;
    display: inline-block;
}

@keyframes livePulse {
    0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(6, 214, 160, 0.4); }
    50%      { opacity: 0.7; box-shadow: 0 0 0 6px rgba(6, 214, 160, 0); }
}

.card__link--inline {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-top: 8px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: color 0.25s ease;
}

.card__link--inline:hover {
    color: var(--text-primary);
}


/* ============================================
   TOOLS GRID
   ============================================ */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

.card--tool {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 28px;
}

.card--tool:hover {
    transform: translateY(-3px);
    border-color: var(--border-hover);
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.25);
}

.card__icon {
    font-size: 28px;
    margin-bottom: 16px;
    filter: grayscale(0.2);
}

.card--tool .card__title {
    font-size: 18px;
    margin-bottom: 10px;
}

.card--tool .card__desc {
    font-size: 14px;
    margin-bottom: 16px;
}


/* ============================================
   EXPLORE GRID
   ============================================ */
.explore-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
}

.card--explore {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-subtle);
    padding: 24px;
}

.card--explore:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: var(--border-medium);
    transform: translateY(-2px);
}

.card--explore .card__title {
    font-size: 16px;
    margin-bottom: 8px;
}

.card--explore .card__desc {
    font-size: 13px;
    line-height: 1.6;
    margin-bottom: 12px;
}


/* ============================================
   FOOTER
   ============================================ */
.footer {
    position: relative;
    z-index: 1;
    border-top: 1px solid var(--border-subtle);
    padding: 48px var(--gutter) 32px;
    margin-top: 80px;
}

.footer__inner {
    max-width: var(--max-width);
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 40px;
}

.footer__left {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.footer__brand {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.footer__tagline {
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--text-muted);
}

.footer__right {
    display: flex;
    gap: 24px;
}

.footer__link {
    font-size: 14px;
    color: var(--text-secondary);
    transition: color 0.25s ease;
}

.footer__link:hover {
    color: var(--text-primary);
}

.footer__bottom {
    max-width: var(--max-width);
    margin: 0 auto;
    padding-top: 24px;
    border-top: 1px solid var(--border-subtle);
    font-size: 13px;
    color: var(--text-muted);
}


/* ============================================
   REVEAL ANIMATIONS
   ============================================ */
[data-reveal] {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.7s var(--ease-out-expo), transform 0.7s var(--ease-out-expo);
}

[data-reveal].revealed {
    opacity: 1;
    transform: translateY(0);
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}


/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 900px) {
    .featured-grid {
        grid-template-columns: 1fr;
    }

    .card--wide {
        grid-column: span 1;
    }
}

@media (max-width: 640px) {
    :root {
        --gutter: 16px;
    }

    .nav__links {
        gap: 16px;
    }

    .nav__link:not(.nav__link--github) {
        display: none;
    }

    .hero {
        padding-top: 100px;
    }

    .hero__sub {
        font-size: 16px;
    }

    .hero__cta {
        flex-direction: column;
    }

    .btn {
        justify-content: center;
    }

    .section {
        padding: 60px var(--gutter);
    }

    .card__body {
        padding: 24px;
    }

    .card--featured.card--wide .card__title {
        font-size: 22px;
    }

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

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

    .footer__inner {
        flex-direction: column;
        gap: 24px;
    }

    .footer__right {
        flex-wrap: wrap;
    }
}
