/* =========================================================
   Imaginable Imaging — stylesheet
   ========================================================= */

:root {
  --blue: #58769c;
  --blue-dark: #3f5a7a;
  --navy: #223247;
  --ink: #282126;
  --gray-light: #d9d9d9;
  --gray-lighter: #eeeeee;
  --white: #ffffff;
  --imperial-blue: #0000cd;

  --font-heading: "Poppins", "Segoe UI", sans-serif;
  --font-body: "Nunito Sans", "Segoe UI", sans-serif;

  --container-w: 1200px;
  --section-pad: clamp(64px, 10vw, 140px);
  --radius: 28px;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; }
html {
  scroll-behavior: smooth;
}
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--white);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

h1, h2, h3 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.12;
  margin: 0 0 0.5em;
  letter-spacing: -0.01em;
}

p { margin: 0 0 1em; }

a { color: inherit; }

.container {
  max-width: var(--container-w);
  margin: 0 auto;
  padding: 0 32px;
}

/* ---------- Scroll progress bar ---------- */
.scroll-progress {
  position: fixed;
  top: 0; left: 0;
  height: 3px;
  width: 0%;
  background: linear-gradient(90deg, var(--blue), var(--imperial-blue));
  z-index: 2000;
  transition: width 0.1s linear;
}

/* ---------- Header / Nav ---------- */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  padding: 18px 0;
  background: transparent;
  transition: background 0.35s var(--ease), box-shadow 0.35s var(--ease), padding 0.35s var(--ease);
}
.site-header.scrolled {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(14px) saturate(160%);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  box-shadow: 0 4px 24px rgba(20, 30, 45, 0.08);
  padding: 12px 0;
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.05rem;
  text-decoration: none;
  color: var(--white);
  transition: color 0.35s var(--ease);
}
.site-header.scrolled .brand { color: var(--ink); }

.brand-mark {
  width: 14px;
  height: 14px;
  border-radius: 4px;
  background: linear-gradient(135deg, var(--blue), var(--imperial-blue));
  display: inline-block;
  flex-shrink: 0;
}

.nav-links {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 32px;
  margin: 0;
  padding: 0;
}
.nav-links a {
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--white);
  opacity: 0.92;
  transition: opacity 0.25s var(--ease), color 0.35s var(--ease);
  position: relative;
}
.site-header.scrolled .nav-links a { color: var(--ink); }
.nav-links a:not(.nav-cta):after {
  content: "";
  position: absolute;
  left: 0; bottom: -6px;
  width: 0%;
  height: 2px;
  background: currentColor;
  transition: width 0.25s var(--ease);
}
.nav-links a:not(.nav-cta):hover:after { width: 100%; }

.nav-cta {
  background: var(--white);
  color: var(--navy) !important;
  padding: 9px 20px;
  border-radius: 100px;
  font-size: 0.9rem !important;
  box-shadow: 0 2px 10px rgba(0,0,0,0.08);
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
.nav-cta:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(0,0,0,0.14); }

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  background: none;
  border: none;
  cursor: pointer;
  z-index: 1100;
}
.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--white);
  transition: transform 0.3s var(--ease), opacity 0.3s var(--ease), background 0.3s var(--ease);
}
.site-header.scrolled .nav-toggle span { background: var(--ink); }

/* ---------- Sections ---------- */
.section {
  position: relative;
  padding: var(--section-pad) 0;
  background: var(--blue);
  color: var(--white);
  overflow: hidden;
}
.section-light {
  background: var(--gray-light);
  color: var(--ink);
}
.section-light h2, .section-light h3 { color: var(--ink); }

.section-title {
  font-size: clamp(2rem, 4.2vw, 3rem);
  max-width: 720px;
  margin-bottom: 56px;
}

.eyebrow {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  opacity: 0.75;
  margin-bottom: 14px;
}

/* ---------- Hero ---------- */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding-top: calc(var(--section-pad) + 40px);
  background: radial-gradient(ellipse at 75% 20%, #6c8bb4 0%, var(--blue) 55%, var(--blue-dark) 100%);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 64px;
  align-items: center;
}
.hero-grid.reverse { grid-template-columns: 0.95fr 1.05fr; }
.hero-grid.reverse .hero-copy { order: 2; }
.hero-grid.reverse .hero-media { order: 1; }

.hero-copy h1 {
  font-size: clamp(2.3rem, 5vw, 3.6rem);
}
.hero-copy h2 {
  font-size: clamp(2rem, 4vw, 3rem);
}
.lead {
  font-size: 1.15rem;
  opacity: 0.95;
}
.section p {
  opacity: 0.92;
  font-size: 1.02rem;
  max-width: 560px;
}
.hero-tagline {
  font-size: 1.1rem;
  font-weight: 600;
  opacity: 1;
}

.hero-actions {
  display: flex;
  gap: 16px;
  margin-top: 28px;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 30px;
  border-radius: 100px;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease), background 0.3s var(--ease);
}
.btn-light {
  background: var(--white);
  color: var(--navy);
  box-shadow: 0 4px 18px rgba(0,0,0,0.12);
}
.btn-light:hover { transform: translateY(-3px); box-shadow: 0 10px 26px rgba(0,0,0,0.18); }
.btn-ghost {
  background: transparent;
  color: inherit;
  border: 1.5px solid rgba(255,255,255,0.55);
}
.section-light .btn-ghost { border-color: rgba(40,33,38,0.35); }
.btn-ghost:hover { background: rgba(255,255,255,0.12); transform: translateY(-3px); }
.section-light .btn-ghost:hover { background: rgba(0,0,0,0.06); }

.hero-media { position: relative; }
.media-card {
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 30px 70px -20px rgba(10, 20, 35, 0.45);
  aspect-ratio: 1 / 1;
  transform: translateZ(0);
}
.media-card img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.7s var(--ease);
}
.media-card:hover img { transform: scale(1.05); }

.scroll-cue {
  position: absolute;
  bottom: 36px;
  left: 50%;
  transform: translateX(-50%);
  width: 26px;
  height: 42px;
  border: 2px solid rgba(255,255,255,0.6);
  border-radius: 20px;
}
.scroll-cue span {
  position: absolute;
  top: 8px;
  left: 50%;
  width: 4px;
  height: 8px;
  background: #fff;
  border-radius: 2px;
  transform: translateX(-50%);
  animation: scrollcue 1.8s ease-in-out infinite;
}
@keyframes scrollcue {
  0% { opacity: 1; top: 8px; }
  70% { opacity: 0; top: 20px; }
  100% { opacity: 0; top: 20px; }
}

/* ---------- Cards (technology) ---------- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
}
.card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 24px 24px 30px;
  box-shadow: 0 20px 45px -22px rgba(30, 45, 65, 0.22);
  transition: transform 0.45s var(--ease), box-shadow 0.45s var(--ease);
}
.card:hover {
  transform: translateY(-8px);
  box-shadow: 0 30px 60px -22px rgba(30, 45, 65, 0.3);
}
.card-media {
  border-radius: calc(var(--radius) - 10px);
  overflow: hidden;
  aspect-ratio: 1 / 1;
  margin-bottom: 22px;
}
.card-media img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 0.6s var(--ease);
}
.card:hover .card-media img { transform: scale(1.06); }
.card h3 {
  font-size: 1.3rem;
  margin-bottom: 10px;
}
.card p {
  font-size: 0.96rem;
  opacity: 0.85;
  max-width: none;
  margin: 0;
}

/* ---------- Research papers ---------- */
.paper-grid {
  margin-top: 72px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 28px 48px;
}
.paper {
  padding-top: 26px;
  border-top: 2px solid rgba(40,33,38,0.12);
}
.paper h3 {
  font-size: 1.2rem;
  color: var(--blue-dark);
  margin-bottom: 10px;
}
.paper-authors {
  font-weight: 700;
  font-size: 0.92rem;
  margin-bottom: 4px;
  max-width: none;
}
.paper-venue {
  font-style: italic;
  font-weight: 700;
  font-size: 0.88rem;
  opacity: 0.7;
  margin-bottom: 12px;
}
.paper-tldr {
  font-size: 0.92rem;
  opacity: 0.82;
  max-width: none;
  margin: 0;
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--navy);
  color: var(--white);
}
.footer-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 28px;
  padding: 48px 32px;
}
.footer-imperial {
  height: 28px;
  width: auto;
  filter: brightness(0) invert(1);
  opacity: 0.95;
}
.footer-supported {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}
.supported-label {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.85rem;
  opacity: 0.75;
  white-space: nowrap;
}
.footer-logos {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.footer-logos img {
  height: 40px;
  width: auto;
  background: var(--white);
  border-radius: 10px;
  padding: 6px 12px;
}
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.12);
  text-align: center;
  padding: 18px 32px;
  background: var(--ink);
}
.footer-bottom p {
  margin: 0;
  font-size: 0.85rem;
  opacity: 0.75;
  max-width: none;
}

/* ---------- Reveal-on-scroll ---------- */
.reveal {
  opacity: 0;
  transform: translateY(36px);
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
  transition-delay: var(--delay, 0ms);
}
.reveal[data-reveal="left"] { transform: translateX(-48px); }
.reveal[data-reveal="right"] { transform: translateX(48px); }
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0) translateX(0);
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .scroll-cue span { animation: none; }
}

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .hero-grid, .hero-grid.reverse {
    grid-template-columns: 1fr;
  }
  .hero-grid .hero-copy, .hero-grid.reverse .hero-copy { order: 2; }
  .hero-grid .hero-media, .hero-grid.reverse .hero-media { order: 1; margin-bottom: 12px; }
  .hero-media .media-card { max-width: 460px; margin: 0 auto; }
  .card-grid { grid-template-columns: 1fr 1fr; }
  .paper-grid { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .nav-links {
    position: fixed;
    top: 0; right: 0;
    height: 100vh;
    width: min(320px, 78vw);
    background: var(--navy);
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 28px;
    padding: 40px;
    transform: translateX(100%);
    transition: transform 0.4s var(--ease);
  }
  .nav-links.open { transform: translateX(0); }
  .nav-links a { color: var(--white) !important; font-size: 1.1rem; }
  .nav-links a.nav-cta { color: var(--navy) !important; }
  .nav-toggle { display: flex; }
  .nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .nav-toggle.open span:nth-child(2) { opacity: 0; }
  .nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

  .card-grid { grid-template-columns: 1fr; }
  .section { padding: 72px 0; }
  .footer-top { flex-direction: column; align-items: flex-start; }
}
