:root {
  --bg: #f8fcff;
  --fg: #153944;
  --accent: #f69a4a;
  --sky: #d6ecff;
  --mint: #c8f0df;
  --border: rgba(21, 57, 68, 0.12);
  --shadow: 0 20px 48px rgba(21, 57, 68, 0.15);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--fg);
  background: radial-gradient(circle at 8% -10%, rgba(200, 240, 223, 0.6), transparent 45%),
              radial-gradient(circle at 92% 0%, rgba(214, 236, 255, 0.7), transparent 48%),
              linear-gradient(180deg, #ffffff 0%, var(--bg) 100%);
  min-height: 100vh;
  padding-top: 40px;
}

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

/* Header pieces specific to home */
.brand-logo {
  width: 220px;
  height: 220px;
  border-radius: 50%;
  object-fit: cover;
  position: absolute;
  left: 28px;
  top: -60px;
  border: 14px solid rgba(255, 255, 255, 0.95);
  box-shadow: 0 24px 48px rgba(21, 57, 68, 0.25);
  background: radial-gradient(circle at 50% 50%, rgba(255,255,255,0) 58%, rgba(255,255,255,0.95) 80%);
}

main {
  max-width: 1440px;
  margin: 0 auto;
  padding: 92px 28px 110px;
  display: grid;
  gap: 96px;
}

.hero {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 48px;
  align-items: flex-start;
}

/* Nudge Archaeology section down 20px below profile image */
#archaeology { margin-top: 20px; }

.hero-copy { display: grid; gap: 20px; }

.hero-copy h1 {
  margin: 0;
  font-size: clamp(2.8rem, 5vw, 4.2rem);
  letter-spacing: -0.02em;
  color: #0e2d34;
}

.hero-copy p {
  margin: 0;
  font-size: 1.1rem;
  color: rgba(21, 57, 68, 0.75);
  max-width: 520px;
  line-height: 1.55;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 22px;
  border-radius: 999px;
  border: 1px solid rgba(246, 154, 74, 0.4);
  background: rgba(246, 154, 74, 0.18);
  font-weight: 600;
  color: #a85f22;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.button:hover { transform: translateY(-2px); box-shadow: 0 14px 24px rgba(246, 154, 74, 0.28); }

.hero figure {
  margin: 0 120px 0 auto;
  border-radius: 36px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.96);
  max-width: 60%;
  box-shadow: 0 0 0 16px rgba(255, 255, 255, 0.92), 0 40px 70px rgba(21, 57, 68, 0.28);
  filter: drop-shadow(0 28px 45px rgba(21, 57, 68, 0.18));
  display: grid;
  gap: 12px;
}

.hero img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 1080px;
  object-fit: cover;
  border-radius: inherit;
}

.hero-caption {
  margin: 0;
  padding: 0 24px 24px;
  font-size: 0.95rem;
  font-style: italic;
  color: rgba(14, 45, 52, 0.75);
  text-align: center;
}

.hero-figure { position: relative; align-self: stretch; }
/* Lift the hero image container an extra 40px (20px more than before) */
.hero .hero-figure { margin-top: -60px; }

.rotator-image { transition: opacity 0.8s ease; }
.rotator-image.is-fading { opacity: 0; }

.section-head { display: grid; gap: 12px; }
.section-head h2 { margin: 0; font-size: clamp(2rem, 4vw, 3rem); color: #104651; }
.section-head p { margin: 0; color: rgba(21, 57, 68, 0.7); max-width: 600px; line-height: 1.6; }

.study-tree { display: grid; gap: 18px; }

.tree-node {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  border-radius: 999px;
  background: rgba(21, 57, 68, 0.08);
  border: 1px solid rgba(21, 57, 68, 0.18);
  font-weight: 600;
  color: #104651;
  text-decoration: none;
}

.tree-root { background: rgba(128, 209, 164, 0.2); border-color: rgba(128, 209, 164, 0.4); }

.tree-branch { display: grid; gap: 12px; padding-left: 28px; position: relative; }
.tree-branch::before { content: ''; position: absolute; left: 10px; top: 0; bottom: 0; border-left: 2px solid rgba(21, 57, 68, 0.15); }
.tree-branch .tree-node { position: relative; }
.tree-branch .tree-node::before { content: ''; position: absolute; left: -18px; top: 50%; width: 18px; border-top: 2px solid rgba(21, 57, 68, 0.15); }

.cards-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 28px; }

.placeholder-card {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 28px;
  display: grid;
  gap: 16px;
  box-shadow: 0 14px 32px rgba(21, 57, 68, 0.12);
  text-align: center;
}

.placeholder-card img { width: 100%; height: 160px; object-fit: cover; border-radius: 18px; }

footer {
  padding: 64px 28px 40px;
  text-align: center;
  color: rgba(21, 57, 68, 0.6);
  background: rgba(255, 255, 255, 0.92);
  border-top: 1px solid var(--border);
}

footer p { margin: 6px 0; }

/* Image modal (home only) */
.image-modal {
  position: fixed;
  inset: 0;
  background: rgba(10, 14, 26, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  z-index: 2000;
  backdrop-filter: blur(14px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.image-modal.is-visible { opacity: 1; pointer-events: auto; }

.image-modal img {
  max-width: min(90vw, 1400px);
  max-height: min(90vh, 900px);
  border-radius: 28px;
  box-shadow: 0 40px 90px rgba(5, 8, 16, 0.6);
  border: 10px solid rgba(255, 255, 255, 0.92);
}

.image-modal button {
  position: absolute;
  top: 28px;
  right: 40px;
  background: rgba(255, 255, 255, 0.85);
  color: #0e2d34;
  border: none;
  font-size: 1.2rem;
  padding: 10px 16px;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 18px 36px rgba(5, 8, 16, 0.25);
}

/* Mobile layout adjustments: put hero image above menu and avoid overlap */
@media (max-width: 768px) {
  /* Reduce top spacing so hero sits closer to header */
  main { padding-top: 48px; }
  .hero { grid-template-columns: 1fr; gap: 28px; }
  /* Make the image full-width and appear first */
  .hero figure { margin: 0; max-width: 100%; }
  .hero .hero-figure { order: -1; margin-top: 0; }
  /* Add a little space below the image before the tree */
  .hero .hero-figure + .hero-copy,
  .hero .hero-figure { margin-bottom: 18px; }
  /* Bring hero section up slightly on mobile */
  #archaeology { margin-top: 0; }
}
