/* ============================================
   GeoPACHA-AI — Design System
   Clean, minimal academic aesthetic
   ============================================ */

/* --- Custom Properties --- */
:root {
  /* Colors */
  --color-bg: #ffffff;
  --color-bg-alt: #f7f8f6;
  --color-bg-dark: #1a1f16;
  --color-text: #2c2c2c;
  --color-text-light: #5a5a5a;
  --color-text-muted: #8a8a8a;
  --color-accent: #5a7a3a;
  --color-accent-light: #e8ede3;
  --color-accent-dark: #3d5428;
  --color-border: #e2e2e2;
  --color-border-light: #f0f0f0;
  --color-white: #ffffff;

  /* Typography */
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-heading: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* Spacing */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 4rem;
  --space-4xl: 6rem;
  --space-5xl: 8rem;

  /* Layout */
  --max-width: 1200px;
  --max-width-narrow: 800px;
  --nav-height: 72px;

  /* Transitions */
  --transition: 0.2s ease;
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

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: var(--color-accent);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover {
  color: var(--color-accent-dark);
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 600;
  line-height: 1.3;
  color: var(--color-text);
}

h1 { font-size: 2.5rem; letter-spacing: -0.02em; }
h2 { font-size: 1.875rem; letter-spacing: -0.01em; }
h3 { font-size: 1.375rem; }
h4 { font-size: 1.125rem; }

p {
  margin-bottom: var(--space-lg);
}

p:last-child {
  margin-bottom: 0;
}

/* --- Utilities --- */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-xl);
}

.container--narrow {
  max-width: var(--max-width-narrow);
}

.text-center { text-align: center; }
.text-muted { color: var(--color-text-light); }

.section {
  padding: var(--space-4xl) 0;
}

.section--alt {
  background-color: var(--color-bg-alt);
}

.section-title {
  margin-bottom: var(--space-md);
}

.section-subtitle {
  color: var(--color-text-light);
  font-size: 1.125rem;
  margin-bottom: var(--space-2xl);
}

.dot-divider {
  display: flex;
  justify-content: center;
  padding: var(--space-lg) 0;
}

.dot-divider::before {
  content: '';
  display: block;
  width: 80px;
  height: 3px;
  background: var(--color-accent);
  border-radius: 2px;
}

/* ============================================
   NAVIGATION
   ============================================ */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--color-border-light);
  height: var(--nav-height);
  transition: box-shadow var(--transition);
}

.site-header.scrolled {
  box-shadow: 0 1px 8px rgba(0,0,0,0.06);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--nav-height);
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-xl);
}

.nav-logo img {
  height: 36px;
  width: auto;
}

.nav-links {
  display: flex;
  list-style: none;
  gap: var(--space-xs);
}

.nav-links a {
  display: block;
  padding: var(--space-sm) var(--space-md);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text-light);
  border-radius: 6px;
  transition: color var(--transition), background var(--transition);
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--color-accent);
  background: var(--color-accent-light);
}

/* Hamburger */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--space-sm);
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--color-text);
  margin: 6px 0;
  transition: transform var(--transition), opacity var(--transition);
}

.nav-toggle.open span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 6px);
}
.nav-toggle.open span:nth-child(2) {
  opacity: 0;
}
.nav-toggle.open span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -6px);
}

/* ============================================
   HERO
   ============================================ */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--color-white);
  overflow: hidden;
  margin-top: 0;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.hero-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(26, 31, 22, 0.55) 0%,
    rgba(26, 31, 22, 0.7) 100%
  );
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 900px;
  padding: var(--space-3xl) var(--space-xl);
}

.hero-logo {
  max-width: 500px;
  margin: 0 auto var(--space-xl);
}

.hero h1 {
  color: var(--color-white);
  font-size: 1.5rem;
  font-weight: 400;
  letter-spacing: 0.02em;
  margin-bottom: var(--space-xl);
  opacity: 0.95;
}

.hero-scroll {
  display: inline-block;
  margin-top: var(--space-xl);
  padding: var(--space-sm) var(--space-lg);
  border: 1px solid rgba(255,255,255,0.4);
  border-radius: 30px;
  color: var(--color-white);
  font-size: 0.875rem;
  font-weight: 500;
  transition: all var(--transition);
}

.hero-scroll:hover {
  background: rgba(255,255,255,0.15);
  border-color: rgba(255,255,255,0.6);
  color: var(--color-white);
}

/* Page hero (smaller, for inner pages) */
.page-hero {
  position: relative;
  padding: calc(var(--nav-height) + var(--space-2xl)) 0 var(--space-xl);
  background: var(--color-bg-dark);
  color: var(--color-white);
  text-align: center;
}

.page-hero--image {
  background-size: cover;
  background-position: center;
}

.page-hero--image::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(26, 31, 22, 0.7);
}

.page-hero .container {
  position: relative;
  z-index: 1;
}

.page-hero h1 {
  color: var(--color-white);
  margin-bottom: var(--space-md);
}

.page-hero p {
  color: rgba(255,255,255,0.8);
  font-size: 1.125rem;
  max-width: 600px;
  margin: 0 auto;
}

/* ============================================
   CARDS
   ============================================ */
.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-xl);
}

.card {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  background: var(--color-white);
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  transition: transform var(--transition), box-shadow var(--transition);
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.1);
}

.card-image {
  position: relative;
  aspect-ratio: 4/3;
  overflow: hidden;
}

.card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.card:hover .card-image img {
  transform: scale(1.03);
}

.card-body {
  padding: var(--space-lg) var(--space-xl);
}

.card-body h3 {
  margin-bottom: var(--space-sm);
}

.card-body p {
  color: var(--color-text-light);
  font-size: 0.9375rem;
}

.card-link {
  display: block;
  color: inherit;
}

.card-link:hover {
  color: inherit;
}

/* ============================================
   CONTENT SECTIONS
   ============================================ */
.content-section {
  padding: var(--space-4xl) 0;
}

.content-section + .content-section {
  padding-top: 0;
}

.prose {
  max-width: var(--max-width-narrow);
  margin: 0 auto;
  font-size: 1.0625rem;
  line-height: 1.8;
}

.prose h2 {
  margin-top: var(--space-3xl);
  margin-bottom: var(--space-lg);
}

.prose h3 {
  margin-top: var(--space-2xl);
  margin-bottom: var(--space-md);
}

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

.prose img {
  margin: var(--space-2xl) 0;
  border-radius: 8px;
}

.container--narrow .fade-in + .fade-in {
  margin-top: var(--space-lg);
}

.figure {
  margin: var(--space-3xl) 0;
}

.figure img {
  width: 100%;
  border-radius: 8px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}

.figure figcaption {
  margin-top: var(--space-sm);
  font-size: 0.875rem;
  color: var(--color-text-muted);
  text-align: center;
}

/* ============================================
   TEAM GRID
   ============================================ */
.team-section {
  margin-bottom: var(--space-3xl);
}

.team-section h2 {
  margin-bottom: var(--space-lg);
  padding-bottom: var(--space-sm);
  border-bottom: 2px solid var(--color-accent);
}

.team-section h3 {
  color: var(--color-accent);
  margin-bottom: var(--space-md);
  margin-top: var(--space-xl);
}

.team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-lg);
}

.team-member {
  padding: var(--space-lg);
  background: var(--color-bg-alt);
  border-radius: 8px;
  border-left: 3px solid var(--color-accent);
}

.team-member .name {
  font-weight: 600;
  font-size: 1rem;
  margin-bottom: var(--space-xs);
}

.team-member .role {
  font-size: 0.875rem;
  color: var(--color-text-light);
}

.region-group {
  margin-bottom: var(--space-2xl);
}

.region-group h3 {
  font-size: 1.125rem;
  color: var(--color-accent);
  margin-bottom: var(--space-md);
}

.surveyor-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: var(--space-sm);
}

.surveyor-list .team-member {
  padding: var(--space-md);
  border-left-width: 2px;
}

/* ============================================
   PUBLICATIONS
   ============================================ */
.pub-list {
  max-width: var(--max-width-narrow);
  margin: 0 auto;
}

.pub-year {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-accent);
  margin-top: var(--space-2xl);
  margin-bottom: var(--space-lg);
  padding-bottom: var(--space-sm);
  border-bottom: 1px solid var(--color-border);
}

.pub-entry {
  margin-bottom: var(--space-xl);
  padding-left: var(--space-lg);
  border-left: 2px solid var(--color-border-light);
}

.pub-entry:hover {
  border-left-color: var(--color-accent);
}

.pub-title {
  font-weight: 600;
  font-size: 1rem;
  line-height: 1.5;
  margin-bottom: var(--space-xs);
}

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

.pub-authors {
  font-size: 0.9375rem;
  color: var(--color-text-light);
  margin-bottom: var(--space-xs);
}

.pub-journal {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  font-style: italic;
}

/* ============================================
   FUNDING
   ============================================ */
.funding-list {
  list-style: none;
  max-width: var(--max-width-narrow);
  margin: 0 auto var(--space-3xl);
}

.funding-list li {
  padding: var(--space-md) 0;
  border-bottom: 1px solid var(--color-border-light);
  font-size: 1rem;
  line-height: 1.6;
}

.funding-list li:last-child {
  border-bottom: none;
}

.logo-grid {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: var(--space-3xl);
  padding: var(--space-2xl) 0;
}

.logo-grid img {
  height: 60px;
  width: auto;
  opacity: 0.7;
  transition: opacity var(--transition);
  filter: grayscale(30%);
}

.logo-grid img:hover {
  opacity: 1;
  filter: none;
}

/* ============================================
   FOOTER
   ============================================ */
.site-footer {
  background: var(--color-bg-dark);
  color: rgba(255,255,255,0.7);
  padding: var(--space-3xl) 0 var(--space-xl);
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-2xl);
  margin-bottom: var(--space-2xl);
}

.footer-brand p {
  font-size: 0.875rem;
  max-width: 350px;
  line-height: 1.6;
}

.footer-brand img {
  height: 32px;
  margin-bottom: var(--space-md);
  opacity: 0.9;
}

.footer-nav h4 {
  color: var(--color-white);
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: var(--space-md);
}

.footer-nav ul {
  list-style: none;
}

.footer-nav li {
  margin-bottom: var(--space-sm);
}

.footer-nav a {
  color: rgba(255,255,255,0.6);
  font-size: 0.875rem;
  transition: color var(--transition);
}

.footer-nav a:hover {
  color: var(--color-white);
}

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: var(--space-xl);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8125rem;
}

.footer-logos {
  display: flex;
  align-items: center;
  gap: var(--space-xl);
}

.footer-logos img {
  height: 36px;
  width: auto;
  opacity: 0.5;
  filter: brightness(2) grayscale(100%);
  transition: opacity var(--transition);
}

.footer-logos img:hover {
  opacity: 0.8;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1024px) {
  .card-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  :root {
    --nav-height: 60px;
  }

  h1 { font-size: 1.875rem; }
  h2 { font-size: 1.5rem; }

  .nav-toggle {
    display: block;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: var(--nav-height);
    left: 0;
    right: 0;
    background: var(--color-white);
    flex-direction: column;
    padding: var(--space-md);
    border-bottom: 1px solid var(--color-border);
    box-shadow: 0 4px 12px rgba(0,0,0,0.06);
  }

  .nav-links.open {
    display: flex;
  }

  .nav-links a {
    padding: var(--space-md);
    font-size: 1rem;
  }

  .card-grid {
    grid-template-columns: 1fr;
    gap: var(--space-lg);
  }

  .hero-logo {
    max-width: 280px;
  }

  .hero h1 {
    font-size: 1.125rem;
  }

  .section {
    padding: var(--space-3xl) 0;
  }

  .footer-inner {
    flex-direction: column;
    gap: var(--space-xl);
  }

  .footer-bottom {
    flex-direction: column;
    gap: var(--space-md);
    text-align: center;
  }

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

  .surveyor-list {
    grid-template-columns: 1fr;
  }

  .logo-grid {
    gap: var(--space-xl);
  }

  .logo-grid img {
    height: 44px;
  }
}

/* ============================================
   LIGHTBOX
   ============================================ */
.figure--zoomable img {
  cursor: zoom-in;
  transition: opacity var(--transition);
}

.figure--zoomable img:hover {
  opacity: 0.85;
}

.lightbox-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: zoom-out;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.lightbox-overlay.active {
  opacity: 1;
  visibility: visible;
}

.lightbox-overlay img {
  max-width: 92vw;
  max-height: 92vh;
  border-radius: 4px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.4);
  transform: scale(0.95);
  transition: transform 0.3s ease;
}

.lightbox-overlay.active img {
  transform: scale(1);
}

/* ============================================
   ANIMATIONS (subtle)
   ============================================ */
/* Fade-in elements are visible by default to prevent blank pages */
.fade-in {
  opacity: 1;
  transform: translateY(0);
}
