@import url('common.css');

/* Header & Navigation */
header {
  position: sticky;
  top: 0;
  width: 100%;
  background-color: var(--bg-color-header);
  border-bottom: 1px solid var(--border-color);
  z-index: 1000;
  transition: all 0.3s ease;
}

nav {
  padding: 1rem 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

:target {
  scroll-margin-top: 90px;
}

.logo {
  height: 50px;
}

.nav-links {
  display: flex;
  list-style: none;
  gap: clamp(1rem, 3vw, 2.5rem);
  align-items: center;
}

.nav-links li {
  font-size: clamp(1rem, 10vw, 1.25rem);
  font-weight: 700;
}

.nav-links a {
  text-decoration: none;
  color: var(--text-color);
  font-weight: 500;
  transition: color 0.3s ease;
}

.nav-links a:hover {
  color: var(--primary-color);
}

.nav-links a.btn-cta {
  background-color: var(--primary-color);
  color: white;
  padding: 0.5rem 1.5rem;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.3s ease;
  border: none;
  cursor: pointer;
  display: inline-block;
}

.nav-links a.btn-cta:hover {
  background-color: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}

.nav-links a.active {
  color: var(--primary-color);
}

.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--text-color);
  cursor: pointer;
}

/* Main Content */
main > section {
  margin-bottom: clamp(2rem, 8vw, 5rem);
}

section {
  padding: 0;
  width: 100%;
}

main section ul {
  margin-left: 2rem;
  margin-bottom: 1rem;
  color: var(--text-secondary);
}

:not(:is(.title, header, footer)) > .container {
  max-width: min(1200px, 100%);
  margin: 0;
  margin-inline: auto;
  padding-inline: clamp(1rem, 4vw, 2rem);
  display: flex;
  flex-direction: column;
}

:not(:is(header, footer)) > .container {
  align-items: center;
}

:is(header, footer) .container {
  width: 100%;
  margin: 0;
  margin-inline: auto;
  padding-inline: clamp(1rem, 4vw, 2rem);
}

header .container {
  display: block;
}

footer .container {
  display: flex;
  flex-direction: column;
}

.container h2 {
  color: var(--primary-color);
  margin-bottom: 0;
}

h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 1rem;
}

h2 {
  font-size: clamp(1.5rem, 3.5vw, 2rem);
  font-weight: 700;
  margin-bottom: 1rem;
}

h3 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

h4 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

p {
  color: var(--text-secondary);
  margin-bottom: 1rem;
  font-size: 1rem;
}

.footnote {
  align-self: flex-start;
  font-size: 0.75rem;
  margin-bottom: 1rem;
}

li {
  font-size: 1.25rem;
}

/* Buttons */
.btn-group {
  display: flex;
  gap: 1rem;
  justify-content: center;
  /* margin-top: 2rem; */
  flex-wrap: wrap;
}

.btn {
  padding: 1rem 2rem;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.3s ease;
  border: none;
  cursor: pointer;
  font-size: 1.25rem;
}

.btn-primary {
  background-color: var(--primary-color);
  color: var(--text-color);
}

.btn-primary:hover {
  background-color: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}

.btn-secondary {
  background-color: transparent;
  color: var(--text-color);
  font-weight: 400;
  outline: none;
  border: none;
  padding: 0;
  text-decoration: underline;
  /* border: 2px solid var(--border-color); */
}

.btn-secondary:hover {
  /* border-color: var(--primary-color);
  color: var(--primary-color);
  transform: translateY(-2px); */
  cursor: pointer;
}

/* Hero Section */
.title {
  min-height: clamp(320px, 50vh, 400px);
  height: auto;
  max-width: 100%;
  background: url("../images/p/hero-background.png") center/cover no-repeat;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.title > .container {
  max-width: min(1200px, 100%);
  margin-top: 0;
  margin-inline: auto;
  padding-inline: clamp(1rem, 4vw, 2rem);
  height: 100%;
}

.title > .container > h1 {
  color: var(--primary-color);
  margin-bottom: 0;
}

/* Moved to details.css as it's not applicable here */
/* .hero {
  min-height: 50vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2rem;
}

.hero > * {
  margin-bottom: 0;
} */

.subtitle {
  font-size: 1.25rem;
  color: var(--text-secondary);
  max-width: 990px;
}

/* Services Section */
.services-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2rem;
  margin: 3rem 0 1rem;
}

.service-card {
  display: flex;
  flex-direction: row;
  justify-content: center;
  gap: 1.5rem;
  padding: 1.5rem;
  background-color: var(--bg-secondary);
  border-radius: 12px;
  border: 1px solid var(--border-color);
  transition: all 0.3s ease;
  opacity: 0;
  transform: translateY(30px);
}

.service-card.animate {
  animation: fadeInUp 0.6s ease forwards;
}

.service-image {
  display: flex;
  flex-direction: column;
  justify-content: start;
  flex: 0 0 72px;
}

.service-image img {
  display: block;
  width: 100%;
  height: 72px;
  object-fit: contain;
}

.service-info {
  display: flex;
  flex-direction: column;
  align-items: start;
  flex: 1 1 auto;
  min-width: 0;
}

.service-info > * {
  margin-bottom: 0;
}

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

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

/* Technology Section */
#technology {
  display: none;
}

.subsection {
  margin: 2rem 0;
}

.subsection h3 {
  color: var(--primary-color);
}

.subsection h3.no-highlight {
  color: var(--text-color);
}

.subsection ul, ol {
  margin-left: 2rem;
  margin-bottom: 1rem;
  color: var(--text-secondary);
}

/* Case Studies Carousel */
.carousel-container {
  position: relative;
  margin: 3rem 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  width: 100%;
}

.carousel-container *,
.carousel-container *::before,
.carousel-container *::after {
  box-sizing: border-box;
}

.carousel {
  position: relative;
  height: 550px;
  width: 100%;
}

.case-study-card {
  position: absolute;
  inset: 0;
  height: 100%;
  width: 100%;
  opacity: 0;
  z-index: 0;
  pointer-events: none;
  transition: opacity 1s ease;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  grid-template-rows: auto 1fr auto;
  grid-template-areas: 
    "project-image section-title"
    "project-image project-content"
    "project-image view-more";
  gap: 2rem;
  align-items: start;
}

.case-study-card.active {
  opacity: 1;
  z-index: 2;
  pointer-events: auto;
}

.case-study-card.prev {
  opacity: 0;
  z-index: 1;
}

.case-study-images {
  grid-area: project-image;
  position: relative;
  /* flex: 0 0 clamp(240px, 35vw, 460px); */
  min-height: 0;
  /* overflow: auto; */
  align-content: start;
  display: block;
  overflow: hidden;
  height: 100%;  
}

.case-study-image {
  display: block;
  width: 100%;
  height: auto;
  object-fit: cover;
  background-color: var(--border-color);
  border-radius: 8px;
  box-shadow: rgba(0,0,0,0.1) -2px 5px 10px 2px;
}

/* Lufthansa */
.case-study-card:nth-child(1) > .case-study-images {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

/* UpTick */
.case-study-card:nth-child(2) > .case-study-images > .case-study-image {
  height: auto;
  width: 25%;
  position: absolute;
}

.case-study-card:nth-child(2) > .case-study-images > .case-study-image:nth-child(1) {
  right: 72%;
  bottom: 30%;
  z-index: 200;
}

.case-study-card:nth-child(2) > .case-study-images > .case-study-image:nth-child(2) {
  right: 48%;
  top: 0;
  z-index: 100;
}

.case-study-card:nth-child(2) > .case-study-images > .case-study-image:nth-child(3) {
  right: 24%;
  bottom: 30%;
  z-index: 200;
}

.case-study-card:nth-child(2) > .case-study-images > .case-study-image:nth-child(4) {
  right: 0;
  top: 0;
  z-index: 100;
}

/* CryptoAlerts */
.case-study-card:nth-child(3) > .case-study-images > .case-study-image:nth-child(1) {
  position: absolute;
  width: 50%;
  height: auto;
  top: 50px;
  right: 45%;
  z-index: 1;
}

.case-study-card:nth-child(3) > .case-study-images > .case-study-image:nth-child(2) {
  position: absolute;
  width: 50%;
  height: auto;
  top: 80px;
  right: 0;
  z-index: 2;
}

/* Senecto */
.case-study-card:nth-child(4) > .case-study-images {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

.case-study-card:nth-child(4) > .case-study-images > .case-study-image:nth-child(1) {
  /* height: 80%;
  width: auto; */
  /* width: 80%;
  height: auto; */
}

/* TopView */
.case-study-card:nth-child(5) > .case-study-images > .case-study-image:nth-child(1) {
  position: absolute;
  width: min(590px, 100%);
  height: auto;
  top: 50px;
  right: 0;
  z-index: 1;
}

.case-study-card:nth-child(5) > .case-study-images > .case-study-image:nth-child(2) {
  position: absolute;
  width: 240px;
  height: auto;
  right: 10%;
  z-index: 2;
}

.case-study-card > h3 {
  grid-area: section-title;
  color: var(--text-secondary);
  margin: 0;
}

.case-study-card > .btn-container {
  grid-area: view-more;
  display: flex;
  flex-direction: row;
  justify-content: flex-end;
}

.case-study-card > .btn-container > .btn {
  background-color: var(--primary-color);
  color: var(--text-footer);
  font-weight: 600;
  padding: 0.5rem 1.5rem;
  border-radius: 8px;
  text-decoration: none;
  border: none;
  transition: all 0.3s ease;
  cursor: pointer;
  display: inline-block;
}

.case-study-card > .btn-container > .btn:hover {
  background-color: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}

.case-study-content {
  grid-area: project-content;
  min-width: 0;
  display: -webkit-box;
  --case-study-content-line-count: 11;
  -webkit-line-clamp: var(--case-study-content-line-count);
  line-clamp: var(--case-study-content-line-count);
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.case-study-content h2,
.case-study-content h3,
.case-study-content p {
  margin: 0;
  line-height: 1.5;
}

.case-study-content > .subsection {
  margin: 2rem 0 0;
}

.case-study-content > .subsection > h3 {
  color: var(--text-secondary);
}

.carousel-controls {
  grid-column: 1 / -1;
  grid-row: 3;
  justify-self: center;
  display: flex;
  justify-content: center;
  gap: 1rem;
  position: relative;
  margin-top: 2rem;
}

.carousel-controls .dot {
  width: 70px;
  height: 12px;
  border-radius: 10%;
  background-color: var(--carousel-dot-default);
  box-shadow: none;
  border: none;
  cursor: pointer;
  transition: background-color 0.3s;
}

.carousel-controls .dot.active {
  background-color: var(--primary-color);
}

.carousel-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid var(--border-color);
  background: var(--bg-color);
  color: var(--text-color);
  cursor: pointer;
  transition: all 0.3s ease;
}

.carousel-btn:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
}

#own-products {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

/* Logo Scroll */
#company-logos {
  max-width: 100%;
}

.logo-scroll {
  display: flex;
  user-select: none;
  background-color: var(--logo-bg-color);
  padding: 3rem 0;
  overflow: hidden;
  position: relative;
  width: 100%;
  margin-top: 3rem;
  -webkit-overflow-scrolling: touch;
}

.logo-track {
  --logo-gap: 4rem;
  display: flex;
  align-items: center;
  gap: var(--logo-gap);
  padding-right: var(--logo-gap);
  animation: scroll-seamless 50s linear infinite;
}

.logo-item {
  background-color: var(--logo-bg-color);
  border-radius: 8px;
  flex: 0 0 auto;
  filter: grayscale(100%);
  opacity: 0.7;
  cursor: pointer;
}

.logo-item:hover {
  filter: grayscale(0%);
  opacity: 1;
}

@media (hover: hover) {
  .logo-scroll:hover .logo-track {
    animation-play-state: paused;
  }
}

@keyframes scroll-seamless {
  to { transform: translateX(-100%); }
}

/* Testimonials */
.testimonials-container {
  position: relative;
  overflow: hidden;
  width: 100%;
  height: 280px;
  margin: 3rem 0;
  border-top: 1px solid black;
  border-bottom: 1px solid black;
}

.testimonials {
  position: relative;
  height: 100%;
}

.testimonial {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 100%;
  padding: clamp(1.5rem, 4vw, 3rem) 1rem;
  background-color: var(--bg-color);
  border-radius: 12px;
  text-align: center;
  opacity: 0;
  transition: opacity 1s ease-in-out;
  overflow: hidden;
}

.testimonial:first-child {
  position: relative;
}

.testimonial > blockquote {
  height: 100%;
  margin: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: clamp(0.75rem, 2vw, 2rem);
}

.testimonial.active {
  opacity: 1;
  pointer-events: auto;
}

.testimonial:not(.active) {
  pointer-events: none;
}

.testimonial-text {
  font-size: clamp(1.25rem, 3.5vw, 2rem);
  font-style: italic;
  color: var(--primary-color);
  text-align: center;
  margin-bottom: clamp(0.75rem, 2vw, 2rem);
}

.testimonial-author {
  font-size: clamp(1rem, 2.5vw, 1.25rem);
  font-weight: 600;
  color: var(--text-secondary);
  text-align: center;
  margin-bottom: 0;
}

/* About Us Section */
#about {
  display: none;
}

/* Footer */
footer {
  width: 100%;
  background-color: var(--bg-color-footer);
  border-top: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.footer-content {
  display: grid;
  grid-template-columns: 1fr minmax(auto, 490px) minmax(auto, 490px);
  justify-content: end;
  gap: 2rem;
  margin-top: 2rem;
}

.footer-section h4 {
  margin-bottom: 1rem;
  color: var(--text-footer);
}

.footer-section ul {
  list-style: none;
  margin: 0;
}

.footer-section a {
  color: var(--text-footer);
  text-decoration: none;
  transition: color 0.3s ease;
  font-size: 1rem;
}

.footer-section a:hover {
  color: var(--primary-color);
}

.footer-section p {
  font-size: 1rem;
  color: var(--text-footer);
}

footer .copyright {
  display: flex;
  justify-content: end;
  margin-top: 2rem;
}

footer .copyright p {
  font-size: 1rem;
  color: var(--text-footer);
}

/* Responsive Design */
@media (max-width: 1200px) {
  footer .copyright {
    width: 100%;
  }
}

@media (max-width: 1024px) {
  .services-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .mobile-menu-btn {
    display: block;
    position: relative;
    z-index: 1001;
  }

  body.menu-open {
    overflow: hidden;
  }

  .nav-links {
    display: none;
    position: fixed;
    transition: none;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: var(--bg-color-header);
    z-index: 1000;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 2rem;
    gap: clamp(1.5rem, 6vh, 3rem);
  }

  .nav-links li {
    width: 100%;
  }  

  .nav-links.active {
    display: flex;
  }

  .nav-links a {
    font-size: clamp(2rem, 5vw, 2.5rem);
    font-weight: 700;
    display: block;
    padding: 0.5rem 0;
  }

  .nav-links a.btn-cta {
    margin-top: 1rem;
    display: inline-block;
    width: auto;
    padding: 0.75rem 2rem;
  }

  .case-study-card {
    flex-direction: column;
  }

  .case-study-image {
    width: 100%;
  }

  .testimonials-container {
    min-height: 280px;
    height: auto;
    overflow: hidden;
  }
  
  .testimonial {
    height: auto;
  }

  .testimonial blockquote {
    height: auto;
  }

  .btn-group {
    flex-direction: column;
  }

  .btn {
    width: 100%;
    text-align: center;
  }

  .footer-content {
    width: 100%;
    grid-template-columns: minmax(auto, 490px);
    justify-content: start;
  }

  .logo-scroll {
    padding: 2rem 0;
  }

  .logo-track {
    animation-duration: 30s;
    --logo-gap: 3rem;
  }
}

@media (max-width: 600px) {
  .service-card {
    gap: 1rem;
  }

  .service-image {
    flex-basis: 48px;
  }
  
  .service-image img {
    height: 48px;
  }

  .carousel {
    display: grid;
    grid-template-columns: 1fr;
    height: auto;
  }

  .case-study-card {
    grid-column: 1;
    grid-row: 1;

    position: relative;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease;

    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto auto;
    grid-template-areas:
      "section-title"
      "project-image"
      "project-content"
      "view-more";
    gap: 0.5rem;
  }

  .case-study-card.active {
    opacity: 1;
    pointer-events: auto;
    z-index: 2;
  }

  .case-study-card.prev {
    opacity: 0;
    pointer-events: none;
  }

  .case-study-images {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    position: relative;
    overflow: hidden;
    border-radius: 8px;
  }

  .case-study-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    background-color: var(--bg-color);
  }

  .case-study-card .case-study-image:nth-child(n+2) {
    display: none;
  }

/* Reset the specific nth-child overrides that might be adding height */
  .case-study-card:nth-child(n) .case-study-images .case-study-image {
    right: auto;
    bottom: auto;
    top: 0;
    left: 0;
  }

  .case-study-card:nth-child(2) .case-study-images .case-study-image:nth-child(1),
  .case-study-card:nth-child(3) .case-study-images .case-study-image:nth-child(1),
  .case-study-card:nth-child(5) .case-study-images .case-study-image:nth-child(1) {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    right: auto;
    bottom: auto;
    left: 0;
    z-index: 1;
    object-fit: contain; 
  }  

  .case-study-content {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 140px;
  }

  .case-study-content > .subsection {
    margin: 1rem 0 0;
  }

  .case-study-card > .btn-container {
    justify-content: center;
    padding-top: 1rem;
  }

  .carousel-controls .dot {
    width: 40px;
  }

  .footer-content {
    padding: 0;
  }
}

@media (max-width: 390px) {
  .case-study-content {
    --case-study-content-line-count: 10;
  }
}

@media (max-width: 375px) {
  .case-study-content {
    --case-study-content-line-count: 9;
  }
}