/* 
  Yuchen Gu Portfolio
  Clean, editorial aesthetic for PhD researcher / filmmaker / photographer
*/

/* ===== CSS Variables ===== */
:root {
  --color-bg: #ffffff;
  --color-text: #1a1a1a;
  --color-text-light: #6b6b6b;
  --color-text-muted: #999999;
  --color-border: #e5e5e5;
  --color-accent: #1a1a1a;
  
  --font-heading: 'Cormorant Garamond', Georgia, serif;
  --font-body: 'Source Sans 3', -apple-system, BlinkMacSystemFont, sans-serif;
  
  --max-width: 1200px;
  --spacing-xs: 0.5rem;
  --spacing-sm: 1rem;
  --spacing-md: 2rem;
  --spacing-lg: 4rem;
  --spacing-xl: 6rem;
  
  --transition: 0.3s ease;
}

/* ===== Reset & Base ===== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

body {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.7;
  color: var(--color-text);
  background-color: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
  transition: opacity var(--transition);
}

a:hover {
  opacity: 0.6;
}

/* ===== Typography ===== */
h1, h2, h3 {
  font-family: var(--font-heading);
  font-weight: 400;
  line-height: 1.2;
}

h1 {
  font-size: 2.5rem;
  letter-spacing: 0.02em;
}

h2 {
  font-size: 2rem;
  margin-bottom: var(--spacing-md);
}

h3 {
  font-size: 1.5rem;
  margin-bottom: var(--spacing-sm);
}

p {
  margin-bottom: var(--spacing-sm);
}

/* ===== Layout ===== */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--spacing-md);
}

/* ===== Header ===== */
.header {
  position: sticky;
  top: 0;
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
  z-index: 100;
  padding: var(--spacing-sm) 0;
}

.header-inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--spacing-md);
}

.nav {
  display: flex;
  gap: var(--spacing-md);
  justify-self: start;
}

.nav a {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 0.95rem;
  font-weight: 400;
  letter-spacing: 0.03em;
  padding: var(--spacing-xs) 0;
  position: relative;
}

.nav a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--color-text);
  transition: width var(--transition);
}

.nav a:hover::after,
.nav a.active::after {
  width: 100%;
}

.nav a:hover {
  opacity: 1;
}

.nav a.active {
  font-weight: 600;
}

.site-title {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.social-links {
  display: flex;
  gap: var(--spacing-sm);
  align-items: center;
  justify-self: end;
}

.social-links a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
}

.social-links svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

/* ===== Page Header ===== */
.page-header {
  text-align: center;
  padding: var(--spacing-xl) 0 var(--spacing-lg);
}

.page-header h1 {
  font-size: 3rem;
  font-weight: 700;
}

.page-header .subtitle {
  color: var(--color-text-light);
  font-size: 1.1rem;
  margin-top: var(--spacing-sm);
  font-style: normal;
}

/* ===== About Page ===== */
.about-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--spacing-xl);
  padding: var(--spacing-lg) 0 var(--spacing-xl);
  align-items: start;
}

.about-content {
  padding-top: var(--spacing-md);
}

.about-content .title {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  color: var(--color-text-light);
  margin-bottom: var(--spacing-lg);
  font-style: italic;
}

.about-content p {
  color: var(--color-text-light);
  margin-bottom: var(--spacing-md);
  text-align: center;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
}

.about-content a {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.about-content .email {
  margin-top: var(--spacing-lg);
  font-size: 0.95rem;
  color: var(--color-text-muted);
}

.about-image {
  position: relative;
}

.about-image img {
  width: 100%;
  height: auto;
  object-fit: cover;
}

.about-image .caption {
  text-align: center;
  color: var(--color-text-muted);
  font-size: 0.85rem;
  margin-top: var(--spacing-sm);
  font-style: italic;
}

/* ===== Gallery (Travel & Visual) ===== */
.gallery {
  padding: 0 0 var(--spacing-xl);
}

.gallery-intro {
  text-align: center;
  color: var(--color-text-light);
  max-width: 700px;
  margin: 0 auto var(--spacing-lg);
  font-size: 0.95rem;
}

.gallery-item {
  margin-bottom: var(--spacing-xl);
}

.gallery-item img {
  width: 100%;
  height: auto;
}

.gallery-item .caption {
  text-align: center;
  margin-top: var(--spacing-sm);
  color: var(--color-text-muted);
  font-size: 0.9rem;
}

.gallery-item .caption .location {
  display: block;
  color: var(--color-text-light);
  margin-bottom: 4px;
}

.gallery-item .caption .meta {
  font-size: 0.85rem;
}

/* ===== Research Page ===== */
.research-list {
  padding: 0 0 var(--spacing-xl);
}

.research-item {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: var(--spacing-lg);
  margin-bottom: var(--spacing-xl);
  align-items: start;
}


.research-item--text-only {
  grid-template-columns: 1fr;
}

.research-image img {
  width: 100%;
  height: auto;
  border-radius: 2px;
}

.research-content {
  padding-top: var(--spacing-sm);
}

.research-content h3 {
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 400;
  color: var(--color-text-light);
  margin-bottom: var(--spacing-md);
  line-height: 1.5;
}

.research-content h3 a {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.research-summary {
  color: var(--color-text-light);
  font-size: 0.92rem;
  line-height: 1.7;
  margin-bottom: var(--spacing-md);
  font-style: italic;
}

.research-content ul {
  list-style: none;
  color: var(--color-text-light);
  font-size: 0.95rem;
}

.research-content li {
  margin-bottom: var(--spacing-sm);
  padding-left: 1rem;
  position: relative;
}

.research-content li::before {
  content: '*';
  position: absolute;
  left: 0;
  color: var(--color-text-muted);
}

/* ===== Visual Page ===== */
.visual-section {
  margin-bottom: var(--spacing-xl);
}

.visual-section h3 {
  text-align: center;
  font-family: var(--font-body);
  font-size: 1.5rem;
  font-weight: 400;
  margin-bottom: var(--spacing-md);
}

.comparison-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  margin-bottom: var(--spacing-sm);
}

.comparison-grid img {
  width: 100%;
  height: auto;
}

.visual-caption {
  text-align: center;
  color: var(--color-text-muted);
  font-size: 0.9rem;
  margin-bottom: var(--spacing-sm);
}

.visual-description {
  text-align: center;
  color: var(--color-text-light);
  max-width: 800px;
  margin: 0 auto var(--spacing-lg);
  font-size: 0.95rem;
}

.credits {
  text-align: center;
  color: var(--color-text-muted);
  font-size: 0.9rem;
  line-height: 1.8;
  margin: var(--spacing-lg) 0;
}

.credits a {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.diagram-image {
  max-width: 800px;
  margin: var(--spacing-md) auto;
}

/* Instagram Embed */
.instagram-embed {
  display: flex;
  justify-content: center;
  margin: var(--spacing-lg) auto;
  max-width: 540px;
}

/* ===== Footer ===== */
.footer {
  text-align: center;
  padding: var(--spacing-lg) 0;
  border-top: 1px solid var(--color-border);
  margin-top: var(--spacing-xl);
  color: var(--color-text-muted);
  font-size: 0.85rem;
}

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

.animate-in {
  animation: fadeIn 0.6s ease forwards;
}

.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
.delay-3 { animation-delay: 0.3s; }

/* ===== Responsive ===== */
@media (max-width: 900px) {
  .about-layout {
    grid-template-columns: 1fr;
    gap: var(--spacing-lg);
  }
  
  .about-image {
    order: -1;
    max-width: 400px;
    margin: 0 auto;
  }
  
  .research-item {
    grid-template-columns: 1fr;
    gap: var(--spacing-md);
  }
  
}

@media (max-width: 700px) {
  :root {
    --spacing-lg: 3rem;
    --spacing-xl: 4rem;
  }

  .header-inner {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto;
    gap: var(--spacing-xs);
  }

  .site-title {
    font-size: 1.2rem;
    justify-self: start;
  }

  .social-links {
    justify-self: end;
  }

  .nav {
    grid-column: 1 / -1;
    width: 100%;
    justify-content: center;
    gap: var(--spacing-sm);
    padding-top: var(--spacing-xs);
    border-top: 1px solid var(--color-border);
  }

  .page-header h1 {
    font-size: 2.2rem;
  }

  .comparison-grid {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: 2rem;
  }
}

/* ===== Utility ===== */
.text-center {
  text-align: center;
}

.mt-lg {
  margin-top: var(--spacing-lg);
}

.mb-lg {
  margin-bottom: var(--spacing-lg);
}

/* ===== Landing Page ===== */
.landing-page {
  overflow-x: hidden;
}

.landing-page .header {
  position: fixed;
  width: 100%;
  background: transparent;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.landing-page .header-inner {
  color: white;
}

.landing-page .nav a {
  color: white;
}

.landing-page .nav a::after {
  background: white;
}

.landing-page .site-title {
  color: white;
}

.landing-page .social-links svg {
  fill: white;
}

.landing-sections {
  display: flex;
  flex-direction: column;
}

.landing-section {
  position: relative;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  cursor: pointer;
  text-decoration: none;
}

.landing-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  transition: transform 0.6s ease;
}

.landing-bg-visual {
  background-image: url('images/travel-alaska-aurora.jpg');
}

.landing-bg-research {
  background-image: url('images/research-lab.jpg');
}

.landing-bg-travel {
  background-image: url('images/travel-namibia-sossusvlei.jpg');
}

.landing-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.3);
  transition: background 0.4s ease;
}

.landing-title {
  position: relative;
  z-index: 2;
  font-family: var(--font-body);
  font-size: 1.8rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  color: white;
  text-transform: uppercase;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

/* Hover Effects */
.landing-section:hover .landing-bg {
  transform: scale(1.05);
}

.landing-section:hover .landing-overlay {
  background: rgba(0, 0, 0, 0.5);
}

.landing-section:hover .landing-title {
  opacity: 1;
  transform: translateY(0);
}

/* Mobile: Always show titles */
@media (max-width: 900px) {
  .landing-section {
    height: 50vh;
  }

  .landing-title {
    opacity: 1;
    transform: translateY(0);
  }

  .landing-page .header {
    position: relative;
    background: var(--color-text);
  }

  .landing-page .header-inner {
    border-bottom: 1px solid var(--color-border);
    color: white;
  }
}

@media (max-width: 700px) {
  .landing-section {
    height: 40vh;
  }

  .landing-title {
    font-size: 1.4rem;
  }
}
