/* ========================================
   GLOBAL VARIABLES & THEME
   ======================================== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Fira+Code:wght@400;500&display=swap');

:root {
    /* Light Mode (Default) */
    --bg-main: #ffffff;
    --bg-surface: #f8fafc;
    /* slate-50 */
    --bg-surface-hover: #f1f5f9;
    /* slate-100 */

    --text-primary: #0f172a;
    /* slate-900 */
    --text-secondary: #475569;
    /* slate-600 */
    --text-muted: #94a3b8;
    /* slate-400 */

    --accent-primary: #4f46e5;
    /* indigo-600 */
    --accent-hover: #4338ca;
    /* indigo-700 */
    --accent-light: #e0e7ff;
    /* indigo-100 */

    --border-color: #e2e8f0;
    /* slate-200 */

    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);

    --font-heading: 'Inter', system-ui, -apple-system, sans-serif;
    --font-body: 'Inter', system-ui, -apple-system, sans-serif;
    --font-mono: 'Fira Code', monospace;

    --transition: all 0.2s ease-in-out;
}

body.dark-theme {
    /* Dark Mode */
    --bg-main: #0f172a;
    /* slate-900 */
    --bg-surface: #1e293b;
    /* slate-800 */
    --bg-surface-hover: #334155;
    /* slate-700 */

    --text-primary: #f8fafc;
    /* slate-50 */
    --text-secondary: #cbd5e1;
    /* slate-300 */
    --text-muted: #64748b;
    /* slate-500 */

    --accent-primary: #38bdf8;
    /* sky-400 */
    --accent-hover: #7dd3fc;
    /* sky-300 */
    --accent-light: rgba(56, 189, 248, 0.1);

    --border-color: #334155;
    /* slate-700 */

    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.3);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.4), 0 2px 4px -2px rgb(0 0 0 / 0.4);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.5), 0 4px 6px -4px rgb(0 0 0 / 0.5);
}

/* ========================================
   RESET & BASE STYLES
   ======================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 5rem;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-main);
    color: var(--text-primary);
    line-height: 1.6;
    transition: background-color var(--transition), color var(--transition);
    overflow-x: hidden;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-heading);
    color: var(--text-primary);
    font-weight: 600;
    line-height: 1.2;
}

a {
    text-decoration: none;
    color: var(--accent-primary);
    transition: var(--transition);
}

a:hover {
    color: var(--accent-hover);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

ul {
    list-style: none;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

section {
    padding: 6rem 0;
}

/* Typography Utilities */
.text-muted {
    color: var(--text-secondary);
}

.text-mono {
    font-family: var(--font-mono);
}

.section-title {
    font-size: 2rem;
    margin-bottom: 3rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--border-color);
    display: inline-block;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border-radius: 0.375rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid transparent;
    gap: 0.5rem;
}

.btn-primary {
    background-color: var(--accent-primary);
    color: #ffffff;
}

.btn-primary:hover {
    background-color: var(--accent-hover);
    color: #ffffff;
}

body.dark-theme .btn-primary {
    color: #0f172a;
}

body.dark-theme .btn-primary:hover {
    color: #0f172a;
}


.btn-secondary {
    background-color: transparent;
    color: var(--text-primary);
    border-color: var(--border-color);
}

.btn-secondary:hover {
    background-color: var(--bg-surface-hover);
    border-color: var(--text-secondary);
}

/* Tags */
.tag {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    font-size: 0.875rem;
    font-family: var(--font-mono);
    color: var(--accent-primary);
    background-color: var(--accent-light);
    border-radius: 9999px;
    margin: 0.25rem;
}

/* ========================================
   NAVIGATION
   ======================================== */
header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: var(--bg-main);
    border-bottom: 1px solid var(--border-color);
    z-index: 1000;
    transition: var(--transition);
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 5rem;
}

.nav-brand {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    font-family: var(--font-mono);
}

.nav-menu {
    display: flex;
    gap: 2rem;
}

.nav-link {
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.95rem;
}

.nav-link:hover,
.nav-link.active {
    color: var(--accent-primary);
}

.theme-toggle {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.5rem;
    transition: var(--transition);
}

.theme-toggle:hover {
    color: var(--accent-primary);
}

/* Hamburger */
.hamburger {
    display: none;
    cursor: pointer;
    flex-direction: column;
    gap: 5px;
}

.hamburger span {
    display: block;
    width: 25px;
    height: 3px;
    background-color: var(--text-primary);
    transition: var(--transition);
}

/* Header scrolled state */
header.scrolled {
    box-shadow: var(--shadow-md);
}

/* Light/dark label for theme toggle – visually helpful */
.theme-toggle {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Section alternating backgrounds handled inline */
/* Hover lift utility */
.hover-lift {
    transition: var(--transition);
}

.hover-lift:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

/* ========================================
   HERO SECTION
   ======================================== */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding-top: 5rem;
    /* Account for fixed header */
    background-color: var(--bg-main);
}

.hero-content {
    max-width: 800px;
}

.hero-title {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 700;
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
}

.hero-subtitle {
    font-size: clamp(1.25rem, 2.5vw, 1.5rem);
    color: var(--text-secondary);
    font-weight: 400;
    margin-bottom: 2rem;
}

.hero-description {
    font-size: 1.125rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin-bottom: 2.5rem;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

/* ========================================
   ABOUT SECTION
   ======================================== */
.about-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 4rem;
    align-items: start;
}

.about-text p {
    font-size: 1.125rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.about-image {
    position: relative;
    border-radius: 0.5rem;
    overflow: hidden;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
}

/* ========================================
   ENGINEERING PRINCIPLES
   ======================================== */
.principles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.principle-card {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    padding: 2rem;
    border-radius: 0.5rem;
    transition: var(--transition);
}

.principle-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.principle-icon {
    font-size: 2rem;
    color: var(--accent-primary);
    margin-bottom: 1rem;
}

.principle-card h3 {
    margin-bottom: 0.75rem;
    font-size: 1.25rem;
}

.principle-card p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* ========================================
   SELECTED WORK (CASE STUDIES)
   ======================================== */
.projects-list {
    display: flex;
    flex-direction: column;
    gap: 4rem;
}

.case-study {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    overflow: hidden;
    transition: var(--transition);
}

.case-study:hover {
    box-shadow: var(--shadow-lg);
}

.case-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-right: 1px solid var(--border-color);
}

.case-content {
    padding: 3rem 3rem 3rem 0;
}

.case-content h3 {
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
}

.case-summary {
    color: var(--text-secondary);
    font-size: 1.125rem;
    margin-bottom: 2rem;
}

.case-section {
    margin-bottom: 1.5rem;
}

.case-section h4 {
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    font-family: var(--font-mono);
}

.case-section p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.case-links {
    margin-top: 2rem;
    display: flex;
    gap: 1rem;
}

/* ========================================
   CURRENTLY BUILDING
   ======================================== */
.now-building {
    background-color: var(--bg-surface);
    border-left: 4px solid var(--accent-primary);
    padding: 2rem;
    border-radius: 0 0.5rem 0.5rem 0;
    margin-top: 2rem;
}

.now-building h3 {
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.now-building p {
    color: var(--text-secondary);
}

/* ========================================
   SKILLS (GROUPED)
   ======================================== */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.skill-group {
    background-color: var(--bg-surface);
    padding: 2rem;
    border-radius: 0.5rem;
    border: 1px solid var(--border-color);
}

.skill-group h3 {
    font-size: 1.125rem;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

.skill-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

/* ========================================
   SYSTEM ARCHITECTURE (Optional Visual)
   ======================================== */
.architecture-diagram {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    padding: 3rem;
    border-radius: 0.5rem;
    text-align: center;
    overflow-x: auto;
}

.diagram-flow {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    min-width: 600px;
}

.diagram-node {
    background-color: var(--bg-main);
    border: 1px solid var(--accent-primary);
    padding: 1rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 500;
    color: var(--text-primary);
}

.diagram-arrow {
    color: var(--text-muted);
}

/* ========================================
   CONTACT SECTION
   ======================================== */
.contact-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
}

.contact-info p {
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.contact-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.contact-icon {
    color: var(--accent-primary);
    font-size: 1.25rem;
    margin-top: 0.25rem;
}

.contact-details h3 {
    font-size: 1rem;
    margin-bottom: 0.25rem;
}

.contact-details a,
.contact-details p {
    color: var(--text-secondary);
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    color: var(--text-primary);
    font-family: var(--font-body);
    transition: var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-light);
}

/* ========================================
   FOOTER
   ======================================== */
footer {
    background-color: var(--bg-surface);
    border-top: 1px solid var(--border-color);
    padding: 3rem 0;
    margin-top: 4rem;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 2rem;
}

.footer-social {
    display: flex;
    gap: 1rem;
}

.footer-social a {
    color: var(--text-secondary);
    font-size: 1.25rem;
}

.footer-social a:hover {
    color: var(--accent-primary);
}

.footer-bottom {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
    text-align: center;
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */
@media (max-width: 900px) {
    .case-study {
        grid-template-columns: 1fr;
    }

    .case-content {
        padding: 2rem;
    }

    .case-image {
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        max-height: 300px;
    }

    .about-grid,
    .contact-wrapper {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .hamburger {
        display: flex;
    }

    .nav-menu {
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background-color: var(--bg-main);
        flex-direction: column;
        padding: 2rem;
        gap: 1.5rem;
        border-bottom: 1px solid var(--border-color);
        box-shadow: var(--shadow-md);
        transform: translateY(-150%);
        opacity: 0;
        transition: var(--transition);
        z-index: -1;
    }

    .nav-menu.active {
        transform: translateY(0);
        opacity: 1;
    }

    .hero-title {
        font-size: 2.5rem;
    }
}
/* ========================================
   TESTIMONIALS
   ======================================== */
.testimonials-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.testimonial-card {
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    padding: 1.75rem;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    position: relative;
}

.testimonial-card::before {
    content: '\201C';
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    font-size: 4rem;
    color: var(--accent-primary);
    opacity: 0.12;
    font-family: Georgia, serif;
    line-height: 1;
}

.testimonial-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}
