/* ===================================================
   NAPF Website - Main Stylesheet
   National Advanced Photonics Facility
   =================================================== */

/* ---- CSS Variables / Brand Colors ---- */
:root {
  --napf-navy: #233b6b;
  --napf-mid-blue: #315ea6;
  --napf-sky: #2eb2e4;
  --napf-deep-navy: #17284a;
  --napf-ink: #263655;
  --napf-slate: #455775;
  --napf-cloud: #eef3f9;
  --napf-surface: #f7f9fc;
  --napf-white: #ffffff;
  --napf-text-dark: #1e2f4f;
  --napf-text-muted: #4f6181;
  --font-sans: 'Manrope', sans-serif;
  --font-display: 'Space Grotesk', sans-serif;
  --shadow-soft: 0 10px 35px rgba(35, 59, 107, 0.1);
  --shadow-lift: 0 18px 40px rgba(35, 59, 107, 0.16);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  color: var(--napf-text-dark);
  background-color: var(--napf-white);
  background-image: radial-gradient(circle at 15% 15%, rgba(49, 94, 166, 0.08), transparent 32%),
                    radial-gradient(circle at 85% 20%, rgba(46, 178, 228, 0.09), transparent 35%);
  line-height: 1.6;
}

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

a {
  color: var(--napf-mid-blue);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--napf-sky);
}

/* ---- Navigation ---- */
.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem clamp(1rem, 4vw, 2.4rem);
  background: rgba(255, 255, 255, 0.9);
  border-bottom: 1px solid rgba(35, 59, 107, 0.08);
  box-shadow: 0 10px 24px rgba(23, 40, 74, 0.08);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 100;
}

.navbar__logo {
  display: flex;
  align-items: center;
}

.navbar__logo img {
  height: clamp(48px, 7vw, 64px);
  width: auto;
}

.navbar__links {
  display: flex;
  list-style: none;
  gap: 2rem;
}

.navbar__links a {
  font-size: 0.92rem;
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--napf-ink);
  letter-spacing: 0.02em;
  padding: 0.25rem 0;
  border-bottom: 2px solid transparent;
  transition: border-color 0.2s ease, color 0.2s ease;
}

.navbar__links a:hover,
.navbar__links a.is-active {
  color: var(--napf-mid-blue);
  border-bottom-color: var(--napf-sky);
}

/* ---- Hero Section ---- */
.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: clamp(4.8rem, 8vw, 7rem) 2rem clamp(3.8rem, 6vw, 5.4rem);
  position: relative;
  overflow: hidden;
  background: linear-gradient(140deg, #f6f9ff 0%, #e9f1fb 52%, #e6f6fd 100%);
}

.hero::before,
.hero::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}

.hero::before {
  width: 380px;
  height: 380px;
  right: -120px;
  top: -160px;
  background: radial-gradient(circle, rgba(46, 178, 228, 0.28), rgba(46, 178, 228, 0));
}

.hero::after {
  width: 360px;
  height: 360px;
  left: -150px;
  bottom: -210px;
  background: radial-gradient(circle, rgba(49, 94, 166, 0.26), rgba(49, 94, 166, 0));
}

.hero__logo {
  width: min(680px, 92%);
  margin-bottom: 1.5rem;
  filter: drop-shadow(0 12px 22px rgba(35, 59, 107, 0.12));
  animation: rise-in 0.8s ease both;
}

.hero__tagline {
  font-size: clamp(1.05rem, 2.4vw, 1.28rem);
  color: var(--napf-slate);
  font-weight: 500;
  max-width: 600px;
  margin-bottom: 2rem;
  position: relative;
  z-index: 1;
  animation: rise-in 0.95s ease both;
}

.hero__cta {
  display: inline-block;
  background: linear-gradient(125deg, var(--napf-navy) 0%, var(--napf-mid-blue) 58%, var(--napf-sky) 100%);
  color: var(--napf-white);
  padding: 0.9rem 2.6rem;
  border-radius: 999px;
  box-shadow: 0 12px 28px rgba(35, 59, 107, 0.28);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
  position: relative;
  z-index: 1;
  animation: rise-in 1.1s ease both;
}

.hero__cta:hover {
  opacity: 0.95;
  transform: translateY(-2px);
  box-shadow: 0 16px 30px rgba(35, 59, 107, 0.34);
  color: var(--napf-white);
}

/* ---- Section Shared ---- */
.section {
  padding: clamp(3.5rem, 6vw, 5rem) 2rem;
}

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

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

.section__title {
  font-size: clamp(1.65rem, 4vw, 2.25rem);
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--napf-deep-navy);
  letter-spacing: 0.01em;
  margin-bottom: 1rem;
  text-align: center;
}

.section__title::after {
  content: '';
  display: block;
  width: 78px;
  height: 4px;
  background: linear-gradient(90deg, var(--napf-mid-blue), var(--napf-sky));
  margin: 0.75rem auto 0;
  border-radius: 999px;
}

.section__subtitle {
  text-align: center;
  color: var(--napf-text-muted);
  max-width: 680px;
  margin: 0 auto 3rem;
  font-size: 1.05rem;
}

/* ---- About ---- */
.about__content {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: clamp(1.4rem, 5vw, 3rem);
  align-items: center;
}

.about__text p {
  color: var(--napf-text-muted);
  margin-bottom: 1rem;
  font-size: 1rem;
}

.about__logo-wrap {
  display: flex;
  justify-content: center;
  padding: 1.25rem;
  border-radius: 20px;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.95), rgba(238, 243, 249, 0.95));
  border: 1px solid rgba(35, 59, 107, 0.08);
  box-shadow: var(--shadow-soft);
}

.about__logo-wrap img {
  width: min(470px, 100%);
}

/* ---- Services / Cards ---- */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
}

.card {
  background: var(--napf-white);
  border-radius: 16px;
  padding: 2rem;
  box-shadow: var(--shadow-soft);
  border: 1px solid rgba(35, 59, 107, 0.07);
  position: relative;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  animation: rise-in 0.7s ease both;
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, var(--napf-mid-blue), var(--napf-sky));
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lift);
}

.cards .card:nth-child(2) {
  animation-delay: 0.06s;
}

.cards .card:nth-child(3) {
  animation-delay: 0.12s;
}

.cards .card:nth-child(4) {
  animation-delay: 0.18s;
}

.cards .card:nth-child(5) {
  animation-delay: 0.24s;
}

.cards .card:nth-child(6) {
  animation-delay: 0.3s;
}

.card__icon {
  font-size: 2.1rem;
  margin-bottom: 1rem;
}

.card__title {
  font-size: 1.2rem;
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--napf-deep-navy);
  margin-bottom: 0.6rem;
}

.card__text {
  color: var(--napf-text-muted);
  font-size: 0.95rem;
}

/* ---- Collaborators ---- */
.partners {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
  align-items: stretch;
}

.partner-card {
  background: linear-gradient(155deg, #ffffff, #f4f8fc);
  border-radius: 14px;
  padding: 1.5rem;
  box-shadow: var(--shadow-soft);
  border: 1px solid rgba(35, 59, 107, 0.09);
}

.partner-card a {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 110px;
}

.partner-card__logo {
  max-height: 72px;
  width: auto;
}

/* ---- Generic Page Content ---- */
.page-content__body {
  max-width: 860px;
  margin: 0 auto;
  background: var(--napf-white);
  border-radius: 18px;
  padding: clamp(1.3rem, 4vw, 2rem);
  border: 1px solid rgba(35, 59, 107, 0.08);
  box-shadow: var(--shadow-soft);
}

.page-content__body p,
.page-content__body ul,
.page-content__body h2,
.page-content__body h3 {
  margin-bottom: 1rem;
}

.page-content__body h2 {
  color: var(--napf-deep-navy);
  margin-top: 2rem;
  font-family: var(--font-display);
}

.page-content__body h3 {
  color: var(--napf-mid-blue);
  margin-top: 1.5rem;
  font-family: var(--font-display);
}

.page-content__body ul {
  padding-left: 1.25rem;
}

.page-content__body li {
  margin-bottom: 0.5rem;
}

/* ---- Contact ---- */
.contact__info {
  text-align: center;
  color: var(--napf-text-muted);
  font-size: 1rem;
  line-height: 2;
}

.contact__info a {
  color: var(--napf-mid-blue);
  font-weight: 600;
}

.contact__info a:hover {
  color: var(--napf-sky);
}

/* ---- Footer ---- */
.footer {
  background: linear-gradient(165deg, #1b2f57 0%, #223b6d 52%, #244e86 100%);
  color: rgba(255, 255, 255, 0.8);
  text-align: center;
  padding: 2.25rem 2rem;
  font-size: 0.875rem;
}

.footer__logo {
  width: min(300px, 82%);
  margin: 0 auto 1rem;
  filter: brightness(0) invert(1.05);
  opacity: 0.95;
}

.footer__links {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  list-style: none;
  margin-bottom: 1rem;
}

.footer__links a {
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.875rem;
  transition: color 0.2s ease;
}

.footer__links a:hover {
  color: var(--napf-sky);
}

.footer__copy {
  margin-top: 0.5rem;
  font-size: 0.8rem;
  opacity: 0.6;
}

.footer__funding {
  margin-top: 1rem;
  display: flex;
  justify-content: center;
}

.footer__funding img {
  max-height: 50px;
  width: auto;
  background: rgba(255, 255, 255, 0.93);
  padding: 0.35rem 0.6rem;
  border-radius: 8px;
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(14px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
  .navbar {
    flex-direction: column;
    gap: 1rem;
    padding: 1rem;
  }

  .navbar__links {
    gap: 0.9rem 1.1rem;
    flex-wrap: wrap;
    justify-content: center;
  }

  .navbar__links a {
    font-size: 0.87rem;
  }

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

  .about__logo-wrap {
    order: -1;
  }

  .hero {
    padding: 4rem 1.5rem 3.5rem;
  }

  .section {
    padding: 3.4rem 1.25rem;
  }

  .card {
    padding: 1.6rem;
  }

  .page-content__body {
    border-radius: 14px;
    padding: 1.1rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
