/* ============================================
   CSS VARIABLES - THEME
   ============================================ */

:root {
    /* Colours */
    --bg: #F7F5F0;
    --text: #2c2c2c;
    --muted: #6b6b6b;
    --accent: #8b7355;
    --border: #e0ddd8;
    --hover-accent: #6d5a42;
    --transition: 150ms ease;

    /* Typography - Max Brenner style */
    --font-sans: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji", sans-serif;
    --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;

    /* Type scale (mobile-first) */
    --fs-body: 1rem; /* 16px */
    --fs-meta: 0.8125rem; /* 13px */
    --fs-h1: 2rem; /* 32px */
    --fs-h2: 1.5rem; /* 24px */
    --fs-h3: 1.125rem; /* 18px */

    /* Line heights */
    --lh-body: 1.575; /* 1.55-1.6 range */
    --lh-heading: 1.2; /* 1.15-1.25 range */

    /* Spacing scale (mobile-first) - Max Brenner style */
    --space-1: 0.5rem; /* 8px */
    --space-2: 0.75rem; /* 12px */
    --space-3: 1rem; /* 16px */
    --space-4: 1.5rem; /* 24px */
    --space-5: 2rem; /* 32px */

    /* Layout spacing - compact like Max Brenner */
    --section-gap: 1.5rem; /* ~24px - spacing between sections */
    --section-gap-last: 0.5rem;
    --section-padding-bottom: 1.5rem; /* ~24px - padding after section content, before divider */
    --divider-gap: 1.5rem; /* ~24px - spacing around dividers (20-28px range) */

    --title-gap: 0.875rem; /* ~14px - gap below headings (12-16px range) */

    --entry-gap: 1.5rem; /* ~24px - gap between entries (24-32px range) */
    --entry-header-gap: 0.375rem; /* ~6px */
    --bullet-gap: 0.375rem; /* ~6px */
}


/* ============================================
   RESET & BASE STYLES
   ============================================ */

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    background-color: var(--bg);
    color: var(--text);
    line-height: var(--lh-body);
    font-size: var(--fs-body);
}


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

header {
    position: sticky;
    top: 0;
    background-color: var(--bg);
    border-bottom: 1px solid var(--border);
    z-index: 100;
    backdrop-filter: blur(10px);
    background-color: rgba(247, 245, 240, 0.95);
}

.nav-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}


/* Mobile Nav Toggle Button */

.nav-toggle {
    display: flex;
    flex-direction: column;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    z-index: 101;
    position: absolute;
    left: 1.5rem;
}

.nav-toggle span {
    width: 24px;
    height: 2px;
    background-color: var(--text);
    transition: all var(--transition);
    border-radius: 2px;
}

.nav-toggle[aria-expanded="true"] span:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

.nav-toggle[aria-expanded="true"] span:nth-child(2) {
    opacity: 0;
}

.nav-toggle[aria-expanded="true"] span:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

.nav-toggle:focus {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}


/* Navigation Menu */

.nav-menu {
    list-style: none;
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: var(--bg);
    border-bottom: 1px solid var(--border);
    padding: 1rem 0;
    margin: 0;
    transform: translateY(-100%);
    opacity: 0;
    visibility: hidden;
    transition: transform var(--transition), opacity var(--transition), visibility var(--transition);
}

.nav-menu.active {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
}

.nav-menu li {
    margin: 0;
}

.nav-link {
    display: block;
    padding: 0.75rem 1.5rem;
    color: var(--text);
    text-decoration: none;
    font-family: var(--font-mono);
    font-weight: 500;
    font-size: var(--fs-meta);
    transition: color var(--transition), background-color var(--transition);
    border-bottom: 2px solid transparent;
}

.nav-link:hover,
.nav-link:focus {
    color: var(--accent);
    background-color: rgba(139, 115, 85, 0.05);
    outline: none;
}

.nav-link.active {
    color: var(--text);
    border-bottom-color: var(--text);
}


/* Desktop Navigation */

@media (min-width: 900px) {
    .nav-toggle {
        display: none;
    }
    .nav-menu {
        position: static;
        flex-direction: row;
        gap: 3rem;
        border: none;
        padding: 0;
        transform: none;
        opacity: 1;
        visibility: visible;
    }
    .nav-link {
        padding: 0.5rem 0;
    }
    .nav-link:hover,
    .nav-link:focus {
        background-color: transparent;
    }
}


/* ============================================
   MAIN CONTENT
   ============================================ */

main {
    max-width: 900px;
    margin: 0 auto;
    padding: var(--space-4) 1.5rem;
}

.section {
    margin-bottom: var(--section-gap);
    scroll-margin-top: 80px;
    padding-bottom: var(--section-padding-bottom);
    border-bottom: 1px solid var(--border);
}

.section:last-of-type {
    margin-bottom: var(--section-gap-last);
    border-bottom: none;
    padding-bottom: 0;
}

h1 {
    font-family: var(--font-sans);
    font-size: var(--fs-h1);
    font-weight: 700;
    margin-bottom: 0.5rem;
    line-height: var(--lh-heading);
    color: var(--text);
}

h2 {
    font-family: var(--font-sans);
    font-size: var(--fs-h2);
    font-weight: 600;
    margin-bottom: var(--title-gap);
    line-height: var(--lh-heading);
    color: var(--text);
}

h3 {
    font-family: var(--font-sans);
    font-size: var(--fs-h3);
    font-weight: 600;
    margin-bottom: var(--space-2);
    margin-top: 1.25rem;
    line-height: var(--lh-heading);
    color: var(--text);
}

h3:first-child {
    margin-top: 0;
}


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

.hero {
    padding: var(--space-3) 0 var(--space-2);
    margin-bottom: var(--section-gap);
    padding-bottom: var(--section-padding-bottom);
    border-bottom: 1px solid var(--border);
}

.hero-content {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 1rem;
    align-items: start;
}

.hero-left {
    min-width: 0;
}

.hero-right {
    display: flex;
    justify-content: flex-end;
    align-items: flex-start;
    flex-shrink: 0;
}

.hero h1 {
    margin-bottom: 0.25rem;
    text-align: left;
}

.tagline {
    font-size: 1rem;
    color: var(--muted);
    margin-bottom: 0.75rem;
    text-align: left;
    line-height: 1.4;
}

.hero-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.hero-icon-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    color: var(--text);
    text-decoration: none;
    border: 1px solid var(--border);
    border-radius: 6px;
    transition: all var(--transition);
    background-color: transparent;
}

.hero-icon-link:hover,
.hero-icon-link:focus {
    color: var(--accent);
    border-color: var(--accent);
    background-color: rgba(139, 115, 85, 0.05);
    outline: none;
}

.hero-icon-link svg {
    width: 18px;
    height: 18px;
}

.hero-photo {
    width: 120px;
    height: 120px;
    flex-shrink: 0;
    aspect-ratio: 1;
    border-radius: 12px;
    overflow: hidden;
    background-color: var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.photo-placeholder {
    color: var(--muted);
    font-family: var(--font-mono);
    font-size: 0.75rem;
    text-align: center;
    padding: 1rem;
    display: none;
    width: 100%;
    height: 100%;
    align-items: center;
    justify-content: center;
    line-height: 1.3;
}

/* Very small screens - stack layout */
@media (max-width: 359px) {
    .hero-content {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .hero-right {
        justify-content: flex-start;
    }
}

/* Medium screens - increase photo size */
@media (min-width: 700px) {
    .hero-photo {
        width: 140px;
        height: 140px;
    }
    
    .hero-content {
        gap: 1.5rem;
    }
}

/* Desktop Hero Layout */
@media (min-width: 900px) {
    .hero-content {
        gap: 4rem;
    }
    
    .hero-right {
        justify-content: flex-end;
    }
    
    .hero-photo {
        width: 160px;
        height: 160px;
    }
    
    .hero-icon-link {
        width: 40px;
        height: 40px;
    }
    
    .hero-icon-link svg {
        width: 20px;
        height: 20px;
    }
    
    .tagline {
        font-size: 1.1rem;
        margin-bottom: 1rem;
    }
    
    .hero-links {
        gap: 0.75rem;
        margin-top: 1rem;
    }
}


/* ============================================
   CONTENT SECTIONS
   ============================================ */

.content {
    max-width: 700px;
}

.content p {
    margin-bottom: 1rem;
    line-height: var(--lh-body);
}


/* Work Experience, Education & Places Lived - Minimal Entry Style */


/* NO BOXES: No background, no border-radius, no box-shadow, no padding that creates boxes */

.entry {
    margin-bottom: var(--entry-gap);
    padding-bottom: 0;
    /* No borders between entries - only sections have dividers */
    border: none;
    /* Explicitly ensure no box-like properties */
    background: transparent;
    border-radius: 0;
    box-shadow: none;
    outline: none;
    padding-top: 0;
    padding-left: 0;
    padding-right: 0;
}

.entry:last-child {
    margin-bottom: 0;
}


/* Entry Header: Title (left) + Dates (right) */

.entry-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: var(--entry-header-gap);
    gap: 1rem;
    flex-wrap: wrap;
}

.entry-title {
    font-family: var(--font-sans);
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text);
    margin: 0;
    flex: 1;
    min-width: 0;
}

.entry-dates {
    font-family: var(--font-mono);
    font-size: var(--fs-meta);
    color: var(--muted);
    white-space: nowrap;
    text-align: right;
}


/* Entry Meta: Company/Institution/Program info */

.entry-meta {
    font-size: 0.95rem;
    color: var(--muted);
    margin-bottom: 0.5rem;
    line-height: 1.5;
}


/* Entry Bullets: Simple list styling */

.entry-bullets {
    list-style: none;
    padding-left: 0;
    margin: 0;
}

.entry-bullets li {
    padding-left: 1.25rem;
    position: relative;
    margin-bottom: var(--bullet-gap);
    line-height: var(--lh-body);
    font-size: 0.95rem;
    color: var(--text);
}

.entry-bullets li::before {
    content: '•';
    position: absolute;
    left: 0.5rem;
    color: var(--muted);
    font-size: 0.75rem;
}

.entry-bullets li:last-child {
    margin-bottom: 0;
}


/* Responsive: Desktop layout - dates aligned right */

@media (min-width: 700px) {
    .entry-header {
        flex-wrap: nowrap;
        justify-content: space-between;
    }
    .entry-dates {
        flex-shrink: 0;
        margin-left: auto;
        min-width: 140px;
        text-align: right;
    }
    .entry-title {
        flex: 1;
        margin-right: 1rem;
    }
}

/* ============================================
   SIDE QUESTS
   ============================================ */
.side-quest-item {
    margin-bottom: var(--entry-gap);
}

/* ============================================
   TYPOGRAPHY SCALE - DESKTOP
   ============================================ */

@media (min-width: 900px) {
    :root {
        --fs-body: 1rem; /* Keep 16px */
        --fs-h1: 2.25rem; /* ~36px */
        --fs-h2: 1.625rem; /* ~26px */
        --fs-h3: 1.125rem; /* Keep 18px */

        --section-gap: 2rem; /* ~32px */
        --section-gap-last: 0.75rem;
        --divider-gap: 1.75rem; /* ~28px */
    }
}

.side-quest-item:last-child {
    margin-bottom: 0;
}

.side-quest-item p {
    margin-bottom: 1rem;
}

.embed-container {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%;
    /* 16:9 aspect ratio */
    height: 0;
    overflow: hidden;
    margin-bottom: 1rem;
    border-radius: 8px;
}

.embed-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* When embed-container holds the YouTube video grid, don't squash it (no fixed aspect box).
   Class is set in JS; :has() fallback for older setups. */
.embed-container.embed-container--video-grid,
.embed-container:has(.video-grid) {
    height: auto;
    padding-bottom: 0;
    overflow: visible;
}

/* SoundCloud: natural height, no card look – sits flush with page */
.embed-container--soundcloud {
    padding-bottom: 0;
    height: auto;
    min-height: 0;
    margin-bottom: 0.5rem;
    border-radius: 0;
    overflow: visible;
}

.embed-container--soundcloud iframe {
    position: relative;
    top: auto;
    left: auto;
    height: 300px;
}

.external-link {
    color: var(--accent);
    text-decoration: none;
    transition: color var(--transition);
    border-bottom: 1px solid transparent;
}

.external-link:hover,
.external-link:focus {
    color: var(--hover-accent);
    border-bottom-color: var(--hover-accent);
    outline: none;
}


/* Video Grid */

.video-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    margin-top: 1rem;
}

.video-card {
    /* No border or card styling - just the video */
    width: 100%;
}

.video-embed {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border-radius: 8px;
}

.video-embed iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

@media (min-width: 900px) {
    .video-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    /* Match gap below YouTube to gap below Music (SoundCloud) on desktop */
    .embed-container.embed-container--video-grid {
        margin-bottom: 0.5rem;
    }
    /* Tighter gap between YouTube and Music on desktop (first side-quest item only) */
    .content .side-quest-item:first-child {
        margin-bottom: 1rem;
    }
}


/* Photo Grid */

.photo-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    margin-top: 1rem;
}

.photo-item {
    position: relative;
    width: 100%;
    padding-bottom: 100%;
    /* Square aspect ratio */
    overflow: hidden;
    border-radius: 8px;
    cursor: pointer;
    transition: transform var(--transition);
}

.photo-item:hover {
    transform: scale(1.02);
}

.photo-item img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

@media (min-width: 600px) {
    .photo-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 900px) {
    .photo-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}


/* ============================================
   LIGHTBOX MODAL
   ============================================ */

.lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.lightbox.active {
    display: flex;
}

.lightbox-image {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    border-radius: 4px;
}

.lightbox-close {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    background: none;
    border: none;
    color: #fff;
    font-size: 2.5rem;
    cursor: pointer;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity var(--transition);
    z-index: 1001;
}

.lightbox-close:hover,
.lightbox-close:focus {
    opacity: 0.7;
    outline: 2px solid #fff;
    outline-offset: 2px;
}


/* Prevent body scroll when lightbox is open */

body.lightbox-open {
    overflow: hidden;
}


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

footer {
    text-align: center;
    padding: 1.5rem 1.5rem;
    border-top: 1px solid var(--border);
    margin-top: 2rem;
    color: var(--muted);
    font-size: 0.9rem;
}


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

@media (min-width: 600px) {
    main {
        padding: 3rem 2rem;
    }
    .hero {
        padding: 4rem 0 3rem;
    }
    h1 {
        font-size: 3rem;
    }
    h2 {
        font-size: 2.25rem;
        font-weight: 700;
    }
}

@media (min-width: 900px) {
    /* Subtle dot pattern background - desktop only */
    body {
        background-image: radial-gradient(circle, rgba(0, 0, 0, 0.03) 1px, transparent 1px);
        background-size: 20px 20px;
        background-position: 0 0;
    }
    main {
        padding: 3rem 2.5rem;
    }
    .hero {
        padding: 3rem 0 2rem;
    }
}