/* ==========================================
   Global Styles
========================================== */
body {
  margin: 0;
  font-family: "Segoe UI", sans-serif;
  background: #10141f url('../images/Fond.jpg') no-repeat center center fixed;
  background-size: cover;
  color: #f1f5f9;
}

.page-wrapper {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

main {
  flex: 1 0 auto; /* allow main to fill remaining space */
}

/* ==========================================
   Header
========================================== */
header {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 1rem 2rem;
  height: 100px;
  background: rgba(60, 70, 95, 0.85);
}

.header-logo-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

header .logo {
  height: 32px;
  width: auto;
}

header h1 {
  margin: 0;
  font-size: 2rem;
}

header p {
  font-size: 1.1rem;
  opacity: 0.9;
  max-width: 800px;
  margin: 0;
}

/* ==========================================
   Main Navigation
========================================== */
.main-nav {
  text-align: center;          /* center the links */
  margin: 20px 0;              /* spacing above/below */
  background: transparent;     /* transparent background */
  padding: 0;
}

.main-nav ul {
  list-style: none;            /* remove bullets */
  padding: 0;
  margin: 0;
}

.main-nav ul li {
  display: inline-block;       /* horizontal items */
  margin: 0 15px;              /* spacing between links */
}

.main-nav ul li a {
  text-decoration: none;
  color: #ffffff;              /* white text */
  font-weight: bold;
  font-size: 16px;
  padding: 5px 10px;           /* clickable padding */
  border-radius: 5px;          /* slight rounding */
  transition: background-color 0.3s ease, color 0.3s ease;
}

.main-nav ul li a:hover {
  background-color: rgba(0, 47, 92, 0.7); /* subtle dark blue hover */
  color: #ffffff;                        /* text remains white */
}

/* ==========================================
   Sections
========================================== */
.section {
  max-width: 1000px;
  margin: 2rem auto;
  padding: 0 1rem;
  background-color: rgba(60, 70, 95, 0.85);
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
  position: relative;
  overflow: hidden;
}

/* About Section Text Contrast */
.section.about p {
  position: relative;
  z-index: 1;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.8);
}

.section p {
  line-height: 1.6;
  margin-bottom: 2rem;
  position: relative;
  z-index: 1;
}

/* About Section Background Parallax */
.section.about::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 120%;
  height: 120%;
  background-image: url('../images/Sophia.jpg');
  background-repeat: no-repeat;
  background-position: center;
  background-size: 120% 120%;
  opacity: 0.25;
  z-index: 0;
  pointer-events: none;
  filter: blur(0.5px);
  animation: subtleGradient 30s ease-in-out infinite;
}

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

.card {
  background: rgba(80, 90, 115, 0.5);
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  padding: 1.5rem;
  transition: transform 0.2s ease;
  backdrop-filter: blur(0.5px);
  position: relative;
  overflow: hidden;
}

.card:hover {
  transform: translateY(-4px);
}

/* Card Background Images with Parallax */
.card.interop::before,
.card.custom-app::before,
.card.maths-lib::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 120%;
  height: 120%;
  background-repeat: no-repeat;
  background-position: center;
  background-size: 200% 200%;
  opacity: 0.6;
  z-index: 0;
  pointer-events: none;
  filter: blur(0.5px);
  animation: subtleGradient 30s ease-in-out infinite;
}

.card.interop::before { background-image: url('../images/Interop.jpg'); }
.card.custom-app::before { background-image: url('../images/CustomApp.jpg'); }
.card.maths-lib::before { background-image: url('../images/MathsLib.jpg'); }

/* Overlay for contrast */
.card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(10,15,25,0.6), rgba(10,15,25,0.6));
  z-index: 0;
  pointer-events: none;
}

/* Card Text Shadow for Contrast */
.card h3, .card p {
  position: relative;
  z-index: 1;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.8);
}

/* ==========================================
   Animations
========================================== */
@keyframes subtleGradient {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* ==========================================
   Download Section
========================================== */
.section.download .download-content {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 4rem;
  max-width: 1000px;
  margin: 1.5rem auto 0 auto;
  padding: 0 1rem 1rem 1rem;
}

.section.download .download-preview {
  max-width: 320px;
  width: 100%;
  max-height: 256px;
  height: auto;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.35);
  object-fit: contain;
  background-color: #111;
  opacity: 0.65;
  flex-shrink: 0;
}

.section.download .download-text {
  max-width: 400px;
  text-align: left;
  flex-shrink: 0;
}

/* ==========================================
   Footer
========================================== */
footer {
  margin-top: auto;
  text-align: center;
  padding: 1rem;
  font-size: 0.9rem;
  color: #cbd5e1;
  background: rgba(60, 70, 95, 0.85);
  position: relative;
  z-index: 1;
}

/* ==========================================
   Links
========================================== */
a {
  color: #60a5fa;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* ==========================================
   Attribution (small text)
========================================== */
.legal-attribution {
  font-size: 0.65rem;
  color: #cbd5e1;
  opacity: 0.5;
  margin-top: 0.25rem;
}

.legal-attribution a {
  color: #60a5fa;
}

.legal-attribution a:hover {
  text-decoration: underline;
}

/* ==========================================
   Responsive
========================================== */
@media (max-width: 600px) {
  header {
    height: auto;
    padding: 1rem 0;
  }
  .header-logo-title {
    flex-direction: column;
    gap: 0.5rem;
  }
  .main-nav ul li {
    display: block;
    margin: 10px 0;
  }
}

@media (max-width: 768px) {
  .section.download .download-content {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 1.5rem;
    padding-bottom: 2rem;
  }
  .section.download .download-text {
    text-align: center;
  }
}