/* 
   Puerta Diaz Engineering - Premium Technical Design System
   Theme: Matte Dark / Precision Engineering / Swiss Style
*/

:root {
    /* --- Palette: Dark Matte Engineering --- */
    --bg-body: #0a0f18;
    /* Deep/Rich Black-Blue */
    --bg-surface: #131b29;
    /* Lighter Matte Blue-Grey */
    --bg-surface-2: #1c2638;
    /* Highlight Surface */

    /* --- Accents --- */
    --color-primary: #38bdf8;
    /* Technical Sky Blue - Use sparingly */
    --color-primary-dim: rgba(56, 189, 248, 0.1);
    --color-accent: #fbbf24;
    /* Amber Gold - Strict usage for Primary Call-to-Actions only */

    /* --- Text --- */
    --text-main: #f1f5f9;
    /* Near White */
    --text-muted: #94a3b8;
    /* Slate 400 */
    --text-dim: #64748b;
    /* Slate 500 - for technical labels */

    /* --- Borders & Lines --- */
    --border-subtle: rgba(255, 255, 255, 0.08);
    --border-light: rgba(255, 255, 255, 0.15);

    /* --- Layout & Spacing --- */
    --container-max: 1280px;
    --header-height: 80px;
    --radius-sm: 2px;
    /* Sharper corners for engineering feel */
    --radius-md: 6px;

    /* --- Typography --- */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* --- Reset & Base --- */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    background-color: var(--bg-body);
    color: var(--text-main);
    font-family: var(--font-sans);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

/* --- Typography System --- */
h1,
h2,
h3,
h4 {
    color: var(--text-main);
    line-height: 1.1;
    font-weight: 600;
    letter-spacing: -0.02em;
}

h1 {
    font-size: clamp(3rem, 6vw, 4.5rem);
    /* Massive, confident scale */
    font-weight: 700;
}

h2 {
    font-size: clamp(2rem, 4vw, 3rem);
    margin-bottom: 1.5rem;
}

h3 {
    font-size: 1.5rem;
    font-weight: 500;
}

p {
    margin-bottom: 1.5rem;
    color: var(--text-muted);
}

.lead {
    font-size: 1.25rem;
    max-width: 60ch;
    color: var(--text-muted);
    font-weight: 300;
}

.eyebrow {
    font-family: var(--font-sans);
    text-transform: uppercase;
    letter-spacing: 0.15em;
    font-size: 0.8rem;
    color: var(--color-primary);
    font-weight: 600;
    margin-bottom: 1rem;
    display: inline-block;
}

/* --- Technical Utilities --- */
.container {
    width: 90%;
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 1rem;
}

.grid-bg {
    /* Technical Grid Background Pattern */
    background-image:
        linear-gradient(var(--border-subtle) 1px, transparent 1px),
        linear-gradient(90deg, var(--border-subtle) 1px, transparent 1px);
    background-size: 40px 40px;
    background-position: center top;
}

.section {
    padding: 6rem 0;
    /* More breathing room */
    position: relative;
    border-top: 1px solid var(--border-subtle);
}

.bg-surface {
    background-color: var(--bg-surface);
}

.bg-body {
    background-color: var(--bg-body);
}

/* --- Components: Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 1rem 2rem;
    font-weight: 500;
    border-radius: var(--radius-md);
    text-decoration: none;
    transition: all 0.2s ease;
    font-size: 1rem;
    letter-spacing: 0.01em;
}

.btn-primary {
    background-color: var(--color-accent);
    color: #0a0f18 !important;
    /* High contrast dark text on Gold/Amber */
    border: 1px solid var(--color-accent);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(251, 191, 36, 0.2);
    background-color: #f59e0b;
    /* Slightly darker amber */
    border-color: #f59e0b;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border-light);
    color: var(--text-main);
}

.btn-outline:hover {
    border-color: var(--text-main);
    background: rgba(255, 255, 255, 0.05);
}

/* --- Navigation --- */
.header {
    position: sticky;
    top: 0;
    z-index: 1000;
    height: var(--header-height);
    background: rgba(10, 15, 24, 0.85);
    /* Glass effect */
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo img {
    height: 64px;
    /* Slightly reduced for sophistication */
    width: auto;
}

.nav-list {
    display: flex;
    gap: 2.5rem;
    align-items: center;
}

.nav-list a {
    text-decoration: none;
    color: var(--text-muted);
    font-size: 0.95rem;
    font-weight: 500;
    transition: color 0.2s;
}

.nav-list a:hover {
    color: var(--text-main);
}

/* --- Hero Section --- */
.hero {
    min-height: 85vh;
    /* Taller, more impact */
    display: flex;
    align-items: center;
    position: relative;
    padding-top: var(--header-height);
}

.hero-content {
    position: relative;
    z-index: 10;
    max-width: 900px;
    /* Animation */
    opacity: 0;
    animation: fadeUp 1s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

.cta-group {
    margin-top: 2.5rem;
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.trust-bar {
    margin-top: 4rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-subtle);
    color: var(--text-dim);
    font-size: 0.9rem;
    font-family: monospace;
    /* Technical feel */
    letter-spacing: -0.02em;
}

/* --- Services (Technical Cards) --- */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.service-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    padding: 2.5rem;
    border-radius: var(--radius-sm);
    transition: transform 0.3s ease, border-color 0.3s ease;
    position: relative;
    overflow: hidden;
}

.service-card:hover {
    transform: translateY(-4px);
    border-color: var(--color-primary);
}

/* "Technical Marker" decorative element */
.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 0%;
    background: var(--color-primary);
    transition: height 0.3s ease;
}

.service-card:hover::before {
    height: 100%;
}

.service-icon {
    font-family: monospace;
    font-size: 2rem;
    color: var(--color-primary);
    opacity: 0.4;
    font-weight: 700;
    margin-bottom: 1.5rem;
    display: block;
}

.service-list li {
    padding-left: 1.5rem;
    position: relative;
    margin-bottom: 0.75rem;
    color: var(--text-muted);
}

.service-list li::before {
    content: '›';
    position: absolute;
    left: 0;
    color: var(--color-primary);
}

/* --- Projects (Stacked / Seniority) --- */
.projects-container {
    display: flex;
    flex-direction: column;
    gap: 6rem;
    /* Large gaps for distinct "Case Study" feel */
}

.project-item {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

/* Alternating layout for projects */
.project-item:nth-child(even) {
    direction: rtl;
    /* Simple hack to swap visual order */
}

.project-item:nth-child(even)>* {
    direction: ltr;
    /* Reset text direction */
}

.project-visual {
    position: relative;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: var(--bg-surface-2);
}

.project-img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.6s ease;
    filter: grayscale(20%) contrast(110%);
    /* High-end filtered look */
}

.project-visual:hover .project-img {
    transform: scale(1.03);
    filter: grayscale(0%);
}

.project-content h3 {
    margin-bottom: 1rem;
    font-size: 2rem;
}

.project-meta {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: var(--bg-surface-2);
    border: 1px solid var(--border-subtle);
    border-radius: 50px;
    font-size: 0.85rem;
    color: var(--text-main);
    margin-bottom: 1rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

/* --- About Section --- */
.about-grid {
    display: grid;
    grid-template-columns: 3fr 2fr;
    gap: 4rem;
    align-items: center;
}

.about-profile-img {
    width: 60%;
    /* Reduced size as requested */
    max-width: 350px;
    border-radius: var(--radius-sm);
    /* Ensure it doesn't look broken */
    display: block;
    margin: 0 auto;
    /* Center if needed */
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    margin-top: 3rem;
    border-top: 1px solid var(--border-subtle);
    padding-top: 2rem;
}

.stat-item h3 {
    font-size: 2.5rem;
    color: var(--color-primary);
    margin-bottom: 0.5rem;
}

.stat-item p {
    font-size: 0.9rem;
    margin: 0;
}

/* --- Footer --- */
.footer {
    background: var(--bg-surface);
    padding: 4rem 0;
    text-align: center;
    border-top: 1px solid var(--border-subtle);
}

/* --- Mobile Responsiveness --- */
.mobile-menu-btn {
    display: none;
}

@media (max-width: 900px) {

    .project-item,
    .project-item:nth-child(even) {
        grid-template-columns: 1fr;
        /* Stack vertically */
        direction: ltr;
        gap: 2rem;
    }

    .about-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .hero {
        min-height: auto;
        padding: 6rem 0;
    }

    .nav-list {
        display: none;
        /* Add JS toggle logic needed later, but focusing on visuals */
    }

    .mobile-menu-btn {
        display: block;
        background: none;
        border: none;
        color: var(--text-main);
        font-size: 1.5rem;
        cursor: pointer;
    }

    h1 {
        font-size: 2.5rem;
    }
}

/* --- Animation Keyframes --- */
@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}