@import url('https://fonts.googleapis.com/css2?family=Epilogue:wght@700&family=Be+Vietnam+Pro:wght@400;500;700&display=swap');

/* Base Styles & Typography */
:root {
    --primary: #03311C;
    --secondary: #05472A;
    --accent: #097343;
    --accent-light: #088C59;
    --text: #055437;
    --bg: #F8F9FA;
    --bg-light: #d0e3ca;
    --dark-green: #063D25;
}

html, body {
    overflow-x: hidden;
}

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

body {
    background-color: var(--bg);
    color: var(--text);
    line-height: 1.6;
    font-family: 'Be Vietnam Pro', sans-serif;
    position: relative;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Epilogue', sans-serif;
}

/* Navigation */
nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 5%;
    background: var(--primary);
    color: white;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(3, 49, 28, 0.3);
}

.logo {
    font-weight: bold;
    font-size: 1.2rem;
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 2rem;
}

.nav-links a {
    color: white;
    text-decoration: none;
    font-weight: bold;
    transition: color 0.3s ease;
    position: relative;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent);
    transition: width 0.3s ease;
}

.nav-links a:hover::after {
    width: 100%;
}

.nav-links a:hover {
    color: var(--accent);
}

/* Sections & Layout */
.section {
    padding: 5rem 5%;
    max-width: 1200px;
    margin: 0 auto;
}

.bg-light {
    background-color: #e8f5e9;
    max-width: 100%;
}

.hero {
    min-height: 80vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, var(--bg) 0%, var(--accent-light) 100%);
    position: relative;
    overflow: hidden;
    padding: 2rem 0;
    max-width: 100%;
}


.hero-content {
    display: flex;
    align-items: center;
    gap: 4rem;
    max-width: 100%;
    width: 100%;
    z-index: 1;
    position: relative;
    padding: 0 5%;
}

.hero-text {
    flex: 1;
    position: relative;
    z-index: 2;
    text-align: center;
}

.hero-image {
    flex: 0 0 300px;
}

.portrait-container {
  overflow: hidden;
  border-radius: 2rem;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  border: 5px solid var(--primary);
  box-shadow: 0 10px 30px rgba(3, 49, 28, 0.3);
  transform: rotate(5deg);
}

.portrait-container:hover {
  transform: rotate(0deg);
}

.portrait-image {
  width: 300px;
  height: auto;
  object-fit: cover;
  transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
  transform: scale(1.05);
}

.portrait-container:hover .portrait-image {
  transform: scale(1.095);
}

.hero h1 {
    font-size: 4rem;
    color: var(--primary);
    margin-bottom: 1rem;
}

.swoosh-in {
    animation: swooshFromLeft 1.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes swooshFromLeft {
    0% {
        opacity: 0;
        transform: translateX(-100px);
    }
    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

.hero p {
    font-size: 1.2rem;
    max-width: 700px;
    margin: 0 auto;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.8rem 1.5rem;
    background: var(--dark-green);
    color: white;
    text-decoration: none;
    border-radius: 5px;
    font-weight: bold;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    z-index: 10;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

.btn:hover {
    background: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(9, 115, 67, 0.4);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary);
    color: var(--primary);
}

.btn-outline:hover {
    background: var(--primary);
    color: white;
}

/* Timeline */
.timeline {
    margin-top: 2rem;
    border-left: 3px solid var(--accent);
    padding-left: 1.5rem;
    margin-left: 1rem; /* Added so the left side of the bullet doesn't clip off the screen */
}

.timeline-item {
    margin-bottom: 2rem;
    position: relative;
    transition: transform 0.3s ease;
}

.timeline-item:hover {
    transform: translateX(15px);
}

.timeline-item::before {
    content: '';
    position: absolute;
    /* Perfectly centers the bullet horizontally on the 3px border using calc() */
    left: calc(-1.5rem - 1.5px - 10.5px); 
    top: 0.25rem; /* Adjusted slightly for better vertical alignment with heading text */
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background-color: var(--accent);
    border: 3px solid #e8f5e9; /* Fixed the invalid var() syntax here */
}

.timeline-item h3 {
    color: var(--primary);
}

.timeline-item .date {
    font-size: 0.9rem;
    color: var(--secondary);
    margin-bottom: 0.5rem;
    font-weight: bold;
}

.timeline-item ul {
    padding-left: 0.5rem;
    list-style-position: inside;
    margin-top: 0.5rem;
}

/* Grid & Cards for Projects */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.card {
    background: #e8f5e9;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(3, 49, 28, 0.15);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    border: 2px solid transparent;
}

.card h3 {
    margin-bottom: 1rem;
    color: var(--primary);
}

.card:hover {
    transform: translateY(-10px) rotate(1deg);
    box-shadow: 0 12px 24px rgba(3, 49, 28, 0.25), 0 0 20px var(--accent-light);
    border-color: var(--accent-light);
}

.project-link {
    display: inline-block;
    margin-top: auto;
    padding-top: 1rem;
    color: var(--accent);
    text-decoration: none;
    font-weight: bold;
    transition: color 0.3s ease;
}

.project-link:hover {
    color: var(--secondary);
}

/* Poster Card & Interactive Sections */
.poster-card {
    background: #e8f5e9;
}

.poster-sections {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 1rem 0;
}

.poster-btn {
    background: var(--accent);
    color: white;
    border: none;
    padding: 0.6rem 1rem;
    border-radius: 5px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.85rem;
}

.poster-btn:hover {
    background: var(--secondary);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(5, 71, 42, 0.4);
}

.poster-btn:active {
    transform: translateY(0);
}

/* Poster Preview */
.poster-preview {
    margin-top: 1rem;
    cursor: pointer;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid var(--accent-light);
    transition: all 0.3s ease;
    position: relative;
}

.poster-preview:hover {
    border-color: var(--accent);
    box-shadow: 0 4px 12px rgba(8, 140, 89, 0.3);
}

.poster-thumbnail {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.3s ease;
}

.poster-preview:hover .poster-thumbnail {
    transform: scale(1.02);
}

.resume-links {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
    justify-content: center;
}

#resume .resume-links {
    justify-content: flex-start;
    margin-top: 2rem;
}

/* Resume Viewer */
.resume-viewer {
    margin-top: 2rem;
    border: 2px solid var(--accent-light);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(5, 71, 42, 0.1);
}

.resume-viewer iframe {
    width: 100%;
    height: 800px;
    border: none;
}

/* Contact Section */
.contact-container {
    display: flex;
    justify-content: center;
    gap: 3rem;
    margin-top: 2rem;
    flex-wrap: wrap;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 1.1rem;
}

.contact-item i {
    font-size: 2rem;
    color: var(--accent);
    transition: transform 0.3s ease;
}

.contact-item:hover i {
    transform: scale(1.1);
}

.contact-link {
    color: var(--text);
    text-decoration: none;
    position: relative;
    font-weight: 500;
}

.contact-link::after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--accent);
    transition: width 0.3s ease;
}

.contact-link:hover::after {
    width: 100%;
}

.contact-info {
    text-align: center;
    margin-top: 2rem;
}

footer {
    text-align: center;
    padding: 2rem;
    background: var(--primary);
    color: white;
}


/* Scroll Animation Classes */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.animate-on-scroll.visible {
    opacity: 1;
    transform: translateY(0);
}

/* New Liquid Flow Simulation Styles */
#liquid-flow-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100px; /* Adjust width as desired */
    height: 100%;
    z-index: 0; /* send it to the background */
}

#liquid-flow-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Responsive Design */
@media (max-width: 1024px) {
    #liquid-flow-container {
        display: none; /* Hide the animation on smaller screens */
    }
}

@media (max-width: 768px) {
    .nav-links {
        gap: 1rem;
        font-size: 0.9rem;
    }
    .hero h1 {
        font-size: 2.5rem;
    }
    .hero-content {
        flex-direction: column-reverse;
        gap: 2rem;
    }
    .hero-image {
        flex: 0 0 200px;
    }
    .profile-photo {
        width: 200px;
        height: 200px;
    }
    .resume-links {
        flex-direction: column;
    }
    .resume-viewer iframe {
        height: 600px;
    }
}

/* MEMS Section Styles */
.mems-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.mems-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.mems-item h4 {
    color: var(--primary);
    font-size: 1.1rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.mems-image-container {
    cursor: pointer;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid var(--accent-light);
    transition: all 0.3s ease;
    position: relative;
    width: 100%;
}

.mems-image-container:hover {
    border-color: var(--accent);
    box-shadow: 0 4px 12px rgba(8, 140, 89, 0.3);
}

.mems-image {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.3s ease;
}

.mems-image-container:hover .mems-image {
    transform: scale(1.02);
}
