/* Author: Gia Cat Nguyen Tran */

/* Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600&family=Inter:wght@400;500;600&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600&family=Inter:wght@400;500;600&family=IBM+Plex+Mono:wght@400;500&display=swap');

:root {
    /* ---------- Fonts ---------- */
    --font-display: "Manrope", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --font-body: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
    
    /* Font weights */
    --fw-regular: 400;
    --fw-medium: 500;
    --fw-semibold: 600;

    /* Line heights */
    --lh-heading: 1.2;
    --lh-body: 1.65;

    /* ---------- Color Palette ---------- */
    /* Base / Canvas */
    --color-bg-primary: #DFDACE;

    /* Text / Structure */
    --color-text-primary: #1F2430;
    /* deep ink navy */
    --color-text-secondary: #2B2A2F;
    /* warm charcoal */

    /* Accents */
    --color-accent-primary: #297CA5;
    /* muted blue */
    --color-accent-secondary: #8FB7A3;
    /* soft sage */
    --color-accent-micro: #C9A44C;
    /* soft ochre */

    /* ---------- UI Utilities ---------- */
    --color-border: rgba(31, 36, 48, 0.12);
    --color-border-strong: rgba(31, 36, 48, 0.2);
    --color-shadow: rgba(31, 36, 48, 0.08);

    /* Focus */
    --focus-ring: 0 0 0 3px rgba(41, 124, 165, 0.3);
}

/* General Styles */
main {
    box-sizing: border-box;
    width: 100%;
    height: auto;
    flex: 1;
}

html,
body {
    height: 100%;
    scroll-behavior: smooth;
}

body {
    display: flex;
    flex-direction: column;
    opacity: 0;
    transition: opacity 0.5s ease-in;
    font-family: var(--font-body);
    margin: 0;
    padding: 0;
    background-color: var(--color-bg-primary);
    color: var(--color-text-primary);
    box-sizing: border-box;
}

body.loaded {
    opacity: 1;
}

h1,
h2 {
    color: var(--color-text-primary);
    font-family: var(--font-display);
    line-height: var(--lh-heading);
}

h5 {
    margin-top: 20px;
    font-family: var(--font-body);
    font-weight: var(--fw-medium);
    color: var(--color-text-secondary);
}

a {
    text-decoration: none;
    color: inherit;
}

/* Navigation Bar */
.custom-navbar {
    background-color: var(--color-bg-primary);
}

.custom-navbar .nav-link {
    color: var(--color-text-primary) !important;
}


.navbar-nav .nav-link {
    transition: color 0.3s ease-in-out;
    font-family: var(--font-body);
    font-size: 1.1rem;
    font-weight: var(--fw-medium);
    letter-spacing: 0.12em;
    padding: 0.85rem 1.5rem;
}

.navbar-nav .nav-link:hover {
    color: var(--color-accent-primary) !important;
}

/* Navbar toggle: editorial "Menu" pill (replaces hamburger) */
.custom-navbar .navbar-toggler {
    border: 0;
    padding: 0;
}

/* The pill button */
.custom-navbar .menu-toggle {
    display: inline-flex;
    align-items: center;
    gap: 10px;

    padding: 10px 14px;
    border: 1px solid var(--color-border-strong);
    border-radius: 999px;

    background: transparent;
    color: var(--color-text-primary);

    font-family: var(--font-body);
    font-weight: var(--fw-medium);
    letter-spacing: 0.14em;
    text-transform: uppercase;
    font-size: 0.85rem;

    transition: transform 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.custom-navbar .menu-toggle:hover {
    border-color: var(--color-text-primary);
    color: var(--color-accent-primary);
    transform: translateY(-1px);
}

.custom-navbar .menu-toggle:focus {
    box-shadow: var(--focus-ring);
}

/* Micro mark (2 lines -> X when expanded) */
.custom-navbar .menu-mark {
    width: 18px;
    height: 12px;
    position: relative;
    display: inline-block;
}

.custom-navbar .menu-mark::before,
.custom-navbar .menu-mark::after {
    content: "";
    position: absolute;
    left: 0;
    width: 100%;
    height: 2px;
    background: currentColor;
    border-radius: 2px;
    transition: transform 0.2s ease, top 0.2s ease;
}

.custom-navbar .menu-mark::before {
    top: 2px;
}

.custom-navbar .menu-mark::after {
    top: 8px;
}

/* When menu is open */
.custom-navbar .menu-toggle[aria-expanded="true"] .menu-mark::before {
    top: 5px;
    transform: rotate(45deg);
}

.custom-navbar .menu-toggle[aria-expanded="true"] .menu-mark::after {
    top: 5px;
    transform: rotate(-45deg);
}

/* Buttons hover */
.btn-outline-light:hover {
    background-color: var(--color-accent-micro);
    border-color: var(--color-accent-micro);
    color: #fff;
}

.btn-outline-dark:hover {
    background-color: var(--color-accent-micro);
    border-color: var(--color-accent-micro);
    color: #fff;
}

.btn-dark:hover {
    background-color: var(--color-accent-micro);
    border-color: var(--color-accent-micro);
    color: #fff;
}

section {
    padding: 50px 10%;
    background-color: var(--color-bg-primary);
    /* kept same */
    text-align: center;
    box-sizing: border-box;
}

/* Hero Section */
.landing {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    box-sizing: border-box;
}

.landing-content {
    text-align: start;
    max-width: 500px;
}

.typing {
    font-size: 4rem;
    font-weight: var(--fw-semibold);
    font-family: var(--font-display);
    margin-bottom: 20px;

    display: inline-block;
    width: 0;
    max-width: max-content;
    white-space: nowrap;
    overflow: hidden;
    border-right: 3px solid var(--color-text-primary);
    animation:
        typing 3s steps(11, end) forwards,
        blink 0.7s step-end infinite;
}

@keyframes typing {
    from {
        width: 0;
    }

    to {
        width: 11ch;
    }
}

/* Cursor blinking effect */
@keyframes blink {
    50% {
        border-color: transparent;
    }
}

.landing-content p {
    font-size: 1.1rem;
    margin-bottom: 20px;
    font-family: var(--font-body);
    line-height: var(--lh-body);
    color: var(--color-text-secondary);
}

.cta-buttons {
    text-align: left;
    grid-column: 1;
}

.cta-button {
    display: inline-block;
    padding: 10px 20px;
    margin: 10px;
    border: 2px solid var(--color-text-primary);
    border-radius: 5px;
    color: var(--color-text-primary);
    background-color: transparent;
    transition: all 0.3s ease;
    font-weight: bold;
}

.cta-button:hover {
    background-color: var(--color-accent-micro);
    border-color: var(--color-accent-micro);
    color: #fff;
    transform: translateY(-3px) scale(1.05);
}

/* Message me button */
p a {
    color: var(--color-accent-primary);
    text-decoration: none;
    border-bottom: 1px solid currentColor;
    padding-bottom: 1px;
    transition: color 0.2s ease, border-color 0.2s ease;
}

p a:hover {
    color: var(--color-accent-micro);
    border-color: var(--color-accent-micro);
}

/* Floating image structure */
.landing-image {
    display: grid;
    grid-column: 2/3;
    grid-row: 1;
    justify-content: center;
    align-items: center;
    margin: auto;
    position: relative;
    /* Allow image stacking */
    width: 100%;
    max-width: 400px;
}

/* Original Image */
.landing-image img {
    width: 100%;
    max-width: 400px;
    display: block;
    animation: floatImage 3s ease-in-out infinite alternate;
    transition: opacity 0.3s ease-in-out;
}

/* Image Swap on Hover */
.landing-image img:hover {
    content: url('../media/myportrait-lefteyes.png');
    /* Change to new image */
}

/* Floating Animation */
@keyframes floatImage {
    from {
        transform: translateY(0);
    }

    to {
        transform: translateY(30px);
    }
}

/* Social Media Icons  */
.social-wrap {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* CTA button */
.social-cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-body);
    font-weight: var(--fw-medium);
    font-size: 0.95rem;
    color: var(--color-text-primary);
    padding: 8px 14px;
    background: transparent;
    transition: all 0.25s ease;
}

/* Arrow */
.social-cta .arrow {
    font-size: 1.1em;
    transform: translateY(-1px);
}

/* Hover */
.social-cta:hover {
    color: var(--color-accent-primary);
    border-color: var(--color-accent-primary);
    text-decoration: none;
}

.social-icons {
    display: flex;
    justify-content: start;
    /* Align icons horizontally in the center */
    gap: 20px;
    box-sizing: border-box;
    max-width: 400px;
}

.social-icons a {
    font-size: 2rem;
    color: var(--color-text-primary);
    transition: color 0.3s ease;
}

.social-icons a:hover {
    color: var(--color-accent-primary);
}

/* LinkedIn Hover Color */
.social-icons a:hover .fa-linkedin {
    color: #0073b1;
}

/* Behance Hover Color */
.social-icons a:hover .fa-behance {
    color: #1769ff;
}

/* Instagram Hover Color */
.social-icons a:hover .fa-instagram {
    color: #E1306C;
}

/* GitHub Hover Color */
.social-icons a:hover .fa-github {
    color: #d7d7d7;
}

/* Archive / Journal styling */
.section h2 {
    margin-bottom: 14px;
}

.section-intro {
    margin: 10px 0 18px;
}

  /* A small journal meta line under the title */
    .section-meta {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--color-text-secondary);
    opacity: 0.85;
    margin: 0 0 18px;
}

  /* Soft divider (journal vibe) */
.section-divider {
    height: 1px;
    background: var(--color-border);
    margin: 0 0 28px;
}

/* Projects Section */
/* Lab Section */
/* Shared Section Base (Projects + Lab) */
.section {
    max-width: 100%;
    padding-left: 10%;
    text-align: left;
    border-top: 1px solid var(--color-border-strong);
}

.section-intro {
    margin: 16px 0 48px;
    color: var(--color-text-secondary);
    font-family: var(--font-body);
}

.section-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.section-list li {
    margin-bottom: 28px;
}

.section-list a {
    display: inline-block;
    text-decoration: none;
    color: var(--color-text-primary);
    transition: transform 0.2s ease, color 0.2s ease;
}

.section-list a:hover {
    color: var(--color-accent-primary);
    transform: translateX(4px);
}

/* Title/Desc (used inside both sections) */
.project-title {
    font-family: var(--font-display);
    font-weight: var(--fw-medium);
}

.project-desc {
    font-family: var(--font-body);
    font-weight: var(--fw-regular);
    color: var(--color-text-secondary);
    margin-left: 4px;
}

/* Editorial project list */
.section-list li {
    position: relative;
    padding-left: 20px;
    /* space between line and text */
}

/* Vertical editorial line */
.section-list li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.2em;
    bottom: 0.2em;
    width: 1px;
    background-color: var(--color-border-strong);
    transition: background-color 0.2s ease, transform 0.2s ease;
    opacity: 0.9;
}


/* Hover focus: editorial emphasis */
.section-list li:hover::before {
    background-color: var(--color-text-primary);
    transform: translateX(2px);
    opacity: 1;
}

.section-list li:hover .project-title {
    color: var(--color-accent-primary);
}

/* Journal links: always feel like links */
.section-list a {
    text-decoration: underline;
    text-underline-offset: 0.18em;
    text-decoration-thickness: 1px;
    text-decoration-color: rgba(31, 36, 48, 0.35);
}

  /* visited = subtle, not purple (still journal-y) */
.section-list a:visited {
    text-decoration-color: rgba(31, 36, 48, 0.22);
    opacity: 0.95;
}

  /* hover = clearer underline + your accent */
.section-list a:hover {
    text-decoration-color: currentColor;
}

/* Tags */
.entry-tags {
    display: inline-block;
    margin-left: 10px;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--color-text-secondary);
    opacity: 0.85;
}


/* About Me */
.about-me {
    max-width: 100%;
    padding-left: 10%;
    text-align: left;
}

/* Footer */
footer {
    padding: 10px;
    text-align: center;
    width: 100%;
    box-sizing: border-box;
}

/* Responsive (Tablet + Mobile) */
/* Hide the toggle on desktop (lg and up) */
@media (min-width: 992px) {
    .custom-navbar .menu-toggle {
        display: none !important;
    }
}

@media (max-width: 768px) {

    /* General section spacing */
    section {
        padding: 50px 8%;
        text-align: center;
    }

    .section-list li {
        padding-left: 16px;
    }

    .section-list li::before {
        top: 0.1em;
        bottom: 0.1em;
    }

    /* Hero layout */
    .landing {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        text-align: left;
    }

    .landing-image {
        order: -1;
        margin-bottom: 40px;
        max-width: 320px;
    }

    .landing-content {
        max-width: 90%;
        text-align: left;
    }

    .typing {
        font-size: 3rem;
    }

    .cta-buttons {
        text-align: left;
    }

    /* Social icons */
    .social-wrap {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .social-wrap p {
        margin: 0;
    }

    .social-icons {
        justify-content: flex-start;
    }

    /* Editorial sections (Projects, Lab, About Me) */
    .section,
    .about-me {
        padding-left: 6%;
        padding-right: 6%;
        text-align: left;
    }

    .section-meta {
        font-size: 0.8rem;
        margin-bottom: 14px;
    }

    .section-divider {
        margin-bottom: 22px;
    }

    .entry-tags {
        display: block;
        margin-left: 0;
        margin-top: 6px;
    }

    .section h2,
    .about-me h2 {
        margin-bottom: 36px;
    }

    .section-intro {
        margin: 12px 0 36px;
    }

    /* Stack title + description for better wrapping */
    .project-title {
        display: block;
    }

    .project-desc {
        display: block;
        margin-left: 0;
        margin-top: 6px;
    }
}