:root {
    --bg: #060908;
    --surface: #0a100e;
    --surface-glass: rgba(10, 16, 14, 0.65);
    --border: #182a22;
    --border-glow: rgba(29, 186, 131, 0.25);
    --text: #F0Fdf6;
    --sub: #A3C2B6;
    --accent: #1DBA83;
    --accent-hover: #22d395;
    --glow: rgba(29, 186, 131, .3);
    --font-ui: 'Inter', system-ui, -apple-system, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
}

* {
    box-sizing: border-box;
}

html,
body {
    height: 100%;
    scroll-behavior: smooth;
}

::selection {
    background: rgba(29, 186, 131, 0.3);
    color: #fff;
}

::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg);
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--sub);
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-ui);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

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

.container {
    max-width: 1120px;
    margin: 0 auto;
    padding: 0 1.25rem;
}

header {
    position: sticky;
    top: 0;
    z-index: 40;
    backdrop-filter: saturate(150%) blur(16px);
    -webkit-backdrop-filter: saturate(150%) blur(16px);
    background: var(--surface-glass);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.2);
}

.nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 72px;
    flex-wrap: wrap;
    /* allow wrapping on very small screens */
}

.nav a:hover {
    color: #fff;
}

/* Hide non-essential links on mobile to save space */
@media (max-width: 767px) {
    .nav nav.sub {
        display: none !important;
    }
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    border: 1px solid transparent;
    background: var(--accent);
    color: var(--bg);
    padding: .6rem 1rem;
    border-radius: .75rem;
    font-weight: 600;
    font-family: var(--font-ui);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 4px 14px rgba(29, 186, 131, 0.25);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.btn:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(29, 186, 131, 0.4);
}

.btn-outline {
    background: transparent;
    color: var(--text);
    border-color: var(--border);
    box-shadow: none;
}

.btn-outline:hover {
    border-color: var(--accent);
    background: rgba(29, 186, 131, 0.08);
    color: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(29, 186, 131, 0.15);
}

.pill {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);
    padding: .25rem .75rem;
    border-radius: 999px;
    font-size: .8rem;
    font-family: var(--font-mono);
    /* Tactical feel */
}

/* Mobile-First Grid Layout */
.grid-2 {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    align-items: center;
}

/* Swap Hero Order natively on Mobile */
#hero .grid-2>div:nth-child(1) {
    order: 2;
    /* Text goes second on mobile */
    text-align: center;
}

#hero .grid-2>div:nth-child(2) {
    order: 1;
    /* Mesh goes first on mobile */
}

/* Revert order for desktop */
@media (min-width: 860px) {
    .grid-2 {
        grid-template-columns: 1.15fr .85fr;
    }

    #hero .grid-2>div:nth-child(1) {
        order: 1;
        /* Text goes first on desktop */
        text-align: left;
    }

    #hero .grid-2>div:nth-child(2) {
        order: 2;
        /* Mesh goes second on desktop */
    }
}

section {
    position: relative;
    padding: 3rem 0;
}

@media (min-width: 768px) {
    section {
        padding: 5rem 0;
    }
}

h1 {
    font-size: clamp(2.5rem, 5vw, 4rem);
    line-height: 1.1;
    margin: .75rem 0 0;
    letter-spacing: -0.03em;
    font-weight: 700;
}

h2 {
    font-size: clamp(1.75rem, 3.5vw, 2.5rem);
    margin: 0 0 .5rem;
    letter-spacing: -0.02em;
    font-weight: 600;
}

h3 {
    font-weight: 600;
    font-size: 1.15rem;
}

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

.card {
    background: var(--surface-glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-radius: 1rem;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 10px 30px rgba(0, 0, 0, .4);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s ease, border-color 0.3s ease;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 20px 40px rgba(0, 0, 0, .5);
    border-color: var(--border-glow);
}

.card-pad {
    padding: 1.25rem;
}

.list {
    color: var(--sub);
    padding-left: 1.2rem;
}

.list li {
    margin: .4rem 0;
}

.projects {
    display: grid;
    gap: 1.25rem;
}

@media (min-width: 900px) {
    .projects {
        grid-template-columns: repeat(3, 1fr);
    }
}

.projects .preview {
    height: 160px;
    border: 1px solid var(--border);
    border-radius: .75rem;
    overflow: hidden;
    position: relative;
    background: radial-gradient(ellipse at center, rgba(29, 186, 131, .06), transparent 60%);
}

/* Footer Redesign - Enterprise Style */
.footer {
    border-top: 1px solid var(--border);
    padding: 2rem 0;
    color: var(--sub);
    font-size: 0.95rem;
    background: var(--surface-glass);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

@media (min-width: 768px) {
    .footer {
        padding: 3rem 0;
    }
}

.footer-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2.5rem;
}

@media (min-width: 768px) {
    .footer-grid {
        grid-template-columns: 2fr 1fr 1fr 1fr;
    }
}

.footer-col {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.footer-col h4 {
    color: var(--text);
    margin: 0 0 0.5rem 0;
    font-size: 1.05rem;
    font-weight: 600;
}

.footer-col a {
    color: var(--sub);
    transition: color 0.2s ease;
}

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

.footer-legal {
    border-top: 1px solid var(--border);
    padding-top: 1.5rem;
    margin-top: 3rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: center;
    text-align: center;
    font-size: 0.85rem;
}

@media (min-width: 768px) {
    .footer-legal {
        flex-direction: row;
        justify-content: space-between;
        text-align: left;
    }
}

/* BACKDROP: tactical grid, smoother dual sweep, nodes */
.tactical-bg {
    position: absolute;
    inset: 0;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

/* Ambient Orbs */
.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(120px);
    z-index: 0;
    pointer-events: none;
    opacity: 0.6;
}

.orb-1 {
    width: 600px;
    height: 600px;
    background: rgba(29, 186, 131, 0.15);
    top: -200px;
    left: -100px;
}

.orb-2 {
    width: 600px;
    height: 600px;
    background: rgba(22, 94, 70, 0.25);
    bottom: 0%;
    right: -200px;
}

.tactical-bg:before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 50% 0%, rgba(29, 186, 131, .08), transparent 40%),
        radial-gradient(circle at 100% 100%, rgba(22, 94, 70, .25), transparent 40%);
}

.tactical-bg:after {
    content: "";
    position: absolute;
    inset: 0;
    opacity: .3;
    background-image:
        linear-gradient(transparent 31px, rgba(22, 94, 70, .25) 32px),
        linear-gradient(90deg, transparent 31px, rgba(22, 94, 70, .25) 32px);
    background-size: 32px 32px;
}

.sweep {
    position: absolute;
    left: 0;
    right: 0;
    height: 140vh;
    background: linear-gradient(to bottom, transparent, var(--glow), transparent);
    filter: saturate(120%);
    animation: sweep 14s linear infinite;
    opacity: .7;
}

.sweep.sweep2 {
    animation-delay: 7s;
    opacity: .55;
}

@keyframes sweep {
    0% {
        transform: translateY(-40%);
    }

    100% {
        transform: translateY(140%);
    }
}

.blip {
    position: absolute;
    width: 6px;
    height: 6px;
    border-radius: 999px;
    background: var(--accent);
    box-shadow: 0 0 0 6px var(--glow);
    animation: blip 2.8s ease-in-out infinite;
}

@keyframes blip {

    0%,
    100% {
        opacity: .3;
        transform: scale(.85);
    }

    50% {
        opacity: 1;
        transform: scale(1.15);
    }
}

/* Logo helpers */
.logo-small {
    width: 32px;
    height: 32px;
    display: inline-block;
    border-radius: .5rem;
    box-shadow: 0 0 16px var(--glow);
    transition: filter 0.3s ease, transform 0.3s ease;
}

.logo-small:hover {
    transform: scale(1.05);
    filter: brightness(1.2) drop-shadow(0 0 12px var(--glow));
}

.logo-hero {
    filter: drop-shadow(0 0 24px rgba(29, 186, 131, .35));
}

.badges {
    display: flex;
    flex-wrap: wrap;
    gap: .75rem;
    font-size: .8rem;
    color: var(--sub);
    font-family: var(--font-mono);
    /* Tactical data look */
}

/* Mesh visuals */
.packet {
    fill: var(--accent);
    filter: drop-shadow(0 0 6px rgba(29, 186, 131, .55));
    opacity: .9;
}

.link-hot {
    stroke: rgba(29, 186, 131, .65);
    stroke-width: 2;
    stroke-linecap: round;
}

/* Scroll Reveal */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Stagger Delays */
.delay-100 {
    transition-delay: 100ms;
}

.delay-200 {
    transition-delay: 200ms;
}

.delay-300 {
    transition-delay: 300ms;
}

.delay-400 {
    transition-delay: 400ms;
}

/* Base form interactions */
input,
textarea,
select {
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--accent) !important;
    box-shadow: 0 0 0 2px rgba(29, 186, 131, 0.2);
}