/* =========================================
   GLOBAL RESET & BASE TYPOGRAPHY
   ========================================= */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-family: "Space Grotesk", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    scroll-behavior: smooth;
}

html,
body {
    height: 100%;
}

/* Page uses a flex column layout so that footer can stick to the bottom */
body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background-color: #C4A484;
}

main {
    flex: 1; /* take remaining height between header and footer */
}

/* Slight offset below the header so content does not hug it */
.main-content {
    margin-top: 45px;
}

/* Utility: uppercase titles */
.uppercase {
    text-transform: uppercase;
}

/* =========================================
   HEADER / NAVIGATION
   ========================================= */

/* Top bar container */
header {
    background-color: #F7F1DE;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    padding: 1rem 2rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    position: relative;
    z-index: 10;
}

/* Inner flex layout: logo, site title, main nav */
.header-content {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    padding-inline: 2rem;
    gap: 1rem;
    width: 100%;
    margin: 0;
}

/* Logo link holds two stacked images (default + hover) */
.logo-link {
    position: relative;
    display: inline-block;
    height: clamp(40px, 8vw, 80px);
    width: clamp(40px, 8vw, 80px);
}

/* Base logo style for both images */
.logo {
    position: absolute;
    inset: 0;
    height: 100%;
    transition: opacity 0.25s ease;
}

/* Default logo visible initially */
.default-logo {
    opacity: 1;
}

/* Hover logo hidden initially */
.hover-logo {
    opacity: 0;
}

/* Swap logos on hover */
.logo-link:hover .default-logo {
    opacity: 0;
}
.logo-link:hover .hover-logo {
    opacity: 1;
}

/* Site title in header (only affects header h1, not content h1) */
header h1 {
    font-size: clamp(24px, 3vw, 36px);
    color: #C4A484;
    margin: 0;
    text-align: left;
    white-space: nowrap;
}

header h1 a {
    text-decoration: none;
    color: #C4A484;
}
header h1 a:hover {
    color: #A8BBA3;
    transform: translateY(-2px);
    text-decoration: none;
}

/* Push navigation to the far right */
.header-content .main-nav {
    margin-left: auto;
}

/* Horizontal navigation list */
.main-nav ul {
    display: flex;
    gap: 3.5rem;
    list-style: none;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
}

.main-nav a {
    text-decoration: none;
    color: #C4A484;
    font-weight: 500;
    font-size: 1.35rem;
}
.main-nav a:hover {
    color: #A8BBA3;
    transform: translateY(-2px);
    text-decoration: none;
}

/* =========================================
   HOME / HERO SECTION
   ========================================= */

/* Main intro area: text + portrait image */
.hero-section {
    padding-block: 2rem;
    display: flex;
    flex-wrap: wrap;      /* allow wrapping on small screens */
    align-items: center;  /* vertically center text and image */
    justify-content: center;
    gap: clamp(1rem, 4vw, 3rem);
}

/* Text column with readable line length */
.hero-text {
    flex: 1 1 480px;
    min-width: 320px;
    max-width: 65ch;
}

/* Hero title style (independent from header h1) */
.hero-title {
    background-color: transparent;
    color: #F7F1DE;
    font-size: clamp(22px, 3vw, 30px);
    text-align: left;
    line-height: 1.3;
    margin-bottom: 0.75em;
}

/* Body text in hero section */
.hero-text p {
    text-align: justify;
    hyphens: auto;
    -webkit-hyphens: auto;
    -ms-hyphens: auto;
    line-height: 1.5;
    margin-bottom: 1em;
}

/* Portrait image: circular and responsive */
.hero-section img {
    flex: 0 1 clamp(240px, 35vw, 420px);
    width: clamp(240px, 35vw, 420px);
    height: auto;
    align-self: center;
    border: 3px solid #F7F1DE;
    border-radius: 50%;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    margin-left: 5rem;
    top: 0.5rem;
}

/* Subtle hover effect on portrait */
.hero-section img:hover {
    transform: scale(1.05) translateY(-5px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

/* =========================================
   SOCIAL ICONS (used in footer)
   ========================================= */

.social-link {
    display: inline-block;
}

.socialLogo {
    position: static;
    height: 32px;
    width: auto;
}

/* =========================================
   CV PAGE LAYOUT
   ========================================= */

/* Top CV hero with portrait + intro text */
.cv-hero {
    max-width: 960px;
    margin: 0 auto;
    padding: 3rem 2rem 2rem;
    display: flex;
    gap: 2rem;
    align-items: center;
}

.cv-portrait {
    width: clamp(160px, 22vw, 220px);
    border-radius: 50%;
    border: 3px solid #F7F1DE;
}

.cv-hero-text h1 {
    color: #F7F1DE;
    margin-bottom: 0.75rem;
}

.cv-hero-text p {
    line-height: 1.6;
    text-align: justify;
    hyphens: auto;
    -webkit-hyphens: auto;
    -ms-hyphens: auto;
}

/* Small pill-style internal navigation (Experience / Education / Skills) */
.cv-nav {
    max-width: 960px;
    margin: 0 auto 1.5rem;
    padding-inline: 2rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.cv-pill {
    text-decoration: none;
    padding: 0.5rem 1.1rem;
    border-radius: 999px;
    border: 1px solid #F7F1DE;
    color: #F7F1DE;
    font-size: 0.95rem;
    transition: background 0.2s ease, color 0.2s ease, transform 0.1s ease;
}
.cv-pill:hover {
    background: #F7F1DE;
    color: #5a4630;
    transform: translateY(-1px);
}

/* Generic wrapper for each CV section (Experience / Education / Skills) */
.cv-section {
    max-width: 960px;
    margin: 0 auto 2.5rem;
    padding-inline: 2rem;
}

.cv-section h2 {
    color: #F7F1DE;
    margin-bottom: 1rem;
}

/* Card containing a single position or education item */
.cv-card {
    background: #F7F1DE;
    color: #473524;
    border-radius: 12px;
    padding: 1.25rem 1.5rem;
    margin-bottom: 1rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
}

/* Header row inside card: title on left, meta (org + year) on right */
.cv-card header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 1rem;
}

.cv-card h3 {
    margin-bottom: 0;
}

/* Organisation / location / year line */
.cv-meta {
    font-size: 0.9rem;
    opacity: 0.8;
    margin-bottom: 0.75rem;
    text-align: right;
    white-space: nowrap;
}

/* Body text inside card */
.cv-card p {
    margin: 0;
    line-height: 1.5;
}

/* Skill badges layout */
.cv-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

/* Individual skill badge */
.badge {
    display: inline-block;
    background: #F7F1DE;
    color: #473524;
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    font-size: 0.9rem;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
}

/* =========================================
   FOOTER
   ========================================= */

/* Basic footer bar */
footer {
    background-color: #F7F1DE;
    margin-top: auto;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.15);
    position: relative;
    z-index: 10;
}

/* Flex container: center content, position copyright separately */
.footer-content {
    position: relative;          /* anchor for absolutely positioned copyright */
    display: flex;
    align-items: center;
    justify-content: center;     /* center the right-side block */
    padding: 1rem 2rem;
}

/* Copyright text, visually placed on the left on larger screens */
footer .copyright {
    position: absolute;
    left: 2rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.9rem;
    color: #8a765e;
    opacity: 0.85;
    margin: 0;
}

/* Right-hand footer content (headline + icons), kept as a centered block */
.footer-right {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 0.5rem;
}

/* Wrapper for heading + icon row */
.social-links {
    display: flex;
    flex-direction: column; /* heading above, icons below */
    align-items: center;
    text-align: center;
    gap: 0.5rem;
}

/* Footer heading spacing */
footer h2 {
    margin-top: 0.5rem;
    margin-bottom: 0.25rem;
}

/* Icon list spacing inside footer */
.social-links ul {
    display: flex;
    gap: 1.5rem;
    list-style: none;
    justify-content: center;
    margin-top: 0.25rem;
    margin-bottom: 0.5rem;
}

/* =========================================
   RESPONSIVE ADJUSTMENTS
   ========================================= */

@media (max-width: 768px) {
    /* Allow header items to wrap to multiple lines */
    .header-content {
        flex-wrap: wrap;
        row-gap: 0.5rem;
    }

    .main-nav {
        width: 100%;
        margin-left: 0;
    }

    .main-nav ul {
        justify-content: flex-end;
        gap: 1.5rem;
    }

    /* Stack hero vertically on small screens */
    .hero-section {
        flex-direction: column;
        align-items: center;
    }

    .hero-text {
        width: 92%;
        max-width: 70ch;
    }

    .hero-section img {
        width: min(65vw, 320px);
        margin-left: 0;  /* avoid horizontal scroll on small devices */
        top: 0;
    }

    /* Stack CV hero vertically */
    .cv-hero {
        flex-direction: column;
        text-align: center;
    }

    .cv-hero-text p {
        text-align: left;
    }

    /* On smaller screens, stack footer elements vertically
       so copyright does not overlap with the content */
    .footer-content {
        flex-direction: column;
        gap: 0.5rem;
        padding-block: 0.75rem 1rem;
    }

    footer .copyright {
        position: static;
        transform: none;
        order: 2;          /* place copyright below social links */
        padding-left: 0;
    }
}
