/* ===== TOKENS ===== */

 :root {
    --bg: #080c14;
    --bg2: #0d1525;
    --surface: #111c30;
    --glass: rgba(17, 28, 48, 0.65);
    --border: rgba(99, 179, 237, 0.12);
    --accent: #63b3ed;
    --accent2: #7ee8a2;
    --muted: #6b7a99;
    --text: #e2e8f0;
    --text-dim: #94a3b8;
    --heading: #f0f6ff;
    --radius: 14px;
    --radius-lg: 22px;
    --shadow: 0 8px 40px rgba(0, 0, 0, .55);
    --trans: all .3s cubic-bezier(.4, 0, .2, 1);
    --font-head: "Syne", sans-serif;
    --font-body: "DM Sans", sans-serif;
    --font-mono: "JetBrains Mono", monospace;
}


/* ===== RESET ===== */

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-body);
    background: var(--bg);
    color: var(--text);
    line-height: 1.7;
    overflow-x: hidden;
}

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

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

ul {
    list-style: none;
}

button {
    cursor: pointer;
    border: none;
    background: none;
    font-family: inherit;
}


/* ===== ANIMATED BACKGROUND ===== */

#bg-canvas {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background: radial-gradient(ellipse 80% 60% at 50% 0%, #0f2040 0%, var(--bg) 70%);
}


/* Floating orbs */

.orb {
    position: fixed;
    border-radius: 50%;
    filter: blur(80px);
    pointer-events: none;
    z-index: 0;
    opacity: .18;
    animation: orbFloat 18s ease-in-out infinite alternate;
}

.orb1 {
    width: 500px;
    height: 500px;
    background: #2563eb;
    top: -150px;
    left: -150px;
    animation-duration: 20s;
}

.orb2 {
    width: 400px;
    height: 400px;
    background: #0d9488;
    bottom: 5%;
    right: -100px;
    animation-duration: 25s;
    animation-delay: -8s;
}

.orb3 {
    width: 300px;
    height: 300px;
    background: #7c3aed;
    top: 40%;
    left: 30%;
    animation-duration: 30s;
    animation-delay: -15s;
}

@keyframes orbFloat {
    from {
        transform: translate(0, 0) scale(1);
    }
    to {
        transform: translate(40px, 60px) scale(1.15);
    }
}


/* Grid overlay */

body::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background-image: linear-gradient(rgba(99, 179, 237, .04) 1px, transparent 1px), linear-gradient(90deg, rgba(99, 179, 237, .04) 1px, transparent 1px);
    background-size: 60px 60px;
}


/* ===== LAYOUT ===== */

.container {
    max-width: 1160px;
    margin: 0 auto;
    padding: 0 24px;
    position: relative;
    z-index: 1;
}

section {
    padding: 100px 0;
    position: relative;
    z-index: 1;
}


/* ===== SCROLL ANIMATION ===== */

.reveal {
    opacity: 0;
    transform: translateY(36px);
    transition: opacity .7s ease, transform .7s ease;
}

.reveal.visible {
    opacity: 1;
    transform: none;
}


/* ===== NAV ===== */

header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    padding: 0;
    transition: var(--trans);
}

header.scrolled {
    background: rgba(8, 12, 20, .85);
    backdrop-filter: blur(18px) saturate(1.4);
    -webkit-backdrop-filter: blur(18px) saturate(1.4);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 4px 30px rgba(0, 0, 0, .4);
}

.nav-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 68px;
    padding: 0 32px;
    max-width: 1200px;
    margin: 0 auto;
}

.logo {
    font-family: var(--font-head);
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -.02em;
    color: var(--heading);
}

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

nav ul {
    display: flex;
    gap: 2px;
    align-items: center;
}

nav ul li a {
    font-size: .88rem;
    font-weight: 500;
    letter-spacing: .04em;
    color: var(--text-dim);
    padding: 8px 14px;
    border-radius: 8px;
    transition: var(--trans);
}

nav ul li a:hover,
nav ul li a.active {
    color: var(--heading);
    background: rgba(99, 179, 237, .1);
}

nav ul li a.nav-cta {
    color: var(--accent);
    border: 1px solid rgba(99, 179, 237, .3);
    padding: 8px 18px;
}

nav ul li a.nav-cta:hover {
    background: rgba(99, 179, 237, .15);
    border-color: var(--accent);
}


/* Hamburger */

.hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    padding: 8px;
    cursor: pointer;
}

.hamburger span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text);
    border-radius: 2px;
    transition: var(--trans);
}

.hamburger.open span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.hamburger.open span:nth-child(2) {
    opacity: 0;
}

.hamburger.open span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}


/* Mobile nav */

@media (max-width: 820px) {
    .hamburger {
        display: flex;
    }
    nav {
        display: none;
        position: absolute;
        top: 68px;
        left: 0;
        right: 0;
        background: rgba(8, 12, 20, .97);
        backdrop-filter: blur(20px);
        border-bottom: 1px solid var(--border);
        padding: 16px 0 24px;
    }
    nav.open {
        display: block;
    }
    nav ul {
        flex-direction: column;
        gap: 2px;
        padding: 0 24px;
    }
    nav ul li a {
        display: block;
        padding: 12px 16px;
    }
}


/* ===== HERO ===== */

.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: 120px 0 80px;
}

.hero-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 48px;
    align-items: center;
}

.hero-tag {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-mono);
    font-size: .78rem;
    letter-spacing: .1em;
    color: var(--accent);
    background: rgba(99, 179, 237, .08);
    border: 1px solid rgba(99, 179, 237, .2);
    border-radius: 100px;
    padding: 6px 16px;
    margin-bottom: 24px;
}

.hero-tag::before {
    content: '';
    width: 6px;
    height: 6px;
    background: var(--accent2);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%,
    100% {
        opacity: 1;
        transform: scale(1)
    }
    50% {
        opacity: .4;
        transform: scale(.8)
    }
}

.hero-name {
    font-family: var(--font-head);
    font-size: clamp(2.6rem, 6vw, 4.2rem);
    font-weight: 800;
    line-height: 1.08;
    letter-spacing: -.03em;
    color: var(--heading);
    margin-bottom: 8px;
}

.hero-name span {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent2) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-role {
    font-family: var(--font-mono);
    font-size: 1rem;
    color: var(--text-dim);
    margin-bottom: 24px;
    min-height: 1.6em;
}

.cursor {
    animation: blink .9s step-end infinite;
}

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

.hero-bio {
    color: var(--text-dim);
    max-width: 440px;
    margin-bottom: 36px;
    line-height: 1.8;
}

.hero-actions {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 40px;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: .9rem;
    letter-spacing: .02em;
    padding: 12px 26px;
    border-radius: 10px;
    transition: var(--trans);
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent), #3b82f6);
    color: #fff;
    box-shadow: 0 4px 20px rgba(59, 130, 246, .35);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(59, 130, 246, .5);
}

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

.btn-outline:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: rgba(99, 179, 237, .06);
    transform: translateY(-2px);
}

.social-row {
    display: flex;
    gap: 12px;
}

.social-row a {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text-dim);
    font-size: 1rem;
    transition: var(--trans);
}

.social-row a:hover {
    border-color: var(--accent);
    color: var(--accent);
    transform: translateY(-3px);
}


/* Hero visual */

.hero-visual {
    display: flex;
    flex-direction: column;
    gap: 16px;
    align-items: flex-end;
}

.hero-card {
    background: var(--glass);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    backdrop-filter: blur(12px);
    width: 100%;
    max-width: 380px;
}

.hero-card-label {
    font-family: var(--font-mono);
    font-size: .7rem;
    letter-spacing: .1em;
    color: var(--accent);
    text-transform: uppercase;
    margin-bottom: 12px;
}

.stat-row {
    display: flex;
    gap: 24px;
}

.stat {
    text-align: center;
}

.stat-num {
    font-family: var(--font-head);
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--heading);
}

.stat-lbl {
    font-size: .72rem;
    color: var(--text-dim);
    letter-spacing: .06em;
    text-transform: uppercase;
}

.hero-code-card {
    background: var(--glass);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    backdrop-filter: blur(12px);
    width: 100%;
    max-width: 380px;
    font-family: var(--font-mono);
    font-size: .78rem;
    line-height: 1.9;
}

.code-dot-row {
    display: flex;
    gap: 6px;
    margin-bottom: 14px;
}

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

.code-dot:nth-child(1) {
    background: #ff5f57
}

.code-dot:nth-child(2) {
    background: #ffbd2e
}

.code-dot:nth-child(3) {
    background: #28ca42
}

.code-kw {
    color: #c084fc;
}

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

.code-str {
    color: var(--accent2);
}

.code-cm {
    color: var(--muted);
}

@media (max-width: 820px) {
    .hero-grid {
        grid-template-columns: 1fr;
    }
    .hero-visual {
        align-items: stretch;
    }
    .hero-card,
    .hero-code-card {
        max-width: 100%;
    }
}


/* ===== SECTION HEADER ===== */

.sec-header {
    text-align: center;
    margin-bottom: 64px;
}

.sec-eyebrow {
    font-family: var(--font-mono);
    font-size: .72rem;
    letter-spacing: .14em;
    color: var(--accent);
    text-transform: uppercase;
    margin-bottom: 12px;
    display: block;
    text-align: center !important;
}

.sec-title {
    font-family: var(--font-head);
    font-size: clamp(1.9rem, 4vw, 2.8rem);
    font-weight: 800;
    letter-spacing: -.03em;
    color: var(--heading);
}

.sec-title span {
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.sec-line {
    width: 48px;
    height: 3px;
    border-radius: 2px;
    margin: 16px auto 0;
    background: linear-gradient(90deg, var(--accent), var(--accent2));
}


/* ===== MARQUEE TICKER ===== */

.ticker-wrap {
    overflow: hidden;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    background: rgba(13, 21, 37, .6);
    padding: 14px 0;
    position: relative;
    z-index: 1;
}

.ticker {
    display: flex;
    gap: 0;
    white-space: nowrap;
    animation: ticker 25s linear infinite;
}

.ticker-wrap:hover .ticker {
    animation-play-state: paused;
}

.ticker-item {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    font-family: var(--font-mono);
    font-size: .78rem;
    letter-spacing: .1em;
    color: var(--text-dim);
    padding: 0 32px;
}

.ticker-item i {
    color: var(--accent);
    font-size: .7rem;
}

@keyframes ticker {
    from {
        transform: translateX(0);
    }
    to {
        transform: translateX(-50%);
    }
}


/* ===== ABOUT CARDS ===== */

.info-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 1120px;
    margin: 120px auto 60px auto;
    padding: 0 18px;
}

.bento-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
    width: 100%;
    margin-top: 26px;
}

.bento-card {
    background: var(--glass);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 28px;
    backdrop-filter: blur(12px);
    transition: var(--trans);
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 180px;
}

.bento-card::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(135deg, rgba(99, 179, 237, .06) 0%, transparent 60%);
    opacity: 0;
    transition: var(--trans);
}

.bento-card:hover {
    border-color: rgba(99, 179, 237, .3);
    transform: translateY(-6px);
    box-shadow: var(--shadow);
}

.bento-card:hover::after {
    opacity: 1;
}


/* Bento card sizes — DESKTOP & TABLET ONLY (original layout preserved) */

.bento-sm {
    grid-column: span 1;
    grid-row: span 1;
}

.bento-sg {
    grid-column: span 2;
    grid-row: span 1;
}

.bento-md,
.bento-lg {
    grid-column: span 1;
    grid-row: span 2;
}

.bento-left {
    grid-column: 1;
    grid-row: 2 / span 2;
}

.bento-center {
    grid-column: 2;
    grid-row: 2 / span 2;
}

.bento-right {
    grid-column: 3;
    grid-row: 2 / span 2;
}

.card-label {
    font-family: var(--font-head);
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: .05em;
}

.bento-card h4 {
    color: var(--heading);
}

.bento-card p {
    color: var(--text-dim);
    font-size: .95rem;
    line-height: 1.75;
    margin-bottom: 10px;
}

.card-meta {
    color: var(--accent);
    font-size: .78rem;
    font-family: var(--font-mono);
    letter-spacing: .08em;
    text-transform: uppercase;
    margin-top: auto;
}

.card-highlight {
    color: var(--heading) !important;
    font-weight: 600;
    margin-top: 14px;
}

.bento-img,
.bento-img-sm {
    border-radius: 14px;
    margin-top: 18px;
    width: 100%;
    height: 180px;
    object-fit: cover;
}

.bento-portrait {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 16px;
    min-height: 320px;
}

.location-info {
    margin-top: 10px;
}

.location-coords {
    font-family: var(--font-mono);
    font-size: .8rem;
    color: var(--text-dim) !important;
    margin-bottom: 12px;
}

.name-card {
    font-family: var(--font-head);
    font-size: clamp(1.8rem, 4vw, 2.4rem);
    font-weight: 800;
    line-height: 1.05;
    color: var(--heading);
    margin: 0 0 8px 0;
}

.name-subtitle {
    font-family: var(--font-mono);
    font-size: .78rem;
    letter-spacing: .18em;
    text-transform: uppercase;
    color: var(--text-dim);
    margin: 0;
}


/* ===== TABLET (≤1060px) — ORIGINAL ORDER KEPT ===== */

@media (max-width: 1060px) {
    .info-section {
        margin: 100px auto 50px auto;
        padding: 0 20px;
    }
    .bento-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 18px;
    }
    .bento-left {
        grid-column: 1;
        grid-row: auto;
    }
    .bento-center {
        grid-column: 2;
        grid-row: auto;
    }
    .bento-right {
        grid-column: 1 / span 2;
        grid-row: auto;
    }
    .bento-md,
    .bento-lg {
        grid-column: span 1;
        grid-row: span 1;
    }
    .bento-img,
    .bento-img-sm {
        height: 160px;
    }
    .bento-portrait {
        min-height: 240px;
    }
}


/* ===== MOBILE (≤768px) — ✅ ONLY HERE: NEW ORDER ✅ ===== */

@media (max-width: 768px) {
    .info-section {
        margin: 70px auto 40px auto;
        padding: 0 20px;
    }
    .sec-header {
        margin-bottom: 40px !important;
    }
    .sec-title {
        font-size: clamp(1.6rem, 6vw, 2.2rem);
    }
    .bento-grid {
        grid-template-columns: 1fr;
        gap: 16px;
        margin-top: 20px;
    }
    /* ✅ MOBILE ONLY ORDER:
       1. Name
       2. Profile Image
       3. Education
       4. Mindset
       5. Craft
       6. Location
       7. Services
       8. Mission
    */
    .bento-card:nth-child(1) {
        order: 1;
    }
    .bento-card:nth-child(4) {
        order: 2;
    }
    /* Profile = 2nd */
    .bento-card:nth-child(2) {
        order: 3;
    }
    /* Education = 3rd */
    .bento-card:nth-child(3) {
        order: 4;
    }
    .bento-card:nth-child(5) {
        order: 5;
    }
    .bento-card:nth-child(6) {
        order: 6;
    }
    .bento-card:nth-child(7) {
        order: 7;
    }
    .bento-card:nth-child(8) {
        order: 8;
    }
    /* Reset grid spans for mobile */
    .bento-md,
    .bento-lg,
    .bento-left,
    .bento-center,
    .bento-right,
    .bento-sg,
    .bento-sm {
        grid-column: 1;
        grid-row: auto;
    }
    .bento-card {
        padding: 24px;
        border-radius: 20px;
        min-height: auto;
        text-align: center;
    }
    .name-card {
        font-size: clamp(1.8rem, 8vw, 2.4rem);
        margin-bottom: 6px;
    }
    .name-subtitle {
        font-size: .75rem;
        letter-spacing: .2em;
    }
    .card-label {
        font-size: .95rem;
        margin-bottom: 10px;
    }
    .bento-card p {
        font-size: .9rem;
        line-height: 1.65;
    }
    .bento-img,
    .bento-img-sm {
        height: 140px;
        margin-top: 14px;
        border-radius: 12px;
    }
    .bento-portrait {
        min-height: 220px;
        border-radius: 16px;
        margin: 0 auto;
        max-width: 260px;
    }
    .location-info {
        display: flex;
        flex-direction: column;
        align-items: center;
    }
    .card-meta {
        font-size: .72rem;
    }
}


/* ===== SMALL MOBILE (≤480px) — SAME ORDER ===== */

@media (max-width: 480px) {
    .info-section {
        padding: 0 16px;
    }
    .bento-card {
        padding: 20px;
        border-radius: 18px;
    }
    .bento-portrait {
        max-width: 220px;
        min-height: 200px;
    }
    .bento-img,
    .bento-img-sm {
        height: 120px;
    }
}


/* ===== TECH STACK ===== */

.tech-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 14px;
}

.tech-chip {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    background: var(--glass);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px 12px;
    backdrop-filter: blur(8px);
    transition: var(--trans);
    cursor: default;
}

.tech-chip:hover {
    border-color: var(--accent);
    transform: translateY(-6px);
    box-shadow: 0 12px 30px rgba(99, 179, 237, .2);
}

.tech-chip img {
    width: 44px;
    height: 44px;
    object-fit: contain;
}

.tech-chip span {
    font-size: .72rem;
    letter-spacing: .07em;
    color: var(--text-dim);
    font-family: var(--font-mono);
}


/* ===== SERVICES ===== */

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.service-card {
    background: var(--glass);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 32px;
    backdrop-filter: blur(12px);
    transition: var(--trans);
    position: relative;
    overflow: hidden;
}

.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--accent), var(--accent2));
    transform: scaleX(0);
    transform-origin: left;
    transition: var(--trans);
}

.service-card:hover {
    transform: translateY(-6px);
    border-color: rgba(99, 179, 237, .3);
    box-shadow: var(--shadow);
}

.service-card:hover::before {
    transform: scaleX(1);
}

.service-icon {
    width: 52px;
    height: 52px;
    display: grid;
    place-items: center;
    background: rgba(99, 179, 237, .1);
    border-radius: 12px;
    font-size: 1.4rem;
    color: var(--accent);
    margin-bottom: 18px;
}

.service-card h3 {
    font-family: var(--font-head);
    font-size: 1.1rem;
    color: var(--heading);
    margin-bottom: 10px;
}

.service-card p {
    color: var(--text-dim);
    font-size: .88rem;
    line-height: 1.8;
}


/* ===== PROJECTS ===== */

.projects-grid {
    display: grid;
    gap: 28px;
}

.project-card {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 0;
    background: var(--glass);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    backdrop-filter: blur(12px);
    transition: var(--trans);
    margin-bottom: 12px;
}

.project-card:nth-child(even) {
    grid-template-columns: 1fr 1.2fr;
}

.project-card:nth-child(even) .project-img {
    order: 2;
}

.project-card:nth-child(even) .project-info {
    order: 1;
}

.project-card:hover {
    border-color: rgba(99, 179, 237, .3);
    transform: translateY(-4px);
    box-shadow: var(--shadow);
}

.project-img {
    position: relative;
    overflow: hidden;
}

.project-img img {
    width: 100%;
    height: 100%;
    min-height: 240px;
    object-fit: cover;
    transition: transform .5s ease;
}

.project-card:hover .project-img img {
    transform: scale(1.06);
}

.project-overlay {
    position: absolute;
    inset: 0;
    background: rgba(8, 12, 20, .75);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    opacity: 0;
    transition: var(--trans);
    backdrop-filter: blur(4px);
}

.project-card:hover .project-overlay {
    opacity: 1;
}

.overlay-btn {
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    background: rgba(99, 179, 237, .15);
    border: 1px solid var(--accent);
    border-radius: 50%;
    color: var(--accent);
    font-size: 1.1rem;
    transition: var(--trans);
}

.overlay-btn:hover {
    background: var(--accent);
    color: #fff;
    transform: scale(1.1);
}

.project-info {
    padding: 32px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.project-num {
    font-family: var(--font-mono);
    font-size: .7rem;
    color: var(--accent);
    letter-spacing: .1em;
    margin-bottom: 10px;
}

.project-info h3 {
    font-family: var(--font-head);
    font-size: 1.2rem;
    color: var(--heading);
    margin-bottom: 12px;
}

.project-info p {
    color: var(--text-dim);
    font-size: .88rem;
    line-height: 1.8;
    margin-bottom: 20px;
}

.tag-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag {
    font-family: var(--font-mono);
    font-size: .68rem;
    letter-spacing: .08em;
    color: var(--accent2);
    background: rgba(126, 232, 162, .08);
    border: 1px solid rgba(126, 232, 162, .2);
    border-radius: 6px;
    padding: 4px 10px;
}

@media (max-width: 700px) {
    .project-card,
    .project-card:nth-child(even) {
        grid-template-columns: 1fr;
    }
    .project-card:nth-child(even) .project-img {
        order: 0;
    }
    .project-card:nth-child(even) .project-info {
        order: 0;
    }
    .project-img img {
        min-height: 180px;
    }
}


/* ===== CERTIFICATES ===== */

.certs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
}

.cert-card {
    background: var(--glass);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: var(--trans);
    backdrop-filter: blur(12px);
}

.cert-card:hover {
    border-color: rgba(99, 179, 237, .3);
    transform: translateY(-5px);
    box-shadow: var(--shadow);
}

.cert-thumb {
    position: relative;
    overflow: hidden;
}

.cert-thumb img {
    width: 100%;
    height: 170px;
    object-fit: cover;
    transition: transform .5s;
}

.cert-card:hover .cert-thumb img {
    transform: scale(1.05);
}

.cert-overlay {
    position: absolute;
    inset: 0;
    background: rgba(8, 12, 20, .7);
    display: grid;
    place-items: center;
    opacity: 0;
    transition: var(--trans);
}

.cert-card:hover .cert-overlay {
    opacity: 1;
}

.cert-view-btn {
    padding: 10px 20px;
    border: 1px solid var(--accent);
    border-radius: 8px;
    color: var(--accent);
    font-size: .82rem;
    font-weight: 600;
    transition: var(--trans);
    font-family: var(--font-body);
}

.cert-view-btn:hover {
    background: var(--accent);
    color: #fff;
}

.cert-info {
    padding: 18px 20px;
}

.cert-info h3 {
    font-family: var(--font-head);
    font-size: .95rem;
    color: var(--heading);
    margin-bottom: 4px;
}

.cert-info p {
    font-size: .78rem;
    color: var(--text-dim);
}


/* ===== CONTACT ===== */

.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1.4fr;
    gap: 40px;
    align-items: start;
}

.contact-left h3 {
    font-family: var(--font-head);
    font-size: 1.4rem;
    color: var(--heading);
    margin-bottom: 12px;
}

.contact-left p {
    color: var(--text-dim);
    line-height: 1.8;
    margin-bottom: 28px;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
}

.contact-item:last-of-type {
    border-bottom: none;
}

.contact-item i {
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    background: rgba(99, 179, 237, .08);
    border-radius: 8px;
    color: var(--accent);
}

.contact-item span {
    color: var(--text-dim);
    font-size: .9rem;
}

.social-icons-row {
    display: flex;
    gap: 10px;
    margin-top: 24px;
}

.social-icons-row a {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    border: 1px solid var(--border);
    border-radius: 9px;
    color: var(--text-dim);
    transition: var(--trans);
}

.social-icons-row a:hover {
    border-color: var(--accent);
    color: var(--accent);
    transform: translateY(-3px);
}


/* Form */

.contact-form {
    background: var(--glass);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 36px;
    backdrop-filter: blur(12px);
}

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

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: .78rem;
    letter-spacing: .06em;
    color: var(--text-dim);
    margin-bottom: 8px;
    font-family: var(--font-mono);
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    background: rgba(255, 255, 255, .04);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text);
    font-family: var(--font-body);
    font-size: .9rem;
    transition: var(--trans);
    outline: none;
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: var(--accent);
    background: rgba(99, 179, 237, .04);
    box-shadow: 0 0 0 3px rgba(99, 179, 237, .1);
}

.form-group textarea {
    resize: vertical;
    min-height: 130px;
}

.form-status {
    margin-top: 12px;
    font-size: .85rem;
    padding: 10px;
    border-radius: 8px;
    display: none;
}

.form-status.success {
    background: rgba(126, 232, 162, .1);
    color: var(--accent2);
    border: 1px solid rgba(126, 232, 162, .3);
    display: block;
}

.form-status.error {
    background: rgba(239, 68, 68, .1);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, .3);
    display: block;
}

@media (max-width: 820px) {
    .contact-grid {
        grid-template-columns: 1fr;
    }
    .form-row {
        grid-template-columns: 1fr;
    }
}


/* ===== FOOTER ===== */

footer {
    border-top: 1px solid var(--border);
    padding: 36px 0;
    background: rgba(8, 12, 20, .9);
    position: relative;
    z-index: 1;
}

.footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
}

.footer-inner p {
    color: var(--text-dim);
    font-size: .82rem;
}

.footer-inner a {
    color: var(--text-dim);
    transition: color .2s;
}

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

.footer-links {
    display: flex;
    gap: 24px;
}

.footer-links a {
    font-size: .82rem;
}


/* ===== MODAL ===== */

.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(0, 0, 0, .85);
    backdrop-filter: blur(8px);
    place-items: center;
}

.modal-overlay.active {
    display: grid;
}

.modal-inner {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
}

.modal-inner img {
    border-radius: var(--radius-lg);
    max-height: 85vh;
}

.modal-close {
    position: absolute;
    top: -14px;
    right: -14px;
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 50%;
    color: var(--text);
    font-size: 1.1rem;
    cursor: pointer;
    transition: var(--trans);
}

.modal-close:hover {
    border-color: var(--accent);
    color: var(--accent);
}


/* Ensure overlay buttons use global token styling and have clean spacing */

button.overlay-btn,
.project-overlay a.overlay-btn {
    background: var(--surface);
    /* Deep blue background from your tokens */
    color: var(--accent);
    /* Cyber-blue glow color from your tokens */
    border: 1px solid var(--border);
    /* Subdued blue borders */
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: inline-flex;
    /* Handles layout flow elegantly side-by-side */
    justify-content: center;
    align-items: center;
    cursor: pointer;
    font-size: 1.1rem;
    transition: var(--trans);
    /* Smooth timing function from your tokens */
    margin: 0 8px;
    /* 🌟 Adds perfect space between the two buttons */
    text-decoration: none;
    /* Removes anchor tag underlining if any */
}


/* Hover effects matching your portfolio's styling rules */

button.overlay-btn:hover,
.project-overlay a.overlay-btn:hover {
    background: var(--accent);
    /* Flipped background color on hover */
    color: var(--bg);
    /* Contrasting text color */
    box-shadow: 0 0 15px rgba(99, 179, 237, 0.4);
    /* Glow effect matching --accent */
    transform: translateY(-3px);
    /* Gentle pop action */
}


/* Layout alignment container fix */

.project-overlay {
    display: flex;
    justify-content: center;
    align-items: center;
}


/* ==================================================== */


/* GALLERY MODAL CLEANUP (Tokens Consistent)            */


/* ==================================================== */

.modal {
    display: none;
    position: fixed;
    z-index: 99999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(8, 12, 20, 0.95);
    /* Deep dark theme --bg backdrop */
    backdrop-filter: blur(8px);
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

.modal-content {
    position: relative;
    max-width: 85%;
    max-height: 80%;
    display: flex;
    justify-content: center;
    align-items: center;
}

#modal-img {
    max-width: 100%;
    max-height: 75vh;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    object-fit: contain;
}

.close-modal {
    position: absolute;
    top: 25px;
    right: 40px;
    color: var(--text-dim);
    font-size: 45px;
    font-weight: 300;
    cursor: pointer;
    transition: var(--trans);
}

.close-modal:hover {
    color: var(--accent);
}


/* Lightbox Gallery Arrow Controls */

.nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: var(--glass);
    color: var(--text);
    border: 1px solid var(--border);
    width: 55px;
    height: 55px;
    font-size: 1.3rem;
    cursor: pointer;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: var(--trans);
}

.nav-btn:hover {
    background: var(--accent);
    color: var(--bg);
}

#prev-btn {
    left: -85px;
}

#next-btn {
    right: -85px;
}

#modal-counter {
    color: var(--text-dim);
    font-family: var(--font-mono);
    margin-top: 20px;
    font-size: 0.95rem;
    letter-spacing: 1px;
}


/* Responsive UI Adjustment for Mobile Devices */

@media (max-width: 900px) {
    #prev-btn {
        left: 15px;
        width: 45px;
        height: 45px;
    }
    #next-btn {
        right: 15px;
        width: 45px;
        height: 45px;
    }
    .modal-content {
        max-width: 95%;
    }
    .close-modal {
        top: 15px;
        right: 25px;
        font-size: 35px;
    }
}


/* ===== LOADING ===== */

#loading {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--bg);
    transition: opacity .5s, visibility .5s;
}

#loading.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.load-logo {
    font-family: var(--font-head);
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--heading);
    margin-bottom: 28px;
}

.load-logo span {
    color: var(--accent);
}

.load-bar {
    width: 200px;
    height: 3px;
    background: rgba(255, 255, 255, .08);
    border-radius: 2px;
    overflow: hidden;
}

.load-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), var(--accent2));
    border-radius: 2px;
    animation: load 1.4s ease-in-out forwards;
}

@keyframes load {
    from {
        width: 0
    }
    to {
        width: 100%
    }
}


/* ===== SCROLL TO TOP ===== */

.scroll-top {
    position: fixed;
    bottom: 28px;
    right: 28px;
    z-index: 99;
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 50%;
    color: var(--text-dim);
    transition: var(--trans);
    opacity: 0;
    pointer-events: none;
}

.scroll-top.visible {
    opacity: 1;
    pointer-events: auto;
}

.scroll-top:hover {
    border-color: var(--accent);
    color: var(--accent);
    transform: translateY(-3px);
}


/* ===== TERMINAL STYLES — CLEAN TEXT ONLY, MOBILE FIXED ===== */

.terminal-open-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 170px;
    margin-top: 16px;
    padding: 0.95rem 1.3rem;
    border-radius: 999px;
    background: rgba(97, 171, 255, 0.16);
    border: 1px solid rgba(97, 171, 255, 0.32);
    color: #dbe7ff;
    font-family: var(--font-mono);
    font-size: 0.95rem;
    letter-spacing: 0.02em;
    transition: var(--trans);
}

.terminal-open-btn:hover {
    background: rgba(97, 171, 255, 0.26);
}

.terminal-overlay {
    position: fixed;
    inset: 0;
    z-index: 1050;
    background: rgba(8, 12, 20, 0.96);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.terminal-overlay.hidden {
    display: none;
}

.terminal-panel {
    width: min(960px, 100%);
    max-height: calc(100vh - 40px);
    display: flex;
    flex-direction: column;
    border-radius: 18px;
    overflow: hidden;
    background: rgba(13, 23, 44, 0.98);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 32px 80px rgba(0, 0, 0, 0.45);
}

.terminal-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 18px;
    background: rgba(12, 18, 35, 0.97);
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

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

.terminal-dots span {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #ff5f56;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14);
}

.terminal-dots span:nth-child(2) {
    background: #ffbd2e;
}

.terminal-dots span:nth-child(3) {
    background: #27c93f;
}

.terminal-title {
    color: #c8d7ff;
    font-family: var(--font-mono);
    font-size: 0.95rem;
}

.terminal-close {
    background: transparent;
    border: none;
    color: #d2d8ed;
    cursor: pointer;
    font-size: 1.2rem;
    line-height: 1;
    padding: 6px;
}

.terminal-body {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 18px;
    overflow: hidden;
    background: #0c172b;
}

.terminal-content {
    flex: 1;
    overflow-y: auto;
    padding-right: 6px;
    white-space: pre-wrap !important;
    word-break: break-word !important;
    overflow-x: hidden !important;
}

.terminal-line {
    font-family: var(--font-mono);
    font-size: 0.96rem;
    line-height: 1.65;
    color: #e6eef8;
    white-space: pre-wrap !important;
    word-break: break-word !important;
    margin-bottom: 10px;
}

.terminal-input-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.terminal-prompt {
    color: #7ee8a2;
    font-family: var(--font-mono);
    font-size: 0.95rem;
    flex-shrink: 0;
}

.terminal-input {
    flex: 1;
    border: none;
    background: transparent;
    color: #f4f7ff;
    font-family: var(--font-mono);
    font-size: 0.96rem;
    outline: none;
}

.terminal-error {
    color: #f78f85;
}

.terminal-input-line {
    color: #8ab9ff;
}


/* ✅ MOBILE — PERFECT, NO CUT TEXT */

@media (max-width: 720px) {
    .terminal-panel {
        max-height: calc(100vh - 20px);
        width: 100%;
        border-radius: 12px !important;
    }
    .terminal-top {
        flex-direction: column;
        align-items: flex-start;
        padding: 8px 12px !important;
    }
    .terminal-content,
    .terminal-line,
    pre,
    code {
        white-space: pre-wrap !important;
        word-break: break-word !important;
        overflow-x: hidden !important;
        font-size: 11px !important;
        line-height: 1.4 !important;
    }
    .terminal-input,
    .terminal-prompt {
        font-size: 11px !important;
    }
}

.command-green {
    color: #4ade80;
}

.command-blue {
    color: #38bdf8;
}

.command-yellow {
    color: #facc15;
}


/* ===== ACTIVE NAV HIGHLIGHT ===== */

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(16px)
    }
    to {
        opacity: 1;
        transform: none
    }
}

.fade-in {
    animation: fadeIn .8s ease both;
}

.command-green {
    color: #4ade80;
}

.command-blue {
    color: #38bdf8;
}

.command-yellow {
    color: #facc15;
}