/* ============================================
   PREVENT HORIZONTAL SCROLL - GLOBAL
   ============================================ */

/* Base Styles and Typography */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 87.5%; /* 14px base - reduces overall scale by ~12% */
    overflow-x: hidden;
    max-width: 100vw;
}

body {
    font-family: var(--font-family);
    background: var(--bg-primary);
    color: var(--text-primary);
    overflow-x: hidden;
    max-width: 100vw;
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    margin: 0;
    padding: 0;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.2;
}

/* Main Layout */
main {
    flex: 1;
    display: flex;
    flex-direction: column;
}

h1 {
    font-size: var(--font-size-6xl);
}

h2 {
    font-size: var(--font-size-5xl);
}

h3 {
    font-size: var(--font-size-2xl);
}

p {
    margin-bottom: var(--spacing-md);
    color: var(--text-secondary);
}

a {
    color: var(--primary-gold);
    text-decoration: none;
    transition: var(--transition-normal);
}

a:hover {
    color: var(--primary-purple);
}

/* Layout */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-lg);
}

/* Main Content */
main {
    padding-top: 80px;
}

.page {
    display: none;
    flex: 1;
    padding: var(--spacing-lg) 0;
}

.page.active {
    display: block;
    animation: fadeIn 0.5s ease-in-out;
}

/* Section Headers */
.section-header {
    text-align: center;
    margin-bottom: 3rem;
}

.section-header h2 {
    font-size: 3rem;
    margin-bottom: 1rem;
    background: linear-gradient(45deg, #9d4edd, #ffd60a);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.section-header p {
    font-size: 1.2rem;
    color: #cccccc;
    max-width: 600px;
    margin: 0 auto;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-card);
}

::-webkit-scrollbar-thumb {
    background: var(--gradient-primary);
    border-radius: var(--radius-sm);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--gradient-reverse);
}

/* ============================================
   PREVENT HORIZONTAL SCROLL - CONTAINERS
   ============================================ */

/* Prevent any element from causing horizontal scroll */
.container,
.section,
.page {
    max-width: 100%;
    overflow-x: hidden;
}

/* Ensure grids don't overflow */
.projects-grid,
.blog-grid,
.featured-projects-grid {
    max-width: 100%;
    overflow-x: visible;
}

/* Ensure all page containers respect viewport width */
#home,
#projects,
#blog,
#about,
#services,
#contact {
    max-width: 100vw;
    overflow-x: hidden;
}
