/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Avenir', sans-serif;
    line-height: 1.6;
    color: #333;
    background-image: url('img/website_bg4.jpg');
    background-repeat: repeat-y;
    background-size: 100% auto;
    background-attachment: fixed;
    background-position: center 0px;
    min-height: 100vh;
    will-change: background-position;
}

.site-wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.site-header {
    position: static;
    top: auto;
    z-index: 100;
    background: none;
    padding-bottom: 15px;
    padding-top: 12px;
    padding-left: 1.5rem;
    padding-right: 1.5rem;
}

.site-header.scrolled {
    background: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    box-shadow: none;
}

.header-inner {
    max-width: 900px;
    margin: 0 auto;
    padding: 0;
}

.main-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
}

.brand {
    font-size: 1.8rem;
    font-weight: 700;
    color: #333;
    text-decoration: none;
    transition: color 0.3s ease;
}

.brand:hover {
    color: #667eea;
}

.nav-toggle {
    display: none;
    flex-direction: column;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
}

.nav-toggle {
    width: 40px;
    height: 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
}

.nav-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: #333;
    margin: 2px 0;
    transition: all 0.2s ease-in-out;
    transform-origin: center;
    border-radius: 2px;
    position: relative;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-list {
    display: flex;
    list-style: none;
    gap: 1rem;
    margin: 0;
}

.nav-link {
    color: #333;
    text-decoration: none;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.nav-link:hover,
.nav-link.active {
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
}

.social-links {
    display: flex;
    gap: 0.1rem; /* tighter spacing between icons */
}

.social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    color: #666;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.social-link:hover {
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
    transform: translateY(-2px);
}

.social-link svg {
    fill: currentColor;
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 1.5rem 1.5rem;
}

.content-inner {
    max-width: 900px;
    margin: 0 auto;
}

.about-content {
    background-color: rgba(255, 255, 255, 0.5); /* 50% transparent base */
    backdrop-filter: blur(3px) saturate(180%);
    -webkit-backdrop-filter: blur(3px) saturate(180%);
    border-radius: 20px;
    padding: 3rem;
    /* box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.3),
        inset 0 -1px 0 rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2); */
    position: relative;
    overflow: hidden;
    /* default positions for glow */
    --glowX: 50%;
    --glowY: 0%;
    background-image:
        radial-gradient(600px 350px at var(--glowX) var(--glowY), rgba(255,255,255,0.18), rgba(255,255,255,0) 60%),
        linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.0));
}

.about-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
}

.about-content::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 1px;
    height: 100%;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.4), transparent);
}

.about-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.about-header h1 {
    font-size: 2.5rem;
    color: #333;
    font-weight: 700;
}

/* Make about-body use normal flow so text can wrap around a floated image */
.about-body {
    display: block;
}

/* Portrait image that allows text to wrap and then continue full-width */
.about-photo {
    float: left;
    width: min(250px, 30vw);
    height: auto;
    border-radius: 8px;
    margin: 0 2rem 1.5rem 0; /* increased spacing for better text flow */
    -webkit-user-drag: none;
}

/* On small screens, stack image above text (no float) */
@media (max-width: 640px) {
    .about-photo {
        float: none;
        display: block;
        margin: 0 auto 2rem auto;
        width: min(280px, 70vw);
        border-radius: 10px;
    }
}

.profile-pic {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid rgba(102, 126, 234, 0.2);
    transition: transform 0.3s ease;
}

.profile-pic:hover {
    transform: scale(1.05);
}

.bio-content {
    flex: 1;
}

.bio-content p {
    margin-bottom: 1.5rem;
    font-size: 1rem;
    line-height: 1.7;
    color: #555;
}

p {
    font-size: 1.1rem;
}

.bio-content p:last-child {
    margin-bottom: 0;
}

.bio-content a {
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.bio-content a:hover {
    color: #5a67d8;
    text-decoration: underline;
}

.bio-content h2 {
    color: #667eea;
    font-size: 1.5rem;
    font-weight: 600;
    margin: 2rem 0 1rem 0;
    border-bottom: 2px solid rgba(102, 126, 234, 0.2);
    padding-bottom: 0.5rem;
}

.bio-content h2:first-child {
    margin-top: 0;
}

.bio-content h3 {
    color: #333;
    font-size: 1.2rem;
    font-weight: 600;
    margin: 1.5rem 0 0.75rem 0;
}

/* Footer */
.site-footer {
    background: transparent !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    border: 0 !important;
    padding: 2rem 0;
    text-align: center;
}

.footer-inner {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 2rem;
}

.site-footer p {
    color: #000;
    font-size: 0.9rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav-toggle {
        display: flex;
    }

    .about-content {
        padding: 2.5rem;
    }
    
    .main-nav {
        position: relative;
    }

    .nav-menu {
        position: absolute;
        top: calc(100% + 12px);
        right: 0;
        transform: translateY(-150%);
        background: rgba(255, 255, 255, 0.85);
        backdrop-filter: blur(8px);
        -webkit-backdrop-filter: blur(8px);
        flex-direction: column;
        padding: 1rem;
        border: 1px solid rgba(255, 255, 255, 0.3);
        border-radius: 12px;
        opacity: 0;
        visibility: hidden;
        transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    }
    
    .nav-menu.active {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }
    
    .nav-list {
        flex-direction: column;
        gap: 0.5rem;
        margin-bottom: 1rem;
    }
    
    .nav-link {
        padding: 0.75rem 1rem;
        display: block;
    }
    
    .social-links {
        justify-content: center;
    }
    
    .main-content {
        padding: 2rem 1rem;
    }
    
    .about-content {
        padding: 2rem 1.25rem;
        border-radius: 16px;
    }
    
    .about-header h1 {
        font-size: 1.8rem;
    }
    
    .about-body {
        grid-template-columns: 1fr;
        text-align: left; /* Keep text left-aligned */
        gap: 1.5rem;
    }
    
    .profile-pic {
        width: 150px;
        height: 150px;
        margin: 0 auto;
    }
    
    .bio-content {
        text-align: left;
    }
}

@media (max-width: 480px) {
    html {
        font-size: 14px;
    }
    
    .about-content {
        padding: 1.5rem;
    }

    .main-content {
        padding: 1.5rem 1rem;
    }
    
    .about-content {
        padding: 1.5rem 1rem;
        border-radius: 14px;
    }

    .about-header h1 {
        font-size: 1.6rem;
    }
    
    .profile-pic {
        width: 120px;
        height: 120px;
    }
    
    .bio-content p {
        font-size: 1rem;
        line-height: 1.6;
    }

    .bio-content h2 {
        font-size: 1.3rem;
    }

    .org-name {
        font-size: 1.1rem;
    }

    .role-title {
        font-size: 1rem;
    }
}

/* Animation for nav toggle */
.nav-toggle.active span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
    transition: transform 0.2s ease-in-out;
}

.nav-toggle.active span:nth-child(2) {
    opacity: 0;
    transform: scale(0);
    transition: all 0.1s ease-in-out;
}

.nav-toggle.active span:nth-child(3) {
    transform: translateY(-5px) rotate(-45deg);
    transition: transform 0.2s ease-in-out;
}

/* Loading animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.about-content {
    animation: fadeIn 0.6s ease-out;
}

/* Elegant enhancements */
:root {
    --primary: #667eea;
    --primary-600: #5a67d8;
    --text: #111;
}

/* Soft vignette to increase readability over background */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    background: radial-gradient(1200px 700px at 50% -10%, rgba(255,255,255,0) 40%, rgba(0,0,0,0.15) 100%);
    z-index: 0;
}

/* Brand subtle gradient on hover */
.brand {
    color: var(--text);
    background-image: linear-gradient(90deg, var(--text), var(--primary));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    transition: opacity 0.25s ease, filter 0.25s ease;
    filter: saturate(80%);
}

.site-header.scrolled .brand {
    /* Ensure adequate contrast on light background */
    filter: saturate(100%);
    opacity: 0.95;
}

/* Animated underline for nav links */
.nav-link {
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: -4px;
    height: 2px;
    background: currentColor;
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 220ms ease;
    opacity: 0.9;
}

.nav-link:hover::after,
.nav-link.active::after {
    transform: scaleX(1);
}

/* Refined social hover effect */
.social-link {
    transition: transform 0.2s ease, box-shadow 0.25s ease, background 0.25s ease;
}

.social-link:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
    background: rgba(102, 126, 234, 0.1);
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
    .site-header, .site-header.scrolled, .about-content {
        transition: none !important;
    }
}

/* Photography Page */
.photography-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    color: #fff; /* ensure header text is visible on varied backgrounds */
}

.search-bar {
    position: relative;
    flex: 1;
    max-width: 520px; /* keep a reasonable width */
}

/* Photography Page search input adjustments */
.search-input {
    width: 100%;
    padding: 0.9rem 1rem 0.9rem 2.5rem;
    border-radius: 10px;
    border: none; /* no border */
    background: #e9e9e9; /* grey background */
    color: #111; /* black text */
    font-family: 'Avenir', sans-serif; /* match paragraph font */
    font-size: 1rem; /* bigger text */
    outline: none;
    transition: background 0.2s ease;
}

.search-input::placeholder {
    color: #555; /* darker placeholder */
}

.search-input:focus {
    background: #e2e2e2; /* subtle change on focus */
}

.search-icon {
    position: absolute;
    top: 50%;
    left: 0.8rem;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    opacity: 0.8;
    fill: #111; /* black icon to match text */
}

.gallery {
    margin-top: 1.25rem;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px;
}

.photo-card {
    position: relative;
    border-radius: 14px;
    overflow: hidden;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.18);
    cursor: zoom-in;
    user-select: none;
    -webkit-user-drag: none;
    aspect-ratio: 4 / 3;
}

.photo-thumb {
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    filter: saturate(95%);
    transition: transform 0.25s ease, filter 0.25s ease;
    will-change: transform;
}

.photo-card:hover .photo-thumb {
    transform: scale(1.03);
    filter: saturate(105%);
}

.photo-meta {
    position: absolute;
    left: 10px;
    bottom: 10px;
    padding: 4px 8px;
    border-radius: 8px;
    background: rgba(0,0,0,0.35);
    color: #fff;
    font-size: 0.75rem;
}

/* Modal viewer */
.viewer-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4); /* ~60% transparent black overlay */
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 999;
    padding: 3.5vh 2vw;
}

.viewer-overlay.active { display: flex; }

.viewer-content {
    max-width: 1100px;
    width: 100%;
    display: grid;
    grid-template-rows: minmax(50vh, 68vh) auto;
    gap: 14px;
}

.viewer-image {
    border-radius: 16px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    background-color: transparent;
    -webkit-user-drag: none;
    user-select: none;
    position: relative;
}

.viewer-card {
    background: rgba(0, 0, 0, 0.8); /* ~20% transparent black caption */
    border: 1px solid rgba(255,255,255,0.18);
    border-radius: 14px;
    padding: 16px;
    color: #fff;
}

/* Navigation buttons */
.viewer-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255,255,255,0.85);
    color: #111;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 6px 16px rgba(0,0,0,0.12);
    transition: transform 0.2s ease, background 0.2s ease;
}
.viewer-nav:hover { transform: translateY(-50%) scale(1.05); background: #fff; }
.viewer-prev { left: -20px; }
.viewer-next { right: -20px; }

.viewer-close {
    position: absolute;
    top: 14px;
    right: 14px;
    background: rgba(255,255,255,0.85);
    color: #111;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s ease, background 0.2s ease;
}

.viewer-close:hover { transform: scale(1.05); background: #fff; }

/* Prevent simple downloads */
.photo-card, .viewer-image {
    -webkit-touch-callout: none; /* iOS */
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* Responsive */
@media (max-width: 700px) {
    .viewer-content { grid-template-rows: minmax(48vh, 56vh) auto; }
}

/* Work experience */
.work-experience {
  margin-top: 1.25rem;
  padding-left: 0.5rem;
  border-left: none;
}

.org + .org {
  margin-top: 1.75rem;
}

.org-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
}

.org-name {
  font-weight: 700;
  color: #111;
}

.org-location {
  color: #666;
  font-size: 0.9rem;
}

.role-list {
  list-style: none;
  margin: 0;
  padding: 0 0 0 1rem; /* slight indent from timeline */
  border-left: 1px solid rgba(0,0,0,0.12);
}

.role-item {
  position: relative;
  padding: 0.9rem 0 0.9rem 0.6rem; /* reduced left padding since dot is removed */
}

.role-item::before {
  content: none; /* remove dot */
  display: none;
}

.role-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 0.25rem;
}

.role-title {
  font-weight: 600;
  color: #222;
}

.role-dates {
  color: #555;
  font-size: 0.9rem;
  white-space: nowrap;
}

.role-duration {
  color: #777;
  margin-left: 0.25rem;
  font-size: 0.9rem;
}

.role-desc {
  margin: 0.4rem 0 0;
  color: #555;
}

/* Mobile stack */
@media (max-width: 640px) {
  .org-header { 
    flex-direction: column; 
    align-items: flex-start; 
    gap: 0.25rem;
  }
  .role-top { 
    flex-direction: column; 
    align-items: flex-start; 
    gap: 0.15rem;
  }
  .role-dates { 
    font-size: 0.95rem;
  }
  .role-list {
    padding-left: 0.75rem;
  }
  .role-item {
    padding: 0.75rem 0 0.75rem 0.5rem;
  }
}