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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    /* nhẹ nhàng: nền sáng pastel */
    background: linear-gradient(135deg, #f7fbff 0%, #eef7ff 100%);
    color: #0f1724;
    /* màu chữ tối nhưng mềm */
    overflow-x: hidden;
}

/* Navbar */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 8%;
    /* nền navbar nhẹ, hơi mờ */
    background: rgba(255, 255, 255, 0.82);
    backdrop-filter: blur(6px);
    z-index: 1000;
    box-shadow: 0 6px 20px rgba(15, 23, 36, 0.06);
}

/* Hamburger (mobile) */
.hamburger {
    display: none;
    background: transparent;
    border: none;
    cursor: pointer;
    width: 42px;
    height: 36px;
    position: relative;
}
.hamburger span {
    display: block;
    height: 3px;
    background: #0f1724;
    margin: 6px 0;
    border-radius: 3px;
    transition: transform 0.25s ease, opacity 0.25s ease;
}

.logo {
    font-size: 24px;
    font-weight: 700;
    color: #0f1724;
    letter-spacing: 1px;
}

.logo span {
    color: #4aa3ff;
    /* soft blue accent */
}

.nav-links {
    display: flex;
    gap: 35px;
    list-style: none;
}

.nav-links a {
    color: #0f1724;
    text-decoration: none;
    font-size: 16px;
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
}

.nav-links a:hover,
.nav-links a.active {
    color: #ff6b6b;
    /* soft coral for hover */
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: #ff6b6b;
    transition: width 0.3s ease;
}

.nav-links a:hover::after,
.nav-links a.active::after {
    width: 100%;
}

.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 100px 8%;
    gap: 60px;
}

.hero-left {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}

.profile-img {
    width: 380px;
    height: 380px;
    border-radius: 50%;
    border: 8px solid #7abaff;
    /* softer blue */
    object-fit: cover;
    object-position: center;
    transition: transform 0.4s ease;
    box-shadow: 0 10px 40px rgba(122, 186, 255, 0.15);
}

/* Circular text wrapper around logo/profile */
.circular-wrap {
    position: relative;
    display: inline-block;
    width: 420px; /* slightly larger than image */
    height: 420px;
    border-radius: 50%;
}

.circular-wrap .profile-img {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 320px;
    height: 320px;
    z-index: 2;
    border-radius: 50%;
}

.circular-text {
    --size: 420px;
    position: absolute;
    left: 50%;
    top: 50%;
    width: var(--size);
    height: var(--size);
    transform: translate(-50%, -50%);
    border-radius: 50%;
    pointer-events: none; /* allow clicks through to image */
    z-index: 1;
    display: block;
    --spin-duration: 20s;
    animation: spin var(--spin-duration) linear infinite;
}

.circular-text span {
    --radius: calc(var(--size) / 2 - 24px);
    position: absolute;
    left: 50%;
    top: 50%;
    transform-origin: 0 0;
    font-size: 18px;
    font-weight: 800;
    color: #4aa3ff;
    white-space: pre;
}

@keyframes spin {
    from { transform: translate(-50%, -50%) rotate(0deg); }
    to   { transform: translate(-50%, -50%) rotate(360deg); }
}

/* hover states will be toggled by JS by adding classes on the wrapper */
.circular-wrap.hover-slow .circular-text { animation-duration: calc(var(--spin-duration) * 2) !important; }
.circular-wrap.hover-fast .circular-text { animation-duration: calc(var(--spin-duration) / 4) !important; }
.circular-wrap.hover-bonkers .circular-text { animation-duration: calc(var(--spin-duration) / 20) !important; transform-origin: 50% 50%; }
.circular-wrap.hover-paused .circular-text { animation-play-state: paused !important; }

/* responsive: reduce sizes on smaller screens */
@media (max-width: 768px) {
    .circular-wrap { width: 300px; height: 300px; }
    .circular-wrap .profile-img { width: 220px; height: 220px; }
    .circular-text { --size: 300px; --spin-duration: 20s; }
    .circular-text span { font-size: 14px; }
}

.profile-img:hover {
    transform: scale(1.08);
}

.hero-right {
    flex: 1;
    max-width: 600px;
}

.intro {
    font-size: 18px;
    color: #4b5563;
    /* muted slate */
    margin-bottom: 10px;
}

.typing-container {
    display: inline-block;
    color: #4aa3ff;
    font-weight: 600;
}

.cursor {
    display: inline-block;
    width: 2px;
    height: 20px;
    background: #4aa3ff;
    margin-left: 2px;
    animation: blink 0.7s infinite;
}

@keyframes blink {

    0%,
    50% {
        opacity: 1;
    }

    51%,
    100% {
        opacity: 0;
    }
}

.hero-name {
    font-size: 62px;
    font-weight: 800;
    color: #4aa3ff;
    margin: 20px 0;
    letter-spacing: 2px;
}

.hero-description {
    font-size: 17px;
    line-height: 1.8;
    color: #475569;
    margin-bottom: 35px;
    text-align: justify;
}

.hero-buttons {
    display: flex;
    gap: 20px;
    margin-bottom: 40px;
}

.btn {
    padding: 14px 35px;
    border: 2px solid #7abaff;
    background: transparent;
    color: #0f1724;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.4s ease;
    border-radius: 5px;
    text-decoration: none;
    display: inline-block;
}

.btn:hover {
    background: #e8f4ff;
    /* very light blue */
    box-shadow: 0 8px 30px rgba(15, 23, 36, 0.06),
        0 12px 40px rgba(122, 186, 255, 0.12);
    transform: translateY(-3px);
}

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

.social-links a {
    color: #0f1724;
    font-size: 22px;
    transition: all 0.3s ease;
}

.social-links a:hover {
    color: #4aa3ff;
    transform: scale(1.15);
}

@media (max-width: 1024px) {
    .hero {
        flex-direction: column;
        text-align: center;
        padding: 120px 5%;
    }

    .hero-right {
        max-width: 100%;
    }

    .profile-img {
        width: 320px;
        height: 320px;
    }

    .hero-name {
        font-size: 48px;
    }

    .hero-description {
        text-align: center;
    }

    .hero-buttons {
        justify-content: center;
    }

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

@media (max-width: 768px) {
    .navbar {
        padding: 15px 5%;
    }

    .logo {
        font-size: 20px;
    }

    .nav-links {
        gap: 20px;
    }

    .nav-links a {
        font-size: 14px;
    }

    .profile-img {
        width: 260px;
        height: 260px;
    }

    .hero-name {
        font-size: 38px;
    }

    .hero-buttons {
        flex-direction: column;
        width: 100%;
    }

    .btn {
        width: 100%;
        max-width: 300px;
    }

    /* show hamburger and hide inline nav links on small screens */
    .hamburger {
        display: block;
    }

    /* make nav-links a slide-in panel */
    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        width: 72%;
        max-width: 340px;
        height: 100vh;
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(6px);
        flex-direction: column;
        align-items: flex-start;
        padding: 80px 20px 20px 20px;
        gap: 18px;
        box-shadow: -6px 0 30px rgba(15,23,36,0.08);
        transition: right 0.3s ease;
        z-index: 1500;
        overflow-y: auto;
    }

    .nav-links li {
        width: 100%;
    }

    .nav-links a {
        width: 100%;
        display: block;
        padding: 12px 10px;
        font-size: 18px;
    }

    /* when navbar has nav-open class, slide the panel in */
    .navbar.nav-open .nav-links {
        right: 0;
    }

    /* transform hamburger to X when open */
    .navbar.nav-open .hamburger span:nth-child(1) { transform: translateY(9px) rotate(45deg); }
    .navbar.nav-open .hamburger span:nth-child(2) { opacity: 0; }
    .navbar.nav-open .hamburger span:nth-child(3) { transform: translateY(-9px) rotate(-45deg); }

    /* CENTER portfolio and contact on small devices */
    .portfolio-grid {
        justify-items: center; /* center grid items horizontally */
        padding: 0 12px;
    }

    .portfolio-item {
        width: 100%;
        max-width: 420px; /* limit card width so they stay centered */
    }

    .portfolio-image img {
        height: auto; /* allow image to scale vertically */
    }

    /* Contact: make blocks full-width but constrained and centered */
    .contact-content {
        align-items: center;
        gap: 24px;
    }

    .contact-info,
    .contact-form {
        width: 100%;
        max-width: 520px;
    }

    .contact-info {
        text-align: center;
    }

    .contact-item {
        justify-content: center;
        text-align: center;
    }

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

@media (max-width: 480px) {
    .nav-links {
        gap: 12px;
    }

    .nav-links a {
        font-size: 12px;
    }

    .profile-img {
        width: 220px;
        height: 220px;
    }

    .hero-name {
        font-size: 32px;
    }

    .intro {
        font-size: 16px;
    }

    .hero-description {
        font-size: 15px;
    }

    /* reduce hero padding on very small screens so content fits better */
    .hero { padding: 80px 5% 40px 5%; }
}

.section {
    min-height: 100vh;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 120px 8% 0 8%;
    background: linear-gradient(135deg, #f7fbff 0%, #eef7ff 100%);
    color: #0f1724;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.section.animate {
    opacity: 1;
    transform: translateY(0);
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

.section-title {
    font-size: 36px;
    font-weight: 700;
    color: #4aa3ff;
    margin-bottom: 40px;
    text-align: center;
    letter-spacing: 2px;
}

.about-content {
    display: flex;
    gap: 40px;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
}

.about-text {
    flex: 1;
    min-width: 280px;
    max-width: 600px;
    font-size: 16px;
    line-height: 1.6;
    color: #475569;
    text-align: justify;
}

.skills {
    margin-top: 20px;
}

.skills h3 {
    font-size: 20px;
    color: #4aa3ff;
    margin-bottom: 10px;
}

.skill-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.skill-tag {
    background: #7abaff;
    color: #0f1724;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    user-select: none;
    animation: fadeInUp 0.5s ease forwards;
    opacity: 0;
    animation-delay: calc(var(--delay) * 0.1s);
}

.about-image {
    flex: 1;
    min-width: 280px;
    max-width: 400px;
    display: flex;
    justify-content: center;
}

.about-img {
    width: 100%;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(122, 186, 255, 0.15);
    object-fit: cover;
}

.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
}

.portfolio-item {
    position: relative;
    overflow: hidden;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(122, 186, 255, 0.12);
    cursor: pointer;
    transition: transform 0.3s ease;
    animation: fadeInUp 0.5s ease forwards;
    opacity: 0;
    animation-delay: calc(var(--delay) * 0.1s);
}

.portfolio-item:hover {
    transform: translateY(-10px);
}

.portfolio-image img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
    border-radius: 15px;
}

.portfolio-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    /* nền overlay nhẹ nhàng */
    background: rgba(122, 186, 255, 0.14);
    color: #0f1724;
    opacity: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
    text-align: center;
    transition: opacity 0.3s ease;
    border-radius: 15px;
}

.portfolio-item:hover .portfolio-overlay {
    opacity: 1;
}

.portfolio-overlay h3 {
    margin-bottom: 10px;
    font-size: 22px;
}

.portfolio-overlay p {
    margin-bottom: 20px;
    font-size: 16px;
}

.resume-content {
    display: flex;
    gap: 60px;
    flex-wrap: wrap;
    justify-content: center;
}

.resume-left,
.resume-right {
    flex: 1;
    min-width: 280px;
    max-width: 500px;
}

.resume-left h3,
.resume-right h3 {
    color: #4aa3ff;
    margin-bottom: 20px;
}

.experience-item,
.education-item {   
    margin-bottom: 25px;
}

.experience-item h4,
.education-item h4 {
    font-size: 18px;
    margin-bottom: 5px;
}

.company,
.university,
.date {
    font-style: italic;
    font-size: 14px;
    color: #6b7280;
    margin-bottom: 5px;
}

.certifications {
    list-style: disc inside;
    color: #475569;
    font-size: 15px;
}

.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
}

.blog-post {
    background: #f8fbff;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(15, 23, 36, 0.06);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease;
    animation: fadeInUp 0.5s ease forwards;
    opacity: 0;
    animation-delay: calc(var(--delay) * 0.1s);
}

.blog-post:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(15, 23, 36, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.blog-image img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    display: block;
}

.blog-content {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.blog-content h3 {
    margin-bottom: 10px;
    color: #4aa3ff;
}

.blog-meta {
    font-size: 13px;
    color: #6b7280;
    margin-bottom: 15px;
}

.read-more {
    margin-top: auto;
    color: #4aa3ff;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.read-more:hover {
    color: #ff6b6b;
}

.contact-content {
    display: flex;
    gap: 60px;
    flex-wrap: wrap;
    justify-content: center;
}

.contact-info {
    flex: 1;
    min-width: 280px;
    max-width: 400px;
    color: #475569;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 25px;
    font-size: 16px;
}

.contact-item i {
    font-size: 22px;
    color: #4aa3ff;
}

.social-links-contact {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

.social-links-contact a {
    color: #0f1724;
    font-size: 24px;
    transition: all 0.3s ease;
}

.social-links-contact a:hover {
    color: #4aa3ff;
    transform: scale(1.08);
}

.contact-form {
    flex: 1;
    min-width: 280px;
    max-width: 500px;
}

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

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #7abaff;
    border-radius: 8px;
    background: #ffffff;
    color: #0f1724;
    font-size: 15px;
    resize: none;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: #ff6b6b;
    outline: none;
}

.contact-form button {
    width: 100%;
    padding: 14px;
    background: #7abaff;
    border: none;
    border-radius: 8px;
    color: #0f1724;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.4s ease;
}

.contact-form button:hover {
    background: #ff6b6b;
    box-shadow: 0 8px 30px rgba(15, 23, 36, 0.06),
        0 12px 40px rgba(255, 107, 107, 0.12);
    transform: translateY(-3px);
}

@media (max-width: 1024px) {

    .about-content,
    .resume-content,
    .contact-content {
        flex-direction: column;
        align-items: center;
    }

    .portfolio-grid,
    .blog-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 768px) {

    .portfolio-grid,
    .blog-grid {
        grid-template-columns: 1fr;
    }
}

.logo {
    cursor: pointer;
}

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

.logo a:hover span {
    color: #ff6b6b;
    transition: color 0.3s ease;
}
footer {
    text-align: center;
    padding: 30px 0;
    background: rgba(255, 255, 255, 0.7);
    margin-top: 80px;
    color: #475569;
    font-size: 15px;
}

