:root {
  --black: #07090d;
  --ink: #101318;
  --panel: #161b22;
  --line: rgba(192, 208, 224, 0.12);
  --silver: #c5ccd4;
  --muted: #8b96a3;
  --white: #f4f7fb;
  --blue: #0060b0;
  --blue-bright: #1c84d4;
  --blue-deep: #003058;
  --glow: rgba(28, 132, 212, 0.35);
  --radius: 22px;
  --max: 1180px;
  --nav-h: 82px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--white);
  background:
    radial-gradient(900px 480px at 90% -10%, rgba(0, 96, 176, 0.22), transparent 55%),
    var(--black);
  font-family: Outfit, sans-serif;
  line-height: 1.55;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

h1, h2, h3 {
  font-family: Syne, sans-serif;
  line-height: 1.05;
  letter-spacing: -0.03em;
  margin: 0 0 0.5em;
}

p { margin: 0 0 1em; }

.container {
  width: min(var(--max), calc(100% - 40px));
  margin: 0 auto;
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--blue-bright);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.section-head {
  max-width: 720px;
  margin-bottom: 28px;
}

.section-head h2 {
  font-size: clamp(2.1rem, 4vw, 3.4rem);
}

.section-head__lead {
  color: var(--muted);
  font-size: 1.05rem;
}

.badge {
  display: inline-block;
  margin-bottom: 14px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--silver);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 22px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--blue-bright), var(--blue));
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 10px 30px var(--glow);
}

.btn:hover { transform: translateY(-1px); }

.btn--ghost {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.18);
  box-shadow: none;
}

.btn--sm {
  min-height: 40px;
  padding: 0 16px;
  font-size: 0.92rem;
}

.btn--full { width: 100%; }

.btn:disabled {
  opacity: 0.65;
  cursor: wait;
  transform: none;
}

.hp {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

.text-link {
  display: inline-flex;
  margin-top: 8px;
  color: var(--blue-bright);
  font-weight: 600;
}

.text-link:hover { text-decoration: underline; }

/* Nav */
.nav {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 24px;
  min-height: var(--nav-h);
  padding: 8px 28px;
  background: rgba(7, 9, 13, 0.78);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
}

.nav.is-scrolled {
  box-shadow: 0 10px 40px rgba(0,0,0,0.25);
}

.nav__brand img {
  width: 58px;
  height: 58px;
  object-fit: cover;
  border-radius: 12px;
}

.nav__links {
  display: flex;
  gap: 22px;
  margin-left: auto;
}

.nav__links a {
  color: var(--silver);
  font-size: 0.95rem;
}

.nav__links a:hover { color: #fff; }

.nav__toggle {
  display: none;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: transparent;
}

.nav__toggle span {
  display: block;
  width: 18px;
  height: 2px;
  margin: 4px auto;
  background: #fff;
}

/* Hero */
.hero {
  position: relative;
  min-height: 0;
  display: grid;
  justify-items: center;
  align-items: start;
  padding: 22px 0 36px;
  overflow: hidden;
}

.hero__media,
.hero__shade {
  position: absolute;
  inset: 0;
}

.hero__media {
  min-height: 100%;
}

.hero__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 42%;
  filter: saturate(0.95) contrast(1.04);
}

.hero__shade {
  background:
    linear-gradient(180deg, rgba(7,9,13,0.52) 0%, rgba(7,9,13,0.68) 42%, rgba(7,9,13,0.92) 100%);
}

.hero__content {
  position: relative;
  z-index: 1;
  max-width: 820px;
  margin: 0 auto;
  text-align: center;
}

.hero .eyebrow {
  color: #8fd0ff;
  text-shadow:
    0 1px 2px rgba(0, 0, 0, 0.9),
    0 2px 10px rgba(0, 0, 0, 0.75),
    0 0 22px rgba(0, 0, 0, 0.55);
}

.hero h1 {
  font-size: clamp(2.2rem, 6vw, 4.4rem);
  margin-bottom: 14px;
  text-shadow:
    0 2px 4px rgba(0, 0, 0, 0.85),
    0 6px 20px rgba(0, 0, 0, 0.6);
}

.hero__lead {
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
  color: #e8eef4;
  font-size: 1.12rem;
  text-shadow:
    0 1px 3px rgba(0, 0, 0, 0.8),
    0 4px 16px rgba(0, 0, 0, 0.5);
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin: 22px 0 22px;
}

.hero__tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.hero__tags li {
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--silver);
  font-size: 0.85rem;
  background: rgba(16,19,24,0.45);
}

/* Strip */
.strip {
  padding: 28px 0 10px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #0c1016;
}

.strip__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}

.strip article {
  padding: 22px 8px 26px;
}

.strip strong {
  color: var(--blue-bright);
  font-family: Syne, sans-serif;
  font-size: 1.2rem;
}

.strip h3 { font-size: 1.35rem; }
.strip p { color: var(--muted); margin: 0; }

/* About */
#inicio,
#servicios,
#proyectos,
#contacto {
  scroll-margin-top: calc(var(--nav-h) + 10px);
}

.about { padding: 72px 0; }

.about__grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 56px;
  align-items: center;
}

.about h2 { font-size: clamp(2rem, 4vw, 3.1rem); }
.about p { color: var(--silver); }

.about__photo {
  margin: 0;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--panel);
}

.about__photo img {
  width: 100%;
  aspect-ratio: 4 / 3;
  height: auto;
  object-fit: cover;
  object-position: center;
}

.about__photo figcaption {
  padding: 14px 16px 16px;
  color: var(--muted);
  font-size: 0.88rem;
}

/* Services */
.services { padding: 20px 0 90px; }

.services__stack {
  display: grid;
  gap: 28px;
}

.service {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 28px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: linear-gradient(180deg, rgba(22,27,34,0.9), rgba(12,16,22,0.9));
}

.service--flip { grid-template-columns: 0.85fr 1.15fr; }
.service--flip .service__visual { order: 2; }

.service__visual > img {
  width: 100%;
  aspect-ratio: 16 / 10;
  height: auto;
  object-fit: cover;
  object-position: center;
  border-radius: 18px;
  background: #0d1117;
}

.service__thumbs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 10px;
}

.service__thumbs img {
  width: 100%;
  aspect-ratio: 4 / 3;
  height: auto;
  object-fit: cover;
  object-position: center;
  border-radius: 12px;
  background: #0d1117;
}

.service__body {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 10px 8px;
}

.service h3 { font-size: clamp(1.8rem, 3vw, 2.5rem); }
.service p { color: var(--silver); }
.service ul {
  margin: 0 0 18px;
  padding-left: 18px;
  color: var(--muted);
}

.service li + li { margin-top: 7px; }

/* Projects */
.projects { padding: 40px 0 100px; }

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 26px;
}

.filter {
  min-height: 40px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--silver);
  cursor: pointer;
}

.filter.is-active {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.card {
  position: relative;
  padding: 0;
  border: 0;
  border-radius: 18px;
  overflow: hidden;
  background: var(--panel);
  cursor: pointer;
  text-align: left;
  min-height: 250px;
}

.card.is-hidden { display: none; }

.card img {
  width: 100%;
  aspect-ratio: 4 / 3;
  height: auto;
  object-fit: cover;
  object-position: center;
  transition: transform 0.45s ease;
}

.card:hover img { transform: scale(1.05); }

.card span {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 18px 16px 14px;
  background: linear-gradient(180deg, transparent, rgba(0,0,0,0.82));
}

.card small {
  display: block;
  color: var(--blue-bright);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 0.68rem;
}

.card strong {
  font-family: Syne, sans-serif;
  font-size: 1.05rem;
}

/* Contact */
.contact {
  padding: 80px 0 110px;
  background:
    radial-gradient(700px 360px at 0% 20%, rgba(0, 96, 176, 0.18), transparent 60%),
    #0b0f14;
  border-top: 1px solid var(--line);
}

.contact__grid {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 48px;
  align-items: start;
}

.contact h2 { font-size: clamp(2.1rem, 4vw, 3.3rem); }
.contact p { color: var(--silver); }

.contact__details {
  list-style: none;
  margin: 0 0 22px;
  padding: 0;
  display: grid;
  gap: 16px;
}

.contact__details li {
  display: grid;
  gap: 4px;
}

.contact__details strong {
  color: var(--blue-bright);
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.contact__details span,
.contact__details a {
  color: var(--silver);
}

.contact__details a:hover { color: #fff; }

.form {
  position: relative;
  padding: 28px;
  border-radius: 24px;
  border: 1px solid var(--line);
  background: rgba(16, 19, 24, 0.8);
}

.field { margin-bottom: 16px; }

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.field label {
  display: block;
  margin-bottom: 7px;
  color: var(--silver);
  font-size: 0.9rem;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 13px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #0d1117;
  outline: none;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--blue-bright);
  box-shadow: 0 0 0 3px rgba(28, 132, 212, 0.18);
}

.field textarea { resize: vertical; }

.error {
  display: block;
  min-height: 1.1em;
  margin-top: 6px;
  color: #ff8d8d;
  font-size: 0.8rem;
}

.form__status {
  margin: 14px 0 0;
  min-height: 1.4em;
  color: #8ee0b0;
  font-weight: 500;
}

.form__status.is-error { color: #ff8d8d; }

/* Footer */
.footer {
  padding: 28px 0 36px;
  border-top: 1px solid var(--line);
}

.footer__grid {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 20px;
  align-items: center;
}

.footer__brand img {
  width: 52px;
  height: 52px;
  object-fit: cover;
  border-radius: 10px;
}

.footer p {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 0.9rem;
}

.footer a:hover { color: #fff; }

/* Lightbox */
.lightbox {
  width: min(920px, calc(100% - 28px));
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #0d1117;
  color: #fff;
  overflow: hidden;
}

.lightbox::backdrop {
  background: rgba(0,0,0,0.72);
}

.lightbox img {
  width: 100%;
  max-height: 68vh;
  object-fit: cover;
}

.lightbox__caption { padding: 18px 20px 22px; }

.lightbox__close {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: rgba(0,0,0,0.55);
  color: #fff;
  font-size: 1.6rem;
  cursor: pointer;
}

/* Motion */
.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: none;
}

@media (max-width: 960px) {
  :root { --nav-h: 70px; }

  .container { width: min(var(--max), calc(100% - 28px)); }

  .nav { padding: 8px 16px; gap: 12px; }
  .nav__brand img { width: 48px; height: 48px; }

  .about__grid,
  .service,
  .service--flip,
  .contact__grid,
  .footer__grid,
  .strip__grid,
  .gallery {
    grid-template-columns: 1fr;
  }

  .service--flip .service__visual { order: 0; }
  .service { padding: 14px; gap: 16px; border-radius: 20px; }

  .nav__links {
    position: fixed;
    inset: var(--nav-h) 12px auto;
    display: none;
    flex-direction: column;
    padding: 16px;
    border-radius: 16px;
    background: #10151c;
    border: 1px solid var(--line);
    z-index: 30;
  }

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

  .nav .btn--sm { display: none; }
  .nav__toggle { display: block; margin-left: auto; }

  .hero {
    min-height: auto;
    padding: 20px 0 28px;
  }

  .hero h1 { font-size: clamp(1.85rem, 9vw, 2.6rem); }
  .hero__lead { font-size: 1rem; }
  .hero__actions .btn { width: 100%; }
  .hero__tags li { font-size: 0.78rem; }

  .strip { padding: 8px 0; }
  .strip article { padding: 16px 0; }
  .about,
  .services,
  .projects { padding: 48px 0; }
  .contact { padding: 56px 0 72px; }

  .section-head { margin-bottom: 20px; }
  .section-head h2 { font-size: clamp(1.8rem, 7vw, 2.4rem); }

  .field-row { grid-template-columns: 1fr; }
  .form { padding: 18px; }

  .card { min-height: 0; }
  .lightbox { width: calc(100% - 16px); }
  .lightbox img { max-height: 52vh; }
}

@media (max-width: 600px) {
  .gallery { gap: 10px; }
  .service__thumbs { gap: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; }
  .card img { transition: none; }
}
