@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&family=Source+Serif+4:opsz,wght@8..60,400;600&family=Roboto:wght@400;500;700&display=swap');

:root {
  --mint: rgb(186, 215, 205);
  --lilac: rgb(192, 182, 231);
  --ink: #3e3e3f;
  --dusk: #2f2d42;
  --sand: #f5f3eb;
  --card: rgba(255, 255, 255, 0.8);
  --border: rgba(17, 16, 26, 0.1);
  --radius: 18px;
  --shadow: 0 15px 40px rgba(0, 0, 0, 0.08);
}

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

h1, h2, h3 {
  text-align: center;
}

h1 {
  font-size: clamp(2rem, 4vw, 2.8rem);
  line-height: 1.15;
  font-variant: small-caps;
}

body {
  font-family: 'Space Grotesk', 'Helvetica Neue', Arial, sans-serif;
  color: var(--ink);
  background: linear-gradient(135deg, var(--mint), var(--lilac));
  min-height: 100vh;
  line-height: 1.6;
  padding: 0 18px 48px;
}

a {
  color: var(--dusk);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.nav-shell {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 0;
  backdrop-filter: blur(12px);
}

.brand-logo {
  height: 50px;
  width: auto;
}

nav {
  display: flex;
  gap: 18px;
}

nav a.current {
  font-weight: 700;
  color: var(--dusk);
}

nav a:hover {
  font-weight: 700;
  text-decoration: none;
}

main {
  max-width: 1100px;
  margin: 0 auto;
}

.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 36px;
  background: rgba(255, 255, 255, 0.55);
  border-radius: 28px;
  box-shadow: var(--shadow);
  margin-top: 12px;
}

.hero__text {
  text-align: center;
}

.facts-section {
  margin-top: 44px;
}

.facts-section h3 {
  font-family: 'Roboto', sans-serif;
  font-weight: 700;
  color: var(--ink);
}

.facts-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
  max-width: 1100px;
  margin: 0 auto;
}

.instrument-image img {
  width: 100%;
  height: auto;
  border-radius: var(--radius);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.1);
}

.hero__text h1 {
  font-size: clamp(1.8rem, 3.5vw, 2.4rem);
  margin: 10px 0 12px;
  line-height: 1.15;
  font-family: 'Roboto', sans-serif;
  font-weight: 700;
  background: linear-gradient(to bottom, #1e3a8a, #3b82f6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero__text h2 {
  font-size: clamp(1.8rem, 3.5vw, 2.4rem);
  margin: 10px 0 12px;
  line-height: 1.15;
}

.hero__text .lede {
  max-width: 560px;
  font-size: 1.04rem;
  margin: 0 auto;
}

.hero__card {
  background: var(--card);
  border-radius: 20px;
  padding: 18px 20px;
  border: 1px solid var(--border);
}

.hero__image img {
  width: 100%;
  height: auto;
  border-radius: var(--radius);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.1);
}

.panel {
  margin-top: 44px;
  padding: 32px;
  background: rgba(255, 255, 255, 0.7);
  border-radius: 24px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.panel.muted {
  background: rgba(255, 255, 255, 0.55);
}

.section-head h2 {
  font-size: clamp(1.6rem, 2.8vw, 2.2rem);
  margin-top: 6px;
}

.section-head {
  text-align: center;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  font-size: 0.78rem;
  color: var(--dusk);
}

.grid.two {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
  margin-top: 18px;
}

.grid.three {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
  margin-top: 18px;
}

.grid.four {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin-top: 18px;
}

.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 18px;
  border: 1px solid var(--border);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.04);
  position: relative;
  overflow: hidden;
  text-align: center;
}

.card:hover::before {
  content: '';
  position: absolute;
  top: -30px;
  right: -30px;
  width: 60px;
  height: 60px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Ccircle cx='50' cy='40' r='8' fill='none' stroke='%23000' stroke-width='2'/%3E%3Ccircle cx='70' cy='40' r='8' fill='none' stroke='%23000' stroke-width='2'/%3E%3Cpath d='M45 55 Q55 65 65 55' stroke='%23000' fill='none' stroke-width='2'/%3E%3Cpath d='M30 30 Q50 20 70 30' stroke='%23000' fill='none' stroke-width='2'/%3E%3C/svg%3E") no-repeat;
  z-index: 1;
  animation: pop 0.5s ease-out;
}

.card h3 {
  margin-bottom: 8px;
  font-family: 'Roboto', sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  text-transform: uppercase;
  text-align: center;
  border-bottom: 1px solid var(--dusk);
  padding-bottom: 8px;
  margin-bottom: 8px;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.metric {
  background: radial-gradient(circle at 20% 20%, rgba(186, 215, 205, 0.4), rgba(192, 182, 231, 0.4));
  border-radius: var(--radius);
  padding: 14px;
  border: 1px solid #e5e5e5;
  border-top: 1px solid #e5e5e5;
}

.metric span {
  display: block;
  font-weight: 600;
  font-size: 0.8rem;
  color: var(--dusk);
  text-transform: uppercase;
  text-align: center;
  font-family: 'Roboto', sans-serif;
  border-bottom: 1px solid var(--dusk);
  padding-bottom: 8px;
  margin-bottom: 8px;
}

.actions {
  display: flex;
  gap: 10px;
  margin-top: 14px;
  justify-content: center;
}

.progress-container {
  margin-top: 24px;
  text-align: center;
}

.progress-container h3 {
  margin-bottom: 12px;
  font-size: 1.2rem;
}

.progress-bar {
  width: 100%;
  height: 20px;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.progress-fill {
  height: 100%;
  background: radial-gradient(circle at 20% 20%, rgb(186, 215, 205), rgb(192, 182, 231));
  border-radius: 10px;
  transition: width 0.5s ease;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 11px 16px;
  border-radius: 999px;
  font-weight: 600;
  border: 1px solid var(--dusk);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.btn.primary {
  background: radial-gradient(circle at 20% 20%, rgb(186, 215, 205), rgb(192, 182, 231));
  color: var(--ink);
  box-shadow: 0 12px 24px rgba(47, 45, 66, 0.2);
}

.btn.ghost {
  background: transparent;
  color: var(--dusk);
}

.btn.ghost:hover {
  background: radial-gradient(circle at 20% 20%, rgb(186, 215, 205), rgb(192, 182, 231));
  color: var(--ink);
}

.btn.link {
  border: none;
  padding: 0;
  color: var(--dusk);
}

.btn:hover {
  transform: translateY(-1px);
  text-decoration: none;
}

.papers-list {
  margin-top: 36px;
}

.paper-item {
  margin-bottom: 24px;
  padding: 12px 16px;
  border-radius: var(--radius);
  background: rgba(0, 0, 0, 0.08);
}

.paper-item:last-child {
  margin-bottom: 0;
}

.paper-item p {
  color: var(--dusk);
  font-size: 0.9rem;
  line-height: 1.4;
  margin: 0;
}

.paper-item p a {
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease;
}

.paper-item p a:hover {
  border-bottom-color: var(--dusk);
}

.panel.contact {
  text-align: left;
}

footer {
  max-width: 1100px;
  margin: 28px auto 0;
  padding: 18px 0 30px;
  color: var(--dusk);
  font-size: 0.95rem;
}

.collaborators {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin: 10px 0;
}

.logos-row {
  display: flex;
  justify-content: space-around;
  gap: 10px;
  flex-wrap: wrap;
  width: 100%;
  margin-top: 40px;
}

.logo-card {
  width: 100px;
  height: 100px;
  background: white;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.person-img {
  width: 120px;
  height: 120px;
  object-fit: cover;
  object-position: center;
  margin-bottom: 10px;
  border-radius: var(--radius);
  margin-top: 5px;
}

/* pseudo-element hack for nonexistent person-img; works in Firefox but not Safari (which papers over bad image urls) */
/* modified from https://stackoverflow.com/a/980948 (CC BY-SA 4.0) */
.person-img::before {
  display: inline-block;
  background-image: url(images/TIME_logo.png);
  width: 120px;
  height: 120px;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: bottom;
}
/* end CSS code with CC BY-SA 4.0 licence for pseudo-element placeholder hack */

.logo {
  width: 70px;
  height: 70px;
  object-fit: contain;
  margin-bottom: 10px;
  border-radius: var(--radius);
  margin-top: 5px;
}

@keyframes pop {
  0% { transform: scale(0) rotate(-45deg); opacity: 0; }
  50% { transform: scale(1.2) rotate(0deg); opacity: 1; }
  100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

@media (max-width: 860px) {
  .hero {
    padding: 22px;
  }

  .facts-content {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .grid.four {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  }

  .logos-row {
    gap: 5px;
  }

  nav a {
    margin-left: 12px;
  }
}

@media (max-width: 600px) {
  body {
    padding: 0 12px 28px;
  }

  .nav-shell {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .panel,
  .hero {
    padding: 22px;
  }

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

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

  .logo-card {
    width: 80px;
    height: 80px;
  }

  .logo {
    width: 50px;
    height: 50px;
    margin-top: 3px;
  }
}

/* Publications section width */
#papers {
  max-width: 1100px;
  margin: 44px auto 0;
}

/* How-to page post-it notes */
.how-to-page .card {
  background: #fff1b8;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  position: relative;
  transform: rotate(-1deg);
  transition: transform 0.3s ease;
  overflow: visible;
}

.how-to-page .card:nth-child(odd) {
  transform: rotate(1deg);
}

.how-to-page .card:nth-child(3n) {
  transform: rotate(-0.5deg);
}

.how-to-page .card:hover {
  transform: rotate(5deg) scale(1.05);
  z-index: 10;
}

.how-to-page .card::before {
  content: '';
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  width: 24px;
  height: 24px;
  background: #374151;
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.how-to-page .card::after {
  content: '';
  position: absolute;
  top: -7px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 19px;
  background: #6b7280;
  border-radius: 2px;
}

/* Spectrometer images container */
.spectrometer-container {
  margin-top: 20px;
}

.spectrometer-images {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
}

.spectrometer-images img {
  max-width: 100%;
  height: auto;
  border-radius: 10px;
}

@media (max-width: 600px) {
  .spectrometer-images {
    flex-direction: column;
    gap: 15px;
  }
}
