:root {
  --bg: #f4f6f8;
  --surface: #ffffff;
  --surface-alt: #e8edf1;
  --text: #1c2a35;
  --muted: #4b5a66;
  --primary: #0f3d5e;
  --primary-strong: #0b2f47;
  --line: #d5dde5;
  --radius: 16px;
  --shadow: 0 12px 30px rgba(15, 61, 94, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Barlow", sans-serif;
  color: var(--text);
  background: linear-gradient(180deg, #f7f9fb 0%, #eef3f7 100%);
  line-height: 1.5;
}

body.drawer-open {
  overflow: hidden;
}

body.project-modal-open {
  overflow: hidden;
}

img {
  max-width: 100%;
  display: block;
  border-radius: 12px;
}

h1,
h2,
h3 {
  font-family: "Sora", sans-serif;
  line-height: 1.2;
  margin: 0 0 0.5rem;
}

p {
  margin: 0 0 1rem;
  color: var(--muted);
}

a {
  color: var(--primary);
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 3px solid #8fc4e8;
  outline-offset: 2px;
}

.container {
  width: min(1120px, 92vw);
  margin: 0 auto;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -50px;
  z-index: 100;
  background: #0f3d5e;
  color: #fff;
  text-decoration: none;
  padding: 0.55rem 0.8rem;
  border-radius: 10px;
}

.skip-link:focus {
  top: 10px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(10px);
  background: rgba(247, 249, 251, 0.9);
  border-bottom: 1px solid var(--line);
}

.nav-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 70px;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

.social-top {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-left: 36px;
}

.social-link {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--primary);
  text-decoration: none;
  transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.social-link:hover {
  transform: translateY(-2px);
  background: var(--primary);
  color: #fff;
}

.social-link svg {
  width: 17px;
  height: 17px;
  fill: currentColor;
}

.brand {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}

.brand-logo {
  width: clamp(190px, 26vw, 300px);
  height: auto;
}

.nav {
  display: flex;
  gap: 1rem;
}

.nav a {
  text-decoration: none;
  color: var(--text);
  font-weight: 500;
}

.menu-toggle {
  display: none;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 10px;
  padding: 0.4rem 0.6rem;
  font-size: 1.1rem;
}

.hero {
  position: relative;
  min-height: 520px;
  display: grid;
  align-items: center;
}

.hero-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 0;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, rgba(7, 23, 37, 0.75), rgba(12, 47, 71, 0.38));
}

.hero-content {
  position: relative;
  color: #f7fbff;
  max-width: 760px;
  padding: 3rem 0;
}

.hero-content p {
  color: rgba(247, 251, 255, 0.9);
}

.kicker {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
  color: #b8d8ee;
  margin-bottom: 0.8rem;
}

.hero h1 {
  font-size: clamp(2rem, 3.5vw, 3.2rem);
  margin-bottom: 1rem;
}

.btn {
  display: inline-block;
  border: 0;
  border-radius: 999px;
  padding: 0.75rem 1.2rem;
  background: var(--primary);
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease;
}

.btn:hover {
  transform: translateY(-2px);
  background: var(--primary-strong);
}

.btn-light {
  background: rgba(255, 255, 255, 0.17);
  border: 1px solid rgba(255, 255, 255, 0.5);
  color: #f7fbff;
}

.btn-light:hover {
  background: rgba(255, 255, 255, 0.28);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.section {
  padding: 4rem 0;
}

.section-alt {
  background: var(--surface-alt);
}

.section h2 {
  margin-bottom: 1.4rem;
}

.cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
}

.card,
.team-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem;
  box-shadow: var(--shadow);
}

.card img,
.team-card img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  margin-bottom: 0.8rem;
}

.intro {
  max-width: 850px;
  margin-bottom: 1.2rem;
}

.team-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.8rem;
}

.projects-grid img {
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border: 1px solid var(--line);
}

.project-item {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.28s ease, box-shadow 0.28s ease;
}

.project-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 34px rgba(8, 20, 30, 0.18);
}

.project-item:focus-visible {
  outline: 3px solid #8fc4e8;
  outline-offset: 2px;
}

.project-item.is-opening-fallback {
  animation: projectOpenLift 0.36s cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes projectOpenLift {
  0% { transform: translateY(0) scale(1); filter: brightness(1); }
  50% { transform: translateY(-10px) scale(1.02); filter: brightness(1.03); }
  100% { transform: translateY(0) scale(1); filter: brightness(1); }
}

.project-item-media {
  position: relative;
}

.project-carousel-image {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 0;
}

.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 999px;
  background: rgba(8, 20, 30, 0.68);
  color: #fff;
  cursor: pointer;
  font-size: 1.2rem;
  line-height: 1;
}

.carousel-btn-prev {
  left: 0.5rem;
}

.carousel-btn-next {
  right: 0.5rem;
}

.carousel-dots {
  position: absolute;
  left: 50%;
  bottom: 0.5rem;
  transform: translateX(-50%);
  display: flex;
  gap: 0.35rem;
}

.carousel-dot {
  width: 9px;
  height: 9px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.58);
  cursor: pointer;
}

.carousel-dot.is-active {
  background: #fff;
}

.project-item-body {
  padding: 0.8rem;
}

.project-item-body h3 {
  margin-bottom: 0.45rem;
}

.project-item-body p {
  margin: 0;
}

.project-details {
  margin: 0.6rem 0 0;
  padding-left: 1rem;
  color: var(--muted);
}

.project-details li {
  margin: 0.2rem 0;
}

.projects-empty {
  display: none;
}

.project-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 105;
  background: rgba(8, 20, 30, 0.5);
  backdrop-filter: blur(6px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.project-modal {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -46%) scale(0.95);
  z-index: 110;
  width: min(60vw, 1080px);
  max-height: 88vh;
  background: linear-gradient(165deg, #ffffff 0%, #f6fbff 100%);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 30px 60px rgba(8, 20, 30, 0.34);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
  display: grid;
  grid-template-rows: auto 1fr;
}

.project-modal.is-open {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, -50%) scale(1);
}

.project-modal-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}

.project-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.7rem;
  padding: 0.9rem 1rem 0.8rem;
  border-bottom: 1px solid var(--line);
}

.project-modal-close {
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
}

.project-modal-body {
  overflow-y: auto;
  padding: 0.9rem 1rem 1rem;
}

.project-modal-media {
  margin-bottom: 0.7rem;
}

.project-modal-media .project-carousel-image {
  max-height: 52vh;
  aspect-ratio: auto;
}

.project-modal-info p {
  margin-bottom: 0.5rem;
}

.contact-wrap {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 1.4rem;
}

.contact-form {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem;
}

.contact-form label {
  display: grid;
  gap: 0.4rem;
  margin-bottom: 0.8rem;
  font-weight: 600;
}

.contact-form input,
.contact-form textarea {
  border: 1px solid #c8d3de;
  border-radius: 10px;
  padding: 0.65rem 0.7rem;
  font: inherit;
}

.contact-submit {
  margin-top: 0.2rem;
}

.form-note {
  min-height: 1.3rem;
  margin-top: 0.8rem;
  color: #166534;
}

.footer {
  border-top: 1px solid var(--line);
  background: #eef2f6;
}

.footer-inner {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 0;
}

.footer p {
  margin: 0.2rem 0;
}

.footer strong {
  color: var(--text);
}

.admin-link {
  font-weight: 700;
  text-decoration: none;
}

@media (max-width: 980px) {
  .cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .projects-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .contact-wrap {
    grid-template-columns: 1fr;
  }

  .footer-inner {
    align-items: flex-start;
  }
}

@media (max-width: 760px) {
  .menu-toggle {
    display: inline-block;
  }

  .brand-logo {
    width: clamp(150px, 40vw, 230px);
  }

  .nav {
    position: absolute;
    top: 70px;
    left: 0;
    right: 0;
    display: none;
    flex-direction: column;
    padding: 0.8rem 1rem;
    gap: 0.75rem;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
  }

  .nav.is-open {
    display: flex;
  }

  .team-grid,
  .cards,
  .projects-grid {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: 450px;
  }

  .header-right {
    gap: 0.55rem;
  }

  .social-top {
    gap: 0.35rem;
    margin-left: 10px;
  }

  .social-link {
    width: 31px;
    height: 31px;
  }

  .project-modal {
    width: 94vw;
    max-height: 92vh;
  }

  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
  }
}

.nav a.is-active {
  color: var(--primary);
  font-weight: 700;
}

.floating-whatsapp {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 80;
  background: #1fa45a;
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  border-radius: 999px;
  padding: 0.75rem 1rem;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.24);
}

.floating-whatsapp:hover {
  background: #188e4d;
}

.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 95;
  background: rgba(8, 20, 30, 0.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.contact-drawer {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 100;
  width: min(520px, 100vw);
  height: 100vh;
  background: #f7fbff;
  border-left: 1px solid var(--line);
  transform: translateX(100%);
  transition: transform 0.28s ease;
  display: grid;
  grid-template-rows: auto 1fr;
  box-shadow: -14px 0 28px rgba(10, 28, 43, 0.2);
}

.contact-drawer.is-open {
  transform: translateX(0);
}

.drawer-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1rem 0.8rem;
  border-bottom: 1px solid var(--line);
}

.drawer-close {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 10px;
  width: 38px;
  height: 38px;
  font-size: 1.05rem;
  cursor: pointer;
}

.drawer-body {
  padding: 1rem;
  overflow-y: auto;
}

@media (max-width: 760px) {
  .contact-drawer {
    width: 100vw;
  }
}
