/* ===== CSS Variables ===== */
:root {
    --background: #1e1e1e;
    --foreground: #ffffff;
    --card: #262626;
    --card-foreground: #ffffff;
    --primary: #ffb400;
    --primary-foreground: #000000;
    --secondary: #2d2d2d;
    --secondary-foreground: #ffffff;
    --muted: #404040;
    --muted-foreground: #a6a6a6;
    --border: #333333;
    --text-light: #bfbfbf;
    --sidebar-bg: #1a1a1a;
    --progress-bg: #404040;
    --timeline-line: #4d4d4d;
    --radius: 0.5rem;
    --transition: all 0.3s ease;
}

/* ===== Light Theme ===== */
body.light {
    --background: #f8f9fb;
    --foreground: #1e1e1e;
    --card: #ffffff;
    --card-foreground: #1e1e1e;
    --secondary: #f0f0f0;
    --secondary-foreground: #1e1e1e;
    --muted: #e4e4e4;
    --muted-foreground: #666666;
    --border: #dddddd;
    --text-light: #555555;
    --sidebar-bg: #ffffff;
    --progress-bg: #dddddd;
    --timeline-line: #cccccc;
}
/* ===== Theme Toggle Nav Item ===== */
.theme-nav {
    background: none;
    border: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
}

.theme-nav svg {
    width: 18px;
    height: 18px;
    position: absolute; /* stack sun & moon */
    transition: transform 0.5s ease, opacity 0.3s ease;
}

/* ===== Theme Toggle Icon Animation ===== */
.theme-nav .nav-icon {
    width: 18px;          /* FIX: match icon width */
    height: 18px;
    min-width: 18px;      /* FIX: prevent extra gap */
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

/* Rotation states */
.rotate-in {
    transform: rotate(0deg) scale(1);
    opacity: 1;
}

.rotate-out {
    transform: rotate(360deg) scale(0.8);
    opacity: 0;
}

/* ===== About Subsections – Light Mode Styling ===== */
body.light #about .about-subsections {
    border-top: 1px solid #cccccc;
    border-left: 1px solid #cccccc;
}

body.light #about .about-subsection {
    border-right: 1px solid #cccccc;
    border-bottom: 1px solid #cccccc;
}

body.light #about .about-subsection:hover {
    background-color: #ffffff;
    box-shadow: 0 4px 10px #00000014;
}

/* ===== Reset & Base ===== */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Roboto', sans-serif;
    background-color: var(--background);
    color: var(--foreground);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* ===== Typography ===== */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

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

/* ===== Utility Classes ===== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

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

.hidden {
    display: none !important;
}

/* ===== Section Title ===== */
.section-title {
    font-size: 1.875rem;
    font-weight: 700;
    color: var(--foreground);
    margin-bottom: 2rem;
    position: relative;
    display: inline-block;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -0.5rem;
    left: 0;
    width: 3rem;
    height: 0.25rem;
    background: var(--primary);
    border-radius: 9999px;
}


/* ===== Mobile Menu Button ===== */
.mobile-menu-btn {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 100;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--foreground);
}

.mobile-menu-btn svg {
    width: 24px;
    height: 24px;
}

@media (min-width: 1024px) {
    .mobile-menu-btn {
        display: none;
    }
}

/* ===== Sidebar ===== */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: 20rem;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border);
    z-index: 90;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    overflow-y: auto;
}

.sidebar.active {
    transform: translateX(0);
}

@media (min-width: 1024px) {
    .sidebar {
        transform: translateX(0);
    }
}

.sidebar-content {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
    z-index: 80;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
}

@media (min-width: 1024px) {
    .sidebar-overlay {
        display: none;
    }
}

/* ===== Profile Section ===== */
.profile-section {
    padding: 2rem;
    text-align: center;
}

.profile-image-wrapper {
    width: 9rem;
    height: 9rem;
    margin: 0 auto 1rem;
    border-radius: 50%;
    overflow: hidden;
    border: 4px solid var(--primary);
    box-shadow: 0 0 20px rgba(255, 180, 0, 0.3);
    animation: pulse-glow 2s ease-in-out infinite;
}

@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 0 5px rgba(255, 180, 0, 0.5);
    }
    50% {
        box-shadow: 0 0 20px rgba(255, 180, 0, 0.8);
    }
}

.profile-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-name {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.profile-title {
    color: var(--text-light);
    font-size: 0.875rem;
    height: 1.5rem;
    overflow: hidden;
}

.typewriter {
    display: inline-block;
    border-right: 2px solid var(--primary);
    animation: blink 0.75s step-end infinite;
}

@keyframes blink {
    from, to { border-color: transparent; }
    50% { border-color: var(--primary); }
}

/* ===== Navigation ===== */
.nav-menu {
    flex: 1;
    padding: 0 1rem;
}

.nav-list {
    list-style: none;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 1rem;
    color: var(--text-light);
    font-size: 0.875rem;
    border-radius: var(--radius);
    transition: var(--transition);
}

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

.nav-link svg {
    width: 18px;
    height: 18px;
}

/* ===== Social Section ===== */
.social-section {
    padding: 1.5rem;
    border-top: 1px solid var(--border);
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

.social-link {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 50%;
    background: var(--secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
    font-size: 0.75rem;
    font-weight: 700;
    transition: var(--transition);
}

.social-link:hover {
    background: var(--primary);
    color: var(--primary-foreground);
}

.copyright {
    text-align: center;
    font-size: 0.75rem;
    color: var(--muted-foreground);
    margin-top: 1rem;
}

/* ===== Main Content ===== */
.main-content {
    margin-left: 0;
    transition: margin-left 0.3s ease;
}

@media (min-width: 1024px) {
    .main-content {
        margin-left: 20rem;
    }
}

/* ===== Sections ===== */
.section {
    padding: 5rem 0;
}

/* ===== Hero Section ===== */
.hero-section {
    min-height: 100vh;
    display: flex;
    align-items: center;
}

.hero-grid {
    display: grid;
    gap: 3rem;
    align-items: center;
}

@media (min-width: 1024px) {
    .hero-grid {
        grid-template-columns: 1fr 1fr;
    }
}

.hero-subtitle {
    color: var(--primary);
    font-size: 0.875rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 1rem;
    display: block;
}

.hero-title {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    line-height: 1.1;
}

@media (min-width: 1024px) {
    .hero-title {
        font-size: 4.5rem;
    }
}

.hero-role {
    font-size: 1.25rem;
    color: var(--text-light);
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.hero-role .text-primary {
    font-weight: 500;
}

.hero-description {
    color: var(--muted-foreground);
    font-size: 1.125rem;
    line-height: 1.7;
    margin-bottom: 2rem;
    max-width: 32rem;
}

.hero-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.hero-image-wrapper {
    display: none;
    position: relative;
}

@media (min-width: 1024px) {
    .hero-image-wrapper {
        display: block;
    }
}

.hero-image-container {
    width: 20rem;
    height: 20rem;
    margin: 0 auto;
    border-radius: 50%;
    overflow: hidden;
    border: 4px solid var(--primary);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.hero-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.experience-badge {
    position: absolute;
    bottom: -1rem;
    right: -1rem;
    width: 6rem;
    height: 6rem;
    background: var(--primary);
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--primary-foreground);
    font-weight: 700;
    font-size: 0.875rem;
    text-align: center;
}

.experience-badge span:first-child {
    font-size: 1.5rem;
}

/* ===== Buttons ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 2rem;
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: var(--transition);
}

.btn svg {
    width: 18px;
    height: 18px;
}

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

.btn-primary:hover {
    background: #e6a200;
    box-shadow: 0 10px 30px -10px rgba(255, 180, 0, 0.5);
}

.btn-outline {
    background: transparent;
    color: var(--foreground);
    border: 1px solid var(--border);
}

.btn-outline:hover {
    background: var(--primary);
    color: var(--primary-foreground);
    border-color: var(--primary);
}

.btn-full {
    width: 100%;
}

/* ===== About Section ===== */
.about-grid {
    display: grid;
    gap: 3rem;
    margin-top: 3rem;
}

@media (min-width: 1024px) {
    .about-grid {
        grid-template-columns: 1fr 1fr;
    }
}

.about-heading {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.about-text {
    color: var(--text-light);
    line-height: 1.7;
    margin-bottom: 1.5rem;
}

.about-details {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

/* ===== About Subsections (2x2 Grid) ===== */
.about-subsections {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    margin-top: 4rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    border-left: 1px solid rgba(255, 255, 255, 0.08);
}

/* Individual subsection */
.about-subsection {
    padding: 2.5rem;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

/* Subsection title */
.about-subsection-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--foreground);
    margin-bottom: 1rem;
}

/* Keep text consistent with existing about-text */
.about-subsection .about-text {
    margin-bottom: 1.25rem;
}

/* Subtle hover effect */
.about-subsection:hover {
    background-color: rgba(255, 255, 255, 0.02);
}

/* ===== Mobile / Small Devices ===== */
@media (max-width: 640px) {
    .about-subsections {
        grid-template-columns: 1fr;
        margin-top: 3rem;
    }

    .about-subsection {
        padding: 2rem 1.5rem;
    }
}

.detail-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.detail-item svg {
    width: 18px;
    height: 18px;
    color: var(--primary);
}

.detail-label {
    color: var(--muted-foreground);
    font-size: 0.875rem;
}

.detail-value {
    color: var(--foreground);
    font-weight: 500;
    margin-left: 0.5rem;
}



/* ===== Stats Grid ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.stat-card {
    background: var(--card);
    padding: 1.5rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    text-align: center;
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px -20px rgba(0, 0, 0, 0.5);
}

.stat-number {
    font-family: 'Poppins', sans-serif;
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.stat-label {
    color: var(--muted-foreground);
    font-size: 0.875rem;
}

/* ===== Resume Section ===== */
.resume-grid {
    display: grid;
    gap: 3rem;
    margin-top: 3rem;
}

@media (min-width: 1024px) {
    .resume-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.resume-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 2rem;
}

.resume-icon {
    width: 2.5rem;
    height: 2.5rem;
    background: rgba(255, 180, 0, 0.1);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
}

.resume-icon svg {
    width: 20px;
    height: 20px;
    color: var(--primary);
}

.resume-header h3 {
    font-size: 1.25rem;
}

/* ===== Timeline ===== */
.timeline {
    position: relative;
}

.timeline-item {
    position: relative;
    padding-left: 2rem;
    padding-bottom: 2rem;
    border-left: 1px solid var(--timeline-line);
}

.timeline-item:last-child {
    padding-bottom: 0;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -5px;
    top: 0;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--primary);
}

.timeline-date {
    color: var(--primary);
    font-size: 0.875rem;
    font-weight: 500;
}

.timeline-title {
    font-size: 1.125rem;
    margin-top: 0.25rem;
}

.timeline-company {
    color: var(--muted-foreground);
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

.timeline-description {
    color: var(--text-light);
    font-size: 0.875rem;
}

.timeline-link {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    color: var(--primary);
    font-size: 0.875rem;
    margin-top: 0.5rem;
}

.timeline-link:hover {
    text-decoration: underline;
}

.timeline-link svg {
    width: 14px;
    height: 14px;
}

/* ===== Skills ===== */
.skills-grid {
    display: grid;
    gap: 3rem;
    margin-top: 3rem;
}

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

.skills-heading {
    font-size: 1.125rem;
    margin-bottom: 1.5rem;
}

.skill-item {
    margin-bottom: 1.25rem;
}

.skill-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.skill-name {
    color: var(--text-light);
    font-size: 0.875rem;
}

.skill-percent {
    color: var(--primary);
    font-size: 0.875rem;
    font-weight: 500;
}

.skill-bar {
    height: 4px;
    background: var(--progress-bg);
    border-radius: 9999px;
    overflow: hidden;
}

.skill-fill {
    height: 100%;
    background: var(--primary);
    border-radius: 9999px;
    transition: width 1s ease-out;
}

.knowledge-list {
    list-style: none;
}

.knowledge-list li {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-light);
    font-size: 0.875rem;
    padding: 0.25rem 0;
}

.bullet {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--primary);
}

/* ===== Portfolio Section ===== */
.filter-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 2rem;
    margin-bottom: 3rem;
}

.filter-btn {
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-weight: 500;
    border: 1px solid var(--border);
    background: var(--card);
    color: var(--text-light);
    cursor: pointer;
    transition: var(--transition);
}

.filter-btn:hover,
.filter-btn.active {
    background: var(--primary);
    color: var(--primary-foreground);
    border-color: var(--primary);
}

/* ===== Portfolio Grid ===== */
.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr); /* 4 cards per row */
    grid-template-rows: repeat(2, auto);   /* 2 rows */
    gap: 1.5rem;                           /* spacing between cards */
    margin-top: 40px;
}

/* ===== Card Styling ===== */
.portfolio-card {
    position: relative;
    background: var(--card);
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.portfolio-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px -20px rgba(0,0,0,0.5);
}

/* ===== Image Styling ===== */
.portfolio-image {
    width: 100%;
    aspect-ratio: 4/3;
    overflow: hidden;
}

.portfolio-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.portfolio-card:hover .portfolio-image img {
    transform: scale(1.1);
}

/* ===== Overlay Styling ===== */
.portfolio-overlay {
    position: absolute;
    inset: 0;
    background: rgba(30,30,30,0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    opacity: 0;
    transition: var(--transition);
}

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

.portfolio-title {
    font-size: 1.125rem;
    margin-bottom: 0.5rem;
    color: var(--foreground);
}

.portfolio-desc {
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
    color: var(--text-light);
}

.portfolio-category {
    font-size: 0.875rem;
    color: var(--primary);
    text-transform: capitalize;
}

/* ===== Filter Buttons ===== */
.filter-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 2rem;
}

.filter-btn {
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--card);
    color: var(--text-light);
    cursor: pointer;
    transition: var(--transition);
}

.filter-btn:hover,
.filter-btn.active {
    background: var(--primary);
    color: var(--primary-foreground);
    border-color: var(--primary);
}

/* ===== Responsive ===== */
@media (max-width: 1024px) {
    .portfolio-grid {
        grid-template-columns: repeat(2, 1fr); /* 2 per row */
        grid-template-rows: repeat(4, auto);   /* 4 rows */
    }
}

@media (max-width: 640px) {
    .portfolio-grid {
        grid-template-columns: 1fr;           /* 1 per row */
        grid-template-rows: repeat(8, auto);  /* 8 rows */
    }
}

/* ===== Contact Section ===== */
.contact-grid {
    display: grid;
    gap: 3rem;
    margin-top: 3rem;
}

@media (min-width: 1024px) {
    .contact-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.contact-heading {
    font-size: 1.25rem;
    margin-bottom: 1.5rem;
}

.contact-text {
    color: var(--text-light);
    line-height: 1.7;
    margin-bottom: 2rem;
}

.contact-details {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.contact-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.contact-icon {
    width: 3rem;
    height: 3rem;
    background: rgba(255, 180, 0, 0.1);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.contact-icon svg {
    width: 20px;
    height: 20px;
    color: var(--primary);
}

.contact-label {
    font-size: 0.875rem;
    color: var(--muted-foreground);
    display: block;
    margin-bottom: 0.25rem;
}

.contact-value {
    font-weight: 500;
}

.map-placeholder {
    margin-top: 2rem;
    height: 12rem;
    background: var(--card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--muted-foreground);
    font-size: 0.875rem;
}

/* ===== Contact Form ===== */
.contact-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-row {
    display: grid;
    gap: 1.5rem;
}

@media (min-width: 640px) {
    .form-row {
        grid-template-columns: repeat(2, 1fr);
    }
}

.form-input,
.form-textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--foreground);
    font-family: inherit;
    font-size: 0.875rem;
    transition: var(--transition);
}

.form-input:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(255, 180, 0, 0.1);
}

.form-input::placeholder,
.form-textarea::placeholder {
    color: var(--muted-foreground);
}

.form-textarea {
    resize: none;
}

/* ===== Footer ===== */
.footer {
    padding: 2rem 0;
    border-top: 1px solid var(--border);
    text-align: center;
}

.footer p {
    color: var(--muted-foreground);
    font-size: 0.875rem;
}

/* ===== Toast ===== */
.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem 1.5rem;
    box-shadow: 0 20px 40px -20px rgba(0, 0, 0, 0.5);
    transform: translateY(150%);
    opacity: 0;
    transition: var(--transition);
    z-index: 1000;
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

.toast-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.toast-content svg {
    width: 20px;
    height: 20px;
    color: var(--primary);
}

/* ===== Animations ===== */
.fade-in {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeIn 0.6s ease-out forwards;
}

.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
.delay-3 { animation-delay: 0.3s; }
.delay-4 { animation-delay: 0.4s; }
.delay-5 { animation-delay: 0.5s; }

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

/* ===== Scroll Animation ===== */
.fade-in-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.fade-in-scroll.visible {
    opacity: 1;
    transform: translateY(0);
}

/* =========================================================
   GLOBAL MOBILE OVERFLOW & TEXT SAFETY FIX
   ========================================================= */

/* Prevent horizontal scrolling everywhere */
html, body {
    max-width: 100%;
    overflow-x: hidden;
}

/* Allow text to wrap properly */
* {
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Fix grid & flex overflow issues */
.container,
.section,
.main-content,
.hero-grid,
.about-grid,
.services-grid,
.resume-grid,
.skills-grid,
.contact-grid,
.portfolio-grid {
    min-width: 0;
}

/* Prevent flex items from pushing outside */
.nav-link,
.hero-role,
.hero-description,
.about-text,
.timeline-description,
.service-description,
.contact-text,
.portfolio-desc {
    max-width: 100%;
    white-space: normal;
}

/* =========================================================
   MOBILE TYPOGRAPHY FIX
   ========================================================= */

@media (max-width: 640px) {

    body {
        font-size: 15px;
        line-height: 1.6;
    }

    .hero-title {
        font-size: 2.2rem;
        line-height: 1.2;
    }

    .hero-description {
        font-size: 1rem;
    }

    h1 { font-size: 2.2rem; }
    h2 { font-size: 1.75rem; }
    h3 { font-size: 1.3rem; }
    h4 { font-size: 1.1rem; }

    /* Ensure all sections have safe padding */
    .section {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    /* Fix cards overflowing */
    .service-card,
    .stat-card,
    .pricing-card,
    .portfolio-card {
        width: 100%;
    }

    /* Prevent buttons/text from stretching layout */
    .btn,
    .btn-full {
        max-width: 100%;
        text-align: center;
        white-space: normal;
    }
}

/* ===== Scroll To Top Button ===== */
#scrollTopBtn {
    position: fixed;
    bottom: 1.25rem;
    right: 1.25rem;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--primary);
    color: var(--primary-foreground);
    border: none;
    font-size: 1.25rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 25px rgba(0,0,0,0.25);
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s;
    z-index: 1000;
}

/* Show button */
#scrollTopBtn.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Desktop: keep it subtle */
@media (min-width: 1024px) {
    #scrollTopBtn {
        opacity: 0.4;
    }

    #scrollTopBtn:hover {
        opacity: 1;
    }
}


html, body {
    width: 100%;
    overflow-x: hidden;
}

* {
    max-width: 100%;
    box-sizing: border-box;
}

img, video, iframe {
    max-width: 100%;
    height: auto;
}
