/* Core Reset & Variables */
:root {
    --bg-color: #ffffff;
    --text-color: #111111;
    --text-muted: #666666;
    --accent-color: #0070f3;
    
    /* Card properties */
    --card-bg: #f8fafc;
    --border-color: #e2e8f0;
    
    /* Button specific variables */
    --btn-bg: #111111;
    --btn-text: #ffffff;

    /* Global smooth color transition */
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

/* Dark Mode Theme Variables Override */
:root.dark-mode {
    color-scheme: dark;
    --bg-color: #121212;
    --text-color: #e2e8f0;
    --text-muted: #94a3b8;
    --accent-color: #3b82f6;
    
    /* Dark card properties */
    --card-bg: #1e1e1e;
    --border-color: #334155;
    
    /* Dark button properties */
    --btn-bg: #f8fafc;
    --btn-text: #111111;
}

/* Global Body Styling */
body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: system-ui, -apple-system, sans-serif;
    margin: 0;
    padding: 0;
    text-align: center; /* Cascades center alignment down to text blocks */
}

/* Main content wrapper with padding from your original setup */
main {
    max-width: 800px;
    margin: 0 auto;
    padding: 5rem 2rem;
    display: flex;
    flex-direction: column;
    align-items: center; /* Centers block components inside main */
}

.container {
    width: 100%;
    margin-bottom: 4rem;
}

h2 {
    font-size: 2rem;
    margin-bottom: 2rem;
}

/* Theme Toggle Button Layout Styling */
.toggle-container {
    max-width: 800px;
    margin: 2rem auto 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: center; /* Centers toggle button horizontally */
}

#theme-toggle {
    color: var(--text-color);
    border: 1px solid var(--border-color);
    background-color: var(--card-bg);
    cursor: pointer; 
    padding: 0.5rem 1rem; 
    border-radius: 20px;
    font-weight: 600;
    transition: background-color 0.2s;
}

#theme-toggle:hover {
    background-color: var(--border-color);
}

/* Hero Section layout */
.hero-section {
    height: 50vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 0 2rem;
}

.hero-content h1 {
    font-size: 3.5rem;
    margin-bottom: 1rem;
}

.hero-content p {
    font-size: 1.25rem;
    margin-bottom: 2rem;
    color: var(--text-muted);
}

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

/* UI Elements (Buttons & Cards) */
.btn-group {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background-color: var(--btn-bg);
    color: var(--btn-text);
    text-decoration: none;
    border-radius: 5px;
    font-weight: 500;
    transition: opacity 0.2s;
}

.btn:hover {
    opacity: 0.9;
}

/* Responsive Grid for Projects */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    width: 100%;
    margin-bottom: 1.5rem;
}

.project-card, .projects-card {
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    padding: 1.5rem;
    border-radius: 20px;
    text-align: center; /* Keeps interior card components centered */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.projects-card {
    margin-bottom: 1.5rem;
    width: auto;
}

.project-card h3 {
    margin-bottom: 0.5rem;
}

.projects-footer {
    color: var(--text-muted);
}

/* Centered Layout elements */
.contact-section {
    text-align: center;
}

.contact-section p {
    margin-bottom: 2rem;
}

hr {
    width: 100%;
    border: none;
    border-top: 1px solid var(--border-color);
    margin: 2rem 0;
}

#quiz {
    text-align: center;
    margin-bottom: 4rem;
}

footer {
    text-align: center;
    padding: 2rem;
    border-top: 1px solid var(--border-color);
    font-size: 0.9rem;
    color: var(--text-muted);
    width: 100%;
}

/* ==========================================
   Isolated Side Image Stack Container
   ========================================== */
.image-stack-sidebar {
    position: fixed;             /* Keeps layout locked while scrolling */
    top: 50%;                    /* Places wrapper halfway down screen */
    transform: translateY(-50%); /* Corrects precision center coordinate alignment */
    z-index: 100;                /* Layered completely over main container */
    
    /* Flexbox Engine Rules */
    display: flex;
    flex-direction: column;      /* Arranges children elements into vertical stack */
    gap: 20px;                   /* Gap control dimensions between elements */
}

/* Modifier class to pin to the left side */
.left-sidebar {
    left: 25px;
}

/* Modifier class to pin to the right side */
.right-sidebar {
    right: 25px;
}

.image-stack-sidebar img {
    width: 400px;                 /* Explicit size configurations */
    height: auto;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    pointer-events: none;        /* Ensures layout elements underneath remain clickable */
}
/* Responsive Rule: Hides the stack on small mobile screens to prevent text collision */
@media (max-width: 1000px) {
    .image-stack-sidebar {
        display: none;
    }
}

