/* Global reset box & model; ensures consisten sizing 
behavior across all elements */
*,
*::before,
*::after {
    box-sizing: border-box;
}

/* Custom Properties, update these for your own design */
:root {
     /* Font families */
    --ff-primary: 'Inter', sans-serif;
    --ff-secondary: 'Montserrat', monospace;
    
    /* Font weights */
    --fw-reg: 300;
    --fw-bold: 900;
    
    /* Color palette */
    --clr-light: #fff;
    --clr-dark: #303030;
    --clr-accent: #3B82F6;
    
    /* Typography scale */
    --fs-h1: 3rem;
    --fs-h2: 2.25rem;
    --fs-h3: 1.25rem;
    --fs-body: 1rem;
    
    /* Box shadow preset */
    --bs: 0.25em 0.25em 0.75em rgba(0,0,0,.25),
          0.125em 0.125em 0.25em rgba(0,0,0,.15);
}

/* Responsive typography - scales font sizes on larger screens*/
@media (min-width: 800px) {
    :root {
        --fs-h1: 4.5rem;
        --fs-h2: 3.75rem;
        --fs-h3: 1.5rem;
        --fs-body: 1.125rem;
    }
}

/* General styles */
html {
    scroll-behavior: smooth; /* Smooth anchor scrolling */
}

body {
    background: var(--clr-light);
    color: var(--clr-dark);
    margin: 0;
    font-family: var(--ff-primary);
    font-size: var(--fs-body);
    line-height: 1.6;
}

section {
    padding: 5em 2em; /* consistent vertical spacing between sections */
}

img {
    display: block;
    max-width: 100%;
}

strong { font-weight: var(--fw-bold) }

/* Accessible focus styles for keyboard navigation */
:focus {
    outline: 3px solid var(--clr-accent);
    outline-offset: 3px;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: .5em 2.5em;
    background: var(--clr-dark);
    text-decoration: none;
    cursor: pointer;
    
    font-size: .8rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: var(--fw-bold);
    color: var(--clr-light);

    transition: transform 200ms ease-in-out;
}

.btn:hover {
    transform: scale(1.1);
}

/* Typography - headings and section titles */
h1,
h2,
h3 {
    line-height: 1;
    margin: 0;
}

h1 { font-size: var(--fs-h1) }
h2 { font-size: var(--fs-h2) }
h3 { font-size: var(--fs-h3) }


.section__title {
    margin-bottom: .25em;
}

.section__title--intro {
    font-weight: var(--fw-reg);
}

.section__title--intro strong {
    display: block;
}

.section__subtitle {
    margin: 0;
    font-size: var(--fs-h3);
}

/* Accent subtitles for different sections */
.section__subtitle--intro,
.section__subtitle--about {
    background: var(--clr-accent);
    padding: .25em 1em;
    font-family: var(--ff-secondary);
    margin-bottom: 1em;
}

.section__subtitle--work {
    color: var(--clr-accent);
    font-weight: var(--fw-bold);
    margin-bottom: 2em;
}


/* Header & Navigation - Mobile-first navigation with animated hamburger */
header {
    display: flex;
    justify-content: space-between;
    padding: 1em;
}

.logo {
    max-width: 150px;
}

/* Fullscreen mobile navigation overlay */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--clr-dark);
    color: var(--clr-light);
    transform: translateX(100%);
    transition: transform 250ms cubic-bezier(.5,0,.5,1);
    z-index: 999; /* above hero content */
}

/* Navigation list layout */
.nav__list {
    list-style: none;
    display: flex;
    flex-direction: column;
    justify-content: space-evenly;
    align-items: center;

    height: 100%;
    margin: 0;
    padding: 0;
}

.nav__link {
    color: inherit;
    font-weight: var(--fw-bold);
    font-size: var(--fs-h3);
    text-decoration: none;

    transition: transform 200ms ease, color 200ms ease; /* smooth animation */

}

.nav__link:hover {
    color: var(--clr-accent);
    transform: scale(1.2);
    
}

/* Hamburger toggle button */
.nav-toggle {
    outline: none; 
    position: absolute;   /* changed from fixed */
    top: 1em;
    right: 1em;

    background: transparent;  /* no white bg */
    border: 0;
    cursor: pointer;

    width: 2em;
    height: 2em;
     z-index: 1000;   
}

/* Navigation open state */
.nav-open .nav{
    transform: translateX(0);
}

.nav-open .nav-toggle {
    position: fixed;
}

.nav-open .hamburger {
    transform: rotate(.625turn);
}

.nav-open .hamburger::before {
    transform: rotate(90deg) translateX(-6px);
}

.nav-open .hamburger::after {
    opacity: 0;
}

.hamburger {
    display: block;
    width: 2em;
    height: 3px; /* gives visible bar */
    background: var(--clr-accent);
    position: relative;
    border-radius: 1em;
    transition: transform 250ms ease-in-out;
}

/* Hamburger icon bars */
.hamburger,
.hamburger::before,
.hamburger::after {
    background: var(--clr-accent);
    width: 2em;
    height: 3px;
    border-radius: 1em;
    transition: transform 250ms ease-in-out;
}

.hamburger::before,
.hamburger::after {
    content: '';
    position: absolute;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--clr-accent);
    border-radius: 1em;
    transition: transform 250ms ease-in-out, opacity 250ms linear;

}

.hamburger::before { top: 6px; }
.hamburger::after { bottom: 6px; }

.nav-toggle:hover .hamburger {
    transform: scale(1.2);  /* makes all 3 bars bigger */
}

/* HERO / ANIMATED BACKGROUND */
.hero {
    position: relative;
    overflow: hidden;
    background-color: var(--clr-dark);
    color: var(--clr-light);
}

/* animated grid backgrounding layer */
.hero::before {
    content: "";
    position: absolute;
    inset: 0;

    background-image:
        radial-gradient(circle at 1px 1px,
        rgba(255,255,255,.5) 2px,
        transparent 0);

    background-size: 28px 28px;
    animation: floatGrid 12s ease-in-out infinite;
    z-index: 0;
}

/* Dark overlay for contrast */
.hero::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom,
        rgba(0,0,0,.55),
        rgba(0,0,0,.35)
    );
    z-index: 1;
}

/* Keyframe animation for background motion */
@keyframes floatGrid {
    0% {
        background-position: 0 0;
        transform: translateY(0);
    }
    50% {
        background-position: 40px 60px;
        transform: translateY(-10px);
    }
    100% {
        background-position: 0 0;
        transform: translateY(0);
    }
}

/* Keep hero content above background layers */
.hero header,
.hero .intro {
    position: relative;
    z-index: 2;
}

/*  Intro section  */
.intro { 
    position: relative;
}

/* Keeps subtitle sized to its content and allows positioning */
.section__subtitle--intro {
    display: inline-block;
}

/* Intro image */
.intro__img,
.about-me__img,
.skills-image-box img {
    width: 100%;       /* scale to container width */
    max-width: 1200px;  /* desktop max size */
    height: auto;      /* keep aspect ratio */
    display: block;
    margin: 0 auto;    /* center horizontally */
}

.about-me__img {
    width: 100%;        /* scale with parent container */
    max-width: 300px;   /* desktop max size */
    height: auto;       /* keep aspect ratio */
    display: block;     /* removes inline spacing issues */
    margin: 1.5rem auto; /* centers the image */
}

@media (min-width: 600px) {
    .intro {
        display: grid;
        width: 90%; /* let container scale */
        margin: 0 auto;
        grid-column-gap: 1em;
        grid-template-areas: 
            "img title"
            "img subtitle";
        grid-template-columns: auto 1fr; /* flexible columns */
    }

    .intro__img {
        grid-area: img;
        width: clamp(150px, 30vw, 300px); /* responsive scaling */
        height: auto;
        position: relative;
        z-index: 2;
        margin: 0; /* grid handles spacing */
    }

    .section__subtitle--intro {
        align-self: start;
        grid-column: -1 / 1;
        grid-row: 2;
        text-align: right;
        position: relative;
        left: 0; /* remove negative shift */
        width: 100%;
    }
}


/*  My services section  */
.my-services {
    background-color: var(--clr-dark);
    background-image: url(../img/theArch2.jpg);
    background-size: cover;
    color: var(--clr-light);
    text-align: center;
}

/* Services section title styling */
.section__title--services {
    color: var(--clr-light);
    position: relative;
}

/* Decorative underline below services title */
.section__title--services::after {
    content: '';
    display: block;
    width: 5em;
    height: 4px;
    margin: 0.5em auto 1em;
    background: var(--clr-light);
    opacity: 0.5;
}

/* Container for all service cards */
.services {
    margin-bottom: 4em;
}

/* Individual service card */
.service {
    max-width: 500px;
    margin: 0 auto;
}

/* Desktop layout for services (flex row) */
@media (min-wdth: 800px) {
    .services {
        display: flex;
        max-width: 1000px;
        margin-left: auto;
        margin-right: auto;
    }

    /* Adds spacing between service cards */
    .service + .ervice {
        margin-left: 2em;
    }
}

/* About Me Section */

/* Centers About Me section and limits width */
.about-me {
    max-width: 1000px;
    margin: 0 auto;
}

/* Desktop grid layout for About Me section */
@media (min-width: 600px) {
    .about-me {
        display: grid;
        grid-template-columns: 1fr 200px;
        grid-template-areas: 
            "title img"
            "subtitle img"
            "text img";
        grid-column-gap: 2em;
    }

    /* About section title placement */
    .section__title--about {
        grid-area: title;
    }

    /* Subtitle styling with extended background effect */
    .section__subtitle--about {
        grid-column: 1 / -1;
        grid-row: 2;
        position: relative;
        left: -2em;
        width: calc(100% + 2em);
        padding-left: 1em;
        padding-right: calc(200px + 2em);
    }

    /* About section image placement and layering */
    .about-me__img {
        grid-area: img;
        position: relative;
        z-index: 2;
    }   
}

/* Centers skills image container */
.skills-image-box {
  flex: 1;
  display: flex;
  justify-content: center;
  margin-top: 2rem;
}

/* Ensures responsive image scaling */
.skills-image-box img {
  height: auto;
 
}

/* Portfolio / My Work */

/* Portfolio section styling */
.my-work {
    background-color: var(--clr-dark);
    color: var(--clr-light);
    text-align: center;
}

/* Responsive grid layout for portfolio items */
.portfolio {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    
}

/* Individual portfolio item container */
.portfolio__item {
    background: var(--clr-accent);
    overflow: hidden;
}

/* Smooth hover animation for portfolio images */
.portfolio__img {
     transition: 
     transform 750ms cubic-bezier(.5, 0, .5, 1),
     opacity 250ms linear;
}

/* Brings focused portfolio item above others */
.portfolio__item:focus {
    position: relative;
    z-index: 2;
}

/* Zoom and fade effect on hover/focus */
.portfolio__img:hover,
.portfolio__item:focus .portfolio__img {
    transform: scale(1.2);
    opacity: .5;
}

/* Footer */

/* Footer container styling */
.footer {
    background: #111;
    color: var(--clr-accent);
    text-align: center;
    padding: 2.5em 0;
    font-size: var(--fs-h3);
}

/* Footer link styling */
.footer a { 
    color: inherit;
    text-decoration: none;
}

/* Emphasized footer link */
.footer__link {
    font-weight: var(--fw-bold);
}

/* Hover effects for footer links and social icons */
.footer__link:hover,
.social-list__link:hover {
    opacity: .7;
}

.footer__link:hover {
    text-decoration: underline;
}

/* Social icon list layout */
.social-list {
    list-style: none;
    display: flex;
    justify-content: center;
    margin: 2em 0 0;
    padding: 0;
}

/* Individual social icon spacing */
.social-list__item {
    margin: 0 .5em;
}

/* Clickable area for social icons */
.social-list__link {
    padding: .5em;
}

/* Footer title styling */
.footer__title {
  font-size: 3rem;
  margin-bottom: 1rem;
}

/* Footer descriptive text */
.footer__text {
  max-width: 800px;
  margin: 0 auto 1.25rem;
  color: #bbb; 
  line-height: 1.6;
  margin-bottom: 3rem; 
  font-size: 1.2rem;     
}


/* Individual Portfolio Page */

/* Main container for individual project pages */
.portfolio-item-individual {
    padding: 0 2em 2em;
    max-width: 1000px;
    margin: 0 auto;
}

/* Paragraph spacing and readability */
.portfolio-item-individual p {
    margin: 0.5em 0;   
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 2rem; 
}

/* Secondary logo sizing */
.logoTwo img {
  width: 250px;   
  height: auto;   /* keeps proportions */
}

.intro__img {
    max-width: 100%;     /* prevents overflow on small screens */
    height: auto;        /* keeps aspect ratio */
    width: 300px;        /* desktop size */
    margin: 1.5rem auto; /* centers image */
    display: block;
}

@media (max-width: 768px) {
    .intro__img {
        width: 200px;    /* smaller on tablets/phones */
    }
}

@media (max-width: 480px) {
    .intro__img {
        width: 160px;    /* even smaller on phones */
    }
}

/* Tech stack list styling */
.portfolio-item-individual img {
    display: block;       /* ensures proper spacing, avoids inline quirks */
    margin-bottom: 2rem;  /* adds space below the image */
}

.tech-stack {
    max-width: 600px;       
    margin: 1rem auto;     
    padding-left: 1.2rem;   
}

/* Tech stack list item spacing */
.tech-stack li {
    margin-bottom: 0.6rem;  /* spacing between items */
    line-height: 1.5;       /* improves readability */
}

/* Centered subheader link styling */
.subheader-link {
    margin-top: 1.5rem;       /* spacing above link */
    text-align: center;        /* center the text within its parent column */
    width: 100%;           
}

/* Subheader link appearance */
.subheader-link .footer__link {
    font-size: 1.6rem;       
    color: #3B82F6;          
    text-decoration: none;   
    transition: opacity 0.3s;
    white-space: nowrap;
}

/* Subheader link hover effect */
.subheader-link .footer__link:hover {
    text-decoration: underline;
    opacity: 0.7;
}

.portfolio-item-individual video {
    width: 50%;       /* default desktop size */
    max-width: 800px; /* optional max size */
    height: auto;
    display: block;
    margin: 2rem auto;
    border-radius: 8px;
}

/* For small screens */
@media (max-width: 768px) {
    .portfolio-item-individual video {
        width: 90%;   /* nearly full width on mobile */
    }
}