/*
  Principia website stylesheet
  Inspired by the modern dark design of BCAS.io, this file defines a consistent
  colour palette, typography and responsive layouts. Colours are declared as
  CSS variables at the top for easy theming.
*/

:root {
  --primary-color: #4f85ff; /* accent blue */
  --secondary-color: #7b5eff; /* accent purple */
  --bg-color: #081b33; /* overall dark background */
  --section-bg: #0b2440; /* section background */
  --card-bg: #0f284b; /* card panels */
  --text-color: #cfd9e6; /* body text */
  --heading-color: #ffffff; /* headings */
  --link-color: #8aa0c8; /* footer links */
  --border-color: #2d4373;
}

/* Reset & base styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
html, body {
  height: 100%;
  scroll-behavior: smooth;
}
/* Offset anchor scrolling for the fixed header */
html {
  scroll-padding-top: 80px;
}
body {
  font-family: 'Poppins', sans-serif;
  background-color: var(--bg-color);
  color: var(--text-color);
  line-height: 1.6;
  overflow-x: hidden;
}
img {
  max-width: 100%;
  display: block;
}
a {
  color: var(--primary-color);
  text-decoration: none;
}
a:hover {
  color: var(--secondary-color);
}

/* Containers */
.container {
  width: 90%;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
}
.section {
  padding: 4rem 0;
}

/* Header */
.header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  background: rgba(8, 27, 51, 0.8);
  backdrop-filter: blur(10px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}
.header .header-social { margin-left: 12px; font-size: 1.2rem; color: #9fb6d9; }
.header .header-social:hover { color: #6ab0ff; }

.header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 0;
}
.logo {
  color: var(--primary-color);
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: 1px;
}
.nav {
  display: flex;
  align-items: center;
  gap: 2rem;
}
.nav a {
  color: var(--text-color);
  font-weight: 500;
  transition: color 0.3s ease;
}
.nav a:hover {
  color: var(--primary-color);
}
.menu-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-color);
  font-size: 1.5rem;
  cursor: pointer;
}

/* Language selector */
.lang-select {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-left: 1rem;
  /* Prevent the language links from shrinking or wrapping within the header */
  flex-shrink: 0;
}
.lang-select a {
  color: var(--text-color);
  font-size: 0.9rem;
  transition: color 0.3s ease;
}
.lang-select a:hover {
  color: var(--primary-color);
}
.lang-select a.active {
  color: var(--primary-color);
  font-weight: 600;
}

/* Hero */
.hero {
  height: 100vh;
  background-image: url('images/hero-background.png');
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  position: relative;
  color: var(--heading-color);
}
.hero::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(180deg, rgba(8, 27, 51, 0.8) 0%, rgba(8, 27, 51, 0.8) 100%);
  z-index: 1;
}
.hero-content {
  position: relative;
  z-index: 2;
  max-width: 800px;
  padding: 0 1rem;
}
.hero h1 {
  font-size: 3rem;
  font-weight: 700;
  margin-bottom: 1rem;
  line-height: 1.2;
}
.hero p {
  font-size: 1.2rem;
  margin-bottom: 2rem;
  color: var(--text-color);
}
.btn-primary, .btn-secondary {
  display: inline-block;
  padding: 0.8rem 2rem;
  border-radius: 30px;
  font-weight: 500;
  text-align: center;
  transition: background 0.3s ease;
  cursor: pointer;
}
.btn-primary {
  background: var(--primary-color);
  color: #ffffff;
}
.btn-primary:hover {
  background: var(--secondary-color);
}
.btn-secondary {
  background: var(--secondary-color);
  color: #ffffff;
  border: none;
}
.btn-secondary:hover {
  background: var(--primary-color);
}

/* Services */
.services {
  /*
   * Use a techy circuit background image blended with the section colour.
   * The linear-gradient overlay preserves readability of text.
   */
  background: var(--section-bg);
  background-image: linear-gradient(rgba(8, 27, 51, 0.95), rgba(8, 27, 51, 0.95)), url('images/circuit-bg.png');
  background-size: cover;
  background-position: center;
}
.services h2 {
  text-align: center;
  color: var(--heading-color);
  font-size: 2rem;
  margin-bottom: 3rem;
}
.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 2rem;
}
.service-card {
  background: var(--card-bg);
  padding: 2rem;
  border-radius: 8px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.service-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
}
.service-icon {
  font-size: 2rem;
  color: var(--primary-color);
  margin-bottom: 1rem;
}
.service-card h3 {
  color: var(--heading-color);
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
}
.service-card p {
  font-size: 0.95rem;
  margin-bottom: 0.7rem;
  color: var(--text-color);
}
.service-card ul {
  list-style: none;
  padding-left: 0;
}
.service-card li {
  position: relative;
  padding-left: 1.5rem;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
  color: var(--text-color);
}
.service-card li::before {
  content: "\f058";
  font-family: "Font Awesome 5 Free";
  font-weight: 900;
  position: absolute;
  left: 0;
  top: 0;
  color: var(--primary-color);
}

/* Pricing */
.pricing {
  background: var(--section-bg);
}
.pricing h2 {
  text-align: center;
  color: var(--heading-color);
  font-size: 2rem;
  margin-bottom: 3rem;
}
.pricing-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
}
.price-card {
  background: var(--card-bg);
  padding: 2rem;
  border-radius: 8px;
  text-align: center;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.price-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
}
.price-card h3 {
  color: var(--heading-color);
  font-size: 1.4rem;
  margin-bottom: 0.5rem;
}
.price-card h4 {
  color: var(--primary-color);
  font-size: 1.2rem;
  margin-bottom: 1rem;
  font-weight: 600;
}
.price-card ul {
  list-style: none;
  padding-left: 0;
  margin-bottom: 1.5rem;
  text-align: left;
}
.price-card li {
  position: relative;
  padding-left: 1.5rem;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
  color: var(--text-color);
}
.price-card li::before {
  content: "\f00c";
  font-family: "Font Awesome 5 Free";
  font-weight: 900;
  position: absolute;
  left: 0;
  top: 0;
  color: var(--primary-color);
}
.price-card a {
  margin-top: 1rem;
}

/* About */
.about {
  background: var(--section-bg);
}
.about h2 {
  color: var(--heading-color);
  font-size: 2rem;
  margin-bottom: 1.5rem;
}
.about-grid {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2rem;
}
.about-text {
  flex: 1 1 50%;
  min-width: 300px;
}
.about-text p {
  margin-bottom: 1rem;
  color: var(--text-color);
  line-height: 1.6;
}
.about-image {
  flex: 1 1 50%;
  min-width: 300px;
  text-align: center;
}
.about-image img {
  border-radius: 10px;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.4);
}

/* Contact */
.contact {
  background: var(--bg-color);
}
.contact h2 {
  text-align: center;
  color: var(--heading-color);
  font-size: 2rem;
  margin-bottom: 1rem;
}
.contact p {
  text-align: center;
  margin-bottom: 2rem;
  color: var(--text-color);
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
}
.contact-form {
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}
.contact-form input,
.contact-form select,
.contact-form textarea {
  width: 100%;
  padding: 0.8rem;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  background: var(--card-bg);
  color: #ffffff;
  font-size: 0.95rem;
}
.contact-form input::placeholder,
.contact-form textarea::placeholder {
  color: #8aa0c8;
}
.contact-form textarea {
  resize: vertical;
}
.contact-form .btn-secondary {
  margin-top: 1rem;
  width: 100%;
}

/* Footer */
.footer {
  background: var(--section-bg);
  padding: 3rem 0 1.5rem;
  color: var(--link-color);
  font-size: 0.9rem;
}
.footer-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 2rem;
}
.footer-col {
  flex: 1 1 200px;
}
.footer-col h3,
.footer-col h4 {
  color: var(--heading-color);
  margin-bottom: 1rem;
}
.footer-col p {
  margin-bottom: 1rem;
  line-height: 1.6;
  color: var(--text-color);
}
.footer-col ul {
  list-style: none;
  padding-left: 0;
}
.footer-col li {
  margin-bottom: 0.5rem;
}
.footer-col a {
  color: var(--link-color);
  transition: color 0.3s ease;
}
.footer-col a:hover {
  color: #ffffff;
}
.social-icons a {
  margin-right: 1rem;
  font-size: 1.4rem;
  color: var(--link-color);
  transition: color 0.3s ease;
}
.social-icons a:hover {
  color: var(--primary-color);
}
.footer-bottom {
  text-align: center;
  border-top: 1px solid var(--border-color);
  padding-top: 1rem;
  color: var(--link-color);
}

/* Responsive navigation */
@media (max-width: 768px) {
  .nav {
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--section-bg);
    flex-direction: column;
    width: 200px;
    border-radius: 0 0 0 10px;
    display: none;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.4);
  }
  .nav.open {
    display: flex;
  }
  .nav a {
    padding: 1rem;
    border-top: 1px solid var(--border-color);
  }
  .menu-toggle {
    display: block;
  }

  /* On smaller screens, allow the header contents to wrap so that language links remain visible. */
  .header .container {
    flex-wrap: wrap;
    row-gap: 0.5rem;
  }
  /* Place the language selector on its own line when space is limited and align it to the left */
  .lang-select {
    margin-left: 0;
    width: 100%;
    justify-content: flex-start;
  }
}

/* Responsive typography */
@media (max-width: 600px) {
  .hero h1 {
    font-size: 2.2rem;
  }
  .hero p {
    font-size: 1rem;
  }
  .services h2, .pricing h2, .about h2, .contact h2 {
    font-size: 1.7rem;
  }
}

/* Technology section */
.technology {
  /*
    The technology section now uses an abstract digital wave image with a dark overlay
    to create a more tech‑inspired feel. The linear-gradient overlay ensures the text
    remains readable against the vibrant background while still highlighting the
    flowing circuit lines of the artwork.
  */
  background-image: linear-gradient(rgba(8, 27, 51, 0.9), rgba(8, 27, 51, 0.9)), url('images/wave-tech.png');
  background-size: cover;
  background-position: center;
  padding: 4rem 0;
}
.technology-grid {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2rem;
}
.tech-image {
  flex: 1 1 50%;
  min-width: 300px;
}
.tech-image img {
  width: 100%;
  border-radius: 10px;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.4);
}
.tech-text {
  flex: 1 1 50%;
  min-width: 300px;
  color: var(--text-color);
}
.tech-text h2 {
  color: var(--heading-color);
  font-size: 2rem;
  margin-bottom: 1rem;
}
.tech-text p {
  margin-bottom: 1rem;
  line-height: 1.6;
}

/* Adjust technology layout on small screens */
@media (max-width: 768px) {
  .tech-image, .tech-text {
    flex: 1 1 100%;
  }
}

/* Blog grid cards */
.blog-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(300px,1fr)); gap:22px; }

/* Uniform media area */
.card-media { aspect-ratio:16/9; width:100%; overflow:hidden; border-bottom:1px solid rgba(255,255,255,.08); background:#0b1a2c; border-top-left-radius:16px; border-top-right-radius:16px; }
.card-media img { width:100%; height:100%; object-fit:cover; object-position:center; display:block; }

/* Card shell (if not already present) */
.card { background:#0b1a2c; border:1px solid rgba(255,255,255,.08); border-radius:16px; overflow:hidden; }
.card a { display:block; color:#dce8f8; text-decoration:none; padding:14px 14px 18px; }

/* Detail pages: hero image uniform too */
.blog-hero { aspect-ratio:16/9; overflow:hidden; border-radius:16px; }
.blog-hero img { width:100%; height:100%; object-fit:cover; object-position:center; display:block; }

/* Single-attachment UI (no drag-and-drop) */
.file-field { grid-column: 1 / -1; margin-top: .5rem; }
.file-field label { display:block; font-weight:600; margin:0 0 .25rem; }
.file-field input[type="file"] {
  display:block; width:100%; padding:.55rem .75rem;
  border-radius:10px; border:1px solid rgba(255,255,255,.15);
  background: rgba(255,255,255,.04); color:#dfe9fb;
}
.file-field input[type="file"]:hover { border-color: rgba(255,255,255,.35); }
.help { color:#9fb3d1; display:block; margin:.35rem 0 0; }
.file-error { color:#ffd3da; margin-top:.35rem; min-height:1.2em; }
