/* ============================================
   Indholddsfortegnelse / Content
   1. Variables & Reset
   2. Base Styles
   3. Navigation
   4. Header / Hero Section
   5. Sociale Medie Links
   6. Højre indhold
   7. Main Content Sections
   8. Projekt 
   9. Værktøjskasse 
   10. Kontakt
   11. Responsive Design
   ============================================ */

/* Begreber:
- . = Class Selector
-- Bruges til flere elementer der skal have samme styling
-- Kan genbruges mange gange på samme side
-- Eksempel: Alle projekt-cards, alle info sections

- # = ID Selector
-- Bruges til ét unikt element
-- Skal kun bruges én gang per side
-- Eksempel: Sektioner (Projects, contract, about)

-   = Element Selctor
-- Bruges til HTML tags direkte
-- Gælder for alle elementer af den type
-- Eks: Alle <nav> tags, alle <body> tags

/* ============================================
   1. VARIABLES & RESET
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Farver fra CV */
    --gold: #D4A574;
    --beige-light: #F5E6D3;
    --beige-medium: #E8DCC8;
    --white: #FFFFFF;
    --text-dark: #2C2C2C;
    --text-light: #5A5A5A;
    --border-gold: #C9A961;

}

/* ============================================
   2. BASE STYLES
   ============================================ */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background-color: var(--white);
}

html {
    scroll-behavior: smooth;
}

/* ============================================
   3. NAVIGATION
   ============================================ */

nav {
    background-color: var(--white);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 0 20px;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

/* Logo/Forside til venstre */
.nav-logo a {
    text-decoration: none;
    color: var(--text-dark);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Helvetica Neue', Arial, sans-serif;
    font-weight: 700;
    font-size: 1.4rem;
    letter-spacing: -0.5px;
    transition: color 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: color 0.3s ease;
}

.nav-logo a:hover {
    color: var(--gold);
}

.nav-logo a:active {
    color: var(--gold);
}

/* LOGO DESIGN */
.logo-link {
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: transform 0.3s ease;
}

.logo-svg {
    transition: all 0.3s ease;
}

.logo-link:hover .logo-svg {
    transform: scale(1.25);
}

.logo-link:hover text {
    fill: var(--gold);
}

.logo-link:hover line {
    stroke: var(--gold)
}

/* Højre hovedindhold */
.nav-menu {
    list-style: none;
    display: flex;
    gap: 30px;
    margin: 0;
    padding: 0;
}

.nav-menu a {
    text-decoration: none;
    color: var(--text-dark);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Helvetica Neue', Arial, sans-serif;
    font-weight: 600;
    font-size: 1rem;
    letter-spacing: 0.3px;
    text-transform: uppercase;
    transition: color 0.3s ease;
    padding: 5px 10px;
}

.nav-menu a:hover {
    color: var(--gold);
}

/* Aktiv navigation link */
.nav-menu a.active {
    color: var(--gold);
    border-bottom: 3px solid var(--gold);
}


/* ============================================
   4. HEADER / HERO SECTION
   ============================================ */
header {
    background: linear-gradient(135deg, var(--beige-light) 0%, var(--beige-medium) 100%);
    padding: 80px 20px;
    min-height: 90vh;
    display: flex;
    align-items: center;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    display: flex;
    gap: 40px;
    align-items: center;
}

/* Venstre hovedindhold */
.header-text {
    flex: 1;
    max-width: 550px;
}

/* Titel */
.header-text h1 {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    font-size: 4.5rem;
    font-weight: 900;
    margin-bottom: 15px;
    color: var(--text-dark);
    line-height: 1.1;
    letter-spacing: -2px;
    background: linear-gradient(135deg, var(--text-dark) 0%, var(--gold) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;

    opacity: 0;
    animation: fadeInUp 1s ease-out forwards;
}

.header-text .subtitle {
    font-size: 2rem;
    color: var(--gold);
    margin-bottom: 20px;
    font-weight: 600;

    opacity: 0;
    animation: fadeInUp 1s ease-out 0.2s forwards;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
        /* Start position: venstre */
    }

    to {
        opacity: 1;
        transform: translateY(0);
        /* Slut position: normal */
    }
}

.header-text .description {
    font-size: 1.2rem;
    color: var(--text-light);
    line-height: 1.8;
    margin-bottom: 30px;

    opacity: 0;
    animation: fadeInUp 1s ease-out 0.4s forwards;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
        /* Start position: venstre */
    }

    to {
        opacity: 1;
        transform: translateY(0);
        /* Slut position: normal */
    }
}


/* ============================================
   5. SOCIAL MEDIA LINKS
   ============================================ */
.social-links {
    display: flex;
    gap: 20px;
    margin-top: 30px;
}

.social-links a {
    width: 50px;
    height: 50px;
    background-color: var(--white);
    border: 2px solid var(--gold);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gold);
    font-size: 1.5rem;
    transition: all 0.3s ease;
    text-decoration: none;

    opacity: 0;
    animation: fadeInUp 1s ease-out 0.6s forwards;
}

.social-links a:hover {
    background-color: var(--gold);
    color: var(--white);
    transform: translateY(-5px) scale(1.1);
    box-shadow: 0 5px 15px rgba(212, 165, 116, 0.5);
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
        /* Start position: venstre */
    }

    to {
        opacity: 1;
        transform: translateY(0);
        /* Slut position: normal */
    }
}

/* ============================================
   6. Indhold - Til højre
   ============================================ */

/* Hvid ramme for indholdet*/
.header-info-card {
    flex: 0 0 500px;
    background: linear-gradient(135deg, var(--white) 0%, #fafafa 100%);
    padding: 30px;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(212, 165, 116, 0.2);
    backdrop-filter: blur(10px);
    display: flex;
}

/* Styler hver enkelt info-boks */
.info-section {
    margin-bottom: 12px;
    padding: 12px;
    background-color: rgba(245, 230, 211, 0.3);
    border-radius: 10px;
    border-left: 3px solid var(--gold);

    /* Animation */
    transition: all 0.5s ease;
    opacity: 0;
    animation: fadeInUp 0.6s ease forwards;
    position: relative;

}

/* Highlight state (når sektionen er aktiv) */
.info-section.highlight {
    background-color: rgba(212, 165, 116, 0.4);
    border-left-width: 5px;
    transform: translateX(8px);
    box-shadow: 0 5px 20px rgba(212, 165, 116, 0.3);
}

/* Glow effekt når highlighted */
.info-section.highlight::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(212, 165, 116, 0.4);
    animation: pulse 1s ease-in-out infinite;
    pointer-events: none;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 0.6;
    }

    50% {
        opacity: 1;
    }
}

/* Styler info-bokse når musen er over dem*/
.info-section:hover {
    background-color: rgba(245, 230, 211, 0.5);
    transform: translateX(5px);
}

/*Styler overskrifterne på hver infoboks */
.info-section h4 {
    font-size: 0.9rem;
    color: var(--text-dark);
    margin-bottom: 5px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Styler beskrivelse i hver info-boks */
.info-section p {
    font-size: 0.8rem;
    color: var(--text-light);
    line-height: 1.4;
    margin-left: 24px;
}

/* Styler den sidste info-boks */
.info-section:last-child {
    margin-bottom: 0;
    /* Giver ekstra plads i bunden*/
}

/* Styling og farvegraduering for hver sektion */
.info-section:nth-child(1) {
    border-left-color: #D4A574;
    /* Guld */
}

.info-section:nth-child(2) {
    border-left-color: #C9A961;
    /* Mørkere guld */
}

.info-section:nth-child(3) {
    border-left-color: #B8985A;
    /* Endnu mørkere */
}

.info-section:nth-child(4) {
    border-left-color: #A78850;
}

.info-section:nth-child(5) {
    border-left-color: #967749;
}

/* Delay hver sektion lidt */
.info-section:nth-child(1) {
    animation-delay: 0.2s;
}

.info-section:nth-child(2) {
    animation-delay: 0.4s;
}

.info-section:nth-child(3) {
    animation-delay: 0.6s;
}

.info-section:nth-child(4) {
    animation-delay: 0.8s;
}

.info-section:nth-child(5) {
    animation-delay: 0.9s;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}


/* ============================================
   7. MAIN CONTENT SECTIONS
   ============================================ */
main {
    max-width: 1200px;
    margin: 0 auto;
}

section {
    padding: 80px 20px;
}

section h2 {
    font-size: 2.5rem;
    margin-bottom: 40px;
    color: var(--text-dark);
    text-align: center;
}


/* ============================================
   8. PROJECTS SECTION
   ============================================ */

#projects {
    background: linear-gradient(180deg, var(--white) 0%, var(--beige-light) 100%);
    padding: 80px 20px;
}

#projects h2 {
    opacity: 0;
    font-size: 2.5rem;
    margin-bottom: 40px;
    text-align: center;
}

#projects h2.in-view {
    animation: fadeInUp 0.8s ease-out forwards;
}

.project-item {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 60px;
    align-items: center;
    min-height: 70vh;
    margin-bottom: 50px;
    background: linear-gradient(135deg, var(--beige-light) 0%, rgba(245, 230, 211, 0.5) 100%);
    padding: 40px;
    border-radius: 16px;
    border: 1px solid rgba(212, 165, 116, 0.2);
    opacity: 0;
    transition: all 300ms ease;
}

.project-item:nth-child(odd).in-view {
    animation: slideInFromLeft 0.8s ease-out forwards;
}

.project-item:nth-child(even).in-view {
    animation: slideInFromRight 0.8s ease-out forwards;
}

.project-item:hover {
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    transform: translateY(-4px);
    border-color: var(--gold);
}

.project-item.reverse {
    direction: rtl;
}

.project-item.reverse>* {
    direction: ltr;
}

/* 2. The Image Wrapper: Control the width relative to the text */
.project-image-container {
    flex: 1;
    /* Takes up 1 part of the available space */
    max-width: 250px;
    /* Prevents it from becoming a giant on huge screens */
    position: relative;
    border-radius: 12px;
    overflow: hidden;
}

/* 3. The Image itself: Fixed the selector name here */
.project-image-container img {
    width: 100%;
    height: 220px;
    /* Set a consistent height for all project images */
    object-fit: cover;
    /* Crops the image to fit the box without stretching */
    display: block;
    transition: transform 300ms ease;
}

/* Make the cursor look like a hand when hovering the image */
.project-image-container a {
    display: block;
    /* Ensures the link covers the whole image area */
    overflow: hidden;
    border-radius: 12px;
}

.project-image-container img:hover {
    transform: scale(1.03);
    /* Slight zoom in effect */
    filter: brightness(0.9);
    /* Dims it slightly to show it's "active" */
    transition: all 0.3s ease;
}

.project-item:hover .project-image img {
    transform: scale(1.05);
}

.project-text {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.project-text h3 {
    font-size: 1.75rem;
    margin: 0;
    color: var(--text-dark);
    font-weight: 700;
}

.project-text p {
    font-size: 1rem;
    color: var(--text-light);
    line-height: 1.8;
    margin: 0;
}

.project-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.project-tech-tag {
    background: rgba(212, 165, 116, 0.1);
    color: var(--gold);
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.85rem;
    border: 1px solid rgba(212, 165, 116, 0.2);
    transition: all 150ms ease;
}

.project-tech-tag:hover {
    background: var(--gold);
    color: white;
    border-color: var(--gold);
}

.project-link {
    color: var(--gold);
    font-weight: 600;
    text-decoration: none;
    transition: all 150ms ease;
    width: fit-content;
}

.project-link:hover {
    transform: translateX(4px);
    border-bottom: 2px solid var(--gold);
}

@keyframes slideInFromLeft {
    from {
        opacity: 0;
        transform: translateX(-40px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInFromRight {
    from {
        opacity: 0;
        transform: translateX(40px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================
   9. TOOLBOX SECTION
   ============================================ */

.toolbox {
    padding: 80px 20px;
    background-color: var(--white);
}

/* Fade in animation for h2 */
.toolbox h2 {
    opacity: 0;
}

.toolbox h2.in-view {
    animation: fadeInUp 2s ease-out forwards;
}

.toolbox-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 40px;
    max-width: 1200px;
    margin: 0 auto;
}

.toolbox-card {
    opacity: 0;
    background: linear-gradient(135deg, var(--beige-light) 0%, rgba(245, 230, 211, 0.5) 100%);
    border-radius: 16px;
    padding: 40px;
    border: 1px solid rgba(212, 165, 116, 0.2);
    transition: all 300ms ease;
}

.toolbox-card.in-view {
    animation: fadeInUp 0.8s ease-out forwards;
}

.toolbox-card:hover {
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
    border-color: var(--gold);
}

.toolbox-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 25px;
}

.toolbox-icon {
    font-size: 1.75rem;
}

.toolbox-header h3 {
    font-size: 1.5rem;
    color: var(--text-dark);
    font-weight: 700;
    margin: 0;
}

.tools-container {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.tool-tag {
    background-color: var(--white);
    color: var(--text-dark);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    border: 1px solid rgba(212, 165, 116, 0.2);
    transition: all 200ms ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.tool-tag:hover {
    background-color: var(--gold);
    color: var(--white);
    border-color: var(--gold);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(212, 165, 116, 0.2);
}

/* ============================================
   10. Kontakt
   ============================================ */
#contact {
    background-color: var(--white);
    text-align: center;
}

/* H2 fade in */
#contact h2 {
    opacity: 0;
}

#contact h2.in-view {
    animation: fadeInUp 1s ease-out forwards;
}

#contact p {
    font-size: 1.2rem;
    text-align: center;
    margin-bottom: 30px;
    color: var(--text-light);
    opacity: 0;
}

#contact p.in-view {
    animation: fadeInUp 1s ease-out 0.2s forwards;
}

#contact a {
    color: var(--gold);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

#contact a:hover {
    color: var(--text-dark);
}

#contact ul {
    list-style: none;
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-top: 20px;
}

.contact-social-links {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin: 30px 0;
}

.contact-social-links a {
    width: 50px;
    height: 50px;
    background-color: var(--white);
    border: 2px solid var(--gold);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gold);
    font-size: 1.5rem;
    transition: all 0.3s ease;
    text-decoration: none;
}

.contact-social-links a:hover {
    background-color: var(--gold);
    color: var(--white);
    transform: translateY(-5px) scale(1.1);
    box-shadow: 0 5px 15px rgba(212, 165, 116, 0.5);
}

/* Links med stagger delay */
#contact li {
    opacity: 0;
}

#contact li:nth-child(1).in-view {
    animation: fadeInUp 1s ease-out 0.3s forwards;
}

#contact li:nth-child(2).in-view {
    animation: fadeInUp 1s ease-out 0.5s forwards;
}

#contact li:nth-child(3).in-view {
    animation: fadeInUp 1s ease-out 0.7s forwards;
}


#contact li a {
    padding: 12px 30px;
    background-color: var(--beige-light);
    border-radius: 5px;
    border: 2px solid var(--gold);
    transition: all 0.3s ease;
}

#contact li a:hover {
    background-color: var(--gold);
    color: var(--white);
}

.back-to-top {
    background: var(--gold);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.8rem;
    transition: all 0.3s ease;
    white-space: nowrap;
    text-align: center;
}

.back-to-top:hover {
    background: #B8985A;
    transform: translateY(-2px);
}

/* ============================================
   11. Brugervenlighed over enheder
   ============================================ */

/* Tablet */
@media (max-width: 968px) {
    .header-content {
        flex-direction: column;
        gap: 40px;
    }

    .header-info-card {
        flex: 1;
        max-width: 100%;
        height: auto;
        max-height: none;
    }

    .info-sections-container {
        overflow-y: visible;
    }
}

/* Mobile */
@media (max-width: 768px) {

    /* Navigation */
    .nav-container {
        flex-direction: row;
        height: auto;
        padding: 0;
        justify-content: space-between;
    }

    .nav-logo {
        font-size: 0.75;
        margin-bottom: 0px;
    }

    .nav-menu {
        gap: 10px;
    }

    .nav-menu a {
        font-size: 0.75rem;
        padding: 5px 8px;
    }

    /* Header */
    .header-text h1 {
        font-size: 2.5rem;
    }

    .header-text .subtitle {
        font-size: 1.5rem;
    }

    .header-text .description {
        font-size: 1.1rem;
    }

    /* Hovedindhold */
    .header-info-card {
        padding: 25px;
    }

    .header-info-card h3 {
        font-size: 1.5rem;
    }

    .info-section h4 {
        font-size: 1rem;
    }

    .info-section p {
        font-size: 0.9rem;
    }

    /* Projekter */
    @media (max-width: 768px) {

        .project-item,
        .project-item.reverse {
            /* Force the grid into a single column */
            grid-template-columns: 1fr;
            /* Remove any reverse direction logic */
            direction: ltr;
            gap: 20px;
        }

        /* Reset direction for children to ensure text reads left-to-right */
        .project-item.reverse>* {
            direction: ltr;
        }

        #projects h2 {
            font-size: 2rem;
            text-align: center;
            /* Often looks better on mobile */

        }

        .project-image-container {
            max-width: 100%;
            /* Lets the image use the full width of the phone */
            width: 100%;
            order: -1;
            /* This ensures the image stays ABOVE the text on mobile */
        }

        .project-image-container img {
            width: 100%;
            /* Change fixed height to auto or a ratio for mobile */
            height: auto;
            aspect-ratio: 16 / 9;
            object-fit: cover;
        }

    }

    /* Sektioner */
    section h2 {
        font-size: 2rem;
    }

    /* Værktøjskasse */
    @media (max-width: 768px) {
        .toolbox-grid {
            grid-template-columns: 1fr;
        }
    }

    /* Kontakt */
    #contact ul {
        flex-direction: row;
        gap: 15px;
        flex-wrap: wrap;
        justify-content: center;
    }

    #contact li a {
        padding: 10px 20px;
        font-size: 0.95rem;
    }

    .back-to-top {
        grid-template-columns: 1fr;
        flex-direction: column;
        text-align: center;
    }
}