/* 1. GLOBAL VARIABLES (always 1st) */
:root {
    /* AutoCAD Dark Mode canvas colors */
    --bg-darker: #1b1e20;       /* Main pg bckgnd (deep charcoal canvas) */
    --bg-dark: #212529;         /* Card & navbar bckgnds (slightly lighter) */

    /* Text Colors */
    --text-main: #f8f9fa;       /* Clean off-white for hi contrast & readability */
    --text-muted: #adb5bd;      /* Muted gray for captions & paragraph pitches */

    /* Accent Colors */
    --accent-red: #dc3545;      /* Structural red for active links, bttns, & highlights */
    --accent-black: #000000;    /* Pure black for deep shadows or contrast panels */
}

/* 2. GLOBAL RESETS & BASE STYLES */
*, *::before, *::after {        /* Gobal Reset: ensures padding doesn't distort element widths */
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {                          /* Global smooth scrolling */
    scroll-behavior: smooth;
    font-family: 'Segoe UI', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; /* clean technical font */
    background-color: var(--bg-darker);
    color: var(--text-main);
}

/* 3. NAVBAR (mobile-1st) */
header {
    position: fixed;                /* keeps navbar pinned to top of screen */
    top: 0;
    left: 0;
    width: 100%;                    /* adds space btwn logo/name & nav links */
    height: 60px;                   /* explicit height to clear pg content beneath */
    background-color: var(--bg-dark);
    border-bottom: 2px solid var(--accent-red); /* sharp architectural red accent line */
    z-index: 1000;                  /* forces navbar to always float above scrolling content */
}

.navbar {
    display: flex;                  /* separates name/logo horizintally from navlinks */
    justify-content: space-between; /* adds space btwn logo/name & nav links */
    align-items: center;            /* centers navbar items vertically */
    height: 100%;                   /* also centers navbar items verically */
    padding: 0 20px;                /* adds clean breathing room to left/right edges */
}

/* FOR OLD Danny Tabares navbar logo
.nav-logo {
    color: var(--text-main);
    text-decoration: none;
    font-weight: bold;
    font-size: 1.1rem;
}
*/

.nav-logo {                 /* FOR NEW NAVBAR LOGO DT//DRAFTING */
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: 1.5px;
    color: var(--text-main);
    text-decoration: none;
    transition: transform 0.2s ease, text-shadow 0.2s ease;
}

/* Red engineering split mark style. FOR DT//DRAFTING LOGO */
.logo-divider {
    color: var(--accent-red);
    font-weight: 900;
}

/* secondary technical modifier txt style. FOR DT//DRAFTING LOGO */
.logo-sub {
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: 2px;
    color: var(--text-muted);
    transition: color 0.2s ease;
}

/* interaction: logo slightly grows & casts a clean red light glow on hover. FOR DT//DRAFTING */
.nav-logo:hover {
    transform: translateY(-1px);
    text-shadow: 0 0 10px rgba(220, 53, 69, 0.4);
}

.nav-logo:hover .logo-sub {
    color: var(--text-main);
}

.nav-links {
    display: flex;              /* spreads navlinks horizontally */
    list-style: none;           /* removes bullet pts */
    gap: 15px;                  /* gives navlinks space from each other (clean finger-tapping distance for mobile links) */
}

/* FOR OLD Danny Tabares NAVBAR LOGO
.nav-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s ease;
}
*/

/* navbar links hover effect: architectural red btm underline. FOR NEW DT//DRAFTING LOGO */
.nav-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    position: relative;     /* setup container for absolute line positioning */
    transition: color 0.2s ease;
    padding: 4px 0;
}

.nav-links a:hover { /* turns navlink red when u hover or press it */
    color: var(--accent-red);
}

/* hi-utility sliding accent line under navbar links on hover. FOR NEW DT//DRAFTING */
.nav-links a::after {
    content: '';
    position: absolute;
    width: 100%;
    transform: scaleX(0);   /* hidden by default */
    height: 2px;
    bottom: 0;
    left: 0;
    background-color: var(--accent-red);
    transform-origin: bottom right;
    transition: transform 0.25s ease-out;
}

.nav-links a:hover::after {
    transform: scaleX(1);   /* smoothly slides out line across the link width */
    transform-origin: bottom left;
}

/* 4. MAIN CONTENT SETUP */
main {
    margin-top: 60px;   /* CRITICAL: pushes pg content dwn so it isn't hidden behind the fixed navbar */
    padding: 20px;
}

section {
    padding: 60px 0;    /* Adds vertical breathing room btwn diff pg sections */ 
    border-bottom: 1px solid #2d3238;
}

/* 5. HERO STYLING */
#hero h1 {
    font-size: 2.2rem;
    color: var(--text-main);
    margin-bottom: 5px;
}

.hero-subtitle {
    font-size: 1.1rem;
    color: var(--accent-red);
    font-weight: 600;           /* px values fail validation. 600 = 60px = semibold */
    margin-bottom: 20px;
}

.hero-pitch {
    color: var(--text-muted);
    line-height: 1.6;
    max-width: 500px;
}

/* 6. PROJECTS SECTION */
#projects h2 {
    font-size: 1.8rem;
    margin-bottom: 25px;
    color: var(--text-main);
}

.project-grid {
    /* display: grid; */
    /* grid-template-columns: 1fr; /* force exactly 1 full-width column on mobile phones */
    display: flex;
    flex-direction: column;
    /* grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); /* automatically scales & wraps columns */
    /* gap: 25px; */
    gap: 20px;
    width: 100%;
    /* justify-content: center; /* FIX: centers the rows & balances out an odd # of cards */ 
}

.project-card {
    background-color: var(--bg-dark);
    border-radius: 6px;
    overflow: hidden;                   /* keeps imgs from spilling outside rounded corners */
    border: 1px solid #2d3238;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.project-card:hover {
    transform: translateY(-4px);
    border-color: var(--accent-red);
}

/*
.project-image-placeholder {
    background-color: #151719;
    height: 200px;
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 500;
    border-bottom: 1px solid #2d3238;
}
*/

.project-image {
    width: 100%;    /* forces the img to perfectly match width of ur card */
    height: 250px;  /* slightly increased for better visibility on wide screens*/
    object-fit: contain; /* FIX: forces entire CAD canvas to show w/out cutting off edges */
    background-color: #151719; /* autocad canvas bckgnd fills in remaining space around dwg */
    padding: 10px;                  /* adds a professional safety border around dwg lines */
    border-bottom: 1px solid #2d3238;
    display: block;
}

.project-image-placeholder-sce {
    width: 100%;
    height: 250px;
    background-color: #121315; /* AutoCAD canvas slate dark */
    display: flex;
    align-items: center; /* CENTERS VERTICALLY */
    justify-content: center; /* CENTERS HORIZONTALLY */
    color: var(--text-muted);
    font-size: 0.9rem; /* made it smaller */
    font-weight: 600;  /* made it a bit bolder */
    letter-spacing: 1px; /* spread the letters out */
    border-bottom: 1px solid #2d3238;
}

.project-info {
    padding: 20px;
}

.project-info h3 {
    font-size: 1.25rem;
    margin-bottom: 10px;
    color: var(--text-main);
}

.project-info p {
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.5;
    margin-bottom: 15px;
}

.project-tags {     
    display: flex;
    flex-wrap: wrap;
    gap: 8px;      
    margin-top: auto;   /* FIX: forces the tag container to Lock perfectly to the absolute btm of the card, keeping all tag lines aligned across cards */ 
}

.project-tags span {
    font-size: 0.8rem;                  /* CRITICAL: forces exact identical size for all proj cards */
    font-weight: 600;
    background-color: rgba(220, 53, 69, 0.1);
    color: var(--text-main);
    padding: 6px 12px;                  /* better than 4px 10px. 1st value: vertical. 2nd value: horizontal */
    border-radius: 4px;
    display: inline-flex;               /* keeps the tag bound tight around the txt wrap */
    align-items: center;
    justify-content: center;
    text-align: center;
    /* min-height: 38px;                   /* FIX: taller constraint ensures tags match perfectly even when wrapping to 2 lines on small screens */
    box-sizing: border-box;
}

/* 7. SKILLS SECTION */
#skills h2 {
    font-size: 1.8rem;
    margin-bottom: 20px;
    color: var(--text-main);
}

.skills-list {
    display: flex;      /* display: grid IS CSS GRID. display: flex IS FLEXBOX */
    flex-wrap: wrap; /* allows badges to wrap to the next line on small screens */
    justify-content: center; /* FIX: centers the entire layout on desktop, eliminating the awk left-hanging look */
    gap: 10px;      /* better than 12. clean, compact, spacing btwn individual tags */
}

.skill-badge {
    background-color: var(--bg-dark);
    color: var(--text-main);
    padding: 8px 14px;                 /* better than 12px 16px. tighter padding removes the chunky "btn" feel */
    border-radius: 4px;                 /* rounds corners */
    font-size: 0.85rem;
    font-weight: 500;
    /*
    border-left: 3px solid var(--accent-red);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.15); /* soft shadow under badge. 3D EFFECT */
    border: 1px solid #2d3238; /* replaced the red border & shadows w/ a clean technical outline */
    display: inline-flex;       /* forces the badge box to wrap tightly around its txt instead of stretching */
    align-items: center;    /* perfectly centers txt vertically if rows match heights */
    text-align: center;     /* centers multiline txt cleanly */
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.skill-badge:hover {
    border-color: var(--accent-red);
    background-color: rgba(220, 53, 69, 0.05);
}

/* 8. ABOUT ME SECTION (mobile-1st) */

.btn-secondary {            /* dwnld resume btn */
    display: block;         /* better than inline-block so I can center-align */
    width: max-content;     /* keeps btn width tight around txt instead of letting the btn stretch out. added this after changing inline-block to block */
    margin: 20px auto 0 auto; /* CRITICAL: 'auto' on left & right perfectly centers the btn on mobile */
    background-color: transparent;
    color: var(--text-main);
    border: 2px solid var(--accent-red);
    padding: 12px 24px;                     /* better than 10px 20px. 1st value: vertical. 2nd value: horizontal */
    font-size: 0.95rem;
    font-weight: 600;
    text-decoration: none;
    border-radius: 4px;
    margin-top: 15px;
    transition: background-color 0.2s ease, color 0.2s ease;
    text-align: center;
}

.btn-secondary:hover {
    background-color: var(--accent-red);
    color: var(--text-main);
}

#about h2 {
    font-size: 1.8rem;
    margin-bottom: 25px;
    color: var(--text-main);
}

.about-container {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

/*
.about-image-placeholder {
    background-color: var(--bg-dark);
    height: 250px;
    border-radius: 6px;
    border: 1px solid #2d3238;
    display: flex;
    justify-content: center;    /* center horizontally */ /*
    align-items: center;        /* center vertically */ /*
}
*/

.about-image-placeholder {
    width: 100%;
    max-width: 320px;       /* restricts the pic from getting too huge on lg phone screens*/
    aspect-ratio: 1 / 1;    /* FIX: forces the container to stay a perfect square @ every single width */
    margin: 0 auto 20px auto; /* centers the pic container on mobile viewports */
    background-color: var(--bg-dark);
    border: 1px solid #2d3238;
    position: relative;
    overflow: hidden;
    border-radius: 4px;     /* rounds corners */
}

.profile-avatar {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top; /* focuses the crop tracking on my face instead of shoulders */
    display: block;
}

.blueprint-crosshairs {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.about-text h3 {
    font-size: 1.3rem;
    color: var(--accent-red);
    margin-bottom: 15px;
    line-height: 1.4;
}

.about-text p {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 15px;
}

/* 9. CONTACT (mobile-1st) */
#contact h2 {
    font-size: 1.8rem;
    margin-bottom: 20px;
    color: var(--text-main);
}

.contact-lead {
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 25px;
    max-width: 550px;
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 20px;              /* increased gap for comfortable finger-tapping space */
    max-width: 550px;       /* prevents inputs from stretching awkwardly wide */
    width: 100%;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;               /* clean separation btwn label txt & input box */
}

.form-group label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-main);
    text-transform: uppercase; /* gives labels a clean, technical architectural look */
    letter-spacing: 1px;        /* adds subtle technical spacing to uppercase txt */
}

.form-group input, .form-group textarea {
    background-color: var(--bg-dark);
    border: 1px solid #2d3238;
    padding: 14px;                          /* taller padding makes it effortless to tap on touchscreen */
    border-radius: 4px;
    color: var(--text-main);
    font-family: inherit;
    font-size: 1rem;                        /* CRITICAL: must be at least 16px/1rem to prevent iOS from autozooming in on focus */
    width: 100%;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

/* red architectural highlight when clicking or typing into a formfield */
.form-group input:focus, .form-group textarea:focus {   
    outline: none;
    border-color: var(--accent-red);
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.15); /*soft, professional, red ambient glow */
}

/* polishing up the placeholder txt contrast */
.form-group input::placeholder, .form-group textarea::placeholder {
    color: #6c757d;
    font-size: 0.9rem;
}

.btn-submit {
    background-color: var(--accent-red);
    color: var(--text-main);
    border: none;
    padding: 16px;                     /* substantial touchscreen tap area */       
    font-size: 1rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-radius: 4px;                 /* rounds corners */
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.1s ease;
    margin-top: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);       /* 3D effect */
}

.btn-submit:hover {
    background-color: #bd2130;  /* shifts to a deeper red on hover states */
}

/* subtle tactile fdbck when a mobile usr actively pressed dwn on the btn */
.btn-submit:active {
    transform: scale(0.98); /* slightly shrinks btn on press to simulate */
}

/* 10. FOOTER (mobile-1st) */
footer {
    background-color: #111314;
    padding: 30px 20px;             /* added bullet pts for some reason? */
    border-top: 1px solid #2d3238;
    text-align: center;
}

.footer-content {
    display: flex;
    flex-direction: column-reverse; /* stacks txt under links on mobile screens */
    gap: 20px;
}

.footer-content p {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.footer-links {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    list-style: none;   /* gets rid of bullet pts */
    gap: 20px;
}

.footer-links a {
    color: var(--text-main);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.2s ease;
}

.footer-links a:hover {
    color: var(--accent-red);
}

/* 11. DESKTOP RESPONSIVE LAYOUT */
@media (min-width: 768px) {
    main {
        padding: 40px;
        max-width: 1200px;
        margin-left: auto;
        margin-right: auto;
    }

    .nav-links {
        gap: 30px;
    }

    .nav-links a {
        font-size: 1rem;
    }

    #hero h1 {
        font-size: 3.5rem;
    }

    .hero-subtitle {
        font-size: 1.5rem;
    }

    .hero-pitch {
        font-size: 1.1rem;
        max-width: 650px;
    }

    #skills h2 {
        font-size: 2.2rem;
        margin-bottom: 30px;
    }

    .skill-badge {
        font-size: 0.95rem;
        padding: 12px 20px;
    }

    #projects h2 {
        font-size: 2.2rem;
        margin-bottom: 35px;
    }

    .project-grid { /* auto-expand into 2 columns */
        display: grid;
        grid-template-columns: repeat(2, 1fr); /* forces exactly 2 equal columns on tablet */
        /* grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
        /* gap: 30px; */
        gap: 25px;
        justify-content: center;
        justify-items: center;  /* FIX: Centers individual cards horizontally inside their grid columns */
    }

    /* if there's an odd 3rd card alone on row 2, this forces it to sit dead-center */
    /* centering trick ONLY applies when there are 2 columns on tablet screens */
    .project-card:last-child:nth-child(odd) {
        grid-column: 1 / -1;
        max-width: 450px;   /* prevents the single centered card from stretching super wide */
        width: 100%;
    }

    .skills-list {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); /* automatically generates dynamic rows/columns based on screen width */
        grid-auto-rows: 1fr;                                        /* forces row 2 to stay as tall as row 1 */
    }

    #about h2 {
        font-size: 2.2rem;
        margin-bottom: 35px;
    }

    .about-container {
        flex-direction: row;
        align-items: flex-start; /* instead of "center" so txt flows naturally from top */
        gap: 50px;          /* btwn graphic & body copy */
    }

    .about-image-placeholder {
        flex: 1;    /* gives both columns equal sizing proportions. takes up exactly 50% of space */
        height: 350px;
    }

    .about-text {
        flex: 1;  /* instead of 121 so it takes up the other 50% of the space */
    }

    #contact h2 {
        font-size: 2.2rem;
    }

    .contact-form {
        max-width: 550px;
    }

    .footer-content {
        flex-direction: row;
        justify-content: space-between; /* adds space btwn copyright & links */
        align-items: center;
        max-width: 1200px;
        margin: 0 auto;
    }

    .btn-secondary {
        margin: 20px 0 0 0; /* resets margins so btn aligns to left nxt to ur paragraph blocks */
    }
}

/* LG WIDESCREEN MONITORS */
@media (min-width: 1030px) {
    .project-grid {
        /* grid-template-columns: repeat(3, 1fr);  /* seamlessly shifts to 3 equal columns on desktop */
        display: grid;
        grid-template-columns: repeat(2, 1fr); /* locks 4 cards into a completely balanced 2x2 grid, removing awk leftover space */
        max-width: 960px;                       /* constraints the master track width so the 2x2 grid looks perfectly balanced */
        margin: 0 auto;                         /* centers the entire 2x2 block inside the section container */
        gap: 30px;
    }

    .project-card:last-child:nth-child(odd) { /* turns off the tablet centering rule entirely so card 3 can sit perfectly in row 1 */
        grid-column: auto;
        max-width: none;
    }
}