/* ─── Design System ──────────────────────────────────────────── */
:root {
    --bg: #07090F;
    --bg-2: #0D111A;
    --panel: rgba(255,255,255,0.035);
    --panel-strong: rgba(255,255,255,0.06);
    --line: rgba(255,255,255,0.09);
    --text: #CBD5E1;
    --text-strong: #F8FAFC;
    --muted: #7B8798;
    --accent: #3B82F6;
    --accent-2: #06B6D4;
    --accent-3: #94A3B8;
    --radius: 18px;
}

* { box-sizing: border-box; }

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg);
    color: #CBD5E1;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background:
        linear-gradient(115deg, transparent 0 42%, rgba(59,130,246,0.035) 42% 42.4%, transparent 42.4%),
        linear-gradient(65deg, transparent 0 58%, rgba(6,182,212,0.03) 58% 58.4%, transparent 58.4%);
    mask-image: linear-gradient(to bottom, rgba(0,0,0,0.9), transparent 78%);
}

h1, h2, h3, h4 { font-family: 'Space Grotesk', sans-serif; }

/* ─── Background ─────────────────────────────────────────────── */
.bg-mesh {
    background-color: var(--bg);
    background-image:
        radial-gradient(ellipse at 15% 10%, rgba(59,130,246,0.13) 0%, transparent 45%),
        radial-gradient(ellipse at 85% 85%, rgba(6,182,212,0.09) 0%, transparent 45%),
        radial-gradient(ellipse at 55% 45%, rgba(148,163,184,0.045) 0%, transparent 40%);
}

/* Particle canvas sits behind everything */
#particle-canvas {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
}

.grid-overlay {
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,0.018) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.018) 1px, transparent 1px);
    background-size: 60px 60px;
    pointer-events: none;
    z-index: 0;
}

.cursor-glow {
    position: fixed;
    width: 360px;
    height: 360px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(59,130,246,0.055) 0%, transparent 70%);
    pointer-events: none;
    transform: translate(-50%, -50%);
    z-index: 1;
    transition: left 0.06s ease, top 0.06s ease;
}

/* ─── Navigation ─────────────────────────────────────────────── */
.main-nav {
    background: rgba(7,9,15,0.75);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.mobile-nav-panel {
    background: rgba(7,9,15,0.96);
    backdrop-filter: blur(24px);
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.nav-mobile {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 500;
    transition: color 0.2s;
}

.logo {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    color: #F8FAFC;
    text-decoration: none;
}

.nav-link {
    position: relative;
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 500;
    font-size: 15px;
    color: #64748B;
    text-decoration: none;
    transition: color 0.25s;
}
.nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -5px;
    left: 0;
    background: linear-gradient(90deg, #3B82F6, #06B6D4);
    transition: width 0.3s cubic-bezier(0.4,0,0.2,1);
    border-radius: 2px;
}
.nav-link:hover, .nav-link.active { color: #F1F5F9; }
.nav-link:hover::after, .nav-link.active::after { width: 100%; }

.icon-btn {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.09);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #64748B;
    text-decoration: none;
    transition: all 0.2s;
}
.icon-btn:hover {
    background: rgba(255,255,255,0.08);
    border-color: rgba(255,255,255,0.18);
    color: #F1F5F9;
}

.btn-compact {
    padding: 9px 18px;
    font-size: 14px;
}

/* ─── Typography helpers ─────────────────────────────────────── */
.accent-text {
    color: #60A5FA;
}

.section-label {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: #60A5FA;
    display: block;
}

.gradient-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(59,130,246,0.34), rgba(6,182,212,0.22), transparent);
}

/* ─── Badges ─────────────────────────────────────────────────── */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    background: rgba(59,130,246,0.1);
    border: 1px solid rgba(59,130,246,0.25);
    border-radius: 100px;
    font-size: 13px;
    font-weight: 500;
    color: #93C5FD;
    font-family: 'Space Grotesk', sans-serif;
}
.badge-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #3B82F6;
    box-shadow: 0 0 6px rgba(59,130,246,0.8);
    animation: blink 2s ease-in-out infinite;
    flex-shrink: 0;
}
@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.25; }
}

/* ─── Buttons ────────────────────────────────────────────────── */
.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 13px 26px;
    background: linear-gradient(135deg, #3B82F6, #06B6D4);
    border-radius: 100px;
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 600;
    font-size: 15px;
    color: white;
    text-decoration: none;
    transition: all 0.3s;
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(59,130,246,0.35);
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 26px;
    background: transparent;
    border: 1px solid rgba(255,255,255,0.13);
    border-radius: 100px;
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 600;
    font-size: 15px;
    color: #E2E8F0;
    text-decoration: none;
    transition: all 0.25s;
}
.btn-secondary:hover {
    background: rgba(255,255,255,0.06);
    border-color: rgba(255,255,255,0.25);
    transform: translateY(-2px);
}

/* ─── Cards / Glass ──────────────────────────────────────────── */
.glass-card {
    background: rgba(255,255,255,0.025);
    border: 1px solid rgba(255,255,255,0.08);
    backdrop-filter: blur(10px);
    border-radius: 24px;
}

/* ─── Profile image ──────────────────────────────────────────── */
.profile-wrapper {
    position: relative;
    display: inline-block;
}
.profile-ring {
    position: absolute;
    inset: -3px;
    border-radius: 22px;
    background: #2563EB;
    z-index: 0;
}
@keyframes rotateGrad {
    0% { filter: hue-rotate(0deg); }
    100% { filter: hue-rotate(360deg); }
}
.profile-img {
    border-radius: 20px;
    display: block;
    position: relative;
    z-index: 1;
    object-fit: cover;
}

/* ─── Stat cards ─────────────────────────────────────────────── */
.stat-card {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 16px;
    padding: 20px;
    text-align: center;
    transition: border-color 0.3s, background 0.3s;
}
.stat-card:hover {
    background: rgba(59,130,246,0.05);
    border-color: rgba(59,130,246,0.2);
}
.stat-number {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 34px;
    font-weight: 700;
    color: #60A5FA;
    line-height: 1;
}

/* ─── Skill tags (about page) ────────────────────────────────── */
.skill-tag {
    display: inline-flex;
    align-items: center;
    padding: 7px 15px;
    background: rgba(59,130,246,0.07);
    border: 1px solid rgba(59,130,246,0.18);
    border-radius: 100px;
    font-size: 14px;
    font-weight: 500;
    color: #93C5FD;
    font-family: 'Space Grotesk', sans-serif;
    transition: all 0.25s;
}
.skill-tag:hover {
    background: rgba(59,130,246,0.14);
    border-color: rgba(59,130,246,0.4);
    color: #BFDBFE;
    transform: translateY(-2px);
}

/* ─── Skill blocks (index page) ──────────────────────────────── */
.skill-block {
    background: rgba(255,255,255,0.025);
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 16px;
    padding: 22px;
    transition: all 0.3s;
}
.skill-block:hover {
    background: rgba(59,130,246,0.05);
    border-color: rgba(59,130,246,0.2);
    transform: translateY(-4px);
}
.skill-block-icon {
    font-size: 22px;
    margin-bottom: 10px;
}

/* ─── Interest cards (about page) ────────────────────────────── */
.interest-card {
    background: rgba(255,255,255,0.025);
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 16px;
    padding: 22px;
    transition: all 0.3s cubic-bezier(0.4,0,0.2,1);
}
.interest-card:hover {
    background: rgba(59,130,246,0.05);
    border-color: rgba(59,130,246,0.2);
    transform: translateY(-5px);
    box-shadow: 0 16px 40px rgba(0,0,0,0.3);
}
.interest-icon {
    width: 42px;
    height: 42px;
    border-radius: 11px;
    background: rgba(59,130,246,0.1);
    border: 1px solid rgba(59,130,246,0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    margin-bottom: 14px;
}

/* ─── Project cards (index page) ─────────────────────────────── */
.project-card {
    background: rgba(255,255,255,0.025);
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 20px;
    overflow: hidden;
    text-decoration: none;
    display: block;
    transition: all 0.3s cubic-bezier(0.4,0,0.2,1);
}
.project-card:hover {
    border-color: rgba(59,130,246,0.3);
    transform: translateY(-6px);
    box-shadow: 0 20px 50px rgba(0,0,0,0.4);
}
.project-img-wrap {
    position: relative;
    overflow: hidden;
    height: 210px;
}
.project-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}
.project-card:hover .project-img { transform: scale(1.05); }
.project-img-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(7,9,15,0.6) 0%, transparent 60%);
}
.project-title {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 600;
    font-size: 17px;
    color: #F1F5F9;
    margin-bottom: 8px;
}
.project-desc {
    color: #64748B;
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 16px;
}
.project-link {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 14px;
    font-weight: 600;
    color: #3B82F6;
    transition: color 0.2s;
}
.project-card:hover .project-link { color: #60A5FA; }
.arrow { display: inline-block; transition: transform 0.2s; }
.project-card:hover .arrow { transform: translateX(4px); }

/* ─── Contact form ───────────────────────────────────────────── */
.form-input {
    display: block;
    width: 100%;
    padding: 12px 16px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 12px;
    color: #F1F5F9;
    font-size: 15px;
    font-family: 'Inter', sans-serif;
    transition: border-color 0.25s, background 0.25s;
    outline: none;
}
.form-input:focus {
    border-color: rgba(59,130,246,0.5);
    background: rgba(59,130,246,0.04);
}
.form-input::placeholder { color: #475569; }

/* ─── Footer ─────────────────────────────────────────────────── */
.site-footer {
    border-top: 1px solid rgba(255,255,255,0.055);
}

/* ─── Scroll reveal ──────────────────────────────────────────── */
.reveal {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 0.65s ease, transform 0.65s ease;
}
.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ─── Sub-page styles ────────────────────────────────────────── */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 14px;
    font-weight: 500;
    color: #64748B;
    text-decoration: none;
    transition: color 0.2s;
}
.back-link:hover { color: #93C5FD; }

.project-hero {
    position: relative;
    width: 100%;
    height: 380px;
    border-radius: 20px;
    overflow: hidden;
    margin-bottom: 0;
}
.project-hero img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.project-hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(7,9,15,0.85) 0%, rgba(7,9,15,0.3) 60%, transparent 100%);
}
.project-hero-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 32px;
}

.project-tag {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    background: rgba(59,130,246,0.12);
    border: 1px solid rgba(59,130,246,0.25);
    border-radius: 100px;
    font-size: 12px;
    font-weight: 600;
    color: #93C5FD;
    font-family: 'Space Grotesk', sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.content-block {
    background: rgba(255,255,255,0.025);
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 20px;
    padding: 32px;
}
.content-block:hover {
    border-color: rgba(59,130,246,0.15);
}

.highlight-stat {
    background: rgba(59,130,246,0.07);
    border: 1px solid rgba(59,130,246,0.18);
    border-radius: 16px;
    padding: 20px;
    text-align: center;
}
.highlight-stat-number {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 30px;
    font-weight: 700;
    color: #60A5FA;
    line-height: 1;
}

.coming-soon-card {
    background: rgba(255,255,255,0.02);
    border: 1px dashed rgba(59,130,246,0.2);
    border-radius: 20px;
    padding: 64px 32px;
    text-align: center;
}

/* ─── Portfolio signature system ────────────────────────────── */
.lab-hero,
.case-hero {
    position: relative;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background:
        linear-gradient(135deg, rgba(255,255,255,0.055), rgba(255,255,255,0.018)),
        radial-gradient(circle at 82% 18%, rgba(59,130,246,0.12), transparent 30%),
        radial-gradient(circle at 18% 82%, rgba(6,182,212,0.08), transparent 34%);
    box-shadow: 0 30px 80px rgba(0,0,0,0.38), inset 0 1px 0 rgba(255,255,255,0.08);
}

.lab-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
    gap: 32px;
    align-items: center;
    min-height: 520px;
    padding: clamp(28px, 5vw, 56px);
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.lab-hero.compact {
    min-height: auto;
}

.lab-hero::before,
.case-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(255,255,255,0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.035) 1px, transparent 1px);
    background-size: 34px 34px;
    mask-image: radial-gradient(circle at 72% 28%, black 0 38%, transparent 75%);
}

.lab-hero::before {
    display: none;
}

.lab-hero h1,
.case-hero h1 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: clamp(42px, 8vw, 86px);
    line-height: 0.98;
    font-weight: 700;
    color: var(--text-strong);
    letter-spacing: 0;
    margin-bottom: 22px;
}

.lab-hero p,
.case-hero-copy > p {
    color: #B7C3D6;
    font-size: clamp(17px, 2vw, 21px);
    line-height: 1.7;
    max-width: 760px;
}

.lab-visual {
    position: relative;
    isolation: isolate;
    min-height: 320px;
}

.lab-visual img {
    width: 100%;
    height: 100%;
    min-height: 320px;
    object-fit: cover;
    border-radius: 16px;
    border: 1px solid rgba(255,255,255,0.12);
    filter: saturate(1.08) contrast(1.02);
    box-shadow: 0 24px 60px rgba(0,0,0,0.42);
}

.lab-visual::after {
    content: '';
    position: absolute;
    inset: -14px;
    z-index: -1;
    border-radius: 24px;
    background: linear-gradient(135deg, rgba(59,130,246,0.28), rgba(6,182,212,0.18));
    filter: blur(22px);
    opacity: 0.55;
}

.proof-strip {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(255,255,255,0.08);
}

.proof-cell {
    min-height: 132px;
    padding: 22px;
    background: rgba(7,9,15,0.76);
}

.proof-cell strong {
    display: block;
    font-family: 'Space Grotesk', sans-serif;
    font-size: clamp(24px, 4vw, 40px);
    line-height: 1;
    color: var(--text-strong);
    margin-bottom: 10px;
}

.proof-cell span {
    color: var(--muted);
    font-size: 14px;
    line-height: 1.5;
}

.case-hero {
    min-height: 520px;
}

.case-hero-media {
    position: absolute;
    inset: 0;
}

.case-hero-media img,
.case-hero-media video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: saturate(1.05) contrast(1.05);
}

.case-hero-overlay {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, rgba(7,9,15,0.96), rgba(7,9,15,0.68) 48%, rgba(7,9,15,0.16)),
        linear-gradient(to top, rgba(7,9,15,0.8), transparent 50%);
}

.case-hero-copy {
    position: relative;
    z-index: 1;
    width: min(720px, 100%);
    padding: clamp(28px, 6vw, 64px);
}

.case-heading {
    font-family: 'Space Grotesk', sans-serif;
    font-size: clamp(30px, 4vw, 46px);
    line-height: 1.08;
    color: var(--text-strong);
    font-weight: 700;
}

.case-copy {
    color: #B7C3D6;
    font-size: 17px;
    line-height: 1.75;
}

.case-copy p {
    margin-bottom: 1rem;
}

.highlight {
    color: #F8FAFC;
    font-weight: 600;
}

.case-section-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: clamp(24px, 3vw, 34px);
    color: var(--text-strong);
    font-weight: 700;
    margin-bottom: 20px;
}

.outcome-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.media-frame {
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 16px;
    background: rgba(255,255,255,0.025);
}

.media-frame img,
.media-frame video {
    display: block;
    width: 100%;
    height: auto;
}

.media-frame figcaption {
    padding: 12px 14px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.project-block {
    background:
        linear-gradient(135deg, rgba(255,255,255,0.055), rgba(255,255,255,0.018)),
        rgba(255,255,255,0.02);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: clamp(24px, 4vw, 38px);
    margin-bottom: 2rem;
    box-shadow: 0 22px 60px rgba(0,0,0,0.24);
}

.project-block-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: clamp(20px, 3vw, 28px);
    font-weight: 700;
    color: var(--text-strong);
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--line);
}

.project-img-sm,
.project-block .project-img {
    border-radius: 14px;
    width: 100%;
    object-fit: cover;
    border: 1px solid rgba(255,255,255,0.1);
}

.check-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.check-list li {
    position: relative;
    padding-left: 1.65rem;
    margin-bottom: 0.75rem;
    color: #AEBBCD;
    line-height: 1.65;
}

.check-list li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.62em;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 12px rgba(59,130,246,0.35);
}

.lab-card .project-img-wrap {
    height: 260px;
}

@media (max-width: 900px) {
    .lab-hero {
        grid-template-columns: 1fr;
    }
    .proof-strip,
    .outcome-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .case-hero {
        min-height: 620px;
    }
    .case-hero-overlay {
        background: linear-gradient(to top, rgba(7,9,15,0.98), rgba(7,9,15,0.72), rgba(7,9,15,0.24));
    }
}

@media (max-width: 640px) {
    .proof-strip,
    .outcome-grid {
        grid-template-columns: 1fr;
    }
    .lab-hero,
    .case-hero-copy {
        padding: 24px;
    }
    .case-hero {
        min-height: 640px;
    }
    .project-hero {
        height: 320px;
    }
}
