/* =============================================
   PORTFOLIO STYLESHEET MAP
   1. Theme tokens
   2. Global / shared utilities
   3. Navbar
   4. Hero
   5. About
   6. Experience
   7. Projects + Modals
   8. Case Study
   9. Legacy shared cards for mastery/resume/contact
   10. Resume
   11. Contact
   12. Footer + Floating controls
   13. Motion / accessibility
   14. Mastery bento redesign
   ============================================= */

/* =============================================
   1. THEME TOKENS
   ============================================= */
:root {
    /* Colors */
    --bg-color: #f7f4ef;
    --text-color: #0f1b1d;
    --secondary-text: #3a4a4f;
    --primary-color: #0f766e;
    --primary-rgb: 15, 118, 110;
    --primary-soft: rgba(15, 118, 110, 0.12);
    --accent-color: #f59e0b;
    --accent-soft: rgba(245, 158, 11, 0.15);
    --nav-active-color: #0f766e;
    --card-bg: #ffffff;
    --card-bg-rgb: 255, 255, 255;
    --border-color: rgba(15, 27, 29, 0.08);
    --bg-gradient: linear-gradient(135deg, #f7f4ef, #eef2f1, #f6f1e7, #edf4f2);

    /* Typography */
    --font-body: "Source Serif 4", Georgia, serif;
    --font-display: "Space Grotesk", "Trebuchet MS", sans-serif;

    /* Perfection Tokens (Consistency) */
    --card-radius: 20px;
    --card-shadow: 0 10px 30px rgba(15, 27, 29, 0.06);
    --card-shadow-hover: 0 20px 40px rgba(15, 27, 29, 0.12);
    --card-hover-transform: translateY(-8px);
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] {
    --bg-color: #0b1214;
    --text-color: #f7f5f0;
    --secondary-text: #b6c1c3;
    --primary-color: #2dd4bf;
    --primary-rgb: 45, 212, 191;
    --primary-soft: rgba(45, 212, 191, 0.18);
    --accent-color: #fbbf24;
    --accent-soft: rgba(251, 191, 36, 0.2);
    --nav-active-color: #2dd4bf;
    --card-bg: #121b1e;
    --card-bg-rgb: 18, 27, 30;
    --border-color: rgba(255, 255, 255, 0.08);
    --bg-gradient: linear-gradient(135deg, #0b1214, #0f1b1d, #101820, #0b1214);
    --card-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
    --card-shadow-hover: 0 20px 40px rgba(0, 0, 0, 0.55);
}

/* =============================================
   2. GLOBAL / SHARED UTILITIES
   ============================================= */

/* Shared card shell used across multiple sections */
.portfolio-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--card-radius);
    box-shadow: var(--card-shadow);
    transition: var(--transition-smooth);
    overflow: hidden;
}

.portfolio-card:hover {
    transform: var(--card-hover-transform);
    box-shadow: var(--card-shadow-hover);
    border-color: var(--primary-color);
}

:focus-visible {
    outline: 3px solid var(--accent-color);
    outline-offset: 3px;
}

/* Offset anchor jumps for the fixed navbar */
section[id] {
    scroll-margin-top: 64px;
}

/* Global scroll behavior */
html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

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

.text-primary {
    color: var(--primary-color) !important;
}

.text-secondary {
    color: var(--secondary-text) !important;
}

/* Typewriter cursor */
.cursor {
    font-weight: 300;
    color: var(--primary-color);
    animation: blink 0.7s infinite;
    margin-left: 2px;
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

/* Base page styles */
body {
    min-height: 100vh;
    font-family: var(--font-body);
    background-color: var(--bg-color);
    background-image: var(--bg-gradient);
    background-size: 400% 400%;
    background-attachment: fixed;
    animation: gradient-flow 18s ease infinite;
    color: var(--text-color);
    transition: background-color 0.3s ease, color 0.3s ease;
    overflow-x: hidden;
}

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

h1,
h2,
h3,
h4,
h5,
h6,
.navbar-brand,
.hero-title,
.badge-cat,
.filter-btn,
.btn-primary-custom,
.btn-outline-custom {
    font-family: var(--font-display);
    letter-spacing: -0.02em;
}

@keyframes gradient-flow {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

/* =============================================
   3. NAVBAR
   ============================================= */
.custom-navbar {
    background-color: transparent;
    padding: 20px 0;
    transition: var(--transition-smooth);
    border-bottom: 1px solid transparent;
}

.custom-navbar.scrolled {
    background-color: var(--card-bg);
    /* Reduced opacity slightly for better glass effect */
    background: rgba(var(--card-bg-rgb), 0.9);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 10px 0;
    box-shadow: var(--card-shadow);
    border-bottom: 1px solid var(--border-color);
}

.navbar-brand {
    color: var(--text-color) !important;
    font-size: 1.5rem;
    letter-spacing: -0.5px;
}

.custom-navbar .nav-link {
    color: var(--secondary-text) !important;
    font-weight: 500;
    font-size: 0.95rem;
    position: relative;
    padding: 8px 12px !important;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    transition: var(--transition-smooth);
}

/* Active link underline */
.custom-navbar .nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 12px;
    width: 0;
    /* Changed from scaleX for smoother ScrollSpy transition */
    height: 2px;
    background-color: var(--primary-color);
    transition: width 0.3s ease;
}

.custom-navbar .nav-link:hover,
.custom-navbar .nav-link.active {
    color: var(--primary-color) !important;
}

.custom-navbar .nav-link:hover::after,
.custom-navbar .nav-link.active::after {
    width: calc(100% - 24px);
    /* Accounts for left/right padding */
}

/* Navbar icon handling in dark mode */
[data-theme="dark"] .navbar-toggler {
    border-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .navbar-toggler-icon {
    filter: invert(1);
}

/* Mobile navbar layout */
@media (max-width: 991px) {
    .navbar-collapse {
        background: var(--card-bg);
        margin-top: 15px;
        padding: 20px;
        border-radius: var(--card-radius);
        box-shadow: var(--card-shadow-hover);
        border: 1px solid var(--border-color);
        text-align: center;
    }

    .custom-navbar .nav-link {
        width: fit-content;
        margin: 5px auto;
        display: block;
    }

    .custom-navbar .nav-link::after {
        left: 0;
    }

    .custom-navbar .nav-link:hover::after,
    .custom-navbar .nav-link.active::after {
        width: 100%;
    }
}

/* =============================================
   4. HERO
   ============================================= */
.hero-section {
    min-height: 100vh;
    padding-top: clamp(100px, 12vw, 140px);
    padding-bottom: clamp(70px, 10vw, 110px);
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.hero-section::before,
.hero-section::after {
    content: '';
    position: absolute;
    width: 300px;
    height: 300px;
    border-radius: 50%;
    filter: blur(100px);
    z-index: -1;
    opacity: 0.15;
    pointer-events: none;
}

/* Background glow behind text */
.hero-section::before {
    top: 10%;
    left: -5%;
    background: var(--primary-color);
}

/* Secondary glow behind image */
.hero-section::after {
    bottom: 10%;
    right: -5%;
    background: var(--accent-color);
}

/* Stronger glow in dark mode */
[data-theme="dark"] .hero-section::before,
[data-theme="dark"] .hero-section::after {
    opacity: 0.25;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent-color);
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.hero-name {
    font-size: clamp(2.8rem, 6vw, 4.8rem);
    font-weight: 800;
    letter-spacing: -2.5px;
    margin-bottom: 1rem;
    line-height: 1.1;
}

.text-gradient {
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-title {
    font-size: clamp(1rem, 2vw, 1.2rem);
    font-weight: 600;
    display: inline-block;
    padding: 8px 24px;
    background: var(--primary-soft);
    color: var(--primary-color);
    border-radius: 100px;
    margin-bottom: 24px;
    border: 1px solid var(--border-color);
}

.hero-tagline {
    font-size: 1.1rem;
    line-height: 1.7;
    color: var(--secondary-text);
    margin-bottom: 28px;
    max-width: 540px;
    font-weight: 400;
    /* border-left: 2px solid var(--primary-color); */
    padding-left: 20px;
    letter-spacing: 0.3px;
}

.hero-focus {
    position: relative;
    font-size: 0.9rem;
    color: var(--secondary-text);
    padding-left: 1.5rem;
    line-height: 1.7;
    max-width: 680px;
    opacity: 0.9;
}


/* Focus indicator dot */
.hero-focus::before {
    content: '';
    position: absolute;
    left: -5.5px;
    top: 50%;
    transform: translateY(-50%);
    width: 9px;
    height: 9px;
    background-color: var(--primary-color);
    border-radius: 50%;
    z-index: 2;
}

/* Focus indicator ripple */
.hero-focus::after {
    content: '';
    position: absolute;
    left: -5.5px;
    top: 50%;
    transform: translateY(-50%);
    width: 9px;
    height: 9px;
    background-color: var(--primary-color);
    border-radius: 50%;
    animation: pulse-ripple 2s infinite;
    z-index: 1;
}

@keyframes pulse-ripple {
    0% {
        transform: translateY(-50%) scale(1);
        opacity: 0.8;
    }

    100% {
        transform: translateY(-50%) scale(3.5);
        opacity: 0;
    }
}

/* Shared primary/outline buttons */
.btn-primary-custom {
    background: var(--primary-color);
    color: white !important;
    border: 2px solid transparent;
    border-radius: 14px;
    font-weight: 600;
    padding: 14px 30px;
    min-height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 20px var(--primary-soft);
    transition: var(--transition-smooth);
}

.btn-primary-custom:hover {
    color: var(--primary-color) !important;
    border: 2px solid var(--primary-color);
    transform: translateY(-4px);
    box-shadow: 0 15px 30px var(--primary-soft);
}

.btn-outline-custom {
    border: 2px solid var(--primary-color);
    color: var(--primary-color) !important;
    border-radius: 14px;
    font-weight: 600;
    padding: 14px 30px;
    min-height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-smooth);
}

.btn-outline-custom:hover {
    background-color: var(--primary-color);
    color: white !important;
    transform: translateY(-4px);
}

/* Hero image */
.hero-image-container {
    position: relative;
    padding: 20px;
}

.hero-img-styled {
    border-radius: 3rem;
    border: 15px solid var(--card-bg);
    box-shadow: var(--card-shadow-hover);
    animation: float 6s ease-in-out infinite;
    width: min(100%, 420px);
    max-width: 100%;
    filter: brightness(1.05) contrast(1.1);
    object-fit: cover;
    object-position: center top;
    aspect-ratio: 4 / 5;
}

/* Hero responsive behavior */
@media (max-width: 991px) {

    /* Center hero text content */
    .hero-section .col-lg-7 {
        text-align: center !important;
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    /* Center action buttons */
    .hero-section .d-flex {
        justify-content: center !important;
        width: 100%;
    }

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

    /* Hero image placement */
    .hero-image-container {
        margin-top: 40px;
        display: flex;
        justify-content: center;
        padding: 0;
    }

    .hero-image-container img {
        max-width: 280px;
        height: auto;
        margin: 0 auto;
        border-width: 10px;
    }

    /* Mobile heading size */
    .hero-name {
        font-size: 2.2rem;
    }

    .hero-section::before {
        top: 20%;
        left: 50%;
        transform: translateX(-50%);
    }

    .hero-section::after {
        display: none;
    }
}

@media (max-width: 1200px) {
    .hero-img-styled {
        border-width: 12px;
    }
}

@media (max-width: 992px) {
    .hero-section {
        min-height: auto;
    }

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

    .hero-image-container {
        margin-top: 30px;
    }
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-20px);
    }
}

/* =============================================
   5. ABOUT
   ============================================= */
.about-section {
    padding: clamp(70px, 8vw, 110px) 0;
}

.section-title {
    font-size: clamp(2rem, 4vw, 2.5rem);
    font-weight: 800;
    margin-bottom: 20px;
    color: var(--text-color);
}

.about-description {
    font-size: 1.1rem;
    /* font-size: clamp(1.1rem, 2vw, 1.3rem); */
    line-height: 1.8;
    color: var(--secondary-text);
    margin-bottom: 25px;
    position: relative;
    padding-left: 20px;
    border-left: 4px solid var(--primary-color);
}

/* Bold text emphasis inside the about copy */
.about-description strong {
    color: var(--text-color);
    font-weight: 700;
}

/* About text mobile spacing */
@media (max-width: 768px) {
    .about-description {
        padding-left: 20px;
        font-size: 1.1rem;
    }
}

/* General mobile typography and spacing shared by early sections */
@media (max-width: 768px) {
    body {
        background-attachment: scroll;
    }
}

@media (max-width: 768px) {
    .section-title {
        font-size: clamp(1.7rem, 6vw, 2.1rem);
    }

    section[id] {
        scroll-margin-top: 60px;
    }

    .hero-name {
        font-size: clamp(2.1rem, 8vw, 2.8rem);
        letter-spacing: -1.2px;
    }

    .hero-title {
        font-size: 0.95rem;
        padding: 8px 18px;
    }

    .hero-tagline {
        font-size: 1rem;
        padding-left: 16px;
        margin-bottom: 22px;
    }

    .btn-primary-custom,
    .btn-outline-custom {
        padding: 12px 22px;
        font-size: 0.95rem;
    }

    .timeline {
        padding-left: 24px;
    }

    .timeline-dot {
        left: -24px;
    }

    .project-card-custom {
        padding: 26px;
    }

    .resume-card-custom,
    .skills-card-custom,
    .contact-intro {
        padding: 24px;
    }
}

@media (max-width: 576px) {
    .navbar-brand {
        font-size: 1.25rem;
    }
    .hero-section .d-flex {
        flex-direction: column;
        gap: 12px;
    }

    .hero-section .btn {
        width: 100%;
        text-align: center;
    }

    .hero-image-container img {
        max-width: 240px;
        border-width: 8px;
    }

    .project-tags-container span {
        font-size: 0.68rem;
        padding: 4px 10px;
    }

    .contact-card-custom {
        flex-direction: column;
        text-align: center;
    }

    .contact-card-custom .icon-circle {
        margin-right: 0;
        margin-bottom: 12px;
    }

    .contact-info .value {
        word-break: break-word;
    }

    .modal-body {
        padding: 20px 16px;
    }

    .modal-dialog {
        margin: 1rem;
    }
}

/* About cards */
.about-card {
    background: var(--card-bg);
    padding: 35px 30px;
    border-radius: var(--card-radius);
    height: 100%;
    border: 1px solid var(--border-color);
    box-shadow: var(--card-shadow);
    transition: var(--transition-smooth);
    display: flex;
    flex-direction: column;
}

.about-card:hover {
    transform: var(--card-hover-transform);
    box-shadow: var(--card-shadow-hover);
    border-color: var(--primary-color);
}

/* Shared icon chip */
.icon-circle {
    width: 55px;
    height: 55px;
    background: var(--primary-soft);
    color: var(--primary-color);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    margin-bottom: 20px;
    transition: var(--transition-smooth);
}

.about-card:hover .icon-circle {
    background: var(--primary-color);
    color: #fff;
}

.about-card h5 {
    font-weight: 700;
    font-size: 1.15rem;
    margin-bottom: 12px;
    color: var(--text-color);
}

.about-card p {
    font-size: 0.95rem;
    color: var(--secondary-text);
    margin: 0;
    line-height: 1.5;
}

/* Inline section link */
.btn-link-custom {
    color: var(--primary-color);
    font-weight: 700;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    transition: gap 0.3s;
}

.btn-link-custom:hover {
    gap: 8px;
    /* Slides the arrow icon slightly */
    color: var(--primary-color);
}

/* About layout adjustment */
@media (max-width: 991.98px) {
    .about-text {
        text-align: center;
        margin-bottom: 20px;
    }

    .btn-link-custom {
        justify-content: center;
        width: 100%;
    }
}


/* =============================================
   6. EXPERIENCE
   ============================================= */
.experience-section {
    padding: clamp(70px, 8vw, 110px) 0;
}

.timeline {
    position: relative;
    max-width: 850px;
    margin: 0 auto;
    padding-left: 40px;
}

/* Timeline vertical line */
.timeline::before {
    content: "";
    position: absolute;
    left: 7px;
    top: 5px;
    width: 3px;
    height: 100%;
    background: linear-gradient(to bottom, var(--primary-color), transparent);
    opacity: 0.3;
}

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

/* Timeline dot */
.timeline-dot {
    position: absolute;
    left: -40px;
    top: 25px;
    width: 18px;
    height: 18px;
    background-color: var(--card-bg);
    border: 3px solid var(--primary-color);
    border-radius: 50%;
    z-index: 2;
    box-shadow: 0 0 10px var(--primary-soft);
}

/* Timeline card content */
.timeline-content.portfolio-card {
    padding: 30px;
}

.timeline-content h5 {
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-color);
}

.timeline-period {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--primary-color);
    display: inline-flex;
    align-items: center;
    margin-bottom: 12px;
}

.badge-role {
    display: block;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--secondary-text);
    margin-bottom: 15px;
    font-style: italic;
}

.timeline-content ul {
    padding-left: 20px;
    margin: 0;
}

.timeline-content li {
    font-size: 0.95rem;
    color: var(--secondary-text);
    margin-bottom: 10px;
    line-height: 1.6;
}

/* Experience mobile layout */
@media (max-width: 768px) {
    .timeline {
        padding-left: 30px;
    }

    .timeline-dot {
        left: -30px;
        width: 14px;
        height: 14px;
        top: 28px;
    }
}

/* =============================================
   7. PROJECTS + MODALS
   ============================================= */
.projects-section {
    padding: clamp(70px, 8vw, 110px) 0;
}

/* Project cards */
.project-card-custom {
    padding: 32px;
    /* Increased for better visual breathing room */
    cursor: pointer;
    position: relative;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.project-card-custom:focus-visible {
    outline: 3px solid var(--accent-color);
    outline-offset: 6px;
}

.project-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 22px;
}

/* Hover icon */
.project-top i {
    font-size: 0.95rem;
    color: var(--primary-color);
    opacity: 0;
    transform: translate(-10px, 10px);
    transition: var(--transition-smooth);
}

.project-card-custom:hover .project-top i {
    opacity: 1;
    transform: translate(0, 0);
}

.badge-cat {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--primary-color);
    background: var(--primary-soft);
    padding: 6px 14px;
    border-radius: 50px;
}

.badge-ai {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: #10b981;
    background: rgba(16, 185, 129, 0.14);
    padding: 6px 14px;
    border-radius: 50px;
}

.project-card-custom h5 {
    font-weight: 700;
    font-size: 1.25rem;
    margin-bottom: 12px;
    color: var(--text-color);
}

.project-card-custom p {
    font-size: 0.95rem;
    color: var(--secondary-text);
    line-height: 1.6;
    margin-bottom: 28px;
}

.project-impact {
    font-size: 0.85rem;
    color: var(--text-color);
    margin-top: -18px;
    margin-bottom: 20px;
    font-weight: 600;
}

/* Shared project tag pills */
.project-tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: auto;
    /* Pushes tags to the bottom of the card */
}

.project-tags-container span {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--secondary-text);
    background: var(--bg-color);
    padding: 5px 12px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    transition: var(--transition-smooth);
}

.project-card-custom:hover .project-tags-container span {
    border-color: var(--primary-soft);
    color: var(--primary-color);
}

/* Project filter tabs */
.filter-btn {
    padding: 10px 22px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    background: var(--card-bg);
    color: var(--secondary-text);
    font-weight: 600;
    font-size: 0.85rem;
    min-height: 44px;
    transition: all 0.3s ease;
}

.filter-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.filter-btn.active {
    background: var(--primary-color);
    color: white !important;
    border-color: var(--primary-color);
    box-shadow: 0 8px 20px var(--primary-soft);
}

/* Project show/hide animation */
.project-item {
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.4s ease;
}

/* Project modals */
.modal-content {
    background-color: var(--card-bg);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    border-radius: var(--card-radius);
    padding: 10px;
    box-shadow: var(--card-shadow-hover);
}

.modal-header {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 20px;
}

.modal-body {
    padding: 30px 20px;
}

.modal-body h6 {
    font-weight: 700;
    color: var(--text-color);
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 1px;
}

.modal-body ul {
    padding-left: 1.2rem;
}

.modal-body ul li {
    margin-bottom: 12px;
    font-size: 0.95rem;
    color: var(--secondary-text);
    line-height: 1.5;
}

/* Dark theme modal override */
[data-theme="dark"] .modal-content {
    background-color: #1c2128;
    /* Slightly lighter than the main bg for depth */
}


/* =============================================
   8. CASE STUDY
   ============================================= */
.case-study-section {
    padding: clamp(70px, 8vw, 110px) 0;
}

.case-study-intro p {
    max-width: 760px;
    margin-left: auto;
    margin-right: auto;
}

.case-study-stack {
    display: grid;
    gap: 26px;
}

.case-study-block {
    position: relative;
}

.case-main-card,
.case-side-card {
    padding: 26px;
}

.case-side-card {
    display: flex;
    flex-direction: column;
}

.case-side-card h4 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 14px;
    color: var(--text-color);
}

.case-project-title {
    font-size: 1.45rem;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--text-color);
}

.case-project-label {
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--primary-color);
}

.case-summary {
    color: var(--secondary-text);
    line-height: 1.65;
    margin-bottom: 18px;
}

.case-study-points {
    display: grid;
    gap: 12px;
    margin-bottom: 12px;
}

.case-study-point {
    display: flex;
    flex-direction: column;
    padding: 16px;
    border-radius: 14px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    box-shadow: var(--card-shadow);
}

.case-title {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--primary-color);
    font-weight: 700;
    margin-bottom: 6px;
}

.case-detail {
    color: var(--text-color);
    font-weight: 600;
}

@media (max-width: 991px) {
    .case-main-card,
    .case-side-card {
        padding: 22px;
    }

    .case-study-stack {
        gap: 18px;
    }
}

/* =============================================
   9. LEGACY SHARED CARDS
   Used by mastery/resume/contact blocks outside the bento styles
   ============================================= */
.skills-section {
    padding: clamp(70px, 8vw, 110px) 0;
}

.language-tag {
    background: rgba(var(--primary-rgb), 0.1);
    color: var(--primary-color);
    padding: 6px 15px;
    border-radius: 20px;
    font-weight: 500;
    display: inline-block;
    margin: 4px;
    border: 1px solid rgba(var(--primary-rgb), 0.2);
    transition: all 0.3s ease;
}

.skills-card-custom {
    padding: 30px;
    height: auto;
    display: flex;
    flex-direction: column;
}

.skills-card-custom h5 {
    font-weight: 700;
    font-size: 1.2rem;
    margin-bottom: 20px;
    color: var(--text-color);
}

/* Compact credential cards */
.cert-card-mini {
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    padding: 20px;
    border-radius: 12px;
    transition: var(--transition-smooth);
}

.cert-card-mini:hover {
    border-color: var(--primary-color);
    background: var(--card-bg);
}

.cert-card-mini h6 {
    font-weight: 700;
    font-size: 0.95rem;
    margin: 5px 0 12px 0;
}

.cert-view-btn {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--primary-color);
    text-decoration: none;
    letter-spacing: 0.5px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 6px 12px;
    background: var(--primary-soft);
    border-radius: 6px;
    transition: 0.3s;
}

.cert-view-btn:hover {
    background: var(--primary-color);
    color: white !important;
}

/* Shared certification item styling */
.cert-item {
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
}

.cert-item p {
    color: var(--text-color) !important;
}

.cert-item:last-child {
    border-bottom: none;
}

.skills-card-custom .project-tags-container span {
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    padding: 5px 10px;
    font-size: 0.75rem;
    border-radius: 6px;
}

.cert-tag {
    font-size: 0.65rem;
    font-weight: 800;
    color: var(--primary-color);
    text-transform: uppercase;
}


/* =============================================
   10. RESUME
   ============================================= */
.resume-section {
    padding: clamp(70px, 8vw, 110px) 0;
}

.resume-description {
    font-size: 1.1rem;
    color: var(--secondary-text);
    max-width: 600px;
    margin: 0 auto 60px auto;
    line-height: 1.7;
    font-weight: 400;
}

.resume-card-custom {
    padding: 50px 40px;
    text-align: center;
    display: flex;
    flex-direction: column;
}

.resume-card-custom h5 {
    font-weight: 700;
    font-size: 1.3rem;
    margin-bottom: 12px;
    color: var(--text-color);
}

.resume-card-custom p {
    font-size: 0.95rem;
    color: var(--secondary-text);
    margin-bottom: 30px;
    line-height: 1.6;
}

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

.resume-card-custom .icon-circle {
    width: 65px;
    height: 65px;
    font-size: 1.5rem;
}

/* Accessibility skip link */
.skip-link {
    position: absolute;
    top: -40px;
    left: 20px;
    background: var(--primary-color);
    color: #fff;
    padding: 8px 14px;
    border-radius: 8px;
    z-index: 2000;
    transition: var(--transition-smooth);
    text-decoration: none;
}

.skip-link:focus {
    top: 20px;
}

/* =============================================
   11. CONTACT
   ============================================= */
.contact-section {
    padding: clamp(80px, 9vw, 120px) 0;
}

.contact-shell {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 40px;
    align-items: center;
}

.contact-intro {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 26px;
    padding: 36px;
    box-shadow: var(--card-shadow);
}

.contact-badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 14px;
    border-radius: 999px;
    background: var(--primary-soft);
    color: var(--primary-color);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.75rem;
    margin-bottom: 16px;
}

.contact-description {
    font-size: 1.05rem;
    color: var(--secondary-text);
    max-width: 100%;
    line-height: 1.7;
    margin-bottom: 24px;
}

.contact-cta {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-bottom: 16px;
}

.contact-note {
    font-size: 0.9rem;
    color: var(--secondary-text);
    opacity: 0.8;
}

.contact-cards {
    display: grid;
    gap: 18px;
}

.contact-card-custom {
    display: flex;
    align-items: center;
    padding: 22px;
    min-height: 88px;
    text-decoration: none !important;
    background: var(--card-bg);
    border-radius: var(--card-radius);
}

/* Reuse the shared icon chip in horizontal cards */
.contact-card-custom .icon-circle {
    width: 54px;
    height: 54px;
    font-size: 1.25rem;
    margin-bottom: 0;
    /* Override bottom margin for horizontal layout */
    margin-right: 20px;
    flex-shrink: 0;
}

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

.contact-info .label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--primary-color);
    font-weight: 700;
    margin-bottom: 2px;
}

.contact-info .value {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-color);
    word-break: break-all;
    transition: var(--transition-smooth);
}

.contact-card-custom:hover .value {
    color: var(--primary-color);
}

/* Contact mobile layout */
@media (max-width: 768px) {
    .contact-shell {
        grid-template-columns: 1fr;
    }

    .contact-intro {
        padding: 28px;
    }

    .contact-card-custom {
        padding: 20px;
    }
}

/* =============================================
   12. FOOTER + FLOATING CONTROLS
   ============================================= */
.footer {
    padding: 40px 0;
    background-color: var(--bg-color);
    border-top: 1px solid var(--border-color);
}

.footer p {
    margin: 0;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--secondary-text);
}

.footer-content {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    gap: 14px;
}

.footer-social-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
}

.footer-social-links a {
    color: var(--secondary-text);
    margin: 0;
    font-size: 1.1rem;
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-smooth);
}

.footer-social-links a:hover {
    color: var(--primary-color);
}

/* Floating controls */
.scroll-top-btn,
.floating-theme-btn {
    position: fixed;
    right: 28px;
    width: 48px;
    height: 48px;
    border: 1px solid var(--border-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 1000;
    transition: var(--transition-smooth);
}

/* Scroll-to-top button */
.scroll-top-btn {
    bottom: 28px;
    background-color: var(--primary-color);
    color: #fff;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
}

.scroll-top-btn.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Theme toggle button */
.floating-theme-btn {
    top: 100px;
    background-color: var(--card-bg);
    color: var(--text-color);
    box-shadow: var(--card-shadow);
}

.scroll-top-btn:hover,
.floating-theme-btn:hover {
    transform: scale(1.1);
    box-shadow: var(--card-shadow-hover);
}

/* =============================================
   13. MOTION / ACCESSIBILITY
   ============================================= */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* Floating control positioning on small screens */
@media (max-width: 576px) {
    .floating-theme-btn {
        top: auto;
        bottom: 90px;
        right: 20px;
    }

    .scroll-top-btn {
        bottom: 25px;
        right: 20px;
    }
}

/* Responsive polish for tablet/mobile */
@media (max-width: 768px) {
    .container {
        width: 100%;
        padding-left: 16px;
        padding-right: 16px;
    }

    .custom-navbar {
        padding: 14px 0;
    }

    .navbar-toggler {
        min-width: 44px;
        min-height: 44px;
        padding: 8px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .navbar-collapse {
        max-width: 100%;
        overflow-x: hidden;
    }

    .hero-section {
        padding-top: 96px;
        padding-bottom: 64px;
    }

    .hero-section::before,
    .hero-section::after {
        width: 220px;
        height: 220px;
        filter: blur(80px);
    }

    .hero-tagline,
    .about-description,
    .hero-focus {
        max-width: 100%;
    }

    .timeline {
        max-width: 100%;
    }

    .case-study-points {
        grid-template-columns: 1fr;
    }

    .resume-actions {
        width: 100%;
    }

    .resume-actions .btn {
        flex: 1 1 220px;
    }

    .contact-cards {
        grid-template-columns: 1fr;
    }

    .mastery-stat,
    .mastery-card,
    .portfolio-card,
    .project-card-custom,
    .contact-intro,
    .resume-card-custom {
        min-width: 0;
    }
}

@media (max-width: 480px) {
    .custom-navbar .nav-link {
        width: 100%;
        justify-content: center;
    }

    .hero-badge,
    .hero-title,
    .contact-badge {
        width: 100%;
        justify-content: center;
        text-align: center;
    }

    .hero-tagline {
        padding-left: 12px;
        font-size: 0.98rem;
    }

    .hero-focus {
        font-size: 0.84rem;
        padding-left: 1.1rem;
    }

    .about-description {
        padding-left: 14px;
        border-left-width: 3px;
        font-size: 1rem;
    }

    .filter-btn,
    .resume-actions .btn,
    .btn-primary-custom,
    .btn-outline-custom {
        width: 100%;
        justify-content: center;
    }

    .project-card-custom,
    .resume-card-custom,
    .skills-card-custom,
    .contact-intro,
    .contact-card-custom,
    .mastery-card {
        padding: 20px;
    }

    .mastery-stats-row {
        grid-template-columns: 1fr;
    }

    .mastery-growth-item {
        padding: 14px;
    }

    .contact-card-custom {
        min-height: 44px;
    }

    .footer {
        padding-bottom: 64px;
    }

    .footer-content {
        text-align: center;
    }

    .footer p {
        font-size: 0.82rem;
        line-height: 1.6;
    }
}

/* Respect reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    .hero-img-styled {
        animation: none;
    }
}

/* =============================================
   MASTERY SECTION — BENTO GRID REDESIGN
   ============================================= */

.mastery-stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}

.mastery-stat {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--card-radius);
  padding: 16px;
  text-align: center;
  box-shadow: var(--card-shadow);
}

.mastery-stat-num {
  display: block;
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-color);
}

.mastery-stat-label {
  display: block;
  font-size: 0.72rem;
  color: var(--secondary-text);
  margin-top: 4px;
}

/* Bento grid */
.mastery-bento {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  align-items: stretch;
}

.mastery-card {
  padding: 1.4rem;
}

.mastery-card--skills {
  grid-column: span 2;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.mastery-card--growth {
  grid-column: span 2;
}

/* Card label */
.mastery-card-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--secondary-text);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.mastery-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--primary-color);
  display: inline-block;
  flex-shrink: 0;
}

/* Skill groups */
.mastery-skill-group {
  margin-bottom: 16px;
}

.mastery-skill-group:last-child {
  margin-bottom: 0;
}

.mastery-skill-group-label {
  font-size: 0.72rem;
  color: var(--secondary-text);
  margin-bottom: 8px;
  font-weight: 600;
}

/* Highlight primary tags */
.mastery-tag-primary {
  color: var(--primary-color) !important;
  border-color: var(--primary-color) !important;
  background: var(--primary-soft) !important;
}

/* Cert timeline */
.mastery-cert-item {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
  align-items: flex-start;
}

.mastery-cert-item:last-child {
  margin-bottom: 0;
}

.mastery-cert-timeline {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 4px;
}

.mastery-cert-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--primary-color);
  flex-shrink: 0;
}

.mastery-cert-line {
  width: 1px;
  flex: 1;
  background: var(--border-color);
  margin-top: 5px;
  min-height: 28px;
}

.mastery-cert-name {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-color);
  margin: 0 0 3px;
}

.mastery-cert-date {
  font-size: 0.75rem;
  color: var(--secondary-text);
  margin: 0 0 8px;
}

/* Education */
.mastery-edu-item {
  margin-bottom: 6px;
}

.mastery-edu-degree {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-color);
  margin: 0 0 2px;
}

.mastery-edu-inst {
  font-size: 0.82rem;
  color: var(--secondary-text);
  margin: 0 0 3px;
}

.mastery-edu-date {
  font-size: 0.72rem;
  color: var(--secondary-text);
  margin: 0;
}

.mastery-divider {
  border: none;
  border-top: 1px solid var(--border-color);
  margin: 14px 0;
}

/* Professional growth */
.mastery-growth-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.mastery-growth-item {
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid var(--border-color);
  background: var(--bg-color);
  transition: var(--transition-smooth);
}

.mastery-growth-item:hover {
  border-color: var(--primary-color);
  background: var(--card-bg);
}

.mastery-growth-type {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--secondary-text);
  margin-bottom: 4px;
  font-weight: 700;
}

.mastery-growth-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-color);
  margin: 0;
}

/* Responsive */
@media (max-width: 991px) {
  .mastery-stats-row {
    grid-template-columns: repeat(2, 1fr);
  }

  .mastery-bento {
    grid-template-columns: 1fr 1fr;
  }

  .mastery-card--skills {
    grid-column: span 2;
  }

  .mastery-card--growth {
    grid-column: span 2;
  }
}

@media (max-width: 576px) {
  .mastery-stats-row {
    grid-template-columns: repeat(2, 1fr);
  }

  .mastery-bento {
    grid-template-columns: 1fr;
  }

  .mastery-card--skills,
  .mastery-card--growth {
    grid-column: span 1;
  }

  .mastery-growth-grid {
    grid-template-columns: 1fr;
  }
}
