/* =====================================================
   THEME: Jet Black + Cerulean Blue + Neon Rose
   Mobile-first safe: fluid sizes, no horizontal scroll,
   breakpoints at 1000 / 768 / 600 / 480 / 360
   ===================================================== */

:root {
    --bg: #0A0A0A;
    /* Jet Black */
    --bg-nav: #0F1419;
    --bg-footer-top: #0C0F13;
    --bg-footer-bottom: #050505;

    --blue: #007BA7;
    /* Cerulean Blue */
    --blue-rgb: 0, 123, 167;
    --blue-bright: #3DB9E6;
    /* lighter cerulean, for readable text */

    --accent: #FF2D95;
    /* Neon Rose */
    --rose-rgb: 255, 45, 149;
    --accent-soft: #FF6FB5;

    --on-accent: #0A0A0A;
    /* dark text on rose buttons (best contrast) */

    --text: #F5F7FA;
    --text-body: #D6DCE3;
    --text-muted: #AAB4BF;
    --text-dim: #7D8895;

    /* Background grid */
    --grid-size: 48px;
    --grid-line: rgba(var(--blue-rgb), 0.16);
}

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: 84px;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

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

body {
    background-color: var(--bg);
    color: var(--text);
    font-family: 'Poppins', sans-serif;
    line-height: 1.5;
    overflow-x: hidden;
    /* guards against any sideways scroll */
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
    -webkit-tap-highlight-color: transparent;
}

/* ================= BACKGROUND GRID ================= */

/* Grid lines, fading out toward the edges */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -2;
    pointer-events: none;
    background-image:
        linear-gradient(var(--grid-line) 1px, transparent 1px),
        linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
    background-size: var(--grid-size) var(--grid-size);
    -webkit-mask-image: radial-gradient(ellipse at 50% 40%, #000 25%, transparent 85%);
    mask-image: radial-gradient(ellipse at 50% 40%, #000 25%, transparent 85%);
}

/* Soft cerulean + rose glow behind the grid */
body::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background:
        radial-gradient(circle at 12% 8%, rgba(var(--blue-rgb), 0.20), transparent 45%),
        radial-gradient(circle at 90% 92%, rgba(var(--rose-rgb), 0.12), transparent 45%);
}

::selection {
    background: var(--accent);
    color: var(--on-accent);
}

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

a,
p,
h1,
h2,
h3,
h4,
span {
    overflow-wrap: break-word;
}

/* Shared section width: never wider than the screen */

.secondSection,
.skills-section,
.projects-section,
.education-section,
.contact-section {
    width: min(1100px, 90%);
    margin-left: auto;
    margin-right: auto;
    padding: clamp(50px, 8vw, 80px) 0;
}

.secondSection h1,
.skills-section h1,
.projects-section h1,
.education-section h1,
.contact-section h1 {
    font-size: clamp(1.6rem, 5vw, 2rem);
    margin-top: 10px;
    margin-bottom: clamp(28px, 5vw, 45px);
}

.secondSection {
    padding-top: 40px;
}

/* ================= NAVBAR ================= */

header {
    position: sticky;
    top: 0;
    z-index: 1000;
}

nav {
    position: relative;
    display: flex;
    justify-content: space-around;
    align-items: center;
    height: 80px;
    background: rgba(15, 20, 25, 0.72);
    backdrop-filter: blur(14px) saturate(140%);
    -webkit-backdrop-filter: blur(14px) saturate(140%);
    border-bottom: 1px solid rgba(var(--blue-rgb), 0.35);
}

nav ul {
    display: flex;
    justify-content: center;
}

nav ul li {
    list-style: none;
    margin: 0 23px;
}

nav ul li a {
    position: relative;
    text-decoration: none;
    color: var(--text);
    transition: 0.3s;
}

/* gradient underline: shows on hover and on the active section */
nav ul li a::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -6px;
    width: 0;
    height: 2px;
    border-radius: 2px;
    background: linear-gradient(90deg, var(--blue), var(--accent));
    transition: width 0.3s ease;
}

nav ul li a:hover,
nav ul li a.active {
    color: var(--accent);
}

nav ul li a:hover::after,
nav ul li a.active::after {
    width: 100%;
}

/* Hamburger button (hidden on desktop) */

.menu-toggle {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    width: 44px;
    height: 44px;
    background: transparent;
    border: 1px solid rgba(var(--blue-rgb), 0.7);
    border-radius: 10px;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    transition: 0.3s;
}

.menu-toggle span {
    display: block;
    width: 20px;
    height: 2px;
    border-radius: 2px;
    background: var(--text);
    transition: transform 0.3s ease, opacity 0.2s ease, background 0.3s;
}

nav.open .menu-toggle {
    border-color: var(--accent);
}

nav.open .menu-toggle span {
    background: var(--accent);
}

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

nav.open .menu-toggle span:nth-child(2) {
    opacity: 0;
}

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

.left {
    font-size: 1.5rem;
}

main hr {
    border: 0;
    background: linear-gradient(90deg, var(--blue), var(--accent));
    height: 1.2px;
    margin: 40px clamp(20px, 6vw, 84px);
}

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

.firstSection {
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    min-height: calc(100vh - 80px);
    min-height: calc(100svh - 80px);
    margin: 0;
    padding: 40px 20px;
}

.firstSection>div {
    width: min(1000px, 100%);
}

.leftSection {
    font-size: clamp(2rem, 6vw, 4.2rem);
    line-height: 1.25;
}

.purple {
    color: var(--accent);
}

.text-gray {
    color: var(--text-dim);
}

#element {
    color: var(--blue-bright);
}

/* ================= HOME BUTTONS ================= */

.home-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 14px 18px;
    margin-top: 36px;
}

.btn {
    display: inline-block;
    text-decoration: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.3;
    transition: 0.3s;
}

.primary-btn {
    background-color: var(--accent);
    color: var(--on-accent);
}

.primary-btn:hover {
    background-color: var(--accent-soft);
    transform: translateY(-3px);
    box-shadow: 0 0 22px rgba(var(--rose-rgb), 0.55);
}

.secondary-btn {
    border: 2px solid var(--blue);
    color: var(--text);
}

.secondary-btn:hover {
    background-color: var(--blue);
    color: #fff;
    transform: translateY(-3px);
    box-shadow: 0 0 22px rgba(var(--blue-rgb), 0.6);
}

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

.about-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 60px;
}

.about-image {
    flex: 1;
    display: flex;
    justify-content: center;
}

.about-image img {
    width: min(360px, 70vw);
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 50%;
    border: 5px solid var(--blue);
    box-shadow: 0 0 35px rgba(var(--rose-rgb), .35);
    transition: .4s;
}

.about-image img:hover {
    transform: scale(1.05);
    box-shadow: 0 0 45px rgba(var(--rose-rgb), .6);
}

.about-content {
    flex: 2;
    min-width: 0;
    background: rgba(8, 10, 14, 0.62);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 35px;
    border-radius: 20px;
    border: 1px solid rgba(var(--blue-rgb), 0.45);
    box-shadow: 0 10px 35px rgba(0, 0, 0, .35);
}

.about-content p {
    font-size: 1.05rem;
    line-height: 1.9;
    color: var(--text-body);
}

/* ================= SKILLS ================= */

.skills-container {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 30px;
}

.skill-category {
    background: rgba(8, 10, 14, 0.62);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(var(--blue-rgb), 0.4);
    border-radius: 18px;
    padding: 30px;
    box-shadow: 0 10px 35px rgba(0, 0, 0, 0.3);
    transition: 0.3s;
}

.skill-category:hover {
    transform: translateY(-5px);
    border-color: rgba(var(--blue-rgb), 0.9);
    box-shadow: 0 15px 40px rgba(var(--blue-rgb), 0.12);
}

.skill-category h2 {
    font-size: 1.2rem;
    margin-bottom: 25px;
    color: var(--text);
}

.skill-category h2 i {
    color: var(--accent);
    margin-right: 10px;
}

.skill-cards {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.skill-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 18px;
    border: 1px solid rgba(var(--blue-rgb), 0.4);
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.22);
    color: var(--text-body);
    transition: 0.3s;
}

.skill-card i {
    font-size: 20px;
    color: var(--accent);
}

.skill-card span {
    font-size: 0.9rem;
}

.skill-card:hover {
    transform: translateY(-3px);
    background: rgba(var(--blue-rgb), 0.1);
    border-color: var(--accent);
    color: var(--text);
    box-shadow: 0 0 15px rgba(var(--blue-rgb), 0.2);
}

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

.projects-container {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 30px;
}

.project-card {
    display: flex;
    flex-direction: column;
    min-width: 0;
    background: rgba(8, 10, 14, 0.62);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(var(--blue-rgb), 0.4);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 10px 35px rgba(0, 0, 0, 0.3);
    transition: 0.3s;
}

.project-card:hover {
    transform: translateY(-8px);
    border-color: rgba(var(--rose-rgb), 0.85);
    box-shadow: 0 15px 40px rgba(var(--blue-rgb), 0.18);
}

.project-image {
    width: 100%;
    height: 220px;
    overflow: hidden;
}

.project-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: 0.4s;
}

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

.project-content {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 25px;
}

.project-content h2 {
    font-size: 1.4rem;
    margin-bottom: 12px;
}

.project-content p {
    color: #C4CDD6;
    font-size: 0.95rem;
    line-height: 1.7;
    margin-bottom: 20px;
}

.project-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 22px;
}

.project-tech span {
    padding: 6px 12px;
    background: rgba(var(--blue-rgb), 0.1);
    border: 1px solid rgba(var(--blue-rgb), 0.54);
    border-radius: 20px;
    font-size: 0.8rem;
    color: var(--accent-soft);
}

.project-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: auto;
}

.project-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 40px;
    padding: 9px 16px;
    border-radius: 8px;
    border: 1px solid rgba(var(--blue-rgb), 0.81);
    color: var(--text);
    text-decoration: none;
    font-size: 0.85rem;
    transition: 0.3s;
}

.project-btn:hover {
    background: var(--accent);
    color: var(--on-accent);
    transform: translateY(-2px);
    box-shadow: 0 0 15px rgba(var(--rose-rgb), 0.45);
}

/* ================= EDUCATION ================= */

.education-section h1 {
    margin-bottom: clamp(36px, 6vw, 60px);
}

.education-timeline {
    position: relative;
    padding-left: 50px;
}

.education-timeline::before {
    content: "";
    position: absolute;
    left: 17px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(180deg, var(--blue), var(--accent));
    box-shadow: 0 0 10px rgba(var(--blue-rgb), 0.5);
}

.timeline-item {
    position: relative;
    margin-bottom: 40px;
}

.timeline-dot {
    position: absolute;
    left: -50px;
    top: 20px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--bg);
    border: 2px solid var(--accent);
    color: var(--accent);
    box-shadow: 0 0 15px rgba(var(--rose-rgb), 0.55);
}

.timeline-content {
    background: rgba(8, 10, 14, 0.62);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(var(--blue-rgb), 0.5);
    border-radius: 18px;
    padding: 30px;
    box-shadow: 0 10px 35px rgba(0, 0, 0, 0.3);
    transition: 0.3s;
}

.timeline-content:hover {
    transform: translateX(8px);
    border-color: rgba(var(--rose-rgb), 0.85);
    box-shadow: 0 10px 35px rgba(var(--blue-rgb), 0.13);
}

.timeline-date {
    display: inline-block;
    color: var(--accent);
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 10px;
}

.timeline-content h2 {
    font-size: 1.4rem;
    margin-bottom: 8px;
}

.timeline-content h3 {
    font-size: 1rem;
    font-weight: 400;
    color: var(--text-muted);
    margin-bottom: 15px;
}

.timeline-content p {
    color: #C4CDD6;
    line-height: 1.7;
    font-size: 0.95rem;
}

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

.contact-container {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 50px;
}

.contact-left,
.contact-right {
    min-width: 0;
    background: rgba(8, 10, 14, 0.62);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(var(--blue-rgb), 0.5);
    border-radius: 20px;
    padding: 35px;
    box-shadow: 0 10px 35px rgba(0, 0, 0, 0.3);
}

.contact-left h2,
.contact-right h2 {
    font-size: 1.6rem;
    margin-bottom: 15px;
}

.contact-right h2 {
    margin-bottom: 25px;
}

.contact-left>p {
    color: #C4CDD6;
    line-height: 1.8;
    margin-bottom: 30px;
}

.contact-info {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 15px;
}

.contact-item>div:last-child {
    min-width: 0;
}

.contact-icon {
    flex-shrink: 0;
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 1px solid rgba(var(--blue-rgb), 0.9);
    color: var(--accent);
    background: rgba(var(--blue-rgb), 0.08);
}

.contact-icon i {
    font-size: 18px;
}

.contact-item h4 {
    margin-bottom: 3px;
}

.contact-item a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    overflow-wrap: anywhere;
    /* long email never overflows */
    word-break: break-word;
    transition: 0.3s;
}

.contact-item a:hover {
    color: var(--accent);
}

/* Form */

.input-group {
    display: flex;
    flex-direction: column;
    margin-bottom: 18px;
}

.input-group label {
    font-size: 0.9rem;
    margin-bottom: 7px;
    color: var(--text-body);
}

.input-group input,
.input-group textarea {
    width: 100%;
    max-width: 100%;
    padding: 12px 15px;
    border-radius: 8px;
    border: 1px solid rgba(var(--blue-rgb), 0.54);
    background: rgba(0, 0, 0, 0.28);
    color: var(--text);
    font-family: 'Poppins', sans-serif;
    font-size: 16px;
    /* stops iPhone auto-zoom when tapping a field */
    outline: none;
    transition: 0.3s;
}

.input-group input:focus,
.input-group textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 10px rgba(var(--blue-rgb), 0.25);
}

.input-group input::placeholder,
.input-group textarea::placeholder {
    color: #6C7783;
}

.input-group textarea {
    resize: vertical;
}

.contact-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    min-height: 46px;
    padding: 12px;
    border: none;
    border-radius: 8px;
    background: var(--accent);
    color: var(--on-accent);
    font-family: 'Poppins', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: 0.3s;
}

.contact-btn:hover {
    background: var(--accent-soft);
    transform: translateY(-3px);
    box-shadow: 0 0 22px rgba(var(--rose-rgb), 0.55);
}

/* Thank you message */

.thank-you-message {
    display: none;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 40px 20px;
}

.thank-you-message i {
    font-size: 3rem;
    color: var(--accent);
    margin-bottom: 15px;
}

.thank-you-message h3 {
    font-size: 1.4rem;
    margin-bottom: 10px;
}

.thank-you-message p {
    color: #C4CDD6;
    font-size: 0.95rem;
}

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

footer {
    background: linear-gradient(180deg, var(--bg-footer-top), var(--bg-footer-bottom));
    margin-top: 60px;
    border-top: 1px solid rgba(var(--blue-rgb), 0.45);
}

.footer {
    max-width: 1200px;
    margin: auto;
    padding: 55px 40px 35px;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1.2fr;
    gap: 40px;
}

.footer>div {
    min-width: 0;
}

.footer h3 {
    font-size: 1.4rem;
    margin-bottom: 15px;
    color: var(--text);
}

.footer h4 {
    color: var(--accent);
    font-size: 1rem;
    margin-bottom: 18px;
}

.first-footer p {
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.7;
    max-width: 320px;
}

.footer ul {
    list-style: none;
    padding: 0;
}

.footer ul li {
    margin-bottom: 12px;
}

.footer ul li a {
    text-decoration: none;
    color: var(--text-muted);
    font-size: 0.9rem;
    transition: 0.3s;
}

.footer ul li a:hover {
    color: var(--accent);
    padding-left: 5px;
}

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

.social-links a {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(var(--blue-rgb), 0.72);
    border-radius: 50%;
    color: var(--text);
    text-decoration: none;
    transition: 0.3s;
}

.social-links a:hover {
    background: var(--accent);
    color: var(--on-accent);
    transform: translateY(-4px);
    box-shadow: 0 0 18px rgba(var(--rose-rgb), 0.55);
}

.footer-bottom {
    max-width: 1200px;
    margin: auto;
    padding: 20px 40px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.footer-rights,
.footer-credit {
    color: var(--text-dim);
    font-size: 13px;
}

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

.resume-btn {
    display: inline-block;
    margin-top: 18px;
    padding: 10px 18px;
    border: 1px solid var(--accent);
    border-radius: 6px;
    color: var(--text);
    text-decoration: none;
    font-size: 13px;
    transition: 0.3s;
}

.resume-btn:hover {
    background: var(--accent);
    color: var(--on-accent);
    box-shadow: 0 0 20px rgba(var(--rose-rgb), 0.5);
}

/* =====================================================
   SCROLL-DRIVEN BACKGROUND (canvas, frames/ folder)
   ===================================================== */

.scroll-bg {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: -3;
    display: block;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.8s ease;
}

.scroll-bg.is-ready {
    opacity: 0.7;
}

/* keep hero text readable over the animation */
.leftSection {
    text-shadow: 0 2px 18px rgba(0, 0, 0, 0.75);
}

/* =====================================================
   UI ENHANCEMENTS
   ===================================================== */

/* ---------- Scroll progress bar ---------- */

.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    z-index: 1100;
    transform-origin: 0 50%;
    transform: scaleX(0);
    background: linear-gradient(90deg, var(--blue), var(--accent));
    box-shadow: 0 0 10px rgba(var(--rose-rgb), 0.6);
    pointer-events: none;
}

/* ---------- Cursor glow (desktop only) ---------- */

.cursor-glow {
    position: fixed;
    top: 0;
    left: 0;
    width: 520px;
    height: 520px;
    margin: -260px 0 0 -260px;
    border-radius: 50%;
    background: radial-gradient(circle,
            rgba(var(--rose-rgb), 0.11) 0%,
            rgba(var(--blue-rgb), 0.09) 40%,
            transparent 70%);
    pointer-events: none;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.4s ease;
    will-change: transform;
}

.cursor-glow.active {
    opacity: 1;
}

@media (hover: none),
(pointer: coarse) {
    .cursor-glow {
        display: none;
    }
}

/* ---------- Pulsing glow on the about photo ---------- */

.about-image img {
    animation: glowPulse 3.6s ease-in-out infinite;
}

@keyframes glowPulse {

    0%,
    100% {
        filter: drop-shadow(0 0 14px rgba(var(--blue-rgb), 0.45));
    }

    50% {
        filter: drop-shadow(0 0 32px rgba(var(--rose-rgb), 0.6));
    }
}

/* ---------- Animated gradient border on project cards ---------- */

@property --angle {
    syntax: "<angle>";
    initial-value: 0deg;
    inherits: false;
}

.project-card {
    position: relative;
}

.project-card::before {
    content: "";
    position: absolute;
    inset: 0;
    padding: 2px;
    border-radius: inherit;
    background: conic-gradient(from var(--angle),
            transparent 0%,
            transparent 50%,
            var(--blue) 72%,
            var(--accent) 92%,
            transparent 100%);
    -webkit-mask:
        linear-gradient(#000 0 0) content-box,
        linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask:
        linear-gradient(#000 0 0) content-box exclude,
        linear-gradient(#000 0 0);
    opacity: 0;
    transition: opacity 0.4s ease;
    animation: borderSpin 4s linear infinite;
    pointer-events: none;
    z-index: 2;
}

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

@keyframes borderSpin {
    to {
        --angle: 360deg;
    }
}

/* ---------- Scroll reveal (classes are added by JavaScript) ---------- */

.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.7s ease, transform 0.7s ease;
    transition-delay: var(--delay, 0s);
}

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

/* =====================================================
   AI ASSISTANT (floating button + chat panel)
   ===================================================== */

.ai-fab {
    position: fixed;
    right: calc(20px + env(safe-area-inset-right));
    bottom: calc(20px + env(safe-area-inset-bottom));
    z-index: 1200;
    width: 58px;
    height: 58px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    color: #fff;
    font-size: 1.35rem;
    background: linear-gradient(135deg, var(--blue), var(--accent));
    box-shadow: 0 8px 28px rgba(var(--rose-rgb), 0.4), 0 0 0 1px rgba(255, 255, 255, 0.12) inset;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    -webkit-appearance: none;
    appearance: none;
}

.ai-fab:hover {
    transform: scale(1.08);
    box-shadow: 0 10px 34px rgba(var(--rose-rgb), 0.6);
}

/* pulsing ring */
.ai-fab::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 2px solid var(--accent);
    animation: aiRing 2.4s ease-out infinite;
    pointer-events: none;
}

@keyframes aiRing {
    0% {
        transform: scale(1);
        opacity: 0.8;
    }

    100% {
        transform: scale(1.6);
        opacity: 0;
    }
}

.ai-fab .ai-fab-close {
    display: none;
}

.ai-assistant.open .ai-fab .ai-fab-open {
    display: none;
}

.ai-assistant.open .ai-fab .ai-fab-close {
    display: block;
}

.ai-assistant.open .ai-fab::before {
    animation: none;
    opacity: 0;
}

/* ---------- Robot icon ---------- */

.ai-robot {
    width: 32px;
    height: 32px;
    display: block;
    transition: transform 0.3s ease;
}

.ai-avatar .ai-robot {
    width: 24px;
    height: 24px;
}

.ai-fab:hover .ai-robot {
    transform: rotate(-8deg) scale(1.05);
}

/* eyes blink, antenna light pulses */
.ai-eye {
    transform-box: fill-box;
    transform-origin: center;
    animation: aiBlink 4.5s ease-in-out infinite;
}

.ai-ant {
    animation: aiAntenna 1.6s ease-in-out infinite;
}

@keyframes aiBlink {

    0%,
    92%,
    100% {
        transform: scaleY(1);
    }

    96% {
        transform: scaleY(0.1);
    }
}

@keyframes aiAntenna {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.3;
    }
}

/* small label next to the button */
.ai-hint {
    position: fixed;
    right: calc(90px + env(safe-area-inset-right));
    bottom: calc(32px + env(safe-area-inset-bottom));
    z-index: 1200;
    padding: 8px 14px;
    border-radius: 20px;
    font-size: 0.82rem;
    font-weight: 600;
    white-space: nowrap;
    color: var(--on-accent);
    background: var(--accent);
    box-shadow: 0 6px 20px rgba(var(--rose-rgb), 0.35);
    opacity: 0;
    transform: translateX(10px);
    pointer-events: none;
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.ai-hint.show {
    opacity: 1;
    transform: none;
}

/* ---------- Panel ---------- */

.ai-panel {
    position: fixed;
    right: calc(20px + env(safe-area-inset-right));
    bottom: calc(92px + env(safe-area-inset-bottom));
    z-index: 1200;
    width: 380px;
    height: min(580px, calc(100vh - 120px));
    height: min(580px, calc(100dvh - 120px));
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: rgba(10, 10, 10, 0.94);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border: 1px solid rgba(var(--blue-rgb), 0.7);
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6), 0 0 40px rgba(var(--blue-rgb), 0.18);
    transform-origin: bottom right;
    opacity: 0;
    visibility: hidden;
    transform: translateY(16px) scale(0.96);
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s;
    outline: none;
}

.ai-assistant.open .ai-panel {
    opacity: 1;
    visibility: visible;
    transform: none;
    pointer-events: auto;
}

/* Header */

.ai-header-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: linear-gradient(135deg, rgba(var(--blue-rgb), 0.35), rgba(var(--rose-rgb), 0.18));
    border-bottom: 1px solid rgba(var(--blue-rgb), 0.5);
}

.ai-avatar {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: var(--accent);
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(var(--rose-rgb), 0.6);
}

.ai-title {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    line-height: 1.3;
}

.ai-title strong {
    font-size: 0.98rem;
}

.ai-title span {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.ai-online {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #3DDC84;
    box-shadow: 0 0 8px #3DDC84;
}

.ai-icon-btn {
    flex-shrink: 0;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.3);
    color: var(--text);
    font-size: 0.85rem;
    cursor: pointer;
    transition: 0.3s;
    -webkit-appearance: none;
    appearance: none;
}

.ai-icon-btn:hover {
    background: var(--accent);
    color: var(--on-accent);
    border-color: var(--accent);
}

/* Messages */

.ai-messages {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

.ai-msg {
    max-width: 88%;
    padding: 10px 14px;
    border-radius: 16px;
    font-size: 0.9rem;
    line-height: 1.6;
    overflow-wrap: anywhere;
    animation: aiPop 0.3s ease;
}

@keyframes aiPop {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

.ai-msg.bot {
    align-self: flex-start;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(var(--blue-rgb), 0.5);
    border-bottom-left-radius: 4px;
    color: var(--text-body);
}

.ai-msg.user {
    align-self: flex-end;
    background: var(--accent);
    color: var(--on-accent);
    font-weight: 500;
    border-bottom-right-radius: 4px;
}

.ai-text {
    white-space: pre-line;
}

/* typing dots */

.ai-typing {
    display: flex;
    gap: 5px;
    padding: 14px 16px;
}

.ai-typing span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--blue-bright);
    animation: aiDot 1s ease-in-out infinite;
}

.ai-typing span:nth-child(2) {
    animation-delay: 0.15s;
}

.ai-typing span:nth-child(3) {
    animation-delay: 0.3s;
}

@keyframes aiDot {

    0%,
    60%,
    100% {
        transform: translateY(0);
        opacity: 0.5;
    }

    30% {
        transform: translateY(-5px);
        opacity: 1;
    }
}

/* action buttons inside answers */

.ai-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.ai-action {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 12px;
    border: 1px solid rgba(var(--blue-rgb), 0.9);
    border-radius: 8px;
    color: var(--text);
    text-decoration: none;
    font-size: 0.8rem;
    transition: 0.3s;
}

.ai-action:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--on-accent);
}

/* Suggested questions */

.ai-suggest {
    flex-shrink: 0;
    max-height: 42%;
    overflow-y: auto;
    padding: 12px 14px 14px;
    border-top: 1px solid rgba(var(--blue-rgb), 0.5);
    background: rgba(0, 0, 0, 0.35);
}

.ai-suggest-title {
    margin-bottom: 8px;
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-dim);
}

.ai-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.ai-chip {
    padding: 8px 13px;
    border: 1px solid rgba(var(--blue-rgb), 0.9);
    border-radius: 18px;
    background: rgba(var(--blue-rgb), 0.12);
    color: var(--text);
    font-family: inherit;
    font-size: 0.8rem;
    line-height: 1.3;
    text-align: left;
    cursor: pointer;
    transition: 0.25s;
    -webkit-appearance: none;
    appearance: none;
}

.ai-chip:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--on-accent);
}

/* Phones: panel nearly full width */

@media (max-width: 480px) {

    .ai-fab {
        width: 54px;
        height: 54px;
        right: calc(14px + env(safe-area-inset-right));
        bottom: calc(14px + env(safe-area-inset-bottom));
    }

    .ai-hint {
        right: calc(78px + env(safe-area-inset-right));
        bottom: calc(24px + env(safe-area-inset-bottom));
    }

    .ai-panel {
        left: 10px;
        right: 10px;
        width: auto;
        bottom: calc(80px + env(safe-area-inset-bottom));
        height: min(560px, calc(100vh - 110px));
        height: min(560px, calc(100dvh - 110px));
    }

    .ai-msg {
        max-width: 92%;
    }
}

/* =====================================================
   RESPONSIVE BREAKPOINTS
   ===================================================== */

/* ---------- Tablets & small laptops ---------- */

@media (max-width: 1000px) {

    .about-container {
        flex-direction: column;
        text-align: center;
        gap: 35px;
    }

    .about-image img {
        width: min(280px, 65vw);
    }

    .about-content {
        width: 100%;
        padding: 28px;
    }
}

@media (max-width: 900px) {

    .skills-container,
    .projects-container,
    .contact-container {
        grid-template-columns: minmax(0, 1fr);
    }

    .contact-container {
        gap: 30px;
    }

    .footer {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        padding: 45px 30px;
    }

    .footer-bottom {
        flex-direction: column;
        text-align: center;
        padding: 20px 30px;
    }
}

/* ---------- Phones (large) ---------- */

@media (max-width: 800px) {

    html {
        scroll-padding-top: 72px;
    }

    nav {
        height: auto;
        min-height: 64px;
        padding: 10px 20px;
        justify-content: space-between;
    }

    .menu-toggle {
        display: flex;
    }

    /* Dropdown panel */
    nav .right {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: rgba(10, 10, 10, 0.97);
        backdrop-filter: blur(14px);
        -webkit-backdrop-filter: blur(14px);
        border-bottom: 1px solid rgba(var(--blue-rgb), 0.6);
        box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
        max-height: 0;
        overflow: hidden;
        opacity: 0;
        visibility: hidden;
        transition: max-height 0.4s ease, opacity 0.3s ease, visibility 0.3s;
    }

    nav.open .right {
        max-height: 420px;
        opacity: 1;
        visibility: visible;
    }

    nav ul {
        flex-direction: column;
        align-items: stretch;
        padding: 8px 20px 16px;
    }

    nav ul li {
        margin: 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    }

    nav ul li:last-child {
        border-bottom: none;
    }

    nav ul li a {
        display: block;
        padding: 14px 4px;
        font-size: 1rem;
    }

    nav ul li a::after {
        display: none;
    }

    nav ul li a.active {
        color: var(--accent);
        padding-left: 12px;
        border-left: 3px solid var(--accent);
    }
}

@media (max-width: 600px) {

    :root {
        --grid-size: 32px;
    }

    .left {
        font-size: 1.25rem;
    }

    .skill-category {
        padding: 22px;
    }

    .skill-cards {
        gap: 10px;
    }

    .skill-card {
        padding: 10px 14px;
    }

    .project-image {
        height: 190px;
    }

    .project-content {
        padding: 20px;
    }

    .project-content h2 {
        font-size: 1.25rem;
    }

    .contact-left,
    .contact-right {
        padding: 24px 20px;
    }

    .contact-left h2,
    .contact-right h2 {
        font-size: 1.3rem;
    }

    /* Timeline: slimmer so cards keep room */

    .education-timeline {
        padding-left: 40px;
    }

    .education-timeline::before {
        left: 13px;
    }

    .timeline-dot {
        left: -40px;
        top: 18px;
        width: 28px;
        height: 28px;
        font-size: 0.75rem;
    }

    .timeline-content {
        padding: 20px;
    }

    .timeline-content h2 {
        font-size: 1.2rem;
    }

    /* Footer: single centred column */

    .footer {
        grid-template-columns: minmax(0, 1fr);
        text-align: center;
        padding: 40px 22px 30px;
        gap: 30px;
    }

    .first-footer p {
        margin: auto;
    }

    .social-links {
        justify-content: center;
    }

    .footer-bottom {
        padding: 18px 20px;
    }
}

/* ---------- Phones (standard) ---------- */

@media (max-width: 480px) {

    .home-buttons {
        flex-direction: column;
        align-items: stretch;
        width: 100%;
        max-width: 320px;
        margin-left: auto;
        margin-right: auto;
    }

    .btn {
        text-align: center;
    }

    .about-content {
        padding: 22px 18px;
    }

    .about-content p {
        font-size: 0.98rem;
        line-height: 1.8;
    }

    .project-image {
        height: 170px;
    }

    .project-tech span {
        font-size: 0.75rem;
        padding: 5px 10px;
    }

    .project-btn {
        flex: 1 1 100%;
        justify-content: center;
    }

    .contact-icon {
        width: 40px;
        height: 40px;
    }

    .contact-item {
        gap: 12px;
    }
}

/* ---------- Small phones (iPhone SE, old Androids) ---------- */

@media (max-width: 360px) {

    .leftSection {
        font-size: 1.7rem;
    }

    .section-title,
    .secondSection h1,
    .skills-section h1,
    .projects-section h1,
    .education-section h1,
    .contact-section h1 {
        font-size: 1.45rem;
    }

    .skill-card {
        padding: 8px 11px;
        gap: 8px;
    }

    .skill-card span {
        font-size: 0.82rem;
    }

    .contact-left,
    .contact-right {
        padding: 20px 14px;
    }

    .footer {
        padding: 35px 16px 25px;
    }
}

/* ---------- Landscape phones (short screens) ---------- */

@media (max-height: 480px) and (orientation: landscape) {

    .firstSection {
        min-height: auto;
        padding: 60px 20px;
    }
}

/* ---------- Touch devices: no sticky hover effects ---------- */

@media (hover: none) {

    .project-card::before {
        opacity: 0.7;
    }

    .project-card:hover,
    .skill-category:hover,
    .skill-card:hover,
    .timeline-content:hover,
    .btn:hover,
    .project-btn:hover,
    .contact-btn:hover,
    .social-links a:hover,
    .about-image img:hover {
        transform: none;
    }

    .project-card:hover .project-image img {
        transform: none;
    }

    .footer ul li a:hover {
        padding-left: 0;
    }
}

/* ---------- Respect "reduce motion" setting ---------- */

@media (prefers-reduced-motion: reduce) {

    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        transition: none !important;
        animation: none !important;
    }
}