/* css/estilos.css */
@import url('https://fonts.googleapis.com/css2?family=Ubuntu+Mono:wght@400;700&display=swap');
@import url('normalize.css');

:root {
  --logo-black:  #000000;
  --logo-navy: #09192b;
  --logo-blue: #888888;
  --logo-sky: rgb(97, 121, 167);
  --logo-grey:   #c7c8d9;
  --page-background: #030910;
  --page-background-hover: #09192b;

  --bg-gradient-start: var(--logo-navy);
  --bg-gradient-end:   var(--logo-sky);
  --accent:            var(--logo-blue);
  --text-light:        var(--logo-grey);

  --font-console: 'Ubuntu Mono', monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

/* 1. KEEP MANDATORY SNAP */
html {
  /* Less rigid than "mandatory" for a more premium feel */
  scroll-snap-type: y proximity;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-console);
  background: linear-gradient(135deg, var(--bg-gradient-start), var(--bg-gradient-end));
  color: var(--text-light);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

.container { width: 90%; max-width: 1200px; margin: 0 auto; }

/* --- NAVIGATION --- */
.nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.9rem 0;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  z-index: 999;

  /* Default: transparent, becomes glass on scroll */
  background: linear-gradient(
    180deg,
    rgba(0, 0, 0, 0.35) 0%,
    rgba(0, 0, 0, 0.0) 100%
  );
  transition: background 200ms ease, backdrop-filter 200ms ease, border-color 200ms ease;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
/* Reduced width slightly to prevent squashing */
.nav__logo img { width: 300px; }

.nav--scrolled {
  background: rgba(3, 9, 16, 0.55);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
}

.nav__inner {
  width: 90%;
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.nav__links { list-style: none; display: flex; }
.nav__links li { margin-left: 2rem; }

.nav__links a {
  color: var(--text-light);
  text-decoration: none;
  font-weight: 700;
  /* Reduced from 1.4rem to 1.1rem to fix wrapping issues */
  font-size: 1.1rem;
  transition: color 0.3s;
  white-space: nowrap; /* Forces text to stay on one line */
}
.nav__links a:hover { color: var(--accent); }
.nav__links a.is-active { color: #ffffff; }

.nav__toggle {
  display: none;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-light);
  border-radius: 10px;
  cursor: pointer;
  padding: 0;
  align-items: center;
  justify-content: center;
}
.nav__toggle span {
  display: block;
  width: 18px;
  height: 2px;
  background: currentColor;
  position: relative;
}
.nav__toggle span::before,
.nav__toggle span::after {
  content: "";
  position: absolute;
  left: 0;
  width: 18px;
  height: 2px;
  background: currentColor;
}
.nav__toggle span::before { top: -6px; }
.nav__toggle span::after { top: 6px; }

/* --- HERO --- */
.hero {
  /* Add top padding so hero content never hides under fixed nav */
  padding-top: 90px;
}

/* --- HERO --- */
.hero {
  position: relative;
  height: 100vh;
  overflow: hidden;
  scroll-snap-align: start;
}
.starfield {
  position: absolute;
  inset: 0;
  background: url('../images/space-bg-v2.png') center/cover no-repeat;
  background-size: cover;
  z-index: 0;
}
.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 1;
}
.hero__content {
  position: relative;
  z-index: 2;
  text-align: center;
  padding-top: 22vh;
}
.hero__title { font-size: clamp(2.2rem, 4.5vw, 4rem); margin-bottom: 0.75rem; letter-spacing: -0.02em; }
.hero__subtitle-wrapper { min-height: 1.75em; margin-bottom: 2rem; }
.hero__subtitle { display: inline-block; white-space: nowrap; font-size: 1.5rem; color: var(--accent); }
.hero__cta-wrapper { text-align: center; margin-top: 1.25rem; }
.cta {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  border: 2px solid var(--accent);
  border-radius: 2rem;
  text-decoration: none;
  color: var(--accent);
  font-weight: 700;
  font-size: 1rem;
  transition: background 0.3s, color 0.3s;
}
.cta:hover { background: var(--accent); color: var(--logo-black); }

/* --- LINKS AS CTA INSIDE CARDS --- */
.link-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--text-light);
  text-decoration: none;
  font-weight: 700;
  border-bottom: 1px solid rgba(255, 255, 255, 0.25);
  padding-bottom: 2px;
  transition: color 0.2s ease, border-color 0.2s ease;
}
.link-cta:hover {
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.55);
}

/* --- RESPONSIVE NAV --- */
@media (max-width: 980px) {
  .capabilities__grid { grid-template-columns: 1fr; gap: 2.5rem; }
  .nav__toggle { display: inline-flex; }
  .nav__logo img { width: 240px; }
  .nav__links {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    display: none;
    flex-direction: column;
    gap: 0.25rem;
    padding: 0.75rem 0.75rem 1rem;
    margin: 0;
    background: rgba(3, 9, 16, 0.72);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  }
  .nav__links li { margin-left: 0; }
  .nav__links a {
    display: block;
    padding: 0.75rem 0.75rem;
    border-radius: 12px;
  }
  .nav__links a:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
  }
  .nav.nav--open .nav__links { display: flex; }
  .projects__list { grid-template-columns: 1fr; }
  .contact__fields { grid-template-columns: 1fr; }
  .contact__textarea { min-height: 10rem; }
}

/* --- SECTIONS (The Fix) --- */
.fullpage.section {
  min-height: 100vh; /* Allow it to grow larger than screen if needed */
  display: flex;
  align-items: center;
  justify-content: center;

  /* FIX: Add padding bottom so content sits higher up, away from fixed Company Name */
  padding: 4rem 0 6rem 0;

  scroll-snap-align: start;
  /* Prevent fixed nav from covering section headings */
  scroll-margin-top: 90px;
}

.fullpage.section:nth-of-type(odd),
.fullpage.section:nth-of-type(even) {
  background: linear-gradient(135deg, var(--page-background), var(--page-background-hover));
}

.section__inner { text-align: center; width: 100%; }
.section__title { font-size: 2.25rem; margin-bottom: 1rem; }
.section__description { max-width: 800px; margin: 0 auto 2rem; font-size: 1.125rem; }

/* Capabilities — overview-style blocks in 2×2 */
.capabilities__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4rem;
  text-align: left;
  margin-top: 2rem;
}
.capabilities__block {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.capabilities__heading {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0;
}
.capabilities__block .section__description {
  margin: 0;
  max-width: none;
}
.capabilities__image {
  max-width: 100%;
  border-radius: 0.5rem;
  margin-top: 1rem;
  box-shadow: 0 20px 20px rgba(0,0,0,0.8);
}

/* Projects grid */
.projects__cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px,1fr));
  gap: 2rem;
}
#projects .container {
  width: 100%;
  max-width: none;
  padding-inline: 2rem;
  box-sizing: border-box;
}
.projects__list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.5rem;
  width: 100%;
  max-width: none;
  margin-top: 2rem;
  margin-inline: 0;
}
.projects__list li {
  margin-bottom: 0;
}
.projects__list .news__img {
  max-height: 240px;
}
.project-card {
  background: rgba(255,255,255,0.05);
  padding: 1.5rem;
  border-radius: .5rem;
  transition: transform .3s;
}
.project-card:hover { transform: translateY(-5px); }
.project-card img { width:100%; display:block; margin-bottom: 1rem; border-radius: 4px; }
.project-card h3 { font-size: 1.25rem; margin-bottom: .5rem; font-weight: 700; }

/* Overview */
.overview__inner { display: flex; flex-wrap: wrap; gap: 4rem; align-items: flex-start; justify-content: center; }
.overview__block { flex: 1 1 45%; display: flex; flex-direction: column; gap: 1rem; }
.overview__image { max-width: 100%; border-radius: 0.5rem; margin-top: 1rem; box-shadow: 0 20px 20px rgba(0,0,0,0.8); }

/* News List */
.news__list { list-style: none; max-width: 900px; margin: 0 auto; text-align: left; }
.news__list.projects__list { max-width: none; width: 100%; margin-inline: 0; }
.news__list li {
  background: rgba(255,255,255,0.05);
  padding: 1rem;
  margin-bottom: 1.5rem;
  border-radius: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}
.news__list li.visible { opacity: 1; transform: translateY(0); }
.news__img { width: 100%; max-height: 150px; object-fit: cover; border-radius: 0.4rem; }
.news__list time { font-size: 0.875rem; opacity: .7; }

/* Clients */
.clients__grid { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 2rem; margin-top: 1.5rem; }
.clients__grid a { display: inline-flex; align-items: center; justify-content: center; line-height: 0; }
.clients__grid img {
  height: 100px;
  width: auto;
  max-width: 320px;
  object-fit: contain;
  opacity: 0.8;
  transition: opacity 0.3s;
}
.clients__grid a:hover img,
.clients__grid img:hover { opacity: 1; }

/* Contact */
#contact.contact {
  background-image:
    radial-gradient(rgba(199, 200, 217, 0.16) 1.2px, transparent 1.2px),
    linear-gradient(135deg, var(--page-background), var(--page-background-hover));
  background-size: 22px 22px, auto;
  background-position: center;
}
.contact__title {
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.35rem;
}
.contact__subtitle {
  font-style: italic;
  font-size: 1.15rem;
  color: rgba(199, 200, 217, 0.85);
  margin-bottom: 2.5rem;
}
.contact__form {
  max-width: 920px;
  margin: 0 auto;
  text-align: left;
  display: flex;
  flex-direction: column;
}
.contact__fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  align-items: stretch;
}
.contact__col {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  min-height: 100%;
}
.contact__input {
  width: 100%;
  padding: 0.95rem 1rem;
  border: none;
  border-radius: 0.35rem;
  background: #ffffff;
  color: #1a1a1a;
  font-family: var(--font-console);
  font-size: 1rem;
  outline: none;
  transition: box-shadow 0.2s ease;
}
.contact__input::placeholder {
  color: #9a9a9a;
}
.contact__input:focus {
  box-shadow: 0 0 0 2px var(--logo-sky);
}
.contact__textarea {
  flex: 1;
  min-height: 8.5rem;
  resize: vertical;
}
.contact__submit {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  margin: 1.75rem auto 0;
  padding: 0.85rem 1.75rem;
  border: none;
  border-radius: 0.25rem;
  background: #3d4f63;
  color: #ffffff;
  font-family: var(--font-console);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}
.contact__submit:hover {
  background: #4d627a;
  transform: translateY(-1px);
}
.contact__submit-icon {
  width: 1.15rem;
  height: 1.15rem;
  flex-shrink: 0;
}
.contact__status {
  margin-top: 1rem;
  text-align: center;
  font-size: 0.95rem;
  line-height: 1.4;
}
.contact__status a { color: var(--logo-sky); }
.contact__status--error { color: #ff8f8f; }
.contact__status--ok { color: rgba(199, 200, 217, 0.9); }
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* --- FOOTER FIX --- */
/* The footer must act as a snap point, otherwise the browser forcefully
   snaps back to the top of the previous section, hiding the bottom content. */
.footer {
  padding: 2rem 0;
  background: var(--logo-black);
  text-align: center;
  font-size: .875rem;

  /* CRITICAL FIX: Allow scrolling to the footer */
  scroll-snap-align: end;
}

.company-name {
  position: fixed;
  bottom: 1rem;
  left: 1rem;
  color: var(--text-light);
  font-family: var(--font-console);
  font-size: 1.0rem;
  opacity: 0.85;
  line-height: 1.2;
  white-space: pre-line;
  pointer-events: none; /* Let clicks pass through */
  z-index: 100;
}