@import url('https://fonts.googleapis.com/css2?family=Courier+Prime&family=Plus+Jakarta+Sans:wght@300;400;500;600;700&display=swap');

:root {
    --bg-paper: #f7f5f0;        /* Muted off-white/warm cream paper */
    --color-ink: #111111;       /* Deep charcoal/black */
    --color-pencil: rgba(0, 0, 0, 0.12); /* Faint pencil drawing gray */
    --color-gray: #6e6d68;      /* Mid-gray for secondary text */
    --color-highlight: rgba(255, 243, 110, 0.75); /* Soft yellow highlighter */
    --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --font-mono: 'Courier Prime', monospace;
}

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

body {
    background-color: var(--bg-paper);
    color: var(--color-ink);
    font-family: var(--font-sans);
    line-height: 1.5;
    overflow-x: hidden;
    min-height: 100vh;
    position: relative;
}

/* Interactive Grid Warp Canvas */
#grid-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1;
    pointer-events: none; /* clicks and events fall through to content layer */
    display: block;
    background-color: var(--bg-paper);
}

/* Tiled Paper Grain Overlay */
body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 9999;
    pointer-events: none;
    opacity: 0.045;
    background-image: url("data:image/svg+xml;utf8,<svg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'><filter id='noise'><feTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23noise)'/></svg>");
}

/* Main Layout Grid */
.portfolio-layout {
    display: flex;
    position: relative;
    z-index: 3; /* sits in front of the background garden and grid canvases */
    min-height: 100vh;
}

/* Sidebar navigation */
.sidebar {
    width: 280px;
    padding: 60px 40px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    border-right: 1px solid rgba(0, 0, 0, 0.04);
}


/* Sidebar Navigation menu */
.sidebar-nav ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 15px;
}
.sidebar-nav li a {
    color: var(--color-ink);
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    padding: 4px 0;
    transition: opacity 0.2s ease;
    opacity: 0.45;
}
.sidebar-nav li a:hover {
    opacity: 1;
}
.sidebar-nav li.active a {
    opacity: 1;
    position: relative;
    padding-left: 12px;
}
.sidebar-nav li.active a::before {
    content: "•";
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
}

/* Sidebar Bio */
.sidebar-bio {
    font-size: 0.8rem;
    line-height: 1.6;
}
.bio-name {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--color-ink);
    margin-bottom: 5px;
}
.bio-title, .bio-location {
    color: var(--color-gray);
    margin-bottom: 2px;
}
.bio-email, .bio-link {
    color: var(--color-gray);
    text-decoration: none;
    display: block;
    margin-top: 6px;
    border-bottom: 1px solid transparent;
    transition: all 0.2s ease;
    width: fit-content;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}
.bio-email:hover, .bio-link:hover {
    color: var(--color-ink);
    border-bottom: 1px solid var(--color-ink);
}

/* Main Content Area */
.main-content {
    margin-left: 280px;
    flex-grow: 1;
    padding: 60px 80px 160px 80px; /* bottom padding adjusted for smaller background garden */
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

/* Typography & Introductions */
.intro-section {
    max-width: 800px;
    margin-bottom: 40px;
}
.intro-text {
    font-size: 2.2rem;
    font-weight: 400;
    line-height: 1.35;
    letter-spacing: -0.01em;
    margin-bottom: 20px;
}
.intro-subtext {
    font-size: 2.2rem;
    font-weight: 400;
    line-height: 1.35;
    letter-spacing: -0.01em;
    margin-bottom: 30px;
}
.intro-callout {
    font-size: 1.35rem;
    font-weight: 400;
    line-height: 1.45;
    color: var(--color-ink);
}

/* Highlighter accents */
.highlight {
    background: linear-gradient(100deg, var(--color-highlight) 0%, rgba(255, 245, 140, 0.85) 100%);
    padding: 0 4px;
    border-radius: 2px;
    box-decoration-break: clone;
    -webkit-box-decoration-break: clone;
    display: inline;
}

/* Work / Projects Showcase Section */
.projects-showcase {
    max-width: 800px;
    margin-bottom: 60px;
}
.showcase-header {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    color: var(--color-gray);
    border-bottom: 1.5px solid rgba(0, 0, 0, 0.08);
    padding-bottom: 8px;
    margin-bottom: 20px;
}
.project-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 0;
    border-bottom: 1px dashed rgba(0, 0, 0, 0.06);
    font-size: 1rem;
    transition: all 0.25s ease;
}
.project-row:hover {
    padding-left: 10px;
    border-bottom-color: var(--color-ink);
    background: rgba(0, 0, 0, 0.005);
}
.project-idx {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--color-gray);
    width: 40px;
}
.project-name {
    flex-grow: 1;
    font-weight: 500;
}
.project-year {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--color-gray);
}

/* Digital Garden Styles */
.view-section {
    width: 100%;
}

.garden-intro {
    max-width: 800px;
}

.garden-workspace {
    display: flex;
    gap: 40px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.sketchpad-column {
    width: 280px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    flex-shrink: 0;
}

.metrics-column {
    flex-grow: 1;
    max-width: 420px;
    min-width: 280px;
}

.sketchpad-container {
    position: relative;
    width: 280px;
    height: 280px;
    background-color: #faf9f6;
    border: 1.5px dashed rgba(17, 17, 17, 0.15);
    border-radius: 4px;
    cursor: crosshair;
    overflow: hidden;
}

.sketchpad-container::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    background-image: 
        linear-gradient(to right, rgba(0, 0, 0, 0.02) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(0, 0, 0, 0.02) 1px, transparent 1px);
    background-size: 20px 20px;
    z-index: 1;
}

#sketchpad-canvas {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 2;
    background: transparent;
}

.sketchpad-instructions {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 0.8rem;
    color: var(--color-gray);
    pointer-events: none;
    font-family: var(--font-mono);
    opacity: 0.6;
    text-align: center;
    width: 80%;
    z-index: 1;
    transition: opacity 0.3s ease;
}

.garden-actions {
    display: flex;
    gap: 12px;
}

.btn-sketch {
    flex-grow: 1;
    font-family: var(--font-sans);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    padding: 10px 16px;
    background: none;
    border: 1.5px solid var(--color-ink);
    color: var(--color-ink);
    cursor: pointer;
    border-radius: 3px;
    transition: all 0.2s ease;
    background-color: var(--bg-paper);
    outline: none;
}

.btn-sketch:hover:not(:disabled) {
    background-color: var(--color-highlight);
    transform: translateY(-1px);
}

.btn-sketch:active:not(:disabled) {
    transform: translateY(1px);
}

.btn-sketch:disabled {
    opacity: 0.3;
    border-color: var(--color-gray);
    color: var(--color-gray);
    cursor: not-allowed;
}

.btn-primary {
    background-color: var(--color-ink);
    color: var(--bg-paper);
}

.btn-primary:hover:not(:disabled) {
    background-color: var(--color-highlight);
    color: var(--color-ink);
    border-color: var(--color-ink);
}

.btn-sketch-sm {
    font-family: var(--font-sans);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    padding: 6px 12px;
    background: none;
    border: 1px solid rgba(0, 0, 0, 0.15);
    color: var(--color-gray);
    cursor: pointer;
    border-radius: 2px;
    transition: all 0.2s ease;
    width: fit-content;
    outline: none;
}

.btn-sketch-sm:hover {
    border-color: var(--color-ink);
    color: var(--color-ink);
    background-color: rgba(0, 0, 0, 0.02);
}

.metrics-card {
    border: 1px solid rgba(17, 17, 17, 0.08);
    border-radius: 4px;
    padding: 15px;
    background-color: #faf9f6;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.01);
}

.metrics-header {
    font-weight: 700;
    color: var(--color-gray);
    border-bottom: 1px dashed rgba(0, 0, 0, 0.12);
    padding-bottom: 6px;
    margin-bottom: 12px;
    letter-spacing: 0.05em;
}

.metrics-body {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.metric-row {
    display: flex;
    justify-content: space-between;
}

.metric-val {
    font-weight: 700;
    color: var(--color-ink);
}

.metric-divider {
    height: 1px;
    border-bottom: 1px dashed rgba(0, 0, 0, 0.08);
    margin: 6px 0;
}

.highlight-metric {
    color: var(--color-ink);
    font-weight: 600;
}

.highlight-metric .metric-val {
    background-color: var(--color-highlight);
    padding: 0 4px;
    border-radius: 2px;
}

#garden-canvas {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 130px; /* height of background garden */
    z-index: 2; /* behind layout (3), in front of background grid (1) */
    pointer-events: auto; /* ENABLE pointer events for hitting flowers! */
    display: block;
    background: transparent;
    cursor: default;
}

/* Retro OS Inspector Window */
.window-inspector {
    position: fixed;
    width: 320px;
    background-color: #faf9f6;
    border: 1.5px solid var(--color-ink);
    border-radius: 4px;
    box-shadow: 4px 4px 0px var(--color-ink);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    user-select: none;
    font-family: var(--font-sans);
    transition: opacity 0.2s ease;
}

.window-header {
    background-color: #e8e6e0;
    border-bottom: 1.5px solid var(--color-ink);
    padding: 6px 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: move;
    touch-action: none;
    transition: background-color 0.15s ease;
}

.window-inspector.active .window-header {
    background-color: var(--color-highlight);
}

.window-title {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    color: var(--color-ink);
}

.window-controls {
    display: flex;
    align-items: center;
}

.window-btn-close {
    background: none;
    border: 1.5px solid var(--color-ink);
    width: 15px;
    height: 15px;
    font-size: 0.65rem;
    font-weight: 700;
    cursor: pointer;
    border-radius: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease;
    line-height: 1;
    color: var(--color-ink);
    padding: 0;
}

.window-btn-close:hover {
    background-color: rgba(17, 17, 17, 0.1);
}

.window-body {
    padding: 12px;
}

.window-layout {
    display: flex;
    gap: 12px;
}

.window-preview-column {
    width: 90px;
    height: 90px;
    border: 1px dashed rgba(17, 17, 17, 0.2);
    background-color: #f5f3ef;
    position: relative;
    border-radius: 3px;
    overflow: hidden;
    flex-shrink: 0;
}

.window-preview-column::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(to right, rgba(0,0,0,0.02) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(0,0,0,0.02) 1px, transparent 1px);
    background-size: 10px 10px;
    pointer-events: none;
    z-index: 1;
}

.window-flower-canvas {
    width: 90px;
    height: 90px;
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 2;
}

.window-info-column {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.flower-scientific-name {
    font-family: var(--font-mono);
    font-style: italic;
    font-size: 0.8rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--color-ink);
}

.window-stats {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    color: var(--color-gray);
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.window-stat-row {
    display: flex;
    justify-content: space-between;
}

.window-stat-val {
    font-weight: 700;
    color: var(--color-ink);
}

/* Collapse Button & Collapsed State */
.window-btn-collapse {
    background: none;
    border: 1.5px solid var(--color-ink);
    width: 15px;
    height: 15px;
    font-size: 0.65rem;
    font-weight: 700;
    cursor: pointer;
    border-radius: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease;
    line-height: 1;
    color: var(--color-ink);
    margin-right: 4px;
    padding: 0;
}

.window-btn-collapse:hover {
    background-color: rgba(17, 17, 17, 0.1);
}

.window-inspector.collapsed .window-body {
    display: none;
}

/* Window Action Buttons */
.window-actions {
    display: flex;
    gap: 6px;
    margin-top: 10px;
    border-top: 1px dashed rgba(17, 17, 17, 0.15);
    padding-top: 8px;
}

.window-action-btn {
    flex: 1;
    background-color: #faf9f6;
    border: 1.5px solid var(--color-ink);
    border-radius: 3px;
    font-family: var(--font-mono);
    font-size: 0.65rem;
    font-weight: 700;
    padding: 4px 0;
    cursor: pointer;
    transition: all 0.1s ease;
    color: var(--color-ink);
    box-shadow: 2px 2px 0px var(--color-ink);
}

.window-action-btn:hover {
    background-color: var(--color-highlight);
    transform: translate(-1px, -1px);
    box-shadow: 3px 3px 0px var(--color-ink);
}

.window-action-btn:active {
    transform: translate(1px, 1px);
    box-shadow: 1px 1px 0px var(--color-ink);
}

/* Go WASM Console Status */
.window-wasm-status {
    font-family: var(--font-mono);
    font-size: 0.55rem;
    color: #888275;
    margin-top: 6px;
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 2px 4px;
    border-radius: 2px;
    transition: color 0.15s ease, background-color 0.15s ease;
}

.window-wasm-status.flash {
    background-color: var(--color-highlight);
    color: var(--color-ink);
    font-weight: bold;
}

/* ===================================
   MOBILE HAMBURGER MENU BUTTON
   =================================== */
.mobile-menu-toggle {
    display: none; /* Hidden on desktop */
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    flex-direction: column;
    gap: 5px;
    z-index: 100;
}

.hamburger-line {
    display: block;
    width: 22px;
    height: 2px;
    background-color: var(--color-ink);
    border-radius: 1px;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

/* Animate hamburger to X when open */
.mobile-menu-toggle.open .hamburger-line:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}
.mobile-menu-toggle.open .hamburger-line:nth-child(2) {
    opacity: 0;
}
.mobile-menu-toggle.open .hamburger-line:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* ===================================
   MOBILE BRAND LABEL
   =================================== */
.mobile-brand {
    display: none; /* Hidden on desktop */
}

/* ===================================
   MOBILE FOOTER CONTACT
   =================================== */
.mobile-footer-contact {
    display: none; /* Hidden on desktop */
}

/* Responsive constraints */
@media (max-width: 1024px) {
    .portfolio-layout {
        flex-direction: column;
    }

    /* --- SIDEBAR becomes a sticky top bar --- */
    .sidebar {
        position: sticky;
        top: 0;
        width: 100%;
        border-right: none;
        border-bottom: 1px solid rgba(0, 0, 0, 0.08);
        padding: 16px 24px;
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        z-index: 100;
        background-color: var(--bg-paper);
        min-height: auto;
    }


    /* --- Hide bio in sidebar on mobile --- */
    .sidebar-bio {
        display: none;
    }

    /* --- Hamburger visible on mobile --- */
    .mobile-brand {
        display: block;
        order: 1;
    }

    .mobile-brand-name {
        font-size: 0.85rem;
        font-weight: 700;
        letter-spacing: 0.02em;
        color: var(--color-ink);
    }

    .mobile-menu-toggle {
        display: flex;
        order: 2;
    }

    /* --- Nav becomes a dropdown on mobile --- */
    .sidebar-nav {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background-color: var(--bg-paper);
        border-bottom: 1.5px solid rgba(0, 0, 0, 0.08);
        padding: 0 24px;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1),
                    padding 0.35s cubic-bezier(0.4, 0, 0.2, 1),
                    opacity 0.3s ease;
        opacity: 0;
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
    }

    .sidebar-nav.mobile-open {
        max-height: 300px;
        padding: 20px 24px;
        opacity: 1;
    }

    .sidebar-nav ul {
        flex-direction: column;
        gap: 0;
    }

    .sidebar-nav li a {
        display: block;
        padding: 14px 0;
        font-size: 0.85rem;
        border-bottom: 1px solid rgba(0, 0, 0, 0.04);
    }

    .sidebar-nav li:last-child a {
        border-bottom: none;
    }

    .sidebar-nav li.active a {
        padding-left: 16px;
    }

    /* --- Main content --- */
    .main-content {
        margin-left: 0;
        padding: 32px 24px 120px 24px;
    }
    .intro-text, .intro-subtext {
        font-size: 1.6rem;
    }
    
    /* Garden mobile styling */
    #garden-canvas {
        height: 95px;
    }
    .garden-workspace {
        flex-direction: column;
        gap: 25px;
    }
    .sketchpad-column {
        width: 100%;
        align-items: center;
    }
    .sketchpad-container {
        margin: 0 auto;
    }
    .garden-actions {
        width: 280px;
        margin: 0 auto;
    }
    .metrics-column {
        width: 100%;
        max-width: 450px;
        margin: 0 auto;
    }

    /* --- Mobile Footer Contact --- */
    .mobile-footer-contact {
        display: block;
        padding: 0 24px 140px 24px;
    }

    .footer-divider {
        height: 1.5px;
        background: linear-gradient(
            90deg,
            transparent 0%,
            rgba(0, 0, 0, 0.1) 20%,
            rgba(0, 0, 0, 0.1) 80%,
            transparent 100%
        );
        margin-bottom: 32px;
    }

    .footer-contact-content {
        text-align: center;
    }

    .footer-contact-content .bio-name {
        font-size: 1rem;
        margin-bottom: 6px;
    }

    .footer-contact-content .bio-title,
    .footer-contact-content .bio-location {
        color: var(--color-gray);
        font-size: 0.85rem;
        margin-bottom: 2px;
    }

    .footer-links {
        margin-top: 16px;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 8px;
    }

    .footer-links .bio-email,
    .footer-links .bio-link {
        color: var(--color-gray);
        text-decoration: none;
        font-size: 0.85rem;
        border-bottom: 1px solid transparent;
        transition: all 0.2s ease;
    }

    .footer-links .bio-email:hover,
    .footer-links .bio-link:hover {
        color: var(--color-ink);
        border-bottom-color: var(--color-ink);
    }
}

/* Retro Toast Notification */
.retro-toast-container {
    position: fixed;
    bottom: 145px; /* Positioned just above the garden-canvas (130px) */
    right: 24px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: none; /* Let clicks fall through unless hovering on a toast */
}

.retro-toast {
    pointer-events: auto; /* Clickable */
    background-color: var(--bg-paper);
    border: 1.5px solid var(--color-ink);
    border-radius: 4px;
    padding: 12px 18px;
    box-shadow: 4px 4px 0px var(--color-ink);
    font-family: var(--font-sans);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-ink);
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
    transform: translateY(30px);
    opacity: 0;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.3s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}

.retro-toast.show {
    transform: translateY(0);
    opacity: 1;
}

.retro-toast:hover {
    background-color: var(--color-highlight);
    transform: translateY(-2px);
    box-shadow: 6px 6px 0px var(--color-ink);
}

.retro-toast:active {
    transform: translateY(1px);
    box-shadow: 2px 2px 0px var(--color-ink);
}

@media (max-width: 900px) {
    .retro-toast-container {
        bottom: 110px; /* Positioned above the shorter garden (95px) on mobile */
        right: 16px;
        left: 16px;
        align-items: center;
    }
    .retro-toast {
        width: 100%;
        max-width: 320px;
        justify-content: center;
    }
}


