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

:root {
  /* Palette */
  --bg-primary: #000000;
  --bg-nav: rgba(10, 10, 10, 0.85);
  --text-primary: #ffffff;
  --text-secondary: #a0a0a0;
  --accent: #5ab0ff;          /* light blue accent */
  --accent-glow: rgba(90, 176, 255, 0.35);
  --border-subtle: rgba(255, 255, 255, 0.08);

  /* Spacing */
  --nav-height: 88px;
  --container-padding: clamp(1.25rem, 4vw, 3rem);

  /* Transitions */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ===== Navigation Bar ===== */
.navbar {
  position: sticky;
  top: 0;
  left: 0;
  width: 100%;
  min-height: var(--nav-height);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--container-padding);
  background: var(--bg-nav);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--border-subtle);
  z-index: 1000;
  transition: background 0.4s var(--ease-out);
}

/* — Logo — */
.navbar__logo {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.navbar__logo img {
  height: 75px;
  width: auto;
  transition: opacity 0.3s var(--ease-out), transform 0.3s var(--ease-out);
}

.navbar__logo img:hover {
  opacity: 0.85;
  transform: scale(1.04);
}

/* — Nav Links — */
.navbar__links {
  display: flex;
  align-items: center;
  gap: 2rem;
  list-style: none;
}

.navbar__links a {
  position: relative;
  font-size: 1.05rem;
  font-weight: 300;
  color: var(--text-primary);
  text-decoration: none;
  letter-spacing: 0.02em;
  padding: 0.25rem 0;
  transition: color 0.3s var(--ease-out);
}

.navbar__links a:hover {
  color: #cccccc;
}

/* Animated underline on hover */
.navbar__links a::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 0;
  height: 2px;
  background: #888888;
  border-radius: 1px;
  box-shadow: none;
  transition: width 0.35s var(--ease-out);
}

.navbar__links a:hover::after {
  width: 100%;
}

/* — Mobile Hamburger — */
.navbar__hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  z-index: 1100;
}

.navbar__hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: transform 0.3s var(--ease-out), opacity 0.3s var(--ease-out);
}

/* Hamburger active state */
.navbar__hamburger.active span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.navbar__hamburger.active span:nth-child(2) {
  opacity: 0;
}

.navbar__hamburger.active span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .navbar__logo,
  .navbar__hamburger {
    height: var(--nav-height);
    display: flex;
    align-items: center;
  }

  .navbar__hamburger {
    display: flex;
  }

  .navbar__links {
    position: static;
    width: 100%;
    max-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
    gap: 1.5rem;
    padding: 0 var(--container-padding);
    background: transparent;
    opacity: 0;
    visibility: hidden;
    transition: 
      max-height 0.7s cubic-bezier(0.4, 0, 0.2, 1), 
      padding 0.7s cubic-bezier(0.4, 0, 0.2, 1),
      opacity 0.7s cubic-bezier(0.4, 0, 0.2, 1),
      visibility 0.7s cubic-bezier(0.4, 0, 0.2, 1);
    order: 3;
  }

  .navbar__links.open {
    max-height: 280px;
    opacity: 1;
    visibility: visible;
    padding-bottom: 2.5rem;
    padding-top: 1.5rem;
  }

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

/* Spacer so content isn't hidden behind the fixed nav */
.nav-spacer {
  height: 0;
}

.hero {
  position: relative;
  width: 100%;
  height: calc(100vh - var(--nav-height));
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: var(--bg-primary);
}

.hero__image {
  max-width: 100%;
  max-height: 98%;
  width: auto;
  height: auto;
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
  z-index: 1;
}

/* — Hero Content overlay — */
.hero__content {
  position: absolute;
  top: 1.2rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  z-index: 10;
  width: 100%;
  max-width: 90vw;
  text-align: center;
}

.hero__tagline {
  font-size: clamp(2.2rem, 7vw, 3.5rem);
  font-weight: 300;
  color: var(--text-primary);
  letter-spacing: 0.04em;
  white-space: nowrap;
  padding: 0.5rem 2.5rem 0.2rem;
}

.hero__subtitle {
  font-size: clamp(1.05rem, 1.5vw, 1.4rem);
  font-weight: 200;
  color: rgba(255, 255, 255, 0.7);
  letter-spacing: 0.08em;
  margin-top: -0.5rem;
}

/* Soft darkened glow behind text block */
.hero__content::before {
  content: '';
  position: absolute;
  inset: 0.5rem -1rem;
  background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.65) 0%, transparent 80%);
  z-index: -1;
  pointer-events: none;
}

.hero__tagline strong {
  font-weight: 400;
}

/* Vignette fade at the bottom — clean blend into the black page */
.hero__fade {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 12%;
  background:
    radial-gradient(ellipse 120% 80% at 50% 100%, var(--bg-primary) 0%, transparent 70%),
    linear-gradient(to bottom, transparent 0%, var(--bg-primary) 100%);
  pointer-events: none;
  z-index: 5;
}

/* ===== Section Foundations ===== */
.section {
  padding: clamp(2.5rem, 5vh, 4rem) var(--container-padding);
  background: var(--bg-primary);
  display: flex;
  justify-content: center;
}

.container {
  width: 100%;
  max-width: 1200px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: clamp(2rem, 5vw, 6rem);
}

.section__content {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.section__label {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--accent); /* subtle purple/grey accent */
  text-transform: uppercase;
  letter-spacing: 0.15em;
}

.section__title {
  font-size: clamp(1.75rem, 3.5vw, 2.75rem); /* Scaled down slightly */
  font-weight: 400;
  line-height: 1.1;
  color: var(--text-primary);
}

.section__text {
  font-size: clamp(1.1rem, 1.5vw, 1.25rem);
  font-weight: 300;
  color: rgba(255, 255, 255, 0.6); /* Slightly more muted for better contrast with highlights */
  line-height: 1.6;
  max-width: 540px;
}

.highlight {
  color: #ffffff;
  font-weight: 400;
}

.metric {
  margin-top: 1.5rem;
  padding-left: 1.5rem;
  border-left: 2px solid var(--accent);
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.metric__number {
  font-size: clamp(2rem, 3.5vw, 3rem);
  font-weight: 300; /* Less bold as requested */
  color: var(--text-primary);
  line-height: 1;
  letter-spacing: -0.02em;
}

.metric__text {
  font-size: clamp(0.9rem, 1vw, 1rem);
  font-weight: 400;
  color: rgba(255, 255, 255, 0.6);
  /* Removed uppercase to allow sentence case */
  letter-spacing: 0.03em;
  max-width: 300px;
}

.section__image {
  width: 100%;
  border-radius: 12px;
  overflow: hidden;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  /* Mask to fade edges into the black background */
  mask-image: radial-gradient(circle at center, black 40%, transparent 95%);
  -webkit-mask-image: radial-gradient(circle at center, black 40%, transparent 95%);
}

.section__image img,
.section__image video {
  width: 100%;
  height: auto;
  object-fit: cover;
  transition: transform 0.6s var(--ease-out);
}

.section__image video {
  filter: brightness(1.2); /* Slightly brighter video */
}

.section__image:hover img,
.section__image:hover video {
  transform: scale(1.02);
}

/* Larger media layout for desktop */
@media (min-width: 993px) {
  .section--larger-media {
    grid-template-columns: 1fr 1.25fr; /* Text gets slightly more space, Video gets ~55% */
  }
}

/* ===== Responsive Sections ===== */
@media (max-width: 992px) {
  .section {
    padding: 2rem var(--container-padding);
  }

  .container {
    grid-template-columns: 1fr;
    text-align: left;
    gap: 2.5rem;
  }

  .section__content {
    align-items: flex-start;
  }

  .section__text {
    max-width: 100%;
  }

  .section__image {
    order: 0; 
  }
}

/* ===== Hero mobile refinements — no more massive gap ===== */
@media (max-width: 768px) {
  .hero {
    height: auto;
    min-height: auto;
    padding: 2rem 0;
  }

  .hero__image {
    max-height: 70vh;
  }

  .hero__content {
    top: 1rem;
  }
}

/* ===== Capabilities Sub-section ===== */
.capabilities {
  padding-top: 0; /* Flows seamlessly from previous section */
  padding-bottom: clamp(6rem, 12vh, 10rem);
}

.capabilities__container {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 2rem; /* Tighter gap since it's just a label */
}

.capabilities__label {
  font-size: 1.2rem;
  font-weight: 500;
  color: #ffffff;
  letter-spacing: 0.15em;
  margin-bottom: 0.5rem;
}

.capabilities__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  width: 100%;
}

.capability-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  text-align: left;
  transition: transform 0.4s var(--ease-out), background 0.4s var(--ease-out), border-color 0.4s var(--ease-out);
  cursor: default;
}

.capability-card__media {
  width: 100%;
  height: 220px;
  background: #050505;
  overflow: hidden;
}

.capability-card__media img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform 0.6s var(--ease-out);
}

.capability-card__media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s var(--ease-out);
}

img[src*="Application"] {
  padding: 1.7rem; /* Reduced padding slightly to make the image slightly larger */
}

.capability-card:hover .capability-card__media img,
.capability-card:hover .capability-card__media video {
  transform: scale(1.05); /* Slight zoom on card hover */
}

.capability-card__content {
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.capability-card:hover {
  transform: scale(1.04) translateY(-8px);
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(90, 176, 255, 0.6); /* brighter blue glow */
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.8), 0 0 20px rgba(90, 176, 255, 0.1);
  z-index: 10;
}

.capability-card__title {
  font-size: 1.5rem;
  font-weight: 400;
  color: #fff;
  letter-spacing: 0.02em;
}

.capability-card__text {
  font-size: 1rem;
  font-weight: 300;
  color: rgba(255, 255, 255, 0.6);
  line-height: 1.6;
}

@media (max-width: 992px) {
  .capabilities__grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
}

/* ===== Workflow Section ===== */
.workflow {
  padding-top: 0; /* Continues seamlessly from the We Created section */
  padding-bottom: clamp(6rem, 12vh, 10rem);
}

.workflow__container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
}

.workflow__image-wrapper {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}

.workflow__image {
  width: 100%;
  max-width: 1000px; /* Prevents the diagram from getting absurdly huge on ultrawide monitors */
  height: auto;
  object-fit: contain;
  transition: transform 0.6s var(--ease-out);
}

.workflow__image:hover {
  transform: scale(1.02);
}

/* ===== The Team Section ===== */
.team__container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3rem;
}

.team__container .section__title {
  align-self: flex-start;
}

.team__grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 2rem;
  width: 100%;
  max-width: 1350px; /* Wider to accommodate 6 people */
}

.team-member {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 1.5rem;
}

.team-member__image-wrapper {
  width: 100%;
  max-width: 200px; /* Slightly smaller max-width so they fit nicely */
  aspect-ratio: 1 / 1;
  border-radius: 16px;
  overflow: hidden;
  background: transparent;
  -webkit-mask-image: linear-gradient(to bottom, black 70%, transparent 100%);
  mask-image: linear-gradient(to bottom, black 70%, transparent 100%);
  transition: transform 0.4s var(--ease-out), box-shadow 0.4s var(--ease-out), filter 0.4s var(--ease-out), opacity 0.4s var(--ease-out);
}

.team-member__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s var(--ease-out);
}

/* Group hover effect: dim/grayscale all by default when grid is hovered */
.team__grid:hover .team-member__image-wrapper {
  filter: grayscale(100%);
  opacity: 0.5;
}

/* But keep the specifically hovered one colored and lifted */
.team__grid .team-member:hover .team-member__image-wrapper {
  filter: grayscale(0%);
  opacity: 1;
  transform: translateY(-8px);
  /* Removed border-color since we are fading into the background now */
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.5), 0 0 20px rgba(90, 176, 255, 0.15);
}

.team-member:hover .team-member__image {
  transform: scale(1.05);
}

.team-member__name {
  font-size: 1.1rem; /* Slightly smaller font to fit the tighter layout */
  font-weight: 400;
  color: var(--text-primary);
  letter-spacing: 0.02em;
}

@media (max-width: 1100px) {
  .team__grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 3rem 2rem;
  }
}

@media (max-width: 576px) {
  .team__grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ===== Our Support Section ===== */
.support__container {
  display: flex;
  flex-direction: column;
  gap: 3rem;
}

.support__container .section__title {
  align-self: flex-start;
}

.support__marquee {
  width: 100%;
  position: relative;
  overflow: hidden;
  padding: 3rem 0;
  display: flex;
}

.support__fade {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 15vw;
  z-index: 2;
  pointer-events: none;
}

.support__fade--left {
  left: 0;
  background: linear-gradient(to right, var(--bg-primary), transparent);
}

.support__fade--right {
  right: 0;
  background: linear-gradient(to left, var(--bg-primary), transparent);
}

.support__track {
  display: flex;
  gap: 6rem;
  align-items: center;
  width: max-content;
  animation: scrollMarquee 40s linear infinite;
  padding-right: 6rem; /* One gap at the end to match the gap between elements */
}

/* Pause animation on hover */
.support__marquee:hover .support__track {
  animation-play-state: paused;
}

.support__logo {
  height: 45px;
  width: auto;
  max-width: 200px;
  object-fit: contain;
  opacity: 1;
  filter: grayscale(100%) brightness(150%);
  transition: opacity 0.4s var(--ease-out), filter 0.4s var(--ease-out), transform 0.4s var(--ease-out);
}

.support__logo:hover {
  opacity: 1;
  filter: grayscale(0%) brightness(100%);
  transform: scale(1.1);
}

img[src*="meanwell"] {
  height: 70px; /* Increased height to balance its proportions with other logos */
}

img[src*="meanwell"]:hover {
  transform: scale(1.1);
}

@keyframes scrollMarquee {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-50%); /* Because padding-right adds the missing gap to the total width */
  }
}

/* ===== Footer & References ===== */
.footer {
  padding: 3rem var(--container-padding);
  background: #080808;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.footer__container {
  display: block;
  text-align: left;
}

.footer__references {
  max-width: 800px;
}

.reference {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.4);
  line-height: 1.5;
}

.reference a, .citation-link {
  color: rgba(255, 255, 255, 0.6);
  text-decoration: none;
  transition: color 0.3s ease;
}

.reference a:hover, .citation-link:hover {
  color: #5ab0ff;
}

.citation-link {
  font-size: 0.75em;
  vertical-align: super;
  margin-left: 0.2em;
}




